private void JbInit()
        {
            //pf = new PrintFile("out");
            this.AddWindowListener(new _WindowAdapter_110());
            //Set up the input/output fields and let them scroll.
            inputBox.SetLineWrap(true);
            inputBox.SetWrapStyleWord(true);
            outputBox.SetLineWrap(true);
            outputBox.SetWrapStyleWord(true);
            outputBox.SetEditable(false);
            JScrollPane scroll1 = new JScrollPane(inputBox);
            JScrollPane scroll2 = new JScrollPane(outputBox);

            scroll1.SetBorder(BorderFactory.CreateTitledBorder(BorderFactory.CreateEtchedBorder(), "Type a sentence to tag: "));
            scroll2.SetBorder(BorderFactory.CreateTitledBorder(BorderFactory.CreateEtchedBorder(), "Tagged sentence: "));
            //Set up the button for starting tagging
            JPanel buttonPanel = new JPanel();

            buttonPanel.SetBackground(Color.White);
            buttonPanel.ApplyComponentOrientation(ComponentOrientation.RightToLeft);
            FlowLayout fl = new FlowLayout();

            fl.SetAlignment(FlowLayout.Right);
            buttonPanel.SetLayout(fl);
            tagButton.SetText("Tag sentence!");
            tagButton.SetBackground(Color.White);
            buttonPanel.Add(tagButton);
            tagButton.AddActionListener(null);
            //Lay it all out
            this.SetLayout(new GridBagLayout());
            GridBagConstraints c = new GridBagConstraints();

            c.fill      = GridBagConstraints.Both;
            c.gridwidth = GridBagConstraints.Remainder;
            c.weightx   = 4.0;
            c.weighty   = 4.0;
            this.Add(scroll1, c);
            c.weighty = 1.0;
            this.Add(buttonPanel, c);
            c.weighty    = 4.0;
            c.gridheight = GridBagConstraints.Remainder;
            this.Add(scroll2, c);
        }
 /// <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
     jPanel1      = new JPanel();
     jLabel2      = new JLabel();
     jPanel3      = new JPanel();
     jLabel1      = new JLabel();
     urlTextField = new JTextField();
     jPanel2      = new JPanel();
     openButton   = new JButton();
     cancelButton = new JButton();
     browseButton = new JButton();
     AddWindowListener(new _WindowAdapter_96(this));
     jPanel1.SetLayout(new BoxLayout(jPanel1, BoxLayout.YAxis));
     jLabel2.SetText("Type in the internet address of a document or web page.");
     jPanel1.Add(jLabel2);
     jLabel1.SetText("Open");
     jPanel3.Add(jLabel1);
     urlTextField.SetMinimumSize(new Dimension(100, 20));
     urlTextField.SetPreferredSize(new Dimension(300, 20));
     urlTextField.GetDocument().AddDocumentListener(new _IDocumentListener_113(this));
     urlTextField.AddActionListener(null);
     jPanel3.Add(urlTextField);
     jPanel1.Add(jPanel3);
     GetContentPane().Add(jPanel1, BorderLayout.North);
     openButton.SetText("Open");
     openButton.SetEnabled(false);
     openButton.AddActionListener(null);
     jPanel2.Add(openButton);
     cancelButton.SetText("Cancel");
     cancelButton.AddActionListener(null);
     jPanel2.Add(cancelButton);
     browseButton.SetText("Browse");
     browseButton.AddActionListener(null);
     jPanel2.Add(browseButton);
     GetContentPane().Add(jPanel2, BorderLayout.South);
     Pack();
 }
Exemplo n.º 3
0
 /// <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);
 }
