<commit_before>/*
 * NARSwing.java
 *
 * Copyright (C) 2008  <NAME>
 *
 * This file is part of Open-NARSwing.
 *
 * Open-NARSwing is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * Open-NARSwing is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Open-NARS.  If not, see <http://www.gnu.org/licenses/>.
 */
package nars.gui;

import automenta.vivisect.swing.NWindow;

import java.awt.Color;
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import nars.core.NAR;
import nars.core.build.Default.CommandLineNARBuilder;
import nars.core.control.experimental.AntAttention;
import nars.io.TextInput;
import nars.io.TextOutput;

/**
 * The main Swing GUI class of the open-nars project.  
 * Creates default Swing GUI windows to operate a NAR.
 */
public class NARSwing  {

    
    /*static {
        System.setProperty("sun.java2d.opengl","True");        
    }*/

    public static void themeInvert() {
        //http://alvinalexander.com/java/java-swing-uimanager-defaults
        UIManager.put("Button.foreground", Color.WHITE);
        UIManager.put("Button.background", Color.DARK_GRAY);
        UIManager.put("Panel.background", Color.BLACK);
        UIManager.put("Button.border", new EmptyBorder(4,8,4,8));
        UIManager.put("ToggleButton.border", new EmptyBorder(4,8,4,8));
        UIManager.put("ScrollPane.border", new EmptyBorder(1,1,1,1));
        UIManager.put("SplitPane.border", new EmptyBorder(1,1,1,1));
        UIManager.put("TextEdit.border", new EmptyBorder(1,1,1,1));
        UIManager.put("TextArea.border", new EmptyBorder(1,1,1,1));
        UIManager.put("TextField.border", new EmptyBorder(1,1,1,1));

        UIManager.put("Label.foreground", Color.WHITE);

        UIManager.put("Tree.background", Color.BLACK);
        UIManager.put("Tree.foreground", Color.BLACK);
        UIManager.put("Tree.textForeground", Color.WHITE);
        UIManager.put("Tree.textBackground", Color.BLACK);
        UIManager.put("TextPane.background", Color.BLACK);
        UIManager.put("TextPane.foreground", Color.WHITE);
        UIManager.put("TextEdit.background", Color.BLACK);
        UIManager.put("TextEdit.foreground", Color.WHITE);
        UIManager.put("TextArea.background", Color.BLACK);
        UIManager.put("TextArea.foreground", Color.WHITE);

        UIManager.put("TextPane.border", new EmptyBorder(1,1,1,1));
        UIManager.put("TextPane.border", new EmptyBorder(1,1,1,1));
        UIManager.put("Panel.border", new EmptyBorder(1,1,1,1));
        UIManager.put("Button.select", Color.GREEN);
        UIManager.put("Button.highlight", Color.YELLOW);
        UIManager.put("ToggleButton.foreground", Color.WHITE);
        UIManager.put("ToggleButton.background", Color.DARK_GRAY);
        UIManager.put("ToggleButton.select", Color.GRAY);
        //UIManager.put("ToggleButton.border", Color.BLUE);
        //UIManager.put("ToggleButton.light", Color.DARK_GRAY);
        UIManager.put("Button.select", Color.ORANGE);
        UIManager.put("Button.opaque", false);
        UIManager.put("Panel.opaque", false);
        UIManager.put("ScrollBar.opaque", false);
        UIManager.put("ScrollBar.background", Color.BLACK);
        UIManager.put("ScrollBar.border", new EmptyBorder(1,1,1,1));
    }

    public final NAR nar;
    private final NWindow mainWindow;
    private final NARControls controls;

    public NARSwing(NAR nar) {
        this(nar, true);
    }

