示例#1
0
        public SettingsPanel(JamochaGui gui) : base(gui)
        {
            InitBlock();
            //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());
            tabbedPane = new JTabbedPane();

            EngineSettingsPanel engineSettingsPanel = new EngineSettingsPanel(gui);

            tabbedPane.addTab("Engine", null, engineSettingsPanel, "Engine Settings");
            panels.add(engineSettingsPanel);

            ShellSettingsPanel shellSettingsPanel = new ShellSettingsPanel(gui);

            tabbedPane.addTab("Shell", null, shellSettingsPanel, "Shell Settings");
            panels.add(shellSettingsPanel);

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

            //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"'
            JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 5, 1));

            saveButton = new JButton("Save Changes", IconLoader.getImageIcon("disk"));
            saveButton.addActionListener(this);
            buttonPanel.add(saveButton);
            //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);
        }
 public virtual void  actionPerformed(System.Object event_sender, System.EventArgs event_Renamed)
 {
     //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
     if (event_sender.equals(closeButton))
     {
         dispose();
     }
     else
     {
         //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
         if (event_sender.equals(resultsBox))
         {
             System.Object item = resultsBox.SelectedItem;
             if (item != null)
             {
                 //UPGRADE_TODO: The equivalent in .NET for method 'java.Object.toString' may return a different value. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1043"'
                 aboutArea.setText((System.String)batchResults.get(item.ToString()));
             }
             batchResultsButton.setIcon(IconLoader.getImageIcon("lorry"));
         }
         else
         {
             //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
             if (event_sender.equals(removeButton))
             {
                 System.Object item = resultsBox.SelectedItem;
                 if (item != null)
                 {
                     resultsBoxModel.removeItem(item);
                     batchResults.remove(item);
                     aboutArea.setText("");
                     resultsBox.setSelectedIndex(-1);
                     // if we removed the last result we hide the indicator button
                     if (batchResults.isEmpty())
                     {
                         batchResultsButton.setVisible(false);
                     }
                 }
             }
             else
             {
                 //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
                 if (event_sender.equals(reloadButton))
                 {
                     resultsBoxModel.setItems(batchResults.keySet().toArray());
                     aboutArea.setText("");
                     resultsBox.setSelectedIndex(-1);
                 }
             }
         }
     }
 }
示例#3
0
        public JamochaMenuBar(JamochaGui gui) : base()
        {
            this.gui = gui;

            // adding the file menu
            fileMenu      = new JMenu("File");
            fileMenuBatch = new JMenuItem("Batch File ...", IconLoader.getImageIcon("lorry"));
            fileMenuBatch.addActionListener(this);
            fileMenuCloseGui = new JMenuItem("Close Gui", IconLoader.getImageIcon("disconnect"));
            fileMenuCloseGui.addActionListener(this);
            fileMenuQuit = new JMenuItem("Quit", IconLoader.getImageIcon("door_in"));
            fileMenuQuit.addActionListener(this);
            fileMenu.add(fileMenuBatch);
            fileMenu.addSeparator();
            fileMenu.add(fileMenuCloseGui);
            fileMenu.add(fileMenuQuit);
            add(fileMenu);
        }
        internal BatchResultBrowser(JButton batchResultsButton)
        {
            this.batchResultsButton = batchResultsButton;
            topPanel = new JPanel();
            setSize(500, 400);
            //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());
            resultsBoxModel = new ResultBoxModel(this);
            resultsBox      = new JComboBox(resultsBoxModel);
            removeButton    = new JButton(IconLoader.getImageIcon("delete"));
            removeButton.addActionListener(this);
            removeButton.setToolTipText("Remove this batch result");
            reloadButton = new JButton(IconLoader.getImageIcon("arrow_refresh"));
            reloadButton.addActionListener(this);
            reloadButton.setToolTipText("Reload the list of available batch results");

            topPanel.add(resultsBox);
            topPanel.add(removeButton);
            topPanel.add(reloadButton);
            //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);
            aboutArea = new JTextArea();
            aboutArea.setBorder(BorderFactory.createEmptyBorder());
            aboutArea.setLineWrap(true);
            aboutArea.setWrapStyleWord(true);
            aboutArea.setEditable(false);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(new JScrollPane(aboutArea, JScrollPane.VERTICAL_SCROLLBAR_ALWAYS, JScrollPane.HORIZONTAL_SCROLLBAR_NEVER), BorderLayout.CENTER);
            resultsBox.addActionListener(this);
            //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"'
            JPanel closePanel = new JPanel(new FlowLayout(FlowLayout.RIGHT));

            closeButton = new JButton("close");
            closeButton.addActionListener(this);
            closePanel.add(closeButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.SOUTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(closePanel, BorderLayout.SOUTH);
            batchResultsButton.setIcon(IconLoader.getImageIcon("lorry"));
        }
示例#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);
        }
