示例#1
0
        public LogPanel(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());
            logChannel = gui.Engine.MessageRouter.openChannel("gui_log", InterestType.ALL);
            detailView = new JTextArea();
            detailView.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"'
            detailView.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));
            cellRenderer = new LogTableCellRenderer(this);
            logTable = new AnonymousClassJTable(this, dataModel);
            logTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            logTable.SelectionModel.addListSelectionListener(this);
            pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(logTable), new JScrollPane(detailView));
            pane.setDividerLocation(gui.Preferences.getInt("log.dividerlocation", 300));
            //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);

            SupportClass.ThreadClass logThread = new AnonymousClassThread(this);
            logThread.Start();
            clearButton = new JButton("Clear Log", IconLoader.getImageIcon("monitor"));
            clearButton.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(clearButton);
            //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);
        }
示例#2
0
    /**
     * Creates a new RPMBrowser object.
     */
    public RPMBrowser() {
        setTitle("RPM Browser");
        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
        setSize(new Dimension(600, 400));
        setJMenuBar(createMenuBar());

        Container content = getContentPane();
        JSplitPane splitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,
                new JScrollPane(createGroupTree()), new JScrollPane(
                createRPMInfoPane()));
        splitPane.setDividerLocation(200);
        content.add(splitPane);

        //Center on screen
        setLocationRelativeTo(null);

        addWindowListener(new IAC_WindowAdapter() );
    }
 /// <summary>
 /// This method is called from within the constructor to
 /// initialize the form.
 /// </summary>
 /// <remarks>
 /// This method is called from within the constructor to
 /// initialize the form.
 /// WARNING: Do NOT modify this code. The content of this method is
 /// always regenerated by the Form Editor.
 /// </remarks>
 private void InitComponents()
 {
     //GEN-BEGIN:initComponents
     splitPane           = new JSplitPane();
     topPanel            = new JPanel();
     buttonsAndFilePanel = new JPanel();
     loadButtonPanel     = new JPanel();
     loadFileButton      = new JButton();
     loadParserButton    = new JButton();
     saveOutputButton    = new JButton();
     buttonPanel         = new JPanel();
     backButton          = new JButton();
     if (GetType().GetResource("/edu/stanford/nlp/parser/ui/leftarrow.gif") != null)
     {
         backButton.SetIcon(new ImageIcon(GetType().GetResource("/edu/stanford/nlp/parser/ui/leftarrow.gif")));
     }
     else
     {
         backButton.SetText("< Prev");
     }
     forwardButton = new JButton();
     if (GetType().GetResource("/edu/stanford/nlp/parser/ui/rightarrow.gif") != null)
     {
         forwardButton.SetIcon(new ImageIcon(GetType().GetResource("/edu/stanford/nlp/parser/ui/rightarrow.gif")));
     }
     else
     {
         forwardButton.SetText("Next >");
     }
     parseButton     = new JButton();
     parseNextButton = new JButton();
     clearButton     = new JButton();
     dataFilePanel   = new JPanel();
     dataFileLabel   = new JLabel();
     textScrollPane  = new JScrollPane();
     textPane        = new JTextPane();
     treeContainer   = new JPanel();
     parserFilePanel = new JPanel();
     parserFileLabel = new JLabel();
     statusPanel     = new JPanel();
     statusLabel     = new JLabel();
     progressBar     = new JProgressBar();
     progressBar.SetVisible(false);
     SetLayout(new BorderLayout());
     splitPane.SetOrientation(JSplitPane.VerticalSplit);
     topPanel.SetLayout(new BorderLayout());
     buttonsAndFilePanel.SetLayout(new BoxLayout(buttonsAndFilePanel, BoxLayout.YAxis));
     loadButtonPanel.SetLayout(new FlowLayout(FlowLayout.Left));
     loadFileButton.SetText("Load File");
     loadFileButton.SetToolTipText("Load a data file.");
     loadFileButton.AddActionListener(null);
     loadButtonPanel.Add(loadFileButton);
     loadParserButton.SetText("Load Parser");
     loadParserButton.SetToolTipText("Load a serialized parser.");
     loadParserButton.AddActionListener(null);
     loadButtonPanel.Add(loadParserButton);
     saveOutputButton.SetText("Save Output");
     saveOutputButton.SetToolTipText("Save the processed output.");
     saveOutputButton.SetEnabled(false);
     saveOutputButton.AddActionListener(null);
     loadButtonPanel.Add(saveOutputButton);
     buttonsAndFilePanel.Add(loadButtonPanel);
     buttonPanel.SetLayout(new FlowLayout(FlowLayout.Left));
     backButton.SetToolTipText("Scroll backward one sentence.");
     backButton.SetEnabled(false);
     backButton.AddActionListener(null);
     buttonPanel.Add(backButton);
     forwardButton.SetToolTipText("Scroll forward one sentence.");
     forwardButton.SetEnabled(false);
     forwardButton.AddActionListener(null);
     buttonPanel.Add(forwardButton);
     parseButton.SetText("Parse");
     parseButton.SetToolTipText("Parse selected sentence.");
     parseButton.SetEnabled(false);
     parseButton.AddActionListener(null);
     buttonPanel.Add(parseButton);
     parseNextButton.SetText("Parse >");
     parseNextButton.SetToolTipText("Parse selected sentence and then scrolls forward one sentence.");
     parseNextButton.SetEnabled(false);
     parseNextButton.AddActionListener(null);
     buttonPanel.Add(parseNextButton);
     clearButton.SetText("Clear");
     clearButton.SetToolTipText("Clears parse tree.");
     clearButton.SetEnabled(false);
     clearButton.AddActionListener(null);
     buttonPanel.Add(clearButton);
     buttonsAndFilePanel.Add(buttonPanel);
     dataFilePanel.SetLayout(new FlowLayout(FlowLayout.Left));
     dataFilePanel.Add(dataFileLabel);
     buttonsAndFilePanel.Add(dataFilePanel);
     topPanel.Add(buttonsAndFilePanel, BorderLayout.North);
     textPane.SetPreferredSize(new Dimension(250, 250));
     textPane.AddFocusListener(new _FocusAdapter_888(this));
     textPane.AddMouseListener(new _MouseAdapter_895(this));
     textPane.AddMouseMotionListener(new _MouseMotionAdapter_902(this));
     textScrollPane.SetViewportView(textPane);
     topPanel.Add(textScrollPane, BorderLayout.Center);
     splitPane.SetLeftComponent(topPanel);
     treeContainer.SetLayout(new BorderLayout());
     treeContainer.SetBackground(new Color(255, 255, 255));
     treeContainer.SetBorder(new BevelBorder(BevelBorder.Raised));
     treeContainer.SetForeground(new Color(0, 0, 0));
     treeContainer.SetPreferredSize(new Dimension(200, 200));
     treePanel = new TreeJPanel();
     treeContainer.Add("Center", treePanel);
     treePanel.SetBackground(Color.white);
     parserFilePanel.SetLayout(new FlowLayout(FlowLayout.Left));
     parserFilePanel.SetBackground(new Color(255, 255, 255));
     parserFileLabel.SetText("Parser: None");
     parserFilePanel.Add(parserFileLabel);
     treeContainer.Add(parserFilePanel, BorderLayout.North);
     splitPane.SetRightComponent(treeContainer);
     Add(splitPane, BorderLayout.Center);
     statusPanel.SetLayout(new FlowLayout(FlowLayout.Left));
     statusLabel.SetText("Ready");
     statusPanel.Add(statusLabel);
     progressBar.SetName(string.Empty);
     statusPanel.Add(progressBar);
     Add(statusPanel, BorderLayout.South);
 }
示例#4
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();
        }