    public NARSwing(NAR nar, boolean logPanel) {
        super();
                
        this.nar = nar;                
        
        controls = new NARControls(nar);        
        mainWindow = new NWindow(NAR.VERSION, controls);
        mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainWindow.setBounds(10, 10, 270, 650);<commit_msg>design adjustment.. sentence table is still gray when empty hm<commit_after>/*
 * NARSwing.java
 *
 * Copyright (C) 2008  <NAME>
 *
 * This file is part of Open-NARSwing.
 *
 * Open-NARSwing is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 2 of the License, or
 * (at your option) any later version.
 *
 * Open-NARSwing is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Open-NARS.  If not, see <http://www.gnu.org/licenses/>.
 */
package nars.gui;

import automenta.vivisect.swing.NWindow;

import java.awt.Color;
import java.io.File;
import java.io.IOException;
import java.lang.management.ManagementFactory;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;
import nars.core.NAR;
import nars.core.build.Default.CommandLineNARBuilder;
import nars.core.control.experimental.AntAttention;
import nars.io.TextInput;
import nars.io.TextOutput;

/**
 * The main Swing GUI class of the open-nars project.  
 * Creates default Swing GUI windows to operate a NAR.
 */
public class NARSwing  {

    
    /*static {
        System.setProperty("sun.java2d.opengl","True");        
    }*/

    public static void themeInvert() {
        //http://alvinalexander.com/java/java-swing-uimanager-defaults
        UIManager.put("Button.foreground", Color.WHITE);
        UIManager.put("Button.background", Color.DARK_GRAY);
        UIManager.put("Panel.background", Color.BLACK);
        UIManager.put("Button.border", new EmptyBorder(4,8,4,8));
        UIManager.put("ToggleButton.border", new EmptyBorder(4,8,4,8));
        UIManager.put("ScrollPane.border", new EmptyBorder(1,1,1,1));
        UIManager.put("SplitPane.border", new EmptyBorder(1,1,1,1));
        UIManager.put("TextEdit.border", new EmptyBorder(1,1,1,1));
        UIManager.put("TextArea.border", new EmptyBorder(1,1,1,1));
        UIManager.put("TextField.border", new EmptyBorder(1,1,1,1));

        UIManager.put("Label.foreground", Color.WHITE);

        UIManager.put("Tree.background", Color.BLACK);
        UIManager.put("Tree.foreground", Color.BLACK);
        UIManager.put("Tree.textForeground", Color.WHITE);
        UIManager.put("Tree.textBackground", Color.BLACK);
        UIManager.put("TextPane.background", Color.BLACK);
        UIManager.put("TextPane.foreground", Color.WHITE);
        UIManager.put("TextEdit.background", Color.BLACK);
        UIManager.put("TextEdit.foreground", Color.WHITE);
        UIManager.put("TextArea.background", Color.BLACK);
        UIManager.put("TextArea.foreground", Color.WHITE);

        UIManager.put("TextPane.border", new EmptyBorder(1,1,1,1));
        UIManager.put("TextPane.border", new EmptyBorder(1,1,1,1));
        UIManager.put("Panel.border", new EmptyBorder(1,1,1,1));
        UIManager.put("Button.select", Color.GREEN);
        UIManager.put("Button.highlight", Color.YELLOW);
        UIManager.put("ToggleButton.foreground", Color.WHITE);
        UIManager.put("ToggleButton.background", Color.DARK_GRAY);
        UIManager.put("ToggleButton.select", Color.GRAY);
        //UIManager.put("ToggleButton.border", Color.BLUE);
        //UIManager.put("ToggleButton.light", Color.DARK_GRAY);
        UIManager.put("Button.select", Color.ORANGE);
        UIManager.put("Button.opaque", false);
        UIManager.put("Panel.opaque", false);
        UIManager.put("ScrollBar.opaque", false);
        UIManager.put("ScrollBar.background", Color.BLACK);
        UIManager.put("ScrollBar.border", new EmptyBorder(1,1,1,1));
        
        UIManager.put("Table.background", Color.BLACK);
        UIManager.put("Table.foreground", Color.WHITE);

    }

    public final NAR nar;
    private final NWindow mainWindow;
    private final NARControls controls;

    public NARSwing(NAR nar) {
        this(nar, true);
    }

    public NARSwing(NAR nar, boolean logPanel) {
        super();
                
        this.nar = nar;                
        
        controls = new NARControls(nar);        
        mainWindow = new NWindow(NAR.VERSION, controls);
        mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        mainWindow.setBounds(10, 10, 270, 650);
{'fraction_non_alphanumeric': 0.12989028039454728, 'fraction_numerical': 0.013299346115482655, 'mean_word_length': 3.3342939481268012, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5154769', 'n_tokens_mistral': 2817, 'n_tokens_neox': 2876, 'n_words': 592}