Пример #1
0
        /// <summary> The main constructor for a RetePanel.
        ///
        /// </summary>
        /// <param name="">engine
        /// The Jamocha engine that should be used with this GUI.
        ///
        /// </param>
        public RetePanel(JamochaGui gui) : base(gui)
        {
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());

            visualiserPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.CardLayout.CardLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtCardLayout"'
            visualiserPanel.setLayout(new CardLayout());
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(visualiserPanel, BorderLayout.CENTER);

            initVisualiser();
        }
Пример #2
0
        /// <summary> The main constructor for a RetePanel.
        /// 
        /// </summary>
        /// <param name="">engine
        /// The Jamocha engine that should be used with this GUI.
        /// 
        /// </param>
        public RetePanel(JamochaGui gui)
            : base(gui)
        {
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());

            visualiserPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.CardLayout.CardLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtCardLayout"'
            visualiserPanel.setLayout(new CardLayout());
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(visualiserPanel, BorderLayout.CENTER);

            initVisualiser();
        }
Пример #3
0
        public TemplateEditor(Rete engine) : base(engine)
        {
            InitBlock();
            setSize(600, 500);
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());
            setTitle("Create new Template");
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            contentPanel = new JPanel(new BorderLayout());
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(contentPanel, BorderLayout.CENTER);
            cancelButton = new JButton("Cancel", IconLoader.getImageIcon("cancel"));
            cancelButton.addActionListener(this);
            assertButton = new JButton("Create Template", IconLoader.getImageIcon("brick_add"));
            assertButton.addActionListener(this);
            JPanel buttonPanel = new JPanel();

            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 1));
            buttonPanel.add(cancelButton);
            buttonPanel.add(assertButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.SOUTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(buttonPanel, BorderLayout.SOUTH);

            nameField = new JTextField(15);
            Collection modules = engine.WorkingMemory.Modules;

            System.String[] moduleNames = new System.String[modules.size()];
            int             i           = 0;
            Iterator        itr         = modules.iterator();

            while (itr.hasNext())
            {
                System.Object obj = itr.next();
                moduleNames[i++] = ((Module)obj).ModuleName;
            }
            moduleBox = new JComboBox(moduleNames);


            addSlotButton = new JButton("Add Slot", IconLoader.getImageIcon("add"));
            addSlotButton.addActionListener(this);
            //UPGRADE_ISSUE: Field 'java.awt.Component.RIGHT_ALIGNMENT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtComponentRIGHT_ALIGNMENT_f"'
            addSlotButton.setAlignmentX(Component.RIGHT_ALIGNMENT);

            JPanel topPanel = new JPanel();

            topPanel.setBorder(BorderFactory.createTitledBorder("General Template Settings"));
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.LEFT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            topPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 20, 1));
            //UPGRADE_ISSUE: Constructor 'java.awt.GridLayout.GridLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridLayout"'
            JPanel innerTopPanel = new JPanel(new GridLayout(2, 2));

            innerTopPanel.add(new JLabel("Template-name:"));
            innerTopPanel.add(nameField);
            innerTopPanel.add(new JLabel("Template-Module:"));
            innerTopPanel.add(moduleBox);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.WEST' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            topPanel.add(innerTopPanel, BorderLayout.WEST);
            topPanel.add(addSlotButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.NORTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(topPanel, BorderLayout.NORTH);

            dumpAreaTemplate.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            dumpAreaTemplate.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle)System.Drawing.FontStyle.Regular));
            dumpAreaTemplate.setRows(5);

            JPanel dumpAreaPanel = new JPanel();

            dumpAreaPanel.setLayout(new BoxLayout(dumpAreaPanel, BoxLayout.Y_AXIS));
            dumpAreaPanel.setBorder(BorderFactory.createTitledBorder("Template Preview"));
            dumpAreaPanel.add(new JScrollPane(dumpAreaTemplate));
            reloadButtonDumpAreaTemplate = new JButton("Reload Template Preview", IconLoader.getImageIcon("arrow_refresh"));
            reloadButtonDumpAreaTemplate.addActionListener(this);
            dumpAreaPanel.add(reloadButtonDumpAreaTemplate);

            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.SOUTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            contentPanel.add(dumpAreaPanel, BorderLayout.SOUTH);
        }
