예제 #1
0
        internal virtual void createFilenamePanel()
        {
            Container     contentPane   = this.getContentPane();
            GridBagLayout gridBagLayout = new GridBagLayout();

            contentPane.setLayout(gridBagLayout);
            this.filename = new JTextField(12);
            JLabel jlabel = new JLabel("Filename:");

            jlabel.setLabelFor(this.filename);
            Insets             insets             = new Insets(12, 12, 0, 0);
            GridBagConstraints gridBagConstraints = new GridBagConstraints(0, 0, 1, 1, (double)0f, (double)0f, 17, 0, insets, 0, 0);

            gridBagLayout.setConstraints(jlabel, gridBagConstraints);
            contentPane.add(jlabel);
            insets             = new Insets(12, 7, 0, 12);
            gridBagConstraints = new GridBagConstraints(1, 0, 1, 1, (double)1f, (double)1f, 17, 2, insets, 0, 0);
            gridBagLayout.setConstraints(this.filename, gridBagConstraints);
            contentPane.add(this.filename);
            JButton jbutton = new JButton("Save");

            jbutton.addActionListener(new FilenameDialog_2(this));
            insets             = new Insets(0, 12, 12, 12);
            gridBagConstraints = new GridBagConstraints(0, 2, 2, 1, (double)1f, (double)1f, 13, 0, insets, 0, 0);
            gridBagLayout.setConstraints(jbutton, gridBagConstraints);
            contentPane.add(jbutton);
            this.getRootPane().setDefaultButton(jbutton);
        }
예제 #2
0
        private void initComponents()
        {
            scrollPane        = new JScrollPane();
            chatMessagesLabel = new JLabel();
            chatMessage       = new JTextField();
            sendButton        = new JButton();
            adhocIDLabel      = new JLabel();
            groupNameLabel    = new JLabel();
            membersLabel      = new JLabel();
            membersList       = new JLabel();

            Title     = "Chat";
            Resizable = true;

            sendButton.Text           = "Send";
            sendButton.DefaultCapable = true;
            RootPane.DefaultButton    = sendButton;
            sendButton.addActionListener(new ActionListenerAnonymousInnerClass(this));

            // Start displaying the chat message from the bottom
            chatMessagesLabel.VerticalAlignment = SwingConstants.BOTTOM;
            chatMessagesLabel.PreferredSize     = new Dimension(500, 300);

            scrollPane.ViewportView = chatMessagesLabel;

            adhocIDLabel.Text   = AdhocID;
            groupNameLabel.Text = GroupName;
            membersLabel.Text   = "Members:";

            membersList.PreferredSize = new Dimension(100, chatMessagesLabel.PreferredSize.height);

            chatMessage.Editable = true;

            //
            // Layout:
            //
            // +-------------------------------------------+-----------------+
            // |                                           | adhocIDLabel    |
            // |                                           | groupNameLabel  |
            // | chatMessageLabel in scrollPane            | membersLabel    |
            // |                                           +-----------------+
            // |                                           | membersList     |
            // |                                           |                 |
            // |                                           |                 |
            // |                                           |                 |
            // |                                           |                 |
            // +-------------------------------------------+----+------------+
            // | chatMessage                                    | sendButton |
            // +------------------------------------------------+------------+
            //
            GroupLayout layout = new GroupLayout(ContentPane);

            ContentPane.Layout     = layout;
            layout.HorizontalGroup = layout.createParallelGroup().addGroup(layout.createSequentialGroup().addComponent(scrollPane).addGroup(layout.createParallelGroup().addGroup(layout.createParallelGroup().addComponent(adhocIDLabel)).addGroup(layout.createParallelGroup().addComponent(groupNameLabel)).addComponent(membersLabel).addComponent(membersList))).addGroup(layout.createSequentialGroup().addComponent(chatMessage).addComponent(sendButton));
            layout.VerticalGroup   = layout.createSequentialGroup().addGroup(layout.createParallelGroup().addComponent(scrollPane).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup().addComponent(adhocIDLabel)).addGroup(layout.createParallelGroup().addComponent(groupNameLabel)).addComponent(membersLabel).addComponent(membersList))).addGroup(layout.createParallelGroup().addComponent(chatMessage).addComponent(sendButton));
            pack();
        }
예제 #3
0
        public UmdBrowserPmf(UmdIsoReader iso, string fileName, JLabel display)
        {
            this.iso      = iso;
            this.fileName = fileName;
            this.display  = display;

            init();
            initVideo();
        }
예제 #4
0
    //--------
    //-------- Constructor
    //--------

    /// <summary>
    /// Constructor a frame to contain the device data
    /// </summary>
    public DeviceFrameSensor(TaggedDevice dev, string logFile) : base(dev, logFile)
    {
        // construct the super

        // add to the center panel
        sensorLabel = new JLabel("            ");
        sensorLabel.HorizontalAlignment = JLabel.CENTER;
        sensorLabel.Font = new Font("SansSerif", Font.PLAIN, 20);
        centerPanel.add(sensorLabel);
    }
        /// <summary>
        /// Constructor. </summary>
        /// <param name="data"> the data to display in the worksheet.  Can be null or empty. </param>
        /// <param name="titleString"> the String to display as the GUI title. </param>
        /// <param name="editable"> whether the data in the JFrame can be edited or not.  If true
        /// the data can be edited, if false they can not. </param>
        /// <exception cref="Exception"> if there is an error building the worksheet. </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public StateCU_DelayTableAssignment_Data_JFrame(java.util.List<StateCU_DelayTableAssignment_Data_TableModel> data, String titleString, boolean editable) throws Exception
        public StateCU_DelayTableAssignment_Data_JFrame(IList <StateCU_DelayTableAssignment_Data_TableModel> data, string titleString, bool editable) : base(data, titleString, editable)
        {
            JPanel panel = new JPanel();

            panel.setLayout(new GridBagLayout());
            JLabel label = new JLabel("Show totals: ");

            JGUIUtil.addComponent(panel, label, 0, 0, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __checkBox = new JCheckBox((string)null, true);
            __checkBox.addActionListener(this);
            JGUIUtil.addComponent(panel, __checkBox, 1, 0, 1, 1, 1, 1, GridBagConstraints.NONE, GridBagConstraints.WEST);
            getContentPane().add("North", panel);
            pack();

            setSize(370, getHeight());
            __tableModel = (StateCU_DelayTableAssignment_Data_TableModel)_worksheet.getTableModel();
            __tableModel.setJWorksheet(_worksheet);
        }
예제 #6
0
        public UILabelPanel(Icon paramIcon, string paramString, JComponent paramJComponent) : base(new BorderLayout())
        {
            this.titleLabel           = new JLabel(paramString, paramIcon, 10);
            this.eastLabel            = new JLabel("", 4);
            this.titleLabel.Font      = new Font("SansSerif", 1, 11);
            this.eastLabel.Font       = new Font("SansSerif", 1, 11);
            this.eastLabel.Foreground = Color.BLACK;
            JPanel jPanel = buildHeader(this.titleLabel);

            this.o_topPanel.Border = BorderFactory.createEmptyBorder();
            this.o_topPanel.add(jPanel, "North");
            add(this.o_topPanel, "North");
            if (paramJComponent != null)
            {
                Content = paramJComponent;
            }
            Selected = true;
            updateHeader();
        }
예제 #7
0
 protected internal virtual JPanel buildHeader(JLabel paramJLabel)
 {
     this.o_eastPanel        = new JPanel(new BorderLayout());
     this.gradientPanel      = createGradientPanel();
     paramJLabel.Opaque      = false;
     this.eastLabel.Opaque   = false;
     this.o_eastPanel.Opaque = false;
     this.o_eastPanel.add(this.eastLabel, "East");
     this.hasEastTextComponent = true;
     this.gradientPanel.add(paramJLabel, "West");
     this.gradientPanel.add(this.o_eastPanel, "East");
     this.gradientPanel.Border = BorderFactory.createEmptyBorder(3, 4, 3, 1);
     this.headerPanel          = new JPanel(new BorderLayout());
     this.headerPanel.add(this.gradientPanel, "Center");
     this.headerPanel.Border = new RaisedHeaderBorder();
     this.headerPanel.Opaque = false;
     this.gradientPanel.setComponentZOrder(paramJLabel, 1);
     this.gradientPanel.setComponentZOrder(this.o_eastPanel, 0);
     return(this.headerPanel);
 }
예제 #8
0
        private void loadUI()
        {
            JPanel jPanel = new JPanel();
//JAVA TO C# CONVERTER WARNING: The original Java variable was marked 'final':
//ORIGINAL LINE: final java.text.DecimalFormat decimalFormat = (java.text.DecimalFormat)java.text.DecimalFormat.getInstance(java.util.Locale.ENGLISH).clone();
            DecimalFormat decimalFormat = (DecimalFormat)DecimalFormat.getInstance(Locale.ENGLISH).clone();

            decimalFormat.applyPattern("0");
            this.o_progressBar = new JProgressBar(0, this.o_totalTimes);
            this.o_progressBar.StringPainted = true;
            this.o_descriptionLabel          = new JLabel();
            this.o_progressBar.addChangeListener(new ChangeListenerAnonymousInnerClass(this, decimalFormat));
            jPanel.Border = BorderFactory.createEmptyBorder(10, 0, 0, 0);
            jPanel.Layout = new BoxLayout(jPanel, 1);
            jPanel.add(this.o_descriptionLabel);
            jPanel.add(Box.createVerticalStrut(5));
            jPanel.add(this.o_progressBar);
            jPanel.add(Box.createVerticalStrut(5));
            this.o_mainPanel.Border = BorderFactory.createEmptyBorder(8, 8, 8, 8);
            this.o_mainPanel.add(jPanel, "Center");
        }
예제 #9
0
        private void displayWeight(List <double?> currentKernel)
        {
            JFrame frame = new JFrame("Weight Visualiser: ");

            frame.setSize(400, 400);

            JLabel    label = new JLabel();
            Dimension d     = new Dimension(kernel.Width * RATIO, kernel.Height * RATIO);

            label.Size          = d;
            label.PreferredSize = d;

            frame.ContentPane.add(label, BorderLayout.CENTER);
            frame.pack();
            frame.Visible = true;

            BufferedImage image = new BufferedImage(kernel.Width, kernel.Height, BufferedImage.TYPE_BYTE_GRAY);

            int[] rgb = convertWeightToRGB(currentKernel);
            image.setRGB(0, 0, kernel.Width, kernel.Height, rgb, 0, kernel.Width);
            label.Icon = new ImageIcon(image.getScaledInstance(kernel.Width * RATIO, kernel.Height * RATIO, Image.SCALE_SMOOTH));
        }
예제 #10
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
     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();
 }
