Search in sources :

Example 1 with EditorPanel

use of nars.lab.grid2d.gui.EditorPanel in project opennars by opennars.

the class Grid2DSpace method newWindow.

public NWindow newWindow(int width, int height, final boolean exitOnClose) {
    NWindow j = new NWindow("") {

        @Override
        protected void close() {
            stop();
            destroy();
            getContentPane().removeAll();
            if (exitOnClose)
                System.exit(0);
        }
    };
    Container content = j.getContentPane();
    content.setLayout(new BorderLayout());
    JPanel menu = new JPanel(new FlowLayout(FlowLayout.LEFT));
    /*final JCheckBox syntaxEnable = new JCheckBox("Syntax");
        syntaxEnable.addActionListener(new ActionListener() {
        @Override public void actionPerformed(ActionEvent e) {
        }
        });
        menu.add(syntaxEnable);
         */
    EditorPanel editor = new EditorPanel(this);
    NWindow editorWindow = new NWindow("Edit", editor);
    editorWindow.setSize(200, 400);
    editorWindow.setVisible(true);
    content.add(menu, BorderLayout.NORTH);
    content.add(this, BorderLayout.CENTER);
    // initial size of the window
    j.setSize(width, height);
    j.setVisible(true);
    return j;
}
Also used : JPanel(javax.swing.JPanel) Container(java.awt.Container) FlowLayout(java.awt.FlowLayout) BorderLayout(java.awt.BorderLayout) NWindow(automenta.vivisect.swing.NWindow) EditorPanel(nars.lab.grid2d.gui.EditorPanel)

Aggregations

NWindow (automenta.vivisect.swing.NWindow)1 BorderLayout (java.awt.BorderLayout)1 Container (java.awt.Container)1 FlowLayout (java.awt.FlowLayout)1 JPanel (javax.swing.JPanel)1 EditorPanel (nars.lab.grid2d.gui.EditorPanel)1