Пример #4
0
        /// <summary> The main constructor for a ShellPanel.
        /// 
        /// </summary>
        /// <param name="">engine
        /// The Jamocha engine that should be used with this GUI.
        /// 
        /// </param>
        public ShellPanel(JamochaGui gui)
            : base(gui)
        {
            InitBlock();
            // GUI construction
            // create the output area
            outputArea = new JTextArea();
            outputArea.setEditable(false);
            outputArea.setLineWrap(true);
            outputArea.setWrapStyleWord(true);
            outputArea.addFocusListener(this);
            // set the font and the colors
            settingsChanged();
            this.addFocusListener(this);
            // create a scroll pane to embedd the output area
            scrollPane = new JScrollPane(outputArea, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            scrollPane.VerticalScrollBar.addAdjustmentListener(this);
            // Assemble the GUI
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(scrollPane, BorderLayout.CENTER);

            // create the button that clears the output area
            clearButton = new JButton("Clear Shell", IconLoader.getImageIcon("application_osx_terminal"));
            clearButton.addActionListener(this);
            JPanel clearButtonPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.RIGHT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            clearButtonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 1));
            clearButtonPanel.add(clearButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000"'
            add(clearButtonPanel, BorderLayout.PAGE_END);

            // initialize the channel to the engine
            //UPGRADE_ISSUE: Constructor 'java.io.PipedOutputStream.PipedOutputStream' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaioPipedOutputStreamPipedOutputStream"'
            System.IO.StreamWriter outStream = new PipedOutputStream();
            //UPGRADE_ISSUE: Constructor 'java.io.PipedInputStream.PipedInputStream' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaioPipedInputStreamPipedInputStream"'
            System.IO.StreamReader inStream = new PipedInputStream();
            outWriter = new System.IO.StreamWriter(outStream);
            try
            {
                //UPGRADE_ISSUE: Method 'java.io.PipedInputStream.connect' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaioPipedInputStreamconnect_javaioPipedOutputStream"'
                inStream.connect(outStream);
            }
            catch (System.IO.IOException e)
            {
                SupportClass.WriteStackTrace(e, Console.Error);
                System.Environment.Exit(1);
            }
            channel = gui.Engine.MessageRouter.openChannel("JamochaGui", inStream);

            printPrompt();
            moveCursorToEnd();
            startTimer();

            // initialize the channellistener for outputs from the engine
            initChannelListener();

            // initialize the keylistener for key events
            initKeyListener();

            // initialize the mouselistener for the context menu
            initPopupMenu();
        }
Пример #5
0
        public TemplateEditor(Rete engine)
            : base(engine)
        {
            InitBlock();
            setSize(600, 500);
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());
            setTitle("Create new Template");
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            contentPanel = new JPanel(new BorderLayout());
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(contentPanel, BorderLayout.CENTER);
            cancelButton = new JButton("Cancel", IconLoader.getImageIcon("cancel"));
            cancelButton.addActionListener(this);
            assertButton = new JButton("Create Template", IconLoader.getImageIcon("brick_add"));
            assertButton.addActionListener(this);
            JPanel buttonPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 1));
            buttonPanel.add(cancelButton);
            buttonPanel.add(assertButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.SOUTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(buttonPanel, BorderLayout.SOUTH);

            nameField = new JTextField(15);
            Collection modules = engine.WorkingMemory.Modules;
            System.String[] moduleNames = new System.String[modules.size()];
            int i = 0;
            Iterator itr = modules.iterator();
            while (itr.hasNext())
            {
                System.Object obj = itr.next();
                moduleNames[i++] = ((Module) obj).ModuleName;
            }
            moduleBox = new JComboBox(moduleNames);

            addSlotButton = new JButton("Add Slot", IconLoader.getImageIcon("add"));
            addSlotButton.addActionListener(this);
            //UPGRADE_ISSUE: Field 'java.awt.Component.RIGHT_ALIGNMENT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtComponentRIGHT_ALIGNMENT_f"'
            addSlotButton.setAlignmentX(Component.RIGHT_ALIGNMENT);

            JPanel topPanel = new JPanel();
            topPanel.setBorder(BorderFactory.createTitledBorder("General Template Settings"));
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.LEFT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            topPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 20, 1));
            //UPGRADE_ISSUE: Constructor 'java.awt.GridLayout.GridLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridLayout"'
            JPanel innerTopPanel = new JPanel(new GridLayout(2, 2));
            innerTopPanel.add(new JLabel("Template-name:"));
            innerTopPanel.add(nameField);
            innerTopPanel.add(new JLabel("Template-Module:"));
            innerTopPanel.add(moduleBox);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.WEST' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            topPanel.add(innerTopPanel, BorderLayout.WEST);
            topPanel.add(addSlotButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.NORTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(topPanel, BorderLayout.NORTH);

            dumpAreaTemplate.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            dumpAreaTemplate.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));
            dumpAreaTemplate.setRows(5);

            JPanel dumpAreaPanel = new JPanel();
            dumpAreaPanel.setLayout(new BoxLayout(dumpAreaPanel, BoxLayout.Y_AXIS));
            dumpAreaPanel.setBorder(BorderFactory.createTitledBorder("Template Preview"));
            dumpAreaPanel.add(new JScrollPane(dumpAreaTemplate));
            reloadButtonDumpAreaTemplate = new JButton("Reload Template Preview", IconLoader.getImageIcon("arrow_refresh"));
            reloadButtonDumpAreaTemplate.addActionListener(this);
            dumpAreaPanel.add(reloadButtonDumpAreaTemplate);

            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.SOUTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            contentPanel.add(dumpAreaPanel, BorderLayout.SOUTH);
        }