Exemplo n.º 4
0
        private void InitComponents()
        {
            JComponent.SetDefaultLocale(Locale.US);
            java.awt.GridBagConstraints gridBagConstraints;
            choosePanel  = new JPanel();
            statusPanel  = new JPanel();
            status       = new JLabel("initializing Q2Sharp...");
            jTextField1  = new JTextField();
            changeButton = new JButton();
            cancelButton = new JButton();
            exitButton   = new JButton();
            okButton     = new JButton();
            SetDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
            SetTitle("Jake2 - Bytonic Software");
            SetResizable(false);
            AddWindowListener(new AnonymousWindowAdapter(this));
            choosePanel.SetLayout(new GridBagLayout());
            choosePanel.SetMaximumSize(new Size(400, 100));
            choosePanel.SetMinimumSize(new Size(400, 100));
            choosePanel.SetPreferredSize(new Size(400, 100));
            gridBagConstraints           = new GridBagConstraints();
            gridBagConstraints.gridx     = 0;
            gridBagConstraints.gridy     = 0;
            gridBagConstraints.gridwidth = 1;
            gridBagConstraints.insets    = new Insets(5, 5, 5, 5);
            gridBagConstraints.weightx   = 0;
            gridBagConstraints.anchor    = GridBagConstraints.SOUTHWEST;
            choosePanel.Add(new JLabel("baseq2 directory"), gridBagConstraints);
            gridBagConstraints.gridx     = 1;
            gridBagConstraints.gridy     = 0;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.fill      = java.awt.GridBagConstraints.BOTH;
            gridBagConstraints.insets    = new Insets(5, 2, 5, 2);
            gridBagConstraints.weightx   = 1;
            choosePanel.Add(jTextField1, gridBagConstraints);
            changeButton.SetText("...");
            changeButton.AddActionListener(new AnonymousActionListener(this));
            gridBagConstraints.gridx     = 3;
            gridBagConstraints.gridy     = 0;
            gridBagConstraints.gridwidth = 1;
            gridBagConstraints.weightx   = 0;
            gridBagConstraints.fill      = java.awt.GridBagConstraints.NONE;
            gridBagConstraints.insets    = new Insets(5, 2, 5, 5);
            gridBagConstraints.anchor    = java.awt.GridBagConstraints.EAST;
            choosePanel.Add(changeButton, gridBagConstraints);
            gridBagConstraints.gridx     = 0;
            gridBagConstraints.gridy     = 1;
            gridBagConstraints.gridwidth = 4;
            gridBagConstraints.weightx   = 0;
            gridBagConstraints.weighty   = 1;
            gridBagConstraints.fill      = java.awt.GridBagConstraints.VERTICAL;
            choosePanel.Add(new JPanel(), gridBagConstraints);
            cancelButton.SetText("Cancel");
            cancelButton.AddActionListener(new AnonymousActionListener1(this));
            gridBagConstraints.gridx     = 0;
            gridBagConstraints.gridy     = 2;
            gridBagConstraints.gridwidth = 4;
            gridBagConstraints.weighty   = 0;
            gridBagConstraints.insets    = new Insets(5, 5, 5, 5);
            gridBagConstraints.anchor    = java.awt.GridBagConstraints.SOUTH;
            choosePanel.Add(cancelButton, gridBagConstraints);
            exitButton.SetText("Exit");
            exitButton.AddActionListener(new AnonymousActionListener2(this));
            gridBagConstraints.gridx     = 0;
            gridBagConstraints.gridy     = 2;
            gridBagConstraints.gridwidth = 1;
            gridBagConstraints.anchor    = java.awt.GridBagConstraints.SOUTHWEST;
            choosePanel.Add(exitButton, gridBagConstraints);
            okButton.SetText("OK");
            okButton.AddActionListener(new AnonymousActionListener3(this));
            gridBagConstraints.gridx     = 2;
            gridBagConstraints.gridy     = 2;
            gridBagConstraints.gridwidth = 2;
            gridBagConstraints.anchor    = java.awt.GridBagConstraints.SOUTHEAST;
            choosePanel.Add(okButton, gridBagConstraints);
            Jake2Canvas c = new Jake2Canvas();

            GetContentPane().Add(c, BorderLayout.CENTER);
            statusPanel.SetLayout(new GridBagLayout());
            statusPanel.SetMaximumSize(new Dimension(400, 100));
            statusPanel.SetMinimumSize(new Dimension(400, 100));
            statusPanel.SetPreferredSize(new Dimension(400, 100));
            gridBagConstraints           = new GridBagConstraints();
            gridBagConstraints.gridx     = 0;
            gridBagConstraints.gridy     = 0;
            gridBagConstraints.gridwidth = 1;
            gridBagConstraints.fill      = java.awt.GridBagConstraints.HORIZONTAL;
            gridBagConstraints.insets    = new Insets(10, 10, 10, 10);
            gridBagConstraints.weightx   = 1;
            statusPanel.Add(status, gridBagConstraints);
            GetContentPane().Add(statusPanel, java.awt.BorderLayout.SOUTH);
            progressPanel = new ProgressPanel(this);
            installPanel  = new InstallPanel(this);
            notFoundPanel = new NotFoundPanel(this);
            Pack();
        }