示例#6
0
 public virtual void  actionPerformed(System.Object event_sender, System.EventArgs event_Renamed)
 {
     //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
     if (event_sender == assertButton)
     {
         channel.executeCommand(getCurrentDeftemplateString(false));
         JOptionPane.showMessageDialog(this, "Template created.\nPlease check the log for Messages.");
     }
     else
     {
         //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
         if (event_sender == cancelButton)
         {
             close();
         }
         else
         {
             //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
             if (event_sender == reloadButtonDumpAreaTemplate)
             {
                 dumpAreaTemplate.setText(getCurrentDeftemplateString(true));
             }
             else
             {
                 //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
                 if (event_sender == addSlotButton)
                 {
                     EditorRow row = new EditorRow(new DeleteButton(IconLoader.getImageIcon("delete"), rows.size()), new JLabel("Slot " + (rows.size() + 1)), NewTypesCombo, new JTextField());
                     row.deleteButton.addActionListener(this);
                     addRemoveButton(templatePanel, row.deleteButton, gridbag, gridbagConstraints, (rows.size() + 1));
                     addLabel(templatePanel, row.rowLabel, gridbag, gridbagConstraints, (rows.size() + 1));
                     addTypesCombo(templatePanel, row.typeBox, gridbag, gridbagConstraints, (rows.size() + 1));
                     addNameField(templatePanel, row.nameField, gridbag, gridbagConstraints, (rows.size() + 1));
                     rows.add(row);
                     templatePanel.revalidate();
                 }
                 else
                 {
                     //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
                     if (event_sender is DeleteButton)
                     {
                         //UPGRADE_NOTE: The method 'java.util.EventObject.getSource' needs to be in a event handling method in order to be properly converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1171"'
                         DeleteButton deleteButton = (DeleteButton)event_sender;
                         rows.remove(deleteButton.Row);
                         templatePanel.removeAll();
                         initTemplatePanel();
                         for (int i = 0; i < rows.size(); ++i)
                         {
                             EditorRow editorRow = (EditorRow)rows.get(i);
                             editorRow.deleteButton.Row = i;
                             editorRow.rowLabel.setText("Slot " + (i + 1));
                             addRemoveButton(templatePanel, editorRow.deleteButton, gridbag, gridbagConstraints, i + 1);
                             addLabel(templatePanel, editorRow.rowLabel, gridbag, gridbagConstraints, i + 1);
                             addTypesCombo(templatePanel, editorRow.typeBox, gridbag, gridbagConstraints, i + 1);
                             addNameField(templatePanel, editorRow.nameField, gridbag, gridbagConstraints, i + 1);
                         }
                         templatePanel.repaint();
                         templatePanel.revalidate();
                     }
                 }
             }
         }
     }
 }
        public ShellSettingsPanel(JamochaGui gui) : base(gui)
        {
            //UPGRADE_ISSUE: Class 'java.awt.GridBagLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagLayout"'
            //UPGRADE_ISSUE: Constructor 'java.awt.GridBagLayout.GridBagLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagLayout"'
            GridBagLayout gridbag = new GridBagLayout();
            //UPGRADE_ISSUE: Class 'java.awt.GridBagConstraints' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            //UPGRADE_ISSUE: Constructor 'java.awt.GridBagConstraints.GridBagConstraints' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            GridBagConstraints c = new GridBagConstraints();

            //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.weightx' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            c.weightx = 1.0;
            setLayout(gridbag);

            // Font
            addLabel(this, new JLabel("Font:"), gridbag, c, 0);
            GraphicsEnvironment ge = GraphicsEnvironment.LocalGraphicsEnvironment;

            System.Drawing.Font[] allFonts = ge.AllFonts;
            fonts = new JComboBox(allFonts);
            System.Drawing.Font selFont     = null;
            System.String       selFontName = gui.Preferences.get("shell.font", "Courier");
            for (int idx = 0; idx < allFonts.Length; idx++)
            {
                System.Drawing.Font curFont = allFonts[idx];
                if (curFont.FontName.equals(selFontName))
                {
                    selFont = curFont;
                    break;
                }
            }
            if (selFont != null)
            {
                fonts.setSelectedItem(selFont);
            }
            fonts.setRenderer(new FontListCellRenderer(this));
            addInputComponent(this, fonts, gridbag, c, 0);

            // Fontsize
            addLabel(this, new JLabel("Fontsize:"), gridbag, c, 1);
            System.Int32[] sizes = new System.Int32[17];
            for (int i = 0; i < sizes.Length; ++i)
            {
                sizes[i] = 8 + i;
            }
            fontsizes = new JComboBox(sizes);
            //fontsizes.setSelectedItem(gui.getPreferences().getInt("shell.fontsize",
            //		12));
            addInputComponent(this, fontsizes, gridbag, c, 1);

            // Fontcolor
            addLabel(this, new JLabel("Fontcolor:"), gridbag, c, 2);
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            JPanel fontColorChooserPanel = new JPanel(new FlowLayout());

            fontColorChooserPreview = new JTextField(5);
            fontColorChooserPreview.setEditable(false);
            fontColorChooserPreview.setBackground(new Color(gui.Preferences.getInt("shell.fontcolor", System.Drawing.Color.WHITE.RGB)));
            fontColorChooserButton = new JButton("Choose Color", IconLoader.getImageIcon("color_swatch"));
            fontColorChooserButton.addActionListener(this);
            fontColorChooserPanel.add(fontColorChooserPreview);
            fontColorChooserPanel.add(fontColorChooserButton);
            addInputComponent(this, fontColorChooserPanel, gridbag, c, 2);

            // Backgroundcolor
            addLabel(this, new JLabel("Backgroundcolor:"), gridbag, c, 3);
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            JPanel backgroundColorChooserPanel = new JPanel(new FlowLayout());

            backgroundColorChooserPreview = new JTextField(5);
            backgroundColorChooserPreview.setEditable(false);
            backgroundColorChooserPreview.setBackground(new Color(gui.Preferences.getInt("shell.backgroundcolor", System.Drawing.Color.BLACK.RGB)));
            backgroundColorChooserButton = new JButton("Choose Color", IconLoader.getImageIcon("color_swatch"));
            backgroundColorChooserButton.addActionListener(this);
            backgroundColorChooserPanel.add(backgroundColorChooserPreview);
            backgroundColorChooserPanel.add(backgroundColorChooserButton);
            addInputComponent(this, backgroundColorChooserPanel, gridbag, c, 3);
        }