Example #1
0
        public FactsPanel(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());

            dataModel = new FactsTableModel(this);
            TableSorter sorter = new TableSorter(new TableMap());
            ((TableMap) sorter.Model).setModel(dataModel);
            factsTable = new JTable(sorter);
            sorter.addMouseListenerToHeaderInTable(factsTable);

            factsTable.setShowHorizontalLines(true);
            factsTable.setRowSelectionAllowed(true);
            factsTable.TableHeader.setReorderingAllowed(false);
            factsTable.TableHeader.setToolTipText("Click to sort ascending. Click while pressing the shift-key down to sort descending");
            factsTable.SelectionModel.addListSelectionListener(this);
            dumpArea = new JTextArea();
            dumpArea.setLineWrap(true);
            dumpArea.setWrapStyleWord(true);
            dumpArea.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"'
            dumpArea.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));

            pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(factsTable), new JScrollPane(dumpArea));
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(pane, BorderLayout.CENTER);
            pane.setDividerLocation(gui.Preferences.getInt("facts.dividerlocation", 300));
            reloadButton = new JButton("Reload Facts", IconLoader.getImageIcon("database_refresh"));
            reloadButton.addActionListener(this);
            assertButton = new JButton("Assert Fact", IconLoader.getImageIcon("database_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.RIGHT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 1));
            buttonPanel.add(reloadButton);
            buttonPanel.add(assertButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000"'
            add(buttonPanel, BorderLayout.PAGE_END);

            initPopupMenu();
        }