Beispiel #1
0
    internal JPanel GetPanel(string a_panelName)
    {
        JPanel panel = null;

        panelDict.TryGetValue(a_panelName, out panel);
        return(panel);
    }
        /// <summary>
        /// Adds the IDs of the upstream nodes to the main JPanel. </summary>
        /// <param name="panel"> the panel to which to add the node IDs. </param>
        /// <param name="y"> the y coordinate at which to start adding them. </param>
        private int addUpstreamNodesToPanel(JPanel panel, int y)
        {
            IList <HydrologyNode> upstreams = __nodes[__nodeNum].getUpstreamNodes();

            if (upstreams == null || upstreams.Count == 0)
            {
                return(y);
            }

            int    size   = upstreams.Count;
            string plural = "s";

            if (size == 1)
            {
                plural = "";
            }

            for (int i = 0; i < size; i++)
            {
                if (i == 0)
                {
                    JGUIUtil.addComponent(panel, new JLabel("Upstream node" + plural + ": "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
                }
                JGUIUtil.addComponent(panel, new JLabel("" + ((HydrologyNode)upstreams[i]).getCommonID()), 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
                y++;
            }

            return(y);
        }
        private static JPanel createButtonPanel()
        {
            JPanel     jpanel     = new JPanel();
            FlowLayout flowLayout = new FlowLayout();

            flowLayout.setAlignment(0);
            jpanel.setLayout(flowLayout);
            AudioTool.playButton = new JButton("Play");
            AudioTool.playButton.setEnabled(true);
            AudioTool.playButton.addActionListener(new AudioTool_12());
            AudioTool.recordButton = new JButton("Record");
            AudioTool.recordButton.setEnabled(true);
            AudioTool.recordButton.addActionListener(AudioTool.recordListener);
            AudioTool.zoomInButton = new JButton("Zoom In");
            AudioTool.zoomInButton.setEnabled(true);
            AudioTool.zoomInButton.addActionListener(new AudioTool_13());
            AudioTool.zoomOutButton = new JButton("Zoom Out");
            AudioTool.zoomOutButton.setEnabled(true);
            AudioTool.zoomOutButton.addActionListener(new AudioTool_14());
            AudioTool.zoomResetButton = new JButton("Reset Size");
            AudioTool.zoomResetButton.setEnabled(true);
            AudioTool.zoomResetButton.addActionListener(new AudioTool_15());
            JButton jbutton = new JButton("Exit");

            jbutton.addActionListener(new AudioTool_16());
            jpanel.add(AudioTool.recordButton);
            jpanel.add(AudioTool.playButton);
            jpanel.add(AudioTool.zoomInButton);
            jpanel.add(AudioTool.zoomOutButton);
            jpanel.add(AudioTool.zoomResetButton);
            jpanel.add(jbutton);
            return(jpanel);
        }
Beispiel #4
0
 protected Layout(JPanel panel)
 {
     this.panel = panel;
     elements   = new List <UIElement>();
     setUpperLeftCorner(0, 0);
     setWidth(panel.getWidth());
     setHeight(panel.getHeight());
 }
Beispiel #5
0
        private JComponent getStatsComponent()
        {
            var jpanel = new JPanel(new BorderLayout());

            jpanel.add(new GuiStatsComponent(), "North");
            jpanel.add(getPlayerListComponent(), "Center");
            jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Stats"));
            return(jpanel);
        }
Beispiel #6
0
        public CenterPaneLayout(JPanel panel)
        {
            layout = new VerticalLayout(panel);

            // three main sections: top, middle, bottom
            Layout topSection = new HorizontalLayout(panel);

            topSection.setPreferredSize(100, 15);
            Layout middleSection = new HorizontalLayout(panel);

            middleSection.setPreferredSize(100, 70);

            Layout bottomSection = new HorizontalLayout(panel);

            bottomSection.setPreferredSize(100, 15);

            // three parts of the middle layout
            Layout middleLeft = new VerticalLayout(panel);

            middleLeft.setPreferredSize(15, 100);
            Layout middleMiddle = new HorizontalLayout(panel); // can be horizontal or vertical

            middleMiddle.setPreferredSize(70, 100);
            Layout middleRight = new VerticalLayout(panel);

            middleRight.setPreferredSize(15, 100);

            // set up the buttons/textview/sliders/etc for each layout
            topSection.addUIElement(new Button(34, 100));
            topSection.addUIElement(new TextEdit(33, 100));
            topSection.addUIElement(new Button(33, 100));

            middleLeft.addUIElement(new TextEdit(100, 25));
            middleLeft.addUIElement(new Slider(100, 25));
            middleLeft.addUIElement(new Button(100, 25));
            middleLeft.addUIElement(new Button(100, 25));

            middleMiddle.addUIElement(new Button(100, 100));

            middleRight.addUIElement(new TextEdit(100, 25));
            middleRight.addUIElement(new Slider(100, 25));
            middleRight.addUIElement(new Button(100, 25));
            middleRight.addUIElement(new Button(100, 25));

            middleSection.addUIElement(middleLeft);
            middleSection.addUIElement(middleMiddle);
            middleSection.addUIElement(middleRight);

            bottomSection.addUIElement(new Button(100, 100));

            layout.addUIElement(topSection);
            layout.addUIElement(middleSection);
            layout.addUIElement(bottomSection);
        }
Beispiel #7
0
 private void BuildExtractButton()
 {
     if (extractButton == null)
     {
         JPanel buttonPanel = new JPanel();
         extractButton = new JButton("Extract");
         buttonPanel.Add(extractButton);
         frame.Add(buttonPanel, BorderLayout.South);
         extractButton.AddActionListener(actor);
     }
 }
Beispiel #8
0
        public virtual void showCancelButton(ActionListener paramActionListener)
        {
            this.cancelButton = new JButton("Cancel");
            this.cancelButton.ActionCommand = "Cancel";
            JPanel jPanel = new JPanel(new FlowLayout(2));

            jPanel.add(this.cancelButton);
            this.o_mainPanel.add(jPanel, "South");
            if (paramActionListener != null)
            {
                this.cancelButton.addActionListener(paramActionListener);
            }
        }
Beispiel #9
0
 internal void RegisterPanel(JPanel a_panel)
 {
     string panelName = a_panel.name;
     if (!panelDict.ContainsKey(panelName))
     {
         panelDict.Add(panelName, a_panel);
         //a_panel.gameObject.SetActive(false);
         a_panel.canvasGroup.blocksRaycasts = false;
     }
     else
     {
         //TODO Debug Msg
     }
 }
Beispiel #10
0
    internal void RegisterPanel(JPanel a_panel)
    {
        string panelName = a_panel.name;

        if (!panelDict.ContainsKey(panelName))
        {
            panelDict.Add(panelName, a_panel);
            //a_panel.gameObject.SetActive(false);
            a_panel.canvasGroup.blocksRaycasts = false;
        }
        else
        {
            //TODO Debug Msg
        }
    }
Beispiel #11
0
    internal void HidePanel(string a_panelName)
    {
        JPanel panel = null;

        panelDict.TryGetValue(a_panelName, out panel);

        if (panel != null)
        {
            panel.StartPanelTransition(false);
        }
        else
        {
            //TODO Debug Msg
        }
    }
Beispiel #12
0
    public LightSwitch()
    {
        button  = new ToggleButton("off", "on");
        counter = new BinaryCounter(0);
        button.addActionListener(counter);
        JPanel contentPane = new JPanel();

        contentPane.add(button);
        contentPane.add(counter);
        JFrame frame = new JFrame("LightSwitch");

        frame.DefaultCloseOperation = JFrame.EXIT_ON_CLOSE;
        frame.ContentPane           = contentPane;
        frame.pack();
        frame.setSize(500, 200);
        frame.Visible = true;
    }
            public void menuEntryActivated(JPanel param1JPanel)
            {
                param1JPanel.removeAll();
                param1JPanel.Layout = new BorderLayout();
                CostOSRibbonApplicationMenuPopupPanelSecondary costOSRibbonApplicationMenuPopupPanelSecondary = new CostOSRibbonApplicationMenuPopupPanelSecondaryAnonymousInnerClass(this, menuEntry);
                JScrollPane jScrollPane = new JScrollPane(costOSRibbonApplicationMenuPopupPanelSecondary, 20, 31);

                jScrollPane.Border = BorderFactory.createEmptyBorder();
                jScrollPane.Viewport.Background = SECONDARY_MENU_COLOR;
                jScrollPane.Background          = SECONDARY_MENU_COLOR;
                Dimension dimension = costOSRibbonApplicationMenuPopupPanelSecondary.PreferredSize;

                costOSRibbonApplicationMenuPopupPanelSecondary.PreferredSize = new Dimension((param1JPanel.PreferredSize).width - (jScrollPane.VerticalScrollBar.PreferredSize).width, dimension.height);
                param1JPanel.Background = SECONDARY_MENU_COLOR;
                param1JPanel.add(jScrollPane, "Center");
                param1JPanel.revalidate();
            }
Beispiel #14
0
    internal void ShowPanel(string a_panelName)
    {
        JPanel panel = null;

        panelDict.TryGetValue(a_panelName, out panel);

        if (panel != null)
        {
            //panel.gameObject.SetActive(true);
            panel.canvasGroup.blocksRaycasts = true;
            panel.StartPanelTransition(true);
            currentShowedPanelList.Add(panel);
        }
        else
        {
            //TODO Debug Msg
        }
    }
Beispiel #15
0
        private JComponent getLogComponent()
        {
            var jpanel    = new JPanel(new BorderLayout());
            var jtextarea = new JTextArea();

            logger.addHandler(new GuiLogOutputHandler(jtextarea));
            var jscrollpane = new JScrollPane(jtextarea, 22, 30);

            jtextarea.setEditable(false);
            var jtextfield = new JTextField();

            jtextfield.addActionListener(new ServerGuiCommandListener(this, jtextfield));
            jtextarea.addFocusListener(new ServerGuiFocusAdapter(this));
            jpanel.add(jscrollpane, "Center");
            jpanel.add(jtextfield, "South");
            jpanel.setBorder(new TitledBorder(new EtchedBorder(), "Log and chat"));
            return(jpanel);
        }
        /// <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);
        }
Beispiel #17
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();
        }
        /// <summary>
        /// Adds the IDs of the downstream nodes to the main JPanel. </summary>
        /// <param name="panel"> the panel to which to add the node IDs. </param>
        /// <param name="y"> the y coordinate at which to start adding them. </param>
        private void addDownstreamNodeToPanel(JPanel panel, int y)
        {
            HydrologyNode node = StateMod_NodeNetwork.findNextRealDownstreamNode(__nodes[__nodeNum]);

            JGUIUtil.addComponent(panel, new JLabel("Downstream node: "), 0, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            JGUIUtil.addComponent(panel, new JLabel("" + node.getCommonID() + " (model node)"), 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            y++;

            node = __nodes[__nodeNum].getDownstreamNode();
            if (node != null)
            {
                JGUIUtil.addComponent(panel, new JLabel("" + node.getCommonID() + " (diagram node)"), 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            }
            else
            {
                JGUIUtil.addComponent(panel, new JLabel("[None] (diagram node)"), 1, y, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            }
        }
        private void JbInit()
        {
            //pf = new PrintFile("out");
            this.AddWindowListener(new _WindowAdapter_110());
            //Set up the input/output fields and let them scroll.
            inputBox.SetLineWrap(true);
            inputBox.SetWrapStyleWord(true);
            outputBox.SetLineWrap(true);
            outputBox.SetWrapStyleWord(true);
            outputBox.SetEditable(false);
            JScrollPane scroll1 = new JScrollPane(inputBox);
            JScrollPane scroll2 = new JScrollPane(outputBox);

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

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

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

            c.fill      = GridBagConstraints.Both;
            c.gridwidth = GridBagConstraints.Remainder;
            c.weightx   = 4.0;
            c.weighty   = 4.0;
            this.Add(scroll1, c);
            c.weighty = 1.0;
            this.Add(buttonPanel, c);
            c.weighty    = 4.0;
            c.gridheight = GridBagConstraints.Remainder;
            this.Add(scroll2, c);
        }
Beispiel #20
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);
 }
Beispiel #21
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");
        }
Beispiel #22
0
    internal void UnloadPanels(string[] a_panelsNameTab)
    {
        if (a_panelsNameTab == null)
        {
            return;
        }
        JPanel panel = null;

        foreach (string panelName in a_panelsNameTab)
        {
            panelDict.TryGetValue(panelName, out panel);
            if (panel != null)
            {
                if (currentShowedPanelList.Contains(panel))
                {
                    currentShowedPanelList.Remove(panel);
                }
                panelDict.Remove(panelName);
                Object.Destroy(panel.gameObject);
            }
        }
    }
Beispiel #23
0
        private VfpuFrame()
        {
            DefaultCloseOperation = DISPOSE_ON_CLOSE;
            Title = java.util.ResourceBundle.getBundle("pspsharp/languages/pspsharp").getString("VfpuFrame.title");             // NOI18N

            for (int i = 0; i < 8; ++i)
            {
                for (int j = 0; j < 4; ++j)
                {
                    for (int k = 0; k < 4; ++k)
                    {
                        registers[i][j][k] = new JTextField();
                    }
                }
            }

            GroupLayout layout = new GroupLayout(ContentPane);

            ContentPane.Layout = layout;

            for (int i = 0; i < panels.Length; ++i)
            {
                JPanel panel = new JPanel();
                panels[i] = panel;

                GroupLayout l = new GroupLayout(panel);
                panel.Layout = l;
                panel.Border = BorderFactory.createCompoundBorder(BorderFactory.createTitledBorder("Block " + i), null);

                l.HorizontalGroup = l.createSequentialGroup().addGroup(l.createParallelGroup().addComponent(registers[i][0][0]).addComponent(registers[i][1][0]).addComponent(registers[i][2][0]).addComponent(registers[i][3][0])).addGroup(l.createParallelGroup().addComponent(registers[i][0][1]).addComponent(registers[i][1][1]).addComponent(registers[i][2][1]).addComponent(registers[i][3][1])).addGroup(l.createParallelGroup().addComponent(registers[i][0][2]).addComponent(registers[i][1][2]).addComponent(registers[i][2][2]).addComponent(registers[i][3][2])).addGroup(l.createParallelGroup().addComponent(registers[i][0][3]).addComponent(registers[i][1][3]).addComponent(registers[i][2][3]).addComponent(registers[i][3][3]));
                l.VerticalGroup   = l.createSequentialGroup().addGroup(l.createParallelGroup().addComponent(registers[i][0][0]).addComponent(registers[i][0][1]).addComponent(registers[i][0][2]).addComponent(registers[i][0][3])).addGroup(l.createParallelGroup().addComponent(registers[i][1][0]).addComponent(registers[i][1][1]).addComponent(registers[i][1][2]).addComponent(registers[i][1][3])).addGroup(l.createParallelGroup().addComponent(registers[i][2][0]).addComponent(registers[i][2][1]).addComponent(registers[i][2][2]).addComponent(registers[i][2][3])).addGroup(l.createParallelGroup().addComponent(registers[i][3][0]).addComponent(registers[i][3][1]).addComponent(registers[i][3][2]).addComponent(registers[i][3][3]));
            }

            layout.HorizontalGroup = layout.createParallelGroup().addGroup(layout.createSequentialGroup().addComponent(panels[0]).addComponent(panels[1])).addGroup(layout.createSequentialGroup().addComponent(panels[2]).addComponent(panels[3])).addGroup(layout.createSequentialGroup().addComponent(panels[4]).addComponent(panels[5])).addGroup(layout.createSequentialGroup().addComponent(panels[6]).addComponent(panels[7]));
            layout.VerticalGroup   = layout.createParallelGroup().addGroup(layout.createSequentialGroup().addComponent(panels[0]).addComponent(panels[2]).addComponent(panels[4]).addComponent(panels[6])).addGroup(layout.createSequentialGroup().addComponent(panels[1]).addComponent(panels[3]).addComponent(panels[5]).addComponent(panels[7]));

            MinimumSize = new Dimension(450, 450);
            WindowPropSaver.loadWindowProperties(this);
        }
        private JPanel getDatabaseFailureUpdateFrame(System.Collections.IList paramList)
        {
            StringWriter stringWriter = new StringWriter();
            PrintWriter  printWriter  = new PrintWriter(stringWriter);

            paramList.ForEach(paramObject =>
            {
                Exception exception = (Exception)paramObject;
                paramPrintWriter.println("====================================");
                paramPrintWriter.println(exception.GetType() + " : " + exception.Message);
                exception.printStackTrace(paramPrintWriter);
                paramPrintWriter.println();
            });
            JPanel jPanel = new JPanel();

            jPanel.Layout = new BorderLayout();
            JTextArea   jTextArea   = new JTextArea(stringWriter.ToString(), 100, 80);
            JScrollPane jScrollPane = new JScrollPane(jTextArea, 22, 32);

            jPanel.add(jScrollPane, "Center");
            return(jPanel);
        }
 /// <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();
 }
Beispiel #26
0
    //--------
    //-------- Constructor
    //--------

    /// <summary>
    /// Constructor a deviceFrame with additional features for the actuator
    /// </summary>
    public DeviceFrameActuator(TaggedDevice dev, string logFile) : base(dev, logFile)
    {
        // construct the super

        // create select panel
        selectPanel            = new JPanel();
        selectPanel.AlignmentX = Component.LEFT_ALIGNMENT;
        selectPanel.Border     = BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Select Actuator State");

        // create combo box
        actuatorCombo = new JComboBox(((TaggedActuator)dev).Selections);
        Dimension actuatorComboDimension = new Dimension(170, 23);

        actuatorCombo.PreferredSize = actuatorComboDimension;
        actuatorCombo.Editable      = false;
        actuatorCombo.AlignmentX    = Component.LEFT_ALIGNMENT;
        actuatorCombo.addActionListener(this);

        // add combo box to select panel
        selectPanel.add(actuatorCombo);

        // add select panel to the center panel
        centerPanel.add(selectPanel);
    }
        /// <summary>
        /// Sets up the GUI.
        /// </summary>
        private void setupGUI()
        {
            __fileJList = new JList();
            __fileJList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            __fileJList.addListSelectionListener(this);
            __fileJList.setToolTipText("<HTML>To view an output file, select a file and press " + "View/Edit.<br>Notepad will be used to view the file.</HTML>");

            // REVISIT - SAM 2003-10-26 if a better help system is enabled.
            //__helpJButton = new JButton(__BUTTON_HELP);
            //__helpJButton.setEnabled(false);
            __closeJButton    = new JButton(__BUTTON_CLOSE);
            __viewEditJButton = new JButton(__BUTTON_VIEW_EDIT);
            __viewEditJButton.setToolTipText("<HTML>Use Notepad to view/edit the selected file.</HTML>");

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

            mainPanel.setLayout(gb);

            FlowLayout fl          = new FlowLayout(FlowLayout.CENTER);
            JPanel     final_panel = new JPanel();

            final_panel.setLayout(fl);

            Font orig   = __fileJList.getFont();
            Font @fixed = null;

            if (orig != null)
            {
                @fixed = new Font("Courier", orig.getStyle(), orig.getSize());
            }
            else
            {
                @fixed = new Font("Courier", Font.PLAIN, 11);
            }
            __fileJList.setFont(@fixed);

            __fileJList.addMouseListener(this);

            JGUIUtil.addComponent(mainPanel, new JScrollPane(__fileJList), 0, 0, 10, 12, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.CENTER);

            // add contents to the list box
            fillFileJListContents();

            final_panel.add(__viewEditJButton);
            __viewEditJButton.addActionListener(this);
            __viewEditJButton.setEnabled(false);     // Change state when something
                                                     // is selected.
            //final_panel.add(__helpJButton);
            //__helpJButton.addActionListener(this);
            final_panel.add(__closeJButton);
            __closeJButton.addActionListener(this);

            JGUIUtil.addComponent(mainPanel, final_panel, 0, 12, 10, 5, 0, 0, GridBagConstraints.NONE, GridBagConstraints.SOUTH);

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

            pack();
            setSize(700, 300);
            JGUIUtil.center(this);
            setVisible(true);
        }
Beispiel #28
0
        /// <summary> Create a GUI-Instance for Jamocha.
        /// 
        /// </summary>
        /// <param name="">engine
        /// The Jamocha-engine that will be used in the GUI.
        /// 
        /// </param>
        public JamochaGui(Rete engine)
        {
            InitBlock();

            // set up the frame
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            this.ContentPane.setLayout(new BorderLayout());
            this.setTitle("Jamocha");
            setSizeAndLocation();

            // show logo
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            JPanel logoPanel = new JPanel(new BorderLayout());
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.EAST' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            logoPanel.add(new JLabel(IconLoader.getImageIcon("jamocha")), BorderLayout.EAST);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.NORTH' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            this.ContentPane.add(logoPanel, BorderLayout.NORTH);

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

            // add MenuBar
            menuBar = new JamochaMenuBar(this);
            this.setJMenuBar(menuBar);

            // create a rete engine
            this.engine = engine;

            // create a shell tab and add it to the tabbed pane
            ShellPanel shellPanel = new ShellPanel(this);
            tabbedPane.addTab("Shell", IconLoader.getImageIcon("application_osx_terminal"), shellPanel, "Jamocha Shell");
            panels.add(shellPanel);
            FactsPanel factsPanel = new FactsPanel(this);
            tabbedPane.addTab("Facts", IconLoader.getImageIcon("database"), factsPanel, "View or modify Facts");
            panels.add(factsPanel);
            TemplatesPanel templatesPanel = new TemplatesPanel(this);
            tabbedPane.addTab("Templates", IconLoader.getImageIcon("brick"), templatesPanel, "View or modify Templates");
            panels.add(templatesPanel);
            FunctionsPanel functionsPanel = new FunctionsPanel(this);
            tabbedPane.addTab("Functions", IconLoader.getImageIcon("cog"), functionsPanel, "View Functions");
            panels.add(functionsPanel);
            RetePanel retePanel = new RetePanel(this);
            tabbedPane.addTab("Rete", IconLoader.getImageIcon("eye"), retePanel, "View the Rete-network");
            panels.add(retePanel);
            LogPanel logPanel = new LogPanel(this);
            tabbedPane.addTab("Log", IconLoader.getImageIcon("monitor"), logPanel, "View alle messages from or to the Rete-engine");
            panels.add(logPanel);
            SettingsPanel settingsPanel = new SettingsPanel(this);
            tabbedPane.addTab("Settings", IconLoader.getImageIcon("wrench"), settingsPanel, "Settings for Jamocha");
            panels.add(settingsPanel);

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

            tabbedPane.addChangeListener(this);
            // add a listener to the frame to kill the engine when the GUI is closed
            addWindowListener(new AnonymousClassWindowAdapter(this));
        }
Beispiel #29
0
 public VerticalLayout(JPanel panel)
     : base(panel)
 {
 }
Beispiel #30
0
        public FactEditor(Rete engine)
            : base(engine)
        {
            InitBlock();
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());
            setTitle("Assert new Fact");
            //UPGRADE_ISSUE: Constructor 'java.awt.CardLayout.CardLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtCardLayout"'
            contentPanel = new JPanel(new CardLayout());
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(contentPanel, BorderLayout.CENTER);
            cancelButton = new JButton("Cancel", IconLoader.getImageIcon("cancel"));
            cancelButton.addActionListener(this);
            assertButton = new JButton("Assert Fact", IconLoader.getImageIcon("database_add"));
            assertButton.addActionListener(this);
            assertButton.setVisible(false);
            backButton = new JButton("Back", IconLoader.getImageIcon("resultset_previous"));
            backButton.addActionListener(this);
            backButton.setVisible(false);
            nextButton = new JButton("Next", IconLoader.getImageIcon("resultset_next"));
            nextButton.setHorizontalTextPosition(SwingConstants.LEFT);
            nextButton.addActionListener(this);
            JPanel buttonPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            buttonPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 5, 1));
            buttonPanel.add(cancelButton);
            buttonPanel.add(backButton);
            buttonPanel.add(nextButton);
            buttonPanel.add(assertButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000"'
            add(buttonPanel, BorderLayout.PAGE_END);

            dumpAreaTemplate.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            dumpAreaTemplate.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));
            dumpAreaTemplate.setRows(5);
            dumpAreaFact.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            dumpAreaFact.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));
            dumpAreaFact.setRows(5);
        }
Beispiel #31
0
 public HorizontalLayout(JPanel panel)
     : base(panel)
 {
 }
Beispiel #32
0
        public FactsPanel(JamochaGui gui)
            : base(gui)
        {
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());

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

            factsTable.setShowHorizontalLines(true);
            factsTable.setRowSelectionAllowed(true);
            factsTable.TableHeader.setReorderingAllowed(false);
            factsTable.TableHeader.setToolTipText("Click to sort ascending. Click while pressing the shift-key down to sort descending");
            factsTable.SelectionModel.addListSelectionListener(this);
            dumpArea = new JTextArea();
            dumpArea.setLineWrap(true);
            dumpArea.setWrapStyleWord(true);
            dumpArea.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            dumpArea.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));

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

            initPopupMenu();
        }
Beispiel #33
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);
        }
        /// <summary>
        /// Sets up the GUI.
        /// </summary>
        public virtual void setupGUI()
        {
            string routine = "setupGUI";

            addWindowListener(this);

            PropList p = new PropList("StateMod_Reservoir_Return_JFrame.JWorksheet");

            p.add("JWorksheet.AllowCopy=true");
            p.add("JWorksheet.CellFont=Courier");
            p.add("JWorksheet.CellStyle=Plain");
            p.add("JWorksheet.CellSize=11");
            p.add("JWorksheet.HeaderFont=Arial");
            p.add("JWorksheet.HeaderStyle=Plain");
            p.add("JWorksheet.HeaderSize=11");
            p.add("JWorksheet.HeaderBackground=LightGray");
            p.add("JWorksheet.RowColumnPresent=false");
            p.add("JWorksheet.ShowPopupMenu=true");
            p.add("JWorksheet.SelectionMode=SingleRowSelection");

            int[]            widths = null;
            JScrollWorksheet jsw    = null;

            try
            {
                /* TODO SAM 2011-01-02 Comment out - might allow something similar if editing is enabled
                 * and choices of IDs are provided
                 * List accounts = __currentRes.getAccounts();
                 * List v3 = new Vector();
                 * int size = accounts.size();
                 * StateMod_ReservoirAccount ra = null;
                 * for (int i = 0; i < size; i++) {
                 *      ra = (StateMod_ReservoirAccount)accounts.get(i);
                 *      v3.add("" + ra.getID() + " - " + ra.getName());
                 * }
                 * for (int i = 1; i < size; i++) {
                 *      v3.add("-" + (i + 1) + " - Fill first " + (i + 1)
                 + " accounts");
                 + }
                 +
                 + List v = new Vector();
                 + List v2 = __currentRes.getRights();
                 + StateMod_ReservoirRight rr;
                 + for (int i = 0; i < v2.size(); i++) {
                 +      rr = (StateMod_ReservoirRight)
                 +              ((StateMod_ReservoirRight)v2.get(i))
                 +              .clone();
                 +      v.add(rr);
                 + }
                 */
                // Get the list of all returns and filter for this reservoir
                // TODO SAM 2011-01-02 The code needs to use a table model with lists if editing is enabled
                StateMod_Reservoir_Return_Data_TableModel   tmr = new StateMod_Reservoir_Return_Data_TableModel(__currentResReturnList, __editable);
                StateMod_Reservoir_Return_Data_CellRenderer crr = new StateMod_Reservoir_Return_Data_CellRenderer(tmr);

                jsw         = new JScrollWorksheet(crr, tmr, p);
                __worksheet = jsw.getJWorksheet();

                /*
                 * List onOff = StateMod_ReservoirRight.getIrsrswChoices(true);
                 * __worksheet.setColumnJComboBoxValues(
                 *      StateMod_ReservoirRight_TableModel.COL_ON_OFF, onOff,
                 *      false);
                 * __worksheet.setColumnJComboBoxValues(
                 *      StateMod_ReservoirRight_TableModel.COL_ACCOUNT_DIST,
                 *      v3, false);
                 * List rightTypes =
                 *      StateMod_ReservoirRight.getItyrsrChoices(true);
                 * __worksheet.setColumnJComboBoxValues(
                 *      StateMod_ReservoirRight_TableModel.COL_RIGHT_TYPE,
                 *      rightTypes, false);
                 * List fillTypes=StateMod_ReservoirRight.getN2fillChoices(true);
                 * __worksheet.setColumnJComboBoxValues(
                 *      StateMod_ReservoirRight_TableModel.COL_FILL_TYPE,
                 *      fillTypes, false);
                 */

                widths = crr.getColumnWidths();
            }
            catch (Exception e)
            {
                Message.printWarning(2, routine, e);
                jsw         = new JScrollWorksheet(0, 0, p);
                __worksheet = jsw.getJWorksheet();
            }
            __worksheet.setPreferredScrollableViewportSize(null);

            __worksheet.setHourglassJFrame(this);
            __worksheet.addMouseListener(this);
            __worksheet.addKeyListener(this);

            __addReturn_JButton    = new JButton(__BUTTON_ADD_RETURN);
            __deleteReturn_JButton = new JButton(__BUTTON_DEL_RETURN);
            __deleteReturn_JButton.setEnabled(false);
            __help_JButton = new JButton(__BUTTON_HELP);
            __help_JButton.setEnabled(false);
            __close_JButton = new JButton(__BUTTON_CLOSE);
            JButton cancelJButton = new JButton(__BUTTON_CANCEL);
            JButton applyJButton  = new JButton(__BUTTON_APPLY);

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

            bigPanel.setLayout(gb);

            FlowLayout fl = new FlowLayout(FlowLayout.RIGHT);
            JPanel     p1 = new JPanel();

            p1.setLayout(fl);

            GridLayout gl         = new GridLayout(2, 2, 1, 1);
            JPanel     info_panel = new JPanel();

            info_panel.setLayout(gl);

            JPanel main_panel = new JPanel();

            main_panel.setLayout(new BorderLayout());

            info_panel.add(new JLabel("Reservoir:"));
            info_panel.add(new JLabel(__currentRes.getID()));
            info_panel.add(new JLabel("Reservoir name:"));
            info_panel.add(new JLabel(__currentRes.getName()));

            if (__editable)
            {
                p1.add(__addReturn_JButton);
                p1.add(__deleteReturn_JButton);
            }
            p1.add(applyJButton);
            p1.add(cancelJButton);
            //	p1.add(__helpJButton);
            p1.add(__close_JButton);
            if (!__editable)
            {
                applyJButton.setEnabled(false);
                applyJButton.setToolTipText("Editing reservoir return data is not implemented.");
                __close_JButton.setEnabled(false);
                __close_JButton.setToolTipText("Editing reservoir return data is not implemented.");
            }

            main_panel.add(jsw, "Center");
            main_panel.add(p1, "South");

            JGUIUtil.addComponent(bigPanel, info_panel, 0, 0, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.NORTHWEST);
            JGUIUtil.addComponent(bigPanel, main_panel, 0, 1, 10, 10, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.SOUTH);
            __addReturn_JButton.addActionListener(this);
            __deleteReturn_JButton.addActionListener(this);
            __help_JButton.addActionListener(this);
            __close_JButton.addActionListener(this);
            applyJButton.addActionListener(this);
            cancelJButton.addActionListener(this);

            getContentPane().add(bigPanel);

            JPanel bottomJPanel = new JPanel();

            bottomJPanel.setLayout(gb);
            __messageJTextField = new JTextField();
            __messageJTextField.setEditable(false);
            JGUIUtil.addComponent(bottomJPanel, __messageJTextField, 0, 0, 7, 1, 1.0, 0.0, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
            __statusJTextField = new JTextField(5);
            __statusJTextField.setEditable(false);
            JGUIUtil.addComponent(bottomJPanel, __statusJTextField, 7, 0, 1, 1, 0.0, 0.0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            getContentPane().add("South", bottomJPanel);

            pack();
            setSize(760, 400);
            JGUIUtil.center(this);
            setVisible(true);
            if (widths != null)
            {
                __worksheet.setColumnWidths(widths);
            }
        }
Beispiel #35
0
        public LogPanel(JamochaGui gui)
            : base(gui)
        {
            InitBlock();
            //UPGRADE_ISSUE: Constructor 'java.awt.BorderLayout.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            setLayout(new BorderLayout());
            logChannel = gui.Engine.MessageRouter.openChannel("gui_log", InterestType.ALL);
            detailView = new JTextArea();
            detailView.setEditable(false);
            //UPGRADE_NOTE: If the given Font Name does not exist, a default Font instance is created. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1075"'
            //UPGRADE_TODO: Method 'java.awt.Font.Plain' was converted to 'System.Drawing.FontStyle.Regular' which has a different behavior. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1073_javaawtFontPLAIN_f"'
            detailView.setFont(new System.Drawing.Font("Courier", 12, (System.Drawing.FontStyle) System.Drawing.FontStyle.Regular));
            cellRenderer = new LogTableCellRenderer(this);
            logTable = new AnonymousClassJTable(this, dataModel);
            logTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
            logTable.SelectionModel.addListSelectionListener(this);
            pane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, new JScrollPane(logTable), new JScrollPane(detailView));
            pane.setDividerLocation(gui.Preferences.getInt("log.dividerlocation", 300));
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout.CENTER' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtBorderLayout"'
            add(pane, BorderLayout.CENTER);

            SupportClass.ThreadClass logThread = new AnonymousClassThread(this);
            logThread.Start();
            clearButton = new JButton("Clear Log", IconLoader.getImageIcon("monitor"));
            clearButton.addActionListener(this);
            JPanel buttonPanel = new JPanel();
            //UPGRADE_ISSUE: Constructor 'java.awt.FlowLayout.FlowLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            //UPGRADE_ISSUE: Field 'java.awt.FlowLayout.RIGHT' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtFlowLayout"'
            buttonPanel.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 1));
            buttonPanel.add(clearButton);
            //UPGRADE_ISSUE: Field 'java.awt.BorderLayout' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000"'
            add(buttonPanel, BorderLayout.PAGE_END);
        }