예제 #11
0
 private void initGUI()
 {
     try
     {
         setPreferredSize(new Dimension(400, 300));
         {
             generalPanel = new JPanel();
             FlowLayout generalPanelLayout = new FlowLayout();
             generalPanelLayout.setAlignment(FlowLayout.LEFT);
             generalPanel.setLayout(generalPanelLayout);
             this.addTab("General", null, generalPanel, null);
             {
                 resolutionPanel = new JPanel();
                 generalPanel.add(resolutionPanel);
                 FlowLayout resolutionPanelLayout = new FlowLayout();
                 resolutionPanel.setLayout(resolutionPanelLayout);
                 resolutionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Resolution", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     resolutionCheckBox = new JCheckBox();
                     resolutionPanel.add(resolutionCheckBox);
                     resolutionCheckBox.setText("Override");
                 }
                 {
                     jLabel1 = new JLabel();
                     resolutionPanel.add(jLabel1);
                     jLabel1.setText("Image Width:");
                 }
                 {
                     resolutionXTextField = new JTextField();
                     resolutionPanel.add(resolutionXTextField);
                     resolutionXTextField.setText("640");
                     resolutionXTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
                 {
                     jLabel2 = new JLabel();
                     resolutionPanel.add(jLabel2);
                     jLabel2.setText("Image Height:");
                 }
                 {
                     resolutionYTextField = new JTextField();
                     resolutionPanel.add(resolutionYTextField);
                     resolutionYTextField.setText("480");
                     resolutionYTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
             }
             {
                 threadsPanel = new JPanel();
                 generalPanel.add(threadsPanel);
                 threadsPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Threads", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     threadCheckBox = new JCheckBox();
                     threadsPanel.add(threadCheckBox);
                     threadCheckBox.setText("Use All Processors");
                 }
                 {
                     jLabel3 = new JLabel();
                     threadsPanel.add(jLabel3);
                     jLabel3.setText("Threads:");
                 }
                 {
                     threadTextField = new JTextField();
                     threadsPanel.add(threadTextField);
                     threadTextField.setText("1");
                     threadTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
             }
         }
         {
             rendererPanel = new JPanel();
             FlowLayout rendererPanelLayout = new FlowLayout();
             rendererPanelLayout.setAlignment(FlowLayout.LEFT);
             rendererPanel.setLayout(rendererPanelLayout);
             this.addTab("Renderer", null, rendererPanel, null);
             {
                 defaultRendererRadioButton = new JRadioButton();
                 rendererPanel.add(defaultRendererRadioButton);
                 defaultRendererRadioButton.setText("Default Renderer");
             }
             {
                 bucketRendererPanel = new JPanel();
                 BoxLayout bucketRendererPanelLayout = new BoxLayout(bucketRendererPanel, javax.swing.BoxLayout.Y_AXIS);
                 bucketRendererPanel.setLayout(bucketRendererPanelLayout);
                 rendererPanel.add(bucketRendererPanel);
                 bucketRendererPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Bucket Renderer", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     bucketRendererRadioButton = new JRadioButton();
                     bucketRendererPanel.add(bucketRendererRadioButton);
                     bucketRendererRadioButton.setText("Enable");
                 }
                 {
                     samplingPanel = new JPanel();
                     GridLayout samplingPanelLayout = new GridLayout(2, 2);
                     samplingPanelLayout.setColumns(2);
                     samplingPanelLayout.setHgap(5);
                     samplingPanelLayout.setVgap(5);
                     samplingPanelLayout.setRows(2);
                     samplingPanel.setLayout(samplingPanelLayout);
                     bucketRendererPanel.add(samplingPanel);
                     {
                         jLabel5 = new JLabel();
                         samplingPanel.add(jLabel5);
                         jLabel5.setText("Min:");
                     }
                     {
                         ComboBoxModel minSamplingComboBoxModel = new DefaultComboBoxModel(new string[] {
                             "Item One", "Item Two"
                         });
                         minSamplingComboBox = new JComboBox();
                         samplingPanel.add(minSamplingComboBox);
                         minSamplingComboBox.setModel(minSamplingComboBoxModel);
                     }
                     {
                         jLabel6 = new JLabel();
                         samplingPanel.add(jLabel6);
                         jLabel6.setText("Max:");
                     }
                     {
                         ComboBoxModel maxSamplingComboxBoxModel = new DefaultComboBoxModel(new string[] {
                             "Item One", "Item Two"
                         });
                         maxSamplingComboxBox = new JComboBox();
                         samplingPanel.add(maxSamplingComboxBox);
                         maxSamplingComboxBox.setModel(maxSamplingComboxBoxModel);
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         e.printStackTrace();
     }
 }
예제 #12
0
    //--------
    //-------- Constructors
    //--------

    /// <summary>
    /// Constructor a frame to contain the device data.  Provide
    /// the device and the log file name
    /// </summary>
    public TagMainFrame() : base("1-Wire Tag Viewer")
    {
        // construct the frame

        //set the look and feel to the system look and feel
        try
        {
            UIManager.LookAndFeel = UIManager.SystemLookAndFeelClassName;
        }
        catch (Exception e)
        {
            Console.WriteLine(e.ToString());
            Console.Write(e.StackTrace);
        }

        // add an event listener to end the aplication when the frame is closed
        addWindowListener(new WindowAdapterAnonymousInnerClassHelper(this, e));

        // create the main panel
        mainPanel = new JPanel(new BorderLayout(10, 10));

        // create the sub-pannels
        northPanel        = new JPanel();
        northPanel.Border = BorderFactory.createLoweredBevelBorder();

        centerPanel        = new JPanel();
        centerPanel.Layout = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);

        southPanel        = new JPanel();
        southPanel.Layout = new BoxLayout(southPanel, BoxLayout.Y_AXIS);
        southPanel.Border = BorderFactory.createLoweredBevelBorder();

        westPanel        = new JPanel();
        westPanel.Border = BorderFactory.createRaisedBevelBorder();
        westPanel.Border = BorderFactory.createEmptyBorder(10, 10, 10, 10);

        eastPanel        = new JPanel();
        eastPanel.Border = BorderFactory.createEmptyBorder(10, 10, 10, 10);

        // fill the panels

        // north
        logLabel = new JLabel("Log Filename: ");
        northPanel.add(logLabel);

        logField = new JTextField("log.txt", 20);
        logField.addActionListener(this);
        northPanel.add(logField);

        // center
        listData = new DefaultListModel();
        listData.addElement("                                                                     ");
        listData.addElement("                                                                     ");
        listData.addElement("                                                                     ");
        listData.addElement("                                                                     ");
        pathList = new JList(listData);
        pathList.VisibleRowCount = 5;
        scrollPanel        = new JScrollPane(pathList);
        scrollPanel.Border = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "1-Wire Paths to Search");
        centerPanel.add(scrollPanel);

        // west
        scanCheck = new JCheckBox("Scan 1-Wire Paths for XML Tags", false);
        scanCheck.addActionListener(this);
        westPanel.add(scanCheck);

        // south
        portLabel = new JLabel("Adapter:");
        southPanel.add(portLabel);

        statusLabel = new JLabel("Status:");
        southPanel.add(statusLabel);

        // add to main
        mainPanel.add(northPanel, BorderLayout.NORTH);
        mainPanel.add(centerPanel, BorderLayout.CENTER);
        mainPanel.add(southPanel, BorderLayout.SOUTH);
        mainPanel.add(eastPanel, BorderLayout.EAST);
        mainPanel.add(westPanel, BorderLayout.WEST);

        // add to frame
        ContentPane.add(mainPanel);

        // pack the frame
        pack();

        // resize the window and put in random location
        Dimension current_sz = Size;

        Size = new Dimension(current_sz.width * 5 / 4, current_sz.height);
        Toolkit   tool = Toolkit.DefaultToolkit;
        Dimension mx   = tool.ScreenSize;
        Dimension sz   = Size;
        Random    rand = new Random();

        setLocation((mx.width - sz.width) / 2, (mx.height - sz.height) / 2);

        // clear out the listbox data
        listData.removeAllElements();

        // make visible
        Visible = true;
    }
예제 #13
0
        private void initComponents()
        {
            Title = "Banking Application";
            LocationByPlatform    = true;
            DefaultCloseOperation = WindowConstants.EXIT_ON_CLOSE;

            JPanel overallPanel = new JPanel();

            Dimension dim  = new Dimension(130, 20);
            Dimension dim2 = new Dimension(80, 20);

            JPanel namesAndFields = new JPanel();
            JLabel nameLabel      = new JLabel("Customer Name: ");

            nameField = new JTextField();
            nameField.PreferredSize = dim;
            JLabel addressLabel = new JLabel("Address: ");

            addressField = new JTextField();
            addressField.PreferredSize = dim;
            JLabel phoneLabel = new JLabel("Phone Number: ");

            phoneField = new JTextField();
            phoneField.PreferredSize = dim;
            JLabel accountNumLabel = new JLabel("Account Number: ");

            accountNumField = new JTextField();
            accountNumField.PreferredSize = dim;
            JLabel balanceLabel = new JLabel("Balance: ");

            balanceField = new JTextField();
            balanceField.PreferredSize = dim;
            balanceField.Editable      = false;
            JLabel wDLabel = new JLabel("Withdrawal/Deposit: ");

            wDField = new JTextField();
            wDField.PreferredSize = dim;

            namesAndFields.Layout = new GridBagLayout();
            namesAndFields.add(nameLabel, getConstraints(0, 0));
            namesAndFields.add(nameField, getConstraints(1, 0));
            namesAndFields.add(addressLabel, getConstraints(0, 1));
            namesAndFields.add(addressField, getConstraints(1, 1));
            namesAndFields.add(phoneLabel, getConstraints(0, 2));
            namesAndFields.add(phoneField, getConstraints(1, 2));
            namesAndFields.add(accountNumLabel, getConstraints(0, 3));
            namesAndFields.add(accountNumField, getConstraints(1, 3));
            namesAndFields.add(balanceLabel, getConstraints(0, 4));
            namesAndFields.add(balanceField, getConstraints(1, 4));
            namesAndFields.add(wDLabel, getConstraints(0, 5));
            namesAndFields.add(wDField, getConstraints(1, 5));
            //---BUTTON PANELS------------------------------------
            JPanel buttonsP = new JPanel();

            searchCustomerB = new JButton("Search Customer");
            searchCustomerB.PreferredSize = dim;
            searchCustomerB.addActionListener(e => searchButtonClicked());
            previousB = new JButton("Previous Customer");
            previousB.PreferredSize = dim;
            previousB.addActionListener(e => previousClicked());
            nextB = new JButton("Next Customer");
            nextB.PreferredSize = dim;
            nextB.addActionListener(e => nextButtonClicked());
            addB = new JButton("Add Customer");
            addB.PreferredSize = dim;
            addB.addActionListener(e => addButtonClicked());
            updateB = new JButton("Update Customer");
            updateB.PreferredSize = dim;
            updateB.addActionListener(e => updateClicked());
            openAcctB = new JButton("Open Account");
            openAcctB.PreferredSize = dim;
            openAcctB.addActionListener(e => openAcctButtonClicked());

            buttonsP.Layout = new GridBagLayout();
            buttonsP.add(searchCustomerB, getConstraints(0, 0));
            buttonsP.add(previousB, getConstraints(0, 1));
            buttonsP.add(nextB, getConstraints(0, 2));
            buttonsP.add(addB, getConstraints(0, 3));
            buttonsP.add(updateB, getConstraints(0, 4));
            buttonsP.add(openAcctB, getConstraints(0, 5));

            JPanel buttonsP2 = new JPanel();

            depositB = new JButton("Deposit");
            depositB.PreferredSize = dim;
            depositB.addActionListener(e => depositButtonClicked());
            withdrawB = new JButton("Withdraw");
            withdrawB.PreferredSize = dim;
            withdrawB.addActionListener(e => withdrawButtonClicked());

            buttonsP2.Layout = new GridBagLayout();
            buttonsP2.add(depositB, getConstraints(0, 0));
            buttonsP2.add(withdrawB, getConstraints(0, 1));

            JPanel buttonsP3 = new JPanel();

            calcInterestB = new JButton("Calculate Interest");
            calcInterestB.PreferredSize = dim;
            calcInterestB.addActionListener(e => calculateInterestClicked());

            buttonsP3.Layout = new GridBagLayout();
            buttonsP3.add(calcInterestB, getConstraints(0, 0));
            //---INTEREST PANEL-----------------------------------
            JPanel interest       = new JPanel();
            JLabel interestMonthL = new JLabel("Interest Month: ");

            interestField = new JTextField();
            interestField.PreferredSize = dim2;
            JLabel calcInterestL = new JLabel("Calculated Interest: ");

            calcInterestField = new JTextField();
            calcInterestField.PreferredSize = dim2;
            calcInterestField.Editable      = false;

            interest.Layout = new GridBagLayout();
            interest.add(interestMonthL, getConstraints(0, 0));
            interest.add(interestField, getConstraints(1, 0));
            interest.add(calcInterestL, getConstraints(0, 1));
            interest.add(calcInterestField, getConstraints(1, 1));

            //---MAIN PANEL---------------------------------------
            overallPanel.Layout = new GridBagLayout();
            overallPanel.add(namesAndFields, getConstraints(0, 0));
            overallPanel.add(buttonsP, getConstraints(1, 0));
            overallPanel.add(buttonsP2, getConstraints(1, 1));
            overallPanel.add(buttonsP3, getConstraints(1, 2));
            overallPanel.add(interest, getConstraints(0, 1));
            add(overallPanel, BorderLayout.CENTER);
            Resizable = false;

            setSize(450, 350);
        }
        /// <summary>
        /// Sets up the GUI.
        /// </summary>
        private void setupGUI()
        {
            addWindowListener(this);

            __descriptionTextField = new JTextField(25);
            __origDesc             = __nodes[__nodeNum].getDescription();
            __descriptionTextField.setText(__origDesc);
            __idTextField = new JTextField(10);
            __origID      = __nodes[__nodeNum].getCommonID();
            __idTextField.setText(__origID);
            __idTextField.addKeyListener(this);
            __xTextField = new JTextField(10);
            __origX      = StringUtil.formatString(__nodes[__nodeNum].getX(), "%13.6f").Trim();
            __xTextField.setText(__origX);
            __xTextField.addKeyListener(this);
            __yTextField = new JTextField(10);
            __origY      = StringUtil.formatString(__nodes[__nodeNum].getY(), "%13.6f").Trim();
            __yTextField.setText(__origY);
            __yTextField.addKeyListener(this);
            __areaTextField = new JTextField(10);
            __origArea      = StringUtil.formatString(__nodes[__nodeNum].getArea(), "%13.6f").Trim();
            __areaTextField.setText(__origArea);
            __areaTextField.addKeyListener(this);
            __precipitationTextField = new JTextField(10);
            __origPrecipitation      = StringUtil.formatString(__nodes[__nodeNum].getPrecip(), "%13.6f").Trim();
            __precipitationTextField.setText(__origPrecipitation);
            __precipitationTextField.addKeyListener(this);

            __typeComboBox = new SimpleJComboBox(false);
            __typeComboBox.add(__NODE_DIVERSION);
            __typeComboBox.add(__NODE_DIVERSION_AND_WELL);
            __typeComboBox.add(__NODE_INSTREAM_FLOW);
            __typeComboBox.add(__NODE_OTHER);
            __typeComboBox.add(__NODE_PLAN);
            __typeComboBox.add(__NODE_RESERVOIR);
            __typeComboBox.add(__NODE_STREAMFLOW);
            __typeComboBox.add(__NODE_WELL);

            int type = __nodes[__nodeNum].getType();

            if (type == HydrologyNode.NODE_TYPE_CONFLUENCE)
            {
                __typeComboBox.select(__NODE_CONFLUENCE);
            }
            else if (type == HydrologyNode.NODE_TYPE_DIV)
            {
                __typeComboBox.select(__NODE_DIVERSION);
            }
            else if (type == HydrologyNode.NODE_TYPE_DIV_AND_WELL)
            {
                __typeComboBox.select(__NODE_DIVERSION_AND_WELL);
            }
            else if (type == HydrologyNode.NODE_TYPE_END)
            {
                __typeComboBox.removeAll();
                __typeComboBox.add(__NODE_END);
            }
            else if (type == HydrologyNode.NODE_TYPE_ISF)
            {
                __typeComboBox.select(__NODE_INSTREAM_FLOW);
            }
            else if (type == HydrologyNode.NODE_TYPE_OTHER)
            {
                __typeComboBox.select(__NODE_OTHER);
            }
            else if (type == HydrologyNode.NODE_TYPE_PLAN)
            {
                __typeComboBox.select(__NODE_PLAN);
            }
            else if (type == HydrologyNode.NODE_TYPE_RES)
            {
                __typeComboBox.select(__NODE_RESERVOIR);
            }
            else if (type == HydrologyNode.NODE_TYPE_FLOW)
            {
                __typeComboBox.select(__NODE_STREAMFLOW);
            }
            else if (type == HydrologyNode.NODE_TYPE_WELL)
            {
                __typeComboBox.select(__NODE_WELL);
            }
            else if (type == HydrologyNode.NODE_TYPE_XCONFLUENCE)
            {
                __typeComboBox.select(__NODE_XCONFLUENCE);
            }
            else
            {
                __typeComboBox.removeAll();
                __typeComboBox.add("Unknown Type: " + type);
            }

            __typeComboBox.setMaximumRowCount(__typeComboBox.getItemCount());

            __origIType = type;
            __origType  = __typeComboBox.getSelected();

            __labelPositionComboBox = new SimpleJComboBox(false);
            __labelPositionComboBox.add(__ABOVE_CENTER);
            __labelPositionComboBox.add(__UPPER_RIGHT);
            __labelPositionComboBox.add(__RIGHT);
            __labelPositionComboBox.add(__LOWER_RIGHT);
            __labelPositionComboBox.add(__BELOW_CENTER);
            __labelPositionComboBox.add(__LOWER_LEFT);
            __labelPositionComboBox.add(__LEFT);
            __labelPositionComboBox.add(__UPPER_LEFT);
            __labelPositionComboBox.add(__CENTER);
            __labelPositionComboBox.setMaximumRowCount(__labelPositionComboBox.getItemCount());

            int dir = __nodes[__nodeNum].getLabelDirection() % 10;

            if (dir == 2)
            {
                __labelPositionComboBox.select(__BELOW_CENTER);
            }
            else if (dir == 1)
            {
                __labelPositionComboBox.select(__ABOVE_CENTER);
            }
            else if (dir == 4)
            {
                __labelPositionComboBox.select(__RIGHT);
            }
            else if (dir == 3)
            {
                __labelPositionComboBox.select(__LEFT);
            }
            else if (dir == 7)
            {
                __labelPositionComboBox.select(__UPPER_RIGHT);
            }
            else if (dir == 8)
            {
                __labelPositionComboBox.select(__LOWER_RIGHT);
            }
            else if (dir == 5)
            {
                __labelPositionComboBox.select(__LOWER_LEFT);
            }
            else if (dir == 6)
            {
                __labelPositionComboBox.select(__UPPER_LEFT);
            }
            else if (dir == 9)
            {
                __labelPositionComboBox.select(__CENTER);
            }
            else
            {
                __labelPositionComboBox.removeAll();
                __labelPositionComboBox.add("Unknown Position: " + dir);
            }

            __origIDir = dir;
            __origDir  = __labelPositionComboBox.getSelected();

            __isNaturalFlowCheckBox = new JCheckBox();
            __isImportCheckBox      = new JCheckBox();

            __origDirty = __nodes[__nodeNum].isDirty();

            __reservoirDirectionLabel    = new JLabel("Reservoir Direction: ");
            __reservoirDirectionComboBox = new SimpleJComboBox(false);
            __reservoirDirectionComboBox.setToolTipText("Reservoir body is to the indicated direction " + "(downstream follows the arrow).");
            __reservoirDirectionComboBox.add(__TOP);
            __reservoirDirectionComboBox.add(__BOTTOM);
            __reservoirDirectionComboBox.add(__LEFT);
            __reservoirDirectionComboBox.add(__RIGHT);

            int resDir = __nodes[__nodeNum].getLabelDirection() / 10;

            if (resDir == 1)
            {
                __reservoirDirectionComboBox.select(__BOTTOM);
            }
            else if (resDir == 2)
            {
                __reservoirDirectionComboBox.select(__TOP);
            }
            else if (resDir == 3)
            {
                __reservoirDirectionComboBox.select(__RIGHT);
            }
            else if (resDir == 4)
            {
                __reservoirDirectionComboBox.select(__LEFT);
            }
            else if (resDir == 0)
            {
            }
            else
            {
                __reservoirDirectionComboBox.removeAll();
                __reservoirDirectionComboBox.add("Unknown direction: " + resDir);
            }

            __origResIDir = resDir;
            __origResDir  = __reservoirDirectionComboBox.getSelected();

            JPanel panel = new JPanel();

            panel.setLayout(new GridBagLayout());

            int y = 0;

            JGUIUtil.addComponent(panel, new JLabel("ID: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __idTextField, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;
            JGUIUtil.addComponent(panel, new JLabel("Type: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __typeComboBox, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;
            JGUIUtil.addComponent(panel, new JLabel("Description: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __descriptionTextField, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;
            JGUIUtil.addComponent(panel, new JLabel("X: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __xTextField, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;
            JGUIUtil.addComponent(panel, new JLabel("Y: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __yTextField, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;
            JGUIUtil.addComponent(panel, new JLabel("Is natural flow?: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __isNaturalFlowCheckBox, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;
            JGUIUtil.addComponent(panel, new JLabel("Is import?: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __isImportCheckBox, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;
            JGUIUtil.addComponent(panel, new JLabel("Area: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __areaTextField, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            y++;
            JGUIUtil.addComponent(panel, new JLabel("Precipitation: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __precipitationTextField, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            if (__nodes[__nodeNum].getIsNaturalFlow())
            {
                __isNaturalFlowCheckBox.setSelected(true);
            }
            else
            {
                __isNaturalFlowCheckBox.setSelected(false);
                __areaTextField.setEnabled(false);
                __precipitationTextField.setEnabled(false);
            }
            __isNaturalFlowCheckBox.addActionListener(this);

            if (__nodes[__nodeNum].getIsImport())
            {
                __isImportCheckBox.setSelected(true);
            }
            else
            {
                __isImportCheckBox.setSelected(false);
            }
            __isImportCheckBox.addActionListener(this);

            __origNaturalFlow = __isNaturalFlowCheckBox.isSelected();
            __origImport      = __isImportCheckBox.isSelected();

            y++;
            JGUIUtil.addComponent(panel, new JLabel("Label Position: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __labelPositionComboBox, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;
            JGUIUtil.addComponent(panel, __reservoirDirectionLabel, 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, __reservoirDirectionComboBox, 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;

            y = addUpstreamNodesToPanel(panel, y);
            addDownstreamNodeToPanel(panel, y);

            getContentPane().add(panel);

            JPanel southPanel = new JPanel();

            southPanel.setLayout(new GridBagLayout());

            __applyButton = new JButton(__BUTTON_APPLY);
            __applyButton.addActionListener(this);
            __okButton = new JButton(__BUTTON_OK);
            __okButton.addActionListener(this);
            JButton cancelButton = new JButton(__BUTTON_CANCEL);

            cancelButton.addActionListener(this);

            JGUIUtil.addComponent(southPanel, __applyButton, 0, 0, 1, 1, 1, 1, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(southPanel, __okButton, 2, 0, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(southPanel, cancelButton, 3, 0, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);

            getContentPane().add(southPanel, "South");

            pack();

            if (__origIType != HydrologyNode.NODE_TYPE_RES)
            {
                __reservoirDirectionLabel.setVisible(false);
                __reservoirDirectionComboBox.setVisible(false);
            }

            __typeComboBox.addActionListener(this);

            if (__parent.inStateModGUI())
            {
                __typeComboBox.setEnabled(false);
                __precipitationTextField.setEditable(false);
                __precipitationTextField.removeKeyListener(this);
                __descriptionTextField.setEditable(false);
                __descriptionTextField.removeKeyListener(this);
                __areaTextField.removeKeyListener(this);
                __areaTextField.setEditable(false);
                __idTextField.removeKeyListener(this);
                __idTextField.setEditable(false);
                __isNaturalFlowCheckBox.setEnabled(false);
                __isImportCheckBox.setEnabled(false);
            }

            JGUIUtil.center(this);
            setVisible(true);
        }
        /// <summary>
        /// Sets up the GUI.
        /// </summary>
        private void setupGUI()
        {
            __xdgSimpleJComboBox = new SimpleJComboBox();

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_Diversion> diversionsVector = (java.util.List<StateMod_Diversion>) __dataset.getComponentForComponentType(StateMod_DataSet.COMP_DIVERSION_STATIONS).getData();
            IList <StateMod_Diversion> diversionsVector = (IList <StateMod_Diversion>)__dataset.getComponentForComponentType(StateMod_DataSet.COMP_DIVERSION_STATIONS).getData();
            IList <string>             list_names       = StateMod_Util.createIdentifierListFromStateModData(diversionsVector, true, null);
            int size = list_names.Count;

            for (int i = 0; i < size; i++)
            {
                __xdgSimpleJComboBox.add(list_names[i] + " - Diversion");
            }

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_InstreamFlow> instreamFlowsVector = (java.util.List<StateMod_InstreamFlow>) __dataset.getComponentForComponentType(StateMod_DataSet.COMP_INSTREAM_STATIONS).getData();
            IList <StateMod_InstreamFlow> instreamFlowsVector = (IList <StateMod_InstreamFlow>)__dataset.getComponentForComponentType(StateMod_DataSet.COMP_INSTREAM_STATIONS).getData();

            list_names = StateMod_Util.createIdentifierListFromStateModData(instreamFlowsVector, true, null);
            size       = list_names.Count;
            for (int i = 0; i < size; i++)
            {
                __xdgSimpleJComboBox.add(list_names[i] + " - Instream Flow");
            }

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_StreamGage> gageVector = (java.util.List<StateMod_StreamGage>) __dataset.getComponentForComponentType(StateMod_DataSet.COMP_STREAMGAGE_STATIONS).getData();
            IList <StateMod_StreamGage> gageVector = (IList <StateMod_StreamGage>)__dataset.getComponentForComponentType(StateMod_DataSet.COMP_STREAMGAGE_STATIONS).getData();

            list_names = StateMod_Util.createIdentifierListFromStateModData(gageVector, true, null);
            size       = list_names.Count;
            for (int i = 0; i < size; i++)
            {
                __xdgSimpleJComboBox.add(list_names[i] + " - Stream Gage");
            }

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_StreamEstimate> estimateVector = (java.util.List<StateMod_StreamEstimate>) __dataset.getComponentForComponentType(StateMod_DataSet.COMP_STREAMESTIMATE_STATIONS).getData();
            IList <StateMod_StreamEstimate> estimateVector = (IList <StateMod_StreamEstimate>)__dataset.getComponentForComponentType(StateMod_DataSet.COMP_STREAMESTIMATE_STATIONS).getData();

            list_names = StateMod_Util.createIdentifierListFromStateModData(estimateVector, true, null);
            size       = list_names.Count;
            for (int i = 0; i < size; i++)
            {
                __xdgSimpleJComboBox.add(list_names[i] + " - Stream Estimate");
            }

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_Reservoir> reservoirsVector = (java.util.List<StateMod_Reservoir>) __dataset.getComponentForComponentType(StateMod_DataSet.COMP_RESERVOIR_STATIONS).getData();
            IList <StateMod_Reservoir> reservoirsVector = (IList <StateMod_Reservoir>)__dataset.getComponentForComponentType(StateMod_DataSet.COMP_RESERVOIR_STATIONS).getData();

            list_names           = StateMod_Util.createIdentifierListFromStateModData(reservoirsVector, true, null);
            size                 = list_names.Count;
            __xrgSimpleJComboBox = new SimpleJComboBox();
            for (int i = 0; i < size; i++)
            {
                __xrgSimpleJComboBox.add(list_names[i] + " - Reservoir");
            }

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_Well> wellsVector = (java.util.List<StateMod_Well>) __dataset.getComponentForComponentType(StateMod_DataSet.COMP_WELL_STATIONS).getData();
            IList <StateMod_Well> wellsVector = (IList <StateMod_Well>)__dataset.getComponentForComponentType(StateMod_DataSet.COMP_WELL_STATIONS).getData();

            list_names           = StateMod_Util.createIdentifierListFromStateModData(wellsVector, true, null);
            size                 = list_names.Count;
            __xwgSimpleJComboBox = new SimpleJComboBox();
            for (int i = 0; i < size; i++)
            {
                __xwgSimpleJComboBox.add(list_names[i] + " - Well");
            }

            // Define the button groups and add radio buttons to the group in the
            // order of the GUI...

            __general_ButtonGroup = new ButtonGroup();
            __general_ButtonGroup.add(__xstJRadioButton = new JRadioButton("-xst", false));
            __general_ButtonGroup.add(__xwbJRadioButton = new JRadioButton("-xwb", true));
            __general_ButtonGroup.add(__xwrJRadioButton = new JRadioButton("-xwr", false));
            __general_ButtonGroup.add(__xcuJRadioButton = new JRadioButton("-xcu", false));
            __compare_ButtonGroup = new ButtonGroup();
            __compare_ButtonGroup.add(__xdcJRadioButton = new JRadioButton("-xdc", true));
            __compare_ButtonGroup.add(__xrcJRadioButton = new JRadioButton("-xrc", false));
            __compare_ButtonGroup.add(__xwcJRadioButton = new JRadioButton("-xwc", false));
            __compare_ButtonGroup.add(__xscJRadioButton = new JRadioButton("-xsc", false));
            __graph_ButtonGroup = new ButtonGroup();
            __graph_ButtonGroup.add(__xdgJRadioButton = new JRadioButton("-xdg", true));
            __graph_ButtonGroup.add(__xrgJRadioButton = new JRadioButton("-xrg", false));
            __graph_ButtonGroup.add(__xwgJRadioButton = new JRadioButton("-xwg", false));
            __daily_ButtonGroup = new ButtonGroup();
            __daily_ButtonGroup.add(__xdyJRadioButton = new JRadioButton("-xdy", true));
            __daily_ButtonGroup.add(__xryJRadioButton = new JRadioButton("-xry", false));
            __daily_ButtonGroup.add(__xwyJRadioButton = new JRadioButton("-xwy", false));
            __other_ButtonGroup = new ButtonGroup();
            __other_ButtonGroup.add(__xnmJRadioButton = new JRadioButton("-xnm", true));
            __other_ButtonGroup.add(__xrxJRadioButton = new JRadioButton("-xrx", false));
            __other_ButtonGroup.add(__xspJRadioButton = new JRadioButton("-xsp", false));
            __other_ButtonGroup.add(__xbnJRadioButton = new JRadioButton("-xbn", false));

            // Set the selected item in the graph output, based on whether data
            // exists...

            bool something_selected = false;     // To help select a radio button

            if (__xdgSimpleJComboBox.getItemCount() == 0)
            {
                __xdgSimpleJComboBox.setEnabled(false);
            }
            else
            {
                __xdgSimpleJComboBox.select(0);
                __xdgJRadioButton.setSelected(true);
                something_selected = true;
            }
            if (__xrgSimpleJComboBox.getItemCount() == 0)
            {
                __xrgSimpleJComboBox.setEnabled(false);
            }
            else
            {
                __xrgSimpleJComboBox.select(0);
                if (!something_selected)
                {
                    __xrgJRadioButton.setSelected(true);
                    something_selected = true;
                }
            }
            if (__xwgSimpleJComboBox.getItemCount() == 0)
            {
                __xwgSimpleJComboBox.setEnabled(false);
            }
            else
            {
                __xwgSimpleJComboBox.select(0);
                if (!something_selected)
                {
                    __xwgJRadioButton.setSelected(true);
                }
            }

            __runStateModJButton = new JButton(__BUTTON_RUN_REPORT);
            __cancelJButton      = new JButton(__BUTTON_CANCEL);
            // REVISIT - enable when full help system is redesigned
            //__helpJButton = new JButton(__BUTTON_HELP);

            GridBagLayout gb        = new GridBagLayout();
            JPanel        mainPanel = new JPanel();

            mainPanel.setLayout(gb);

            int col1 = 0;
            int col2 = 1;
            int col3 = 2;
            int y;
            int bound = 2;     // buffer around components.

            __main_JTabbedPane = new JTabbedPane();

            __general_JPanel = new JPanel();
            __general_JPanel.setLayout(gb);
            __compare_JPanel = new JPanel();
            __compare_JPanel.setLayout(gb);
            __graph_JPanel = new JPanel();
            __graph_JPanel.setLayout(gb);
            __daily_JPanel = new JPanel();
            __daily_JPanel.setLayout(gb);
            __other_JPanel = new JPanel();
            __other_JPanel.setLayout(gb);

            /////////////////////////////////////////////////////////////
            // general panel
            /////////////////////////////////////////////////////////////
            y = 0;
            JGUIUtil.addComponent(__general_JPanel, new JLabel("Select one of the following report options." + "  Output files will have the extensions shown."), col1, y, 3, 1, 0, 0, 0, 0, bound, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            JGUIUtil.addComponent(__general_JPanel, __xstJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xstJLabel1 = new JLabel("Direct and Instream Flow Data (*.xdd)");
            __xstJLabel1.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xstJLabel1, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xstJLabel2 = new JLabel("Reservoir Data - Total and by Account " + "(*.xre)");
            __xstJLabel2.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xstJLabel2, col2, ++y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xstJLabel3 = new JLabel("Operation Right Summary (*.xop)");
            __xstJLabel3.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xstJLabel3, col2, ++y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xstJLabel4 = new JLabel("Instream Flow Reach Summary (*.xir)");
            __xstJLabel4.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xstJLabel4, col2, ++y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xstJLabel5 = new JLabel("Well Summary (*.xwe)");
            __xstJLabel5.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xstJLabel5, col2, ++y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__general_JPanel, __xwbJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xwbJLabel = new JLabel("Water balance (*.xwb) and " + "Ground Water Balance (*.xgw)");
            __xwbJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xwbJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__general_JPanel, __xwrJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xwrJLabel = new JLabel("Water rights list, sorted by basin " + "rank (*.xwr)");
            __xwrJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xwrJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__general_JPanel, __xcuJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xcuJLabel1 = new JLabel("Simulated Diversions and " + "Consumptive Use (*.xcu)");
            __xcuJLabel1.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xcuJLabel1, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xcuJLabel2 = new JLabel("Water supply summary (*.xsu)");
            __xcuJLabel2.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xcuJLabel2, col2, ++y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xcuJLabel3 = new JLabel("Shortage Summary (*.xsh)");
            __xcuJLabel3.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xcuJLabel3, col2, ++y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xcuJLabel4 = new JLabel("CU by Water District (*.xwd)");
            __xcuJLabel4.addMouseListener(this);
            JGUIUtil.addComponent(__general_JPanel, __xcuJLabel4, col2, ++y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            /////////////////////////////////////////////////////////////
            // compare panel
            /////////////////////////////////////////////////////////////
            y = 0;
            JGUIUtil.addComponent(__compare_JPanel, new JLabel("Select one of the following report options." + "  Output files will have the extensions shown."), col1, y, 3, 1, 0, 0, 0, 0, bound, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__compare_JPanel, __xdcJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xdcJLabel = new JLabel("Diversion comparison (*.xdc)");
            __xdcJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__compare_JPanel, __xdcJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__compare_JPanel, __xrcJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xrcJLabel = new JLabel("Reservoir comparison (*.xrc)");
            __xrcJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__compare_JPanel, __xrcJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__compare_JPanel, __xwcJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xwcJLabel = new JLabel("Well comparison (*.xwc)");
            __xwcJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__compare_JPanel, __xwcJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__compare_JPanel, __xscJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xscJLabel = new JLabel("Stream flow gage comparison (*.xsc)");
            __xscJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__compare_JPanel, __xscJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            /////////////////////////////////////////////////////////////
            // graph panel
            /////////////////////////////////////////////////////////////
            y = 0;
            JGUIUtil.addComponent(__graph_JPanel, new JLabel("Select one of the following report options." + "  Output files will have the extensions shown."), col1, y, 3, 1, 0, 0, 0, 0, bound, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__graph_JPanel, __xdgJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            JGUIUtil.addComponent(__graph_JPanel, __xdgSimpleJComboBox, col2, y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.BOTH, GridBagConstraints.WEST);
            __xdgSimpleJComboBox.addMouseListener(this);
            __xdgJLabel = new JLabel("Direct diversion, instream flow and " + "gage graph (*.xdg)");
            __xdgJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__graph_JPanel, __xdgJLabel, col3, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__graph_JPanel, __xrgJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            JGUIUtil.addComponent(__graph_JPanel, __xrgSimpleJComboBox, col2, y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.BOTH, GridBagConstraints.WEST);
            __xrgSimpleJComboBox.addMouseListener(this);
            __xrgJLabel = new JLabel("Reservoir graph (*.xrg)");
            __xrgJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__graph_JPanel, __xrgJLabel, col3, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__graph_JPanel, __xwgJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            JGUIUtil.addComponent(__graph_JPanel, __xwgSimpleJComboBox, col2, y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.BOTH, GridBagConstraints.WEST);
            __xwgSimpleJComboBox.addMouseListener(this);
            __xwgJLabel = new JLabel("Well graph (*.xwg)");
            __xwgJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__graph_JPanel, __xwgJLabel, col3, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);


            /////////////////////////////////////////////////////////////
            // daily panel
            /////////////////////////////////////////////////////////////
            y = 0;
            JGUIUtil.addComponent(__daily_JPanel, new JLabel("Select one of the following report options." + "  Output files will have the extensions shown."), col1, y, 3, 1, 0, 0, 0, 0, bound, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__daily_JPanel, __xdyJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xdyJLabel = new JLabel("Daily Direct Diversion and Instream Flow Data" + " (*.xdy)");
            __xdyJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__daily_JPanel, __xdyJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__daily_JPanel, __xryJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xryJLabel = new JLabel("Daily Reservoir Data (*.xry)");
            __xryJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__daily_JPanel, __xryJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__daily_JPanel, __xwyJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xwyJLabel = new JLabel("Daily Well Data (*.xwy)");
            __xwyJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__daily_JPanel, __xwyJLabel, col2, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            /////////////////////////////////////////////////////////////
            // other panel
            /////////////////////////////////////////////////////////////
            y = 0;
            JGUIUtil.addComponent(__other_JPanel, new JLabel("Select one of the following report options." + "  Output files will have the extensions shown."), col1, y, 3, 1, 0, 0, 0, 0, bound, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__other_JPanel, __xnmJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xnmJLabel1 = new JLabel("Detailed Node Accounting, monthly (*.xnm) and ");
            __xnmJLabel1.addMouseListener(this);
            JGUIUtil.addComponent(__other_JPanel, __xnmJLabel1, col3, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xnmJLabel2 = new JLabel("Summary Node Accounting, average (*.xna)");
            __xnmJLabel2.addMouseListener(this);
            JGUIUtil.addComponent(__other_JPanel, __xnmJLabel2, col3, ++y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__other_JPanel, __xrxJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xrxJLabel = new JLabel("River data summary (*.xrx)");
            __xrxJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__other_JPanel, __xrxJLabel, col3, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__other_JPanel, __xspJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xspJLabel = new JLabel("Selected parameter printout," + " uses output control file (*.xsp)");
            __xspJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__other_JPanel, __xspJLabel, col3, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            JGUIUtil.addComponent(__other_JPanel, __xbnJRadioButton, col1, ++y, 1, 1, 0, 0, 0, 0, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            __xbnJLabel = new JLabel("ASCII listing of Binary Direct and " + "Instream Data (*.xbn)");
            __xbnJLabel.addMouseListener(this);
            JGUIUtil.addComponent(__other_JPanel, __xbnJLabel, col3, y, 1, 1, 0, 0, 0, bound, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            __main_JTabbedPane.add("General", __general_JPanel);
            __main_JTabbedPane.add("Compare", __compare_JPanel);
            __main_JTabbedPane.add("Graph", __graph_JPanel);
            __main_JTabbedPane.add("Daily", __daily_JPanel);
            __main_JTabbedPane.add("Other", __other_JPanel);

            getContentPane().add("Center", __main_JTabbedPane);

            // add buttons
            JPanel p1 = new JPanel();

            p1.add(__runStateModJButton);
            p1.add(__cancelJButton);
            // REVISIT - add when full help system is redesigned.
            //p1.add(__helpJButton);
            //__helpJButton.setEnabled(false);
            //__helpJButton.addActionListener(this);
            __runStateModJButton.addActionListener(this);
            __cancelJButton.addActionListener(this);

            getContentPane().add("South", p1);

            if (__dataset_wm != null)
            {
                __dataset_wm.setWindowOpen(StateMod_DataSet_WindowManager.WINDOW_RUN_REPORT, this);
            }

            pack();
            JGUIUtil.center(this);
            setVisible(true);
        }
예제 #16
0
 private void initGUI()
 {
     try
     {
         setPreferredSize(new Dimension(400, 300));
         {
             generalPanel = new JPanel();
             FlowLayout generalPanelLayout = new FlowLayout();
             generalPanelLayout.setAlignment(FlowLayout.LEFT);
             generalPanel.setLayout(generalPanelLayout);
             this.addTab("General", null, generalPanel, null);
             {
                 resolutionPanel = new JPanel();
                 generalPanel.add(resolutionPanel);
                 FlowLayout resolutionPanelLayout = new FlowLayout();
                 resolutionPanel.setLayout(resolutionPanelLayout);
                 resolutionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Resolution", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     resolutionCheckBox = new JCheckBox();
                     resolutionPanel.add(resolutionCheckBox);
                     resolutionCheckBox.setText("Override");
                 }
                 {
                     jLabel1 = new JLabel();
                     resolutionPanel.add(jLabel1);
                     jLabel1.setText("Image Width:");
                 }
                 {
                     resolutionXTextField = new JTextField();
                     resolutionPanel.add(resolutionXTextField);
                     resolutionXTextField.setText("640");
                     resolutionXTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
                 {
                     jLabel2 = new JLabel();
                     resolutionPanel.add(jLabel2);
                     jLabel2.setText("Image Height:");
                 }
                 {
                     resolutionYTextField = new JTextField();
                     resolutionPanel.add(resolutionYTextField);
                     resolutionYTextField.setText("480");
                     resolutionYTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
             }
             {
                 threadsPanel = new JPanel();
                 generalPanel.add(threadsPanel);
                 threadsPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Threads", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     threadCheckBox = new JCheckBox();
                     threadsPanel.add(threadCheckBox);
                     threadCheckBox.setText("Use All Processors");
                 }
                 {
                     jLabel3 = new JLabel();
                     threadsPanel.add(jLabel3);
                     jLabel3.setText("Threads:");
                 }
                 {
                     threadTextField = new JTextField();
                     threadsPanel.add(threadTextField);
                     threadTextField.setText("1");
                     threadTextField.setPreferredSize(new java.awt.Dimension(50, 20));
                 }
             }
         }
         {
             rendererPanel = new JPanel();
             FlowLayout rendererPanelLayout = new FlowLayout();
             rendererPanelLayout.setAlignment(FlowLayout.LEFT);
             rendererPanel.setLayout(rendererPanelLayout);
             this.addTab("Renderer", null, rendererPanel, null);
             {
                 defaultRendererRadioButton = new JRadioButton();
                 rendererPanel.add(defaultRendererRadioButton);
                 defaultRendererRadioButton.setText("Default Renderer");
             }
             {
                 bucketRendererPanel = new JPanel();
                 BoxLayout bucketRendererPanelLayout = new BoxLayout(bucketRendererPanel, javax.swing.BoxLayout.Y_AXIS);
                 bucketRendererPanel.setLayout(bucketRendererPanelLayout);
                 rendererPanel.add(bucketRendererPanel);
                 bucketRendererPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(BevelBorder.LOWERED), "Bucket Renderer", TitledBorder.LEADING, TitledBorder.TOP));
                 {
                     bucketRendererRadioButton = new JRadioButton();
                     bucketRendererPanel.add(bucketRendererRadioButton);
                     bucketRendererRadioButton.setText("Enable");
                 }
                 {
                     samplingPanel = new JPanel();
                     GridLayout samplingPanelLayout = new GridLayout(2, 2);
                     samplingPanelLayout.setColumns(2);
                     samplingPanelLayout.setHgap(5);
                     samplingPanelLayout.setVgap(5);
                     samplingPanelLayout.setRows(2);
                     samplingPanel.setLayout(samplingPanelLayout);
                     bucketRendererPanel.add(samplingPanel);
                     {
                         jLabel5 = new JLabel();
                         samplingPanel.add(jLabel5);
                         jLabel5.setText("Min:");
                     }
                     {
                         ComboBoxModel minSamplingComboBoxModel = new DefaultComboBoxModel(new string[] {
                             "Item One", "Item Two" });
                         minSamplingComboBox = new JComboBox();
                         samplingPanel.add(minSamplingComboBox);
                         minSamplingComboBox.setModel(minSamplingComboBoxModel);
                     }
                     {
                         jLabel6 = new JLabel();
                         samplingPanel.add(jLabel6);
                         jLabel6.setText("Max:");
                     }
                     {
                         ComboBoxModel maxSamplingComboxBoxModel = new DefaultComboBoxModel(new string[] {
                             "Item One", "Item Two" });
                         maxSamplingComboxBox = new JComboBox();
                         samplingPanel.add(maxSamplingComboxBox);
                         maxSamplingComboxBox.setModel(maxSamplingComboxBoxModel);
                     }
                 }
             }
         }
     }
     catch (Exception e)
     {
         e.printStackTrace();
     }
 }
예제 #17
0
        /**
         * Set up the applet's GUI.
         * As recommended, the init method executes this in the event-dispatching
         * thread.
         */
        public void run()
        {
            Container pane = getContentPane();

            pane.setLayout(new BorderLayout());

            // Build the button controls
            JRadioButton voronoiButton = new JRadioButton("Voronoi Diagram");

            voronoiButton.setActionCommand("voronoi");
            JRadioButton delaunayButton = new JRadioButton("Delaunay Triangulation");

            delaunayButton.setActionCommand("delaunay");
            JButton clearButton = new JButton("Clear");

            clearButton.setActionCommand("clear");

            ButtonGroup group = new ButtonGroup();

            group.add(voronoiButton);
            group.add(delaunayButton);
            JPanel buttonPanel = new JPanel();

            buttonPanel.add(voronoiButton);
            buttonPanel.add(delaunayButton);
            buttonPanel.add(clearButton);
            pane.add(buttonPanel, "North");

            // Build the mouse-entry switches
            JLabel circleLabel = new JLabel("Show Empty Circles");

            circleLabel.setName("circles");
            JLabel delaunayLabel = new JLabel("Show Delaunay Edges");

            delaunayLabel.setName("delaunay");
            JLabel voronoiLabel = new JLabel("Show Voronoi Edges");

            voronoiLabel.setName("voronoi");
            JPanel switchPanel = new JPanel();

            switchPanel.add(circleLabel);
            switchPanel.add(new Label("     "));
            switchPanel.add(delaunayLabel);
            switchPanel.add(new Label("     "));
            switchPanel.add(voronoiLabel);
            pane.add(switchPanel, "South");

            // Build the graphics panel
            DelaunayPanel graphicsPanel = new DelaunayPanel();

            graphicsPanel.setBackground(Color.gray);
            pane.add(graphicsPanel, "Center");

            // Register the listeners
            voronoiButton.addActionListener(graphicsPanel);
            delaunayButton.addActionListener(graphicsPanel);
            clearButton.addActionListener(graphicsPanel);
            graphicsPanel.addMouseListener(graphicsPanel);
            circleLabel.addMouseListener(graphicsPanel);
            delaunayLabel.addMouseListener(graphicsPanel);
            voronoiLabel.addMouseListener(graphicsPanel);

            // Initialize the radio buttons
            voronoiButton.doClick();
        }
예제 #18
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);
 }
예제 #19
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(EditActionSet));
     this.textBox1  = new JHUI.Controls.JTextBox();
     this.textBox2  = new JHUI.Controls.JTextBox();
     this.label1    = new JHUI.Controls.JLabel();
     this.asdasdasd = new JHUI.Controls.JLabel();
     this.SuspendLayout();
     //
     // textBox1
     //
     //
     //
     //
     this.textBox1.CustomButton.Image         = null;
     this.textBox1.CustomButton.Location      = new System.Drawing.Point(390, 2);
     this.textBox1.CustomButton.Name          = "";
     this.textBox1.CustomButton.Size          = new System.Drawing.Size(15, 15);
     this.textBox1.CustomButton.Style         = JHUI.JColorStyle.Blue;
     this.textBox1.CustomButton.TabIndex      = 1;
     this.textBox1.CustomButton.Theme         = JHUI.JThemeStyle.Light;
     this.textBox1.CustomButton.UseSelectable = true;
     this.textBox1.CustomButton.Visible       = false;
     this.textBox1.Lines            = new string[0];
     this.textBox1.Location         = new System.Drawing.Point(54, 26);
     this.textBox1.MaxLength        = 32767;
     this.textBox1.Name             = "textBox1";
     this.textBox1.PasswordChar     = '\0';
     this.textBox1.ScrollBars       = System.Windows.Forms.ScrollBars.None;
     this.textBox1.SelectedText     = "";
     this.textBox1.SelectionLength  = 0;
     this.textBox1.SelectionStart   = 0;
     this.textBox1.ShortcutsEnabled = true;
     this.textBox1.Size             = new System.Drawing.Size(408, 20);
     this.textBox1.Style            = JHUI.JColorStyle.Silver;
     this.textBox1.TabIndex         = 19;
     this.textBox1.TextWaterMark    = "";
     this.textBox1.Theme            = JHUI.JThemeStyle.Dark;
     this.textBox1.UseSelectable    = true;
     this.textBox1.WaterMarkColor   = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
     this.textBox1.WaterMarkFont    = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
     this.textBox1.Leave           += new System.EventHandler(this.textBox1_TextChanged);
     //
     // textBox2
     //
     //
     //
     //
     this.textBox2.CustomButton.Image         = null;
     this.textBox2.CustomButton.Location      = new System.Drawing.Point(390, 2);
     this.textBox2.CustomButton.Name          = "";
     this.textBox2.CustomButton.Size          = new System.Drawing.Size(15, 15);
     this.textBox2.CustomButton.Style         = JHUI.JColorStyle.Blue;
     this.textBox2.CustomButton.TabIndex      = 1;
     this.textBox2.CustomButton.Theme         = JHUI.JThemeStyle.Light;
     this.textBox2.CustomButton.UseSelectable = true;
     this.textBox2.CustomButton.Visible       = false;
     this.textBox2.Lines            = new string[0];
     this.textBox2.Location         = new System.Drawing.Point(54, 52);
     this.textBox2.MaxLength        = 32767;
     this.textBox2.Name             = "textBox2";
     this.textBox2.PasswordChar     = '\0';
     this.textBox2.ScrollBars       = System.Windows.Forms.ScrollBars.None;
     this.textBox2.SelectedText     = "";
     this.textBox2.SelectionLength  = 0;
     this.textBox2.SelectionStart   = 0;
     this.textBox2.ShortcutsEnabled = true;
     this.textBox2.Size             = new System.Drawing.Size(408, 20);
     this.textBox2.Style            = JHUI.JColorStyle.Silver;
     this.textBox2.TabIndex         = 21;
     this.textBox2.TextWaterMark    = "";
     this.textBox2.Theme            = JHUI.JThemeStyle.Dark;
     this.textBox2.UseSelectable    = true;
     this.textBox2.WaterMarkColor   = System.Drawing.Color.FromArgb(((int)(((byte)(109)))), ((int)(((byte)(109)))), ((int)(((byte)(109)))));
     this.textBox2.WaterMarkFont    = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Pixel);
     this.textBox2.Leave           += new System.EventHandler(this.textBox2_TextChanged);
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(8, 53);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(40, 19);
     this.label1.Style    = JHUI.JColorStyle.Gold;
     this.label1.TabIndex = 20;
     this.label1.Text     = "Index";
     this.label1.Theme    = JHUI.JThemeStyle.Dark;
     //
     // asdasdasd
     //
     this.asdasdasd.AutoSize = true;
     this.asdasdasd.Location = new System.Drawing.Point(3, 27);
     this.asdasdasd.Name     = "asdasdasd";
     this.asdasdasd.Size     = new System.Drawing.Size(45, 19);
     this.asdasdasd.Style    = JHUI.JColorStyle.Gold;
     this.asdasdasd.TabIndex = 18;
     this.asdasdasd.Text     = "Name";
     this.asdasdasd.Theme    = JHUI.JThemeStyle.Dark;
     //
     // EditActionSet
     //
     this.ClientSize = new System.Drawing.Size(473, 88);
     this.Controls.Add(this.textBox2);
     this.Controls.Add(this.label1);
     this.Controls.Add(this.textBox1);
     this.Controls.Add(this.asdasdasd);
     this.Icon          = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.MaximizeBox   = false;
     this.MinimizeBox   = false;
     this.Name          = "EditActionSet";
     this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
     this.Style         = JHUI.JColorStyle.Silver;
     this.FormClosing  += new System.Windows.Forms.FormClosingEventHandler(this.EditActionSet_FormClosing);
     this.ResumeLayout(false);
     this.PerformLayout();
 }
예제 #20
0
        private void initFactEditPanel()
        {
            factComponents.clear();
            //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: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            JPanel factEditPanel = new JPanel(new BorderLayout());
            JPanel innerPanel = new JPanel(gridbag);
            factEditPanel.setBorder(BorderFactory.createTitledBorder("Set the Slots for the Fact"));
            if (templateList.SelectedIndex > - 1)
            {
                Module module = engine.WorkingMemory.findModule(System.String.valueOf(moduleList.SelectedValue));

                Template tmp = module.getTemplate(System.String.valueOf(templateList.SelectedValue));

                //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;
                Slot[] slots = tmp.AllSlots;
                for (int i = 0; i < slots.Length; ++i)
                {
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.gridx' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    c.gridx = 0;
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.gridy' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    c.gridy = i;
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.fill' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.VERTICAL' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    c.fill = GridBagConstraints.VERTICAL;
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.anchor' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.EAST' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    c.anchor = GridBagConstraints.EAST;
                    JLabel label = new JLabel(slots[i].Name + ": ");
                    gridbag.setConstraints(label, c);
                    innerPanel.add(label);
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.gridx' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    c.gridx = 1;
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.fill' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.BOTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    c.fill = GridBagConstraints.BOTH;
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.anchor' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.WEST' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
                    c.anchor = GridBagConstraints.WEST;
                    if (slots[i] is MultiSlot)
                    {
                        MultiSlotEditor multislotEditor = new MultiSlotEditor(this);
                        JScrollPane scrollPane = new JScrollPane(multislotEditor.List);
                        gridbag.setConstraints(scrollPane, c);
                        innerPanel.add(scrollPane);
                        factComponents.put(slots[i], multislotEditor.List);
                    }
                    else if (slots[i].ValueType == Constants.FACT_TYPE)
                    {
                        // TODO Fact-Selector

                        JComboBox factBox = new JComboBox();
                        factComponents.put(slots[i], factBox);
                    }
                    else
                    {
                        JTextField textField = new JTextField();
                        gridbag.setConstraints(textField, c);
                        innerPanel.add(textField);
                        factComponents.put(slots[i], textField);
                    }
                }
            }
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            factEditPanel.add(new JScrollPane(innerPanel), BorderLayout.CENTER);
            JPanel dumpAreaPanel = new JPanel();
            dumpAreaPanel.setLayout(new BoxLayout(dumpAreaPanel, BoxLayout.Y_AXIS));
            dumpAreaPanel.add(new JLabel("Fact Preview:"));
            dumpAreaPanel.add(new JScrollPane(dumpAreaFact));
            reloadButtondumpAreaFact = new JButton("Reload Fact Preview", IconLoader.getImageIcon("arrow_refresh"));
            reloadButtondumpAreaFact.addActionListener(this);
            dumpAreaPanel.add(reloadButtondumpAreaFact);
            //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.weightx' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            c.weightx = 0.0;
            //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.gridwidth' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            c.gridwidth = 2;
            //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.gridy' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            c.gridy = 1;
            //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.gridx' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            c.gridx = 0;
            //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.fill' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.BOTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
            c.fill = GridBagConstraints.BOTH;
            gridbag.setConstraints(dumpAreaPanel, c);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.SOUTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            factEditPanel.add(dumpAreaPanel, BorderLayout.SOUTH);
            contentPanel.add("factEdit", factEditPanel);
        }
예제 #21
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();
        }
예제 #22
0
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents()
        {
            canvas = new BufferedImage(320, 320, BufferedImage.TYPE_BYTE_GRAY);

            buttonGroup1 = new ButtonGroup();
            buttonGroup2 = new ButtonGroup();
            jPanel4      = new JPanel();
            jSlider2     = new JSlider();
            jLabel1      = new JLabel();
            jPanel2      = new JPanel(new GridBagLayout());
            JLabel canvasLabel = new JLabel(new ImageIcon(canvas));

            jPanel2.add(canvasLabel, null);

            jPanel3       = new JPanel();
            jRadioButton3 = new JRadioButton();
            jRadioButton4 = new JRadioButton();
            jRadioButton5 = new JRadioButton();
            jRadioButton6 = new JRadioButton();
            jRadioButton7 = new JRadioButton();
            jRadioButton8 = new JRadioButton();
            jButton1      = new JButton();

            DefaultCloseOperation = WindowConstants.EXIT_ON_CLOSE;
            Title = "FuNet1 --- powered by Neuroph";

            jPanel4.Border = BorderFactory.createTitledBorder("Line thickness");


            jSlider2.MajorTickSpacing = 10;
            jSlider2.Maximum          = 51;
            jSlider2.Minimum          = 1;
            jSlider2.MinorTickSpacing = 5;
            jSlider2.PaintTicks       = true;
            jSlider2.addChangeListener(new ChangeListenerAnonymousInnerClassHelper(this));

            //        jLabel1.setText("Stroke Size (Radius)");

            GroupLayout jPanel4Layout = new GroupLayout(jPanel4);

            jPanel4.Layout = jPanel4Layout;
            jPanel4Layout.HorizontalGroup = jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel4Layout.createSequentialGroup().addContainerGap().addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED, 51, short.MaxValue).addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jLabel1).addComponent(jSlider2, GroupLayout.PREFERRED_SIZE, 150, GroupLayout.PREFERRED_SIZE)).addContainerGap());

            label = new JLabel("");
            Font labelFont = label.Font;

            label.Font = new Font(labelFont.Name, Font.PLAIN, 30);


            jPanel4Layout.VerticalGroup = jPanel4Layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.TRAILING).addComponent(jSlider2, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addGroup(jPanel4Layout.createSequentialGroup().addGroup(jPanel4Layout.createParallelGroup(GroupLayout.Alignment.BASELINE).addComponent(jLabel1)).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED)));

            jPanel2.Background = new Color(0, 0, 0);
            jPanel2.Border     = BorderFactory.createBevelBorder(BevelBorder.RAISED);
            // add the listeners to the label that contains the canvas buffered image
            canvasLabel.addMouseListener(new MouseAdapterAnonymousInnerClassHelper(this));
            canvasLabel.addMouseMotionListener(new MouseMotionAdapterAnonymousInnerClassHelper(this));


            jButton1.Text = "Clear";
            jButton1.addActionListener(new ActionListenerAnonymousInnerClassHelper(this));

            GroupLayout layout = new GroupLayout(ContentPane);

            ContentPane.Layout     = layout;
            layout.HorizontalGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addContainerGap().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jPanel2, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addGroup(layout.createSequentialGroup().addComponent(jPanel4, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jPanel3, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addComponent(jButton1, GroupLayout.DEFAULT_SIZE, 112, short.MaxValue).addComponent(label, GroupLayout.DEFAULT_SIZE, 112, short.MaxValue)))).addContainerGap());
            layout.VerticalGroup   = layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(layout.createSequentialGroup().addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false).addGroup(layout.createSequentialGroup().addGap(4, 4, 4).addComponent(jButton1, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE).addComponent(label, GroupLayout.PREFERRED_SIZE, 30, GroupLayout.PREFERRED_SIZE).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)).addComponent(jPanel4, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addComponent(jPanel3, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue)).addPreferredGap(LayoutStyle.ComponentPlacement.RELATED).addComponent(jPanel2, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, short.MaxValue).addContainerGap());

            Graphics g = canvas.Graphics;

            g.Color = Color.WHITE;
            g.fillRect(0, 0, canvas.Width, canvas.Height);
            repaint();
            pack();
        }         // </editor-fold>
예제 #23
0
    //--------
    //-------- Constructors
    //--------

    /// <summary>
    /// Constructor a frame to contain the device data.  Provide
    /// the device and the log file name
    /// </summary>
    public DeviceFrame(TaggedDevice dev, string logFile) : base(dev.DeviceContainer.AddressAsString)
    {
        // construct the frame

        // init
        pollDelay       = 0;
        readButtonClick = false;
        num_format      = NumberFormat.Instance;
        num_format.MaximumFractionDigits = 2;
        num_format.MinimumFractionDigits = 0;
        num_format.MinimumIntegerDigits  = 2;
        num_format.GroupingUsed          = false;
        lastReading = "none";

        // get ref to the tagged device and log file
        this.dev     = dev;
        this.logFile = logFile;

        // set the look and feel to the system look and feel
        try
        {
            UIManager.LookAndFeel = UIManager.SystemLookAndFeelClassName;
        }
        catch (Exception e)
        {
            Debug.WriteLine(e.ToString());
            Debug.Write(e.StackTrace);
        }

        // add an event listener to end the aplication when the frame is closed
        addWindowListener(new WindowAdapterAnonymousInnerClassHelper(this, e));

        // create the main panel
        mainPanel = new JPanel(new GridLayout(3, 1));

        // create the sub-panels
        topPanel        = new JPanel();
        topPanel.Layout = new BoxLayout(topPanel, BoxLayout.Y_AXIS);
        topPanel.Border = BorderFactory.createEmptyBorder(10, 10, 10, 10);

        centerPanel            = new JPanel();
        centerPanel.Layout     = new BoxLayout(centerPanel, BoxLayout.Y_AXIS);
        centerPanel.Border     = BorderFactory.createEmptyBorder(10, 10, 10, 10);
        centerPanel.Background = Color.white;

        bottomPanel        = new JPanel();
        bottomPanel.Layout = new BoxLayout(bottomPanel, BoxLayout.Y_AXIS);
        bottomPanel.Border = BorderFactory.createEmptyBorder(10, 10, 10, 10);

        // fill the panels
        // top
        clusterLabel = new JLabel("Cluster: " + dev.ClusterName);
        topPanel.add(clusterLabel);

        mainLabel = new JLabel(dev.Label);
        mainLabel.HorizontalAlignment = JLabel.CENTER;
        mainLabel.Font = new Font("SansSerif", Font.PLAIN, 20);
        topPanel.add(mainLabel);

        logCheck = new JCheckBox("Logging Enable", false);
        logCheck.addActionListener(this);
        topPanel.add(logCheck);

        // center
        timeLabel = new JLabel("Last Reading: none");
        timeLabel.HorizontalAlignment = JLabel.CENTER;
        centerPanel.add(timeLabel);

        // bottom
        readButton            = new JButton("Read Once");
        readButton.AlignmentX = Component.LEFT_ALIGNMENT;
        readButton.addActionListener(this);
        bottomPanel.add(readButton);

        string[] selectionStrings = new string[] { "No Polling", "1 second", "30 seconds", "1 minute", "10 minutes", "1 hour" };
        pollCombo            = new JComboBox(selectionStrings);
        pollCombo.Editable   = false;
        pollCombo.AlignmentX = Component.LEFT_ALIGNMENT;
        pollCombo.addActionListener(this);
        bottomPanel.add(pollCombo);

        pathLabel            = new JLabel("Path: " + dev.OWPath.ToString());
        pathLabel.AlignmentX = Component.LEFT_ALIGNMENT;
        bottomPanel.add(pathLabel);

        // add to main
        mainPanel.add(topPanel);
        mainPanel.add(centerPanel);
        mainPanel.add(bottomPanel);

        // add to frame
        ContentPane.add(mainPanel);

        // pack the frame
        pack();

        // resize the window and put in random location
        Dimension current_sz = Size;

        Size = new Dimension(current_sz.width * 3 / 2, current_sz.height);
        Toolkit   tool = Toolkit.DefaultToolkit;
        Dimension mx   = tool.ScreenSize;
        Dimension sz   = Size;
        Random    rand = new Random();

        setLocation(rand.Next((mx.width - sz.width) / 2), rand.Next((mx.height - sz.height) / 2));

        // make visible
        Visible = true;
    }