Beispiel #36
0
 private void initPreselectionPanel()
 {
     //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();
     JPanel preselectionPanel = new JPanel(gridbag);
     preselectionPanel.setBorder(BorderFactory.createTitledBorder("Module and Template Selection"));
     //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;
     moduleList = new JList(moduleListModel);
     moduleList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     moduleList.SelectionModel.addListSelectionListener(this);
     Collection modules = engine.WorkingMemory.Modules;
     Iterator itr = modules.iterator();
     while (itr.hasNext())
     {
         Module mod = (Module) itr.next();
         moduleListModel.addElement(mod.ModuleName);
     }
     JPanel modulePanel = new JPanel();
     modulePanel.setLayout(new BoxLayout(modulePanel, BoxLayout.Y_AXIS));
     modulePanel.add(new JLabel("Select a Module:"));
     modulePanel.add(new JScrollPane(moduleList));
     //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.5;
     //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.gridx' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
     //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.gridy' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
     c.gridx = c.gridy = 0;
     //UPGRADE_ISSUE: Field 'java.awt.GridBagConstraints.weighty' was not converted. 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="jlca1000_javaawtGridBagConstraints"'
     c.weighty = 1.0;
     // c.gridwidth = GridBagConstraints.RELATIVE;
     gridbag.setConstraints(modulePanel, c);
     preselectionPanel.add(modulePanel);
     templateList = new JList(templateListModel);
     templateList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     templateList.SelectionModel.addListSelectionListener(this);
     initTemplateList();
     JPanel templatePanel = new JPanel();
     templatePanel.setLayout(new BoxLayout(templatePanel, BoxLayout.Y_AXIS));
     templatePanel.add(new JLabel("Select a Template:"));
     templatePanel.add(new JScrollPane(templateList));
     // c.gridwidth = GridBagConstraints.REMAINDER;
     //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;
     gridbag.setConstraints(templatePanel, c);
     preselectionPanel.add(templatePanel);
     JPanel dumpAreaPanel = new JPanel();
     dumpAreaPanel.setLayout(new BoxLayout(dumpAreaPanel, BoxLayout.Y_AXIS));
     dumpAreaPanel.add(new JLabel("Template Definition:"));
     dumpAreaPanel.add(new JScrollPane(dumpAreaTemplate));
     //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);
     preselectionPanel.add(dumpAreaPanel);
     contentPanel.add(preselectionPanel, "preselection");
 }
        /// <summary>
        /// Sets up the GUI.
        /// </summary>
        private void setupGUI()
        {
            string routine = "StateMod_QueryTool_JFrame.setupGUI";

            addWindowListener(this);

            GridBagLayout gb = new GridBagLayout();

            JPanel main_JPanel = new JPanel();

            main_JPanel.setLayout(gb);
            JGUIUtil.addComponent(main_JPanel, new JLabel("Component:"), 0, 0, 1, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.EAST);
            __component_JComboBox = new SimpleJComboBox(false);
            __component_JComboBox.add("Diversion Stations");
            JGUIUtil.addComponent(main_JPanel, __component_JComboBox, 1, 0, 2, 1, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);

            try
            {
                __input_filter_diversion_JPanel = new StateMod_Diversion_InputFilter_JPanel(__dataset);
                JGUIUtil.addComponent(main_JPanel, __input_filter_diversion_JPanel, 0, 1, 4, 4, 0, 0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            }
            catch (Exception)
            {
                Message.printWarning(1, routine, "Unable to initialize input filter for diversion stations.");
            }
            getContentPane().add(main_JPanel);

            // add bottom buttons
            FlowLayout fl = new FlowLayout(FlowLayout.CENTER);

            JPanel buttonPanel = new JPanel();

            buttonPanel.setLayout(fl);
            __query_JButton = new SimpleJButton(__Query_String, this);
            __query_JButton.setToolTipText("Query the data set using specified criteria.");
            __display_JButton = new SimpleJButton(__Display_String, this);
            __display_JButton.setToolTipText("Display the results of the query.");
            __display_JButton.setEnabled(false);     // Enable after query.
            __cancel_JButton = new SimpleJButton(__Cancel_String, this);
            __cancel_JButton.setToolTipText("Cancel query and close window.");

            buttonPanel.add(__query_JButton);
            buttonPanel.add(__display_JButton);
            buttonPanel.add(__cancel_JButton);

            JPanel bottomJPanel = new JPanel();

            bottomJPanel.setLayout(gb);
            JGUIUtil.addComponent(bottomJPanel, buttonPanel, 0, 0, 8, 1, 1, 0, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
            __message_JTextField = new JTextField();
            __message_JTextField.setText("Select filter criteria and then press Query");
            __message_JTextField.setEditable(false);
            JGUIUtil.addComponent(bottomJPanel, __message_JTextField, 0, 1, 7, 1, 1.0, 0.0, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
            __status_JTextField = new JTextField(5);
            __status_JTextField.setEditable(false);
            JGUIUtil.addComponent(bottomJPanel, __status_JTextField, 7, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NONE, GridBagConstraints.WEST);
            getContentPane().add("South", bottomJPanel);

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

            pack();
            setSize(550, 190);     // Allows replacement res option to display
            JGUIUtil.center(this);
            setResizable(true);
            setVisible(true);
        }
Beispiel #38
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();
     }
 }