Creates the GUI controls for toggling graph display options.
@return A component that can be added to the main panel.
437172
private JComponent createControls(boolean islands)
    {
        JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT));

        allDataButton.addItemListener(new ItemListener()
        {
            public void itemStateChanged(ItemEvent ev)
            {
                updateDomainAxisRange();
            }
        });
        String text = "Last " + SHOW_FIXED_GENERATIONS + (islands ? " Epochs" : " Generations");
        JRadioButton recentDataButton = new JRadioButton(text, true);
        ButtonGroup buttonGroup = new ButtonGroup();
        buttonGroup.add(allDataButton);
        buttonGroup.add(recentDataButton);

        controls.add(allDataButton);
        controls.add(recentDataButton);

        final JCheckBox meanCheckBox = new JCheckBox("Show Mean", true);
        meanCheckBox.addItemListener(new ItemListener()
        {
            public void itemStateChanged(ItemEvent itemEvent)
            {
                if (itemEvent.getStateChange() == ItemEvent.SELECTED)
                {
                    dataSet.addSeries(meanSeries);
                }
                else
                {
                    dataSet.removeSeries(meanSeries);
                }
            }
        });
        controls.add(meanCheckBox);

        invertCheckBox.addItemListener(new ItemListener()
        {
            public void itemStateChanged(ItemEvent itemEvent)
            {
                rangeAxis.setInverted(invertCheckBox.isSelected());
            }
        });
        controls.add(invertCheckBox);

        return controls;
    }
24083
private void initComponents() {
        // JFormDesigner - Component initialization - DO NOT MODIFY  //GEN-BEGIN:initComponents
        headerControlsPanel = new JPanel();
        buttonPreviousYear = new JButton();
        buttonPreviousMonth = new JButton();
        monthAndYearOuterPanel = new JPanel();
        monthAndYearInnerPanel = new JPanel();
        labelMonth = new JLabel();
        labelYear = new JLabel();
        buttonNextMonth = new JButton();
        buttonNextYear = new JButton();
        centerPanel = new JPanel();
        footerPanel = new JPanel();
        labelSetDateToToday = new JLabel();
        labelClearDate = new JLabel();
        yearEditorPanel = new JPanel();
        doneEditingYearButton = new JButton();

        //======== this ========
        setLayout(new GridBagLayout());
        ((GridBagLayout) getLayout()).columnWidths = new int[]{5, 0, 5, 0};
        ((GridBagLayout) getLayout()).rowHeights = new int[]{6, 0, 5, 80, 5, 0, 5, 0};
        ((GridBagLayout) getLayout()).columnWeights = new double[]{0.0, 0.0, 0.0, 1.0E-4};
        ((GridBagLayout) getLayout()).rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0E-4};

        //======== headerControlsPanel ========
        {
            headerControlsPanel.setLayout(new FormLayout(
                "3*(pref), pref:grow, 3*(pref)",
                "fill:pref:grow"));
            ((FormLayout) headerControlsPanel.getLayout()).setColumnGroups(new int[][]{{1, 2, 6, 7}});

            //---- buttonPreviousYear ----
            buttonPreviousYear.setText("<<");
            buttonPreviousYear.setFocusable(false);
            buttonPreviousYear.setFocusPainted(false);
            buttonPreviousYear.setHorizontalTextPosition(SwingConstants.CENTER);
            buttonPreviousYear.setMargin(new Insets(5, 6, 5, 6));
            buttonPreviousYear.setFont(new Font("Monospaced", Font.BOLD, 12));
            buttonPreviousYear.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    buttonPreviousYearActionPerformed(e);
                }
            });
            headerControlsPanel.add(buttonPreviousYear, CC.xy(1, 1));

            //---- buttonPreviousMonth ----
            buttonPreviousMonth.setText(" < ");
            buttonPreviousMonth.setFocusable(false);
            buttonPreviousMonth.setFocusPainted(false);
            buttonPreviousMonth.setHorizontalTextPosition(SwingConstants.CENTER);
            buttonPreviousMonth.setMargin(new Insets(5, 6, 5, 6));
            buttonPreviousMonth.setFont(new Font("Monospaced", Font.BOLD, 12));
            buttonPreviousMonth.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    buttonPreviousMonthActionPerformed(e);
                }
            });
            headerControlsPanel.add(buttonPreviousMonth, CC.xy(2, 1));

            //======== monthAndYearOuterPanel ========
            {
                monthAndYearOuterPanel.setLayout(new FormLayout(
                    "pref:grow, pref, pref:grow",
                    "fill:pref:grow"));

                //======== monthAndYearInnerPanel ========
                {
                    monthAndYearInnerPanel.setLayout(new FormLayout(
                        "pref, [1px,pref], pref",
                        "fill:pref:grow"));

                    //---- labelMonth ----
                    labelMonth.setText("September");
                    labelMonth.setHorizontalAlignment(SwingConstants.RIGHT);
                    labelMonth.setOpaque(true);
                    labelMonth.addMouseListener(new MouseAdapter() {
                        @Override
                        public void mouseEntered(MouseEvent e) {
                            labelIndicatorMouseEntered(e);
                        }

                        @Override
                        public void mouseExited(MouseEvent e) {
                            labelIndicatorMouseExited(e);
                        }

                        @Override
                        public void mousePressed(MouseEvent e) {
                            labelMonthIndicatorMousePressed(e);
                        }
                    });
                    monthAndYearInnerPanel.add(labelMonth, CC.xy(1, 1));

                    //---- labelYear ----
                    labelYear.setText("2100");
                    labelYear.setOpaque(true);
                    labelYear.addMouseListener(new MouseAdapter() {
                        @Override
                        public void mouseEntered(MouseEvent e) {
                            labelIndicatorMouseEntered(e);
                        }

                        @Override
                        public void mouseExited(MouseEvent e) {
                            labelIndicatorMouseExited(e);
                        }

                        @Override
                        public void mousePressed(MouseEvent e) {
                            labelYearIndicatorMousePressed(e);
                        }
                    });
                    monthAndYearInnerPanel.add(labelYear, CC.xy(3, 1));
                }
                monthAndYearOuterPanel.add(monthAndYearInnerPanel, CC.xy(2, 1));
            }
            headerControlsPanel.add(monthAndYearOuterPanel, CC.xy(4, 1));

            //---- buttonNextMonth ----
            buttonNextMonth.setText(" > ");
            buttonNextMonth.setFocusable(false);
            buttonNextMonth.setFocusPainted(false);
            buttonNextMonth.setHorizontalTextPosition(SwingConstants.CENTER);
            buttonNextMonth.setMargin(new Insets(5, 6, 5, 6));
            buttonNextMonth.setFont(new Font("Monospaced", Font.BOLD, 12));
            buttonNextMonth.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    buttonNextMonthActionPerformed(e);
                }
            });
            headerControlsPanel.add(buttonNextMonth, CC.xy(6, 1));

            //---- buttonNextYear ----
            buttonNextYear.setText(">>");
            buttonNextYear.setFocusable(false);
            buttonNextYear.setFocusPainted(false);
            buttonNextYear.setHorizontalTextPosition(SwingConstants.CENTER);
            buttonNextYear.setMargin(new Insets(5, 6, 5, 6));
            buttonNextYear.setFont(new Font("Monospaced", Font.BOLD, 12));
            buttonNextYear.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    buttonNextYearActionPerformed(e);
                }
            });
            headerControlsPanel.add(buttonNextYear, CC.xy(7, 1));
        }
        add(headerControlsPanel, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0), 0, 0));

        //======== centerPanel ========
        {
            centerPanel.setBackground(new Color(210, 210, 210));
            centerPanel.setLayout(new FormLayout(
                "3*(min), 7*(default:grow), min",
                "fill:min, fill:2px, fill:default:grow, fill:1px, fill:min, 6*(fill:default:grow), fill:min"));
            ((FormLayout) centerPanel.getLayout()).setColumnGroups(new int[][]{{4, 5, 6, 7, 8, 9, 10}});
            ((FormLayout) centerPanel.getLayout()).setRowGroups(new int[][]{{3, 6, 7, 8, 9, 10, 11}});
        }
        add(centerPanel, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0), 0, 0));

        //======== footerPanel ========
        {
            footerPanel.setLayout(new GridBagLayout());
            ((GridBagLayout) footerPanel.getLayout()).columnWidths = new int[]{6, 0, 0, 0, 6, 0};
            ((GridBagLayout) footerPanel.getLayout()).rowHeights = new int[]{0, 0};
            ((GridBagLayout) footerPanel.getLayout()).columnWeights = new double[]{0.0, 0.0, 1.0, 0.0, 0.0, 1.0E-4};
            ((GridBagLayout) footerPanel.getLayout()).rowWeights = new double[]{1.0, 1.0E-4};

            //---- labelSetDateToToday ----
            labelSetDateToToday.setText("Today: Feb 12, 2016");
            labelSetDateToToday.setHorizontalAlignment(SwingConstants.CENTER);
            labelSetDateToToday.setOpaque(true);
            footerPanel.add(labelSetDateToToday, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0), 0, 0));

            //---- labelClearDate ----
            labelClearDate.setText("Clear");
            labelClearDate.setOpaque(true);
            footerPanel.add(labelClearDate, new GridBagConstraints(3, 0, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0), 0, 0));
        }
        add(footerPanel, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0,
            GridBagConstraints.CENTER, GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0), 0, 0));

        //======== yearEditorPanel ========
        {
            yearEditorPanel.setLayout(new GridBagLayout());
            ((GridBagLayout) yearEditorPanel.getLayout()).columnWidths = new int[]{40, 1, 26, 0};
            ((GridBagLayout) yearEditorPanel.getLayout()).rowHeights = new int[]{0, 0};
            ((GridBagLayout) yearEditorPanel.getLayout()).columnWeights = new double[]{1.0, 0.0, 0.0, 1.0E-4};
            ((GridBagLayout) yearEditorPanel.getLayout()).rowWeights = new double[]{1.0, 1.0E-4};

            //---- doneEditingYearButton ----
            doneEditingYearButton.setFocusPainted(false);
            doneEditingYearButton.setFocusable(false);
            doneEditingYearButton.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    doneEditingYearButtonActionPerformed(e);
                }
            });
            yearEditorPanel.add(doneEditingYearButton, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0,
                GridBagConstraints.CENTER, GridBagConstraints.BOTH,
                new Insets(0, 0, 0, 0), 0, 0));
        }
        // JFormDesigner - End of component initialization  //GEN-END:initComponents
    }
1270636
public static JComponent createAdjustEditor ()
    {
        VGroupLayout layout = new VGroupLayout(
            VGroupLayout.NONE, VGroupLayout.STRETCH,
            3, VGroupLayout.TOP);
        layout.setOffAxisJustification(VGroupLayout.LEFT);

        JTabbedPane editor = new EditorPane();
        Font font = editor.getFont();
        Font smaller = font.deriveFont(font.getSize()-1f);

        String library = null;
        JPanel lpanel = null;
        String pkgname = null;
        CollapsiblePanel pkgpanel = null;

        int acount = _adjusts.size();
        for (int ii = 0; ii < acount; ii++) {
            Adjust adjust = _adjusts.get(ii);

            // create a new library label if necessary
            if (!adjust.getLibrary().equals(library)) {
                library = adjust.getLibrary();
                pkgname = null;
                lpanel = new JPanel(layout);
                lpanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
                editor.addTab(library, lpanel);
            }

            // create a new package panel if necessary
            if (!adjust.getPackage().equals(pkgname)) {
                pkgname = adjust.getPackage();
                pkgpanel = new CollapsiblePanel();
                JCheckBox pkgcheck = new JCheckBox(pkgname);
                pkgcheck.setSelected(true);
                pkgpanel.setTrigger(pkgcheck, null, null);
                pkgpanel.setTriggerContainer(pkgcheck);
                pkgpanel.getContent().setLayout(layout);
                pkgpanel.setCollapsed(false);
                lpanel.add(pkgpanel);
            }

            // add an entry for this adjustment
            pkgpanel.getContent().add(new JSeparator());
            JPanel aeditor = adjust.getEditor();
            aeditor.setFont(smaller);
            pkgpanel.getContent().add(aeditor);
        }

        return editor;
    }
120643
public JPanel getPanel() {
        if (panel == null) {
            panel = getComponentFactory().createPanel();
        }
        insertMissingSpecs();
        fixColSpans();
        fillInGaps();
        fillPanel();

        if( focusOrder != null ) {
            installFocusOrder( focusOrder );
        }

        return panel;
    }
758829
def _create_ui(self):
        """"""

        self.preview = None
        self.about_dialog = None
        self.preferences = None
        self.builder = pygubu.Builder(translator)
        self.currentfile = None
        self.is_changed = False

        uifile = os.path.join(FILE_PATH, "ui/pygubu-ui.ui")
        self.builder.add_from_file(uifile)
        self.builder.add_resource_path(os.path.join(FILE_PATH, "images"))

        #build main ui
        self.builder.get_object('mainwindow', self.master)
        toplevel = self.master.winfo_toplevel()
        menu = self.builder.get_object('mainmenu', toplevel)
        toplevel['menu'] = menu

        #project name
        self.project_name = self.builder.get_object('projectname_lbl')

        #Class selector values
        self.widgetlist_sf = self.builder.get_object("widgetlist_sf")
        self.widgetlist = self.builder.get_object("widgetlist")
        self.configure_widget_list()

        #widget tree
        self.treeview = self.builder.get_object('treeview1')
        self.bindings_frame = self.builder.get_object('bindingsframe')
        self.bindings_tree = self.builder.get_object('bindingstree')

        #Preview
        previewc = self.builder.get_object('preview_canvas')
        self.previewer = PreviewHelper(previewc)
        #tree editor
        self.tree_editor = WidgetsTreeEditor(self)

        self.builder.connect_callbacks(self)

        #Status bar
        self.statusbar = self.builder.get_object('statusbar')
        handler = StatusBarHandler(self.statusbar)
        handler.setLevel(logging.INFO)
        logger.addHandler(handler)
        pygubu.builder.logger.addHandler(handler)

        #app grid
        self.set_resizable()

        #
        #Application bindings
        #
        master = self.master
        master.bind_all(
            '<Control-KeyPress-n>',
            lambda e: self.on_file_menuitem_clicked('file_new'))
        master.bind_all(
            '<Control-KeyPress-o>',
            lambda e: self.on_file_menuitem_clicked('file_open'))
        master.bind_all(
            '<Control-KeyPress-s>',
            lambda e: self.on_file_menuitem_clicked('file_save'))
        master.bind_all(
            '<Control-KeyPress-q>',
            lambda e: self.on_file_menuitem_clicked('file_quit'))
        master.bind_all(
            '<Control-KeyPress-i>',
            lambda e: self.on_edit_menuitem_clicked('edit_item_up'))
        master.bind_all(
            '<Control-KeyPress-k>',
            lambda e: self.on_edit_menuitem_clicked('edit_item_down'))
        master.bind_all(
            '<F5>',
            lambda e: self.tree_editor.preview_in_toplevel())
        master.bind_all(
            '<F6>',
            lambda e: self.previewer.close_toplevel_previews())

        #
        # Widget bindings
        #
        self.tree_editor.treeview.bind(
            '<Control-KeyPress-c>',
            lambda e: self.tree_editor.copy_to_clipboard())
        self.tree_editor.treeview.bind(
            '<Control-KeyPress-v>',
            lambda e: self.tree_editor.paste_from_clipboard())
        self.tree_editor.treeview.bind(
            '<Control-KeyPress-x>',
            lambda e: self.tree_editor.cut_to_clipboard())
        self.tree_editor.treeview.bind(
            '<KeyPress-Delete>',
            lambda e: self.on_edit_menuitem_clicked('edit_item_delete'))

        def clear_key_pressed(event, newevent):
            # when KeyPress, not Ctrl-KeyPress, generate event.
            if event.keysym_num == ord(event.char):
                self.tree_editor.treeview.event_generate(newevent)
        self.tree_editor.treeview.bind('<i>',
                lambda e: clear_key_pressed(e, '<Up>'))
        self.tree_editor.treeview.bind('<k>',
                lambda e: clear_key_pressed(e, '<Down>'))

        #grid move bindings
        self.tree_editor.treeview.bind(
            '<Alt-KeyPress-i>',
            lambda e: self.on_edit_menuitem_clicked('grid_up'))
        self.tree_editor.treeview.bind(
            '<Alt-KeyPress-k>',
            lambda e: self.on_edit_menuitem_clicked('grid_down'))
        self.tree_editor.treeview.bind(
            '<Alt-KeyPress-j>',
            lambda e: self.on_edit_menuitem_clicked('grid_left'))
        self.tree_editor.treeview.bind(
            '<Alt-KeyPress-l>',
            lambda e: self.on_edit_menuitem_clicked('grid_right'))
            
        # On preferences save binding
        self.master.bind('<<PygubuDesignerPreferencesSaved>>', self.on_preferences_saved)

        #
        # Setup tkk styles
        #
        self._setup_styles()

        #
        # Setup dynamic theme submenu
        #
        self._setup_theme_menu()

        #app config
        top = self.master.winfo_toplevel()
        try:
            top.wm_iconname('pygubu')
            top.tk.call('wm', 'iconphoto', '.', StockImage.get('pygubu'))
        except StockImageException as e:
            pass

        self.set_title(_('Pygubu a GUI builder for tkinter'))
        self.set_size('640x480')
1243773
private static void createAndShowGUI() {

    // Create and set up the window.
    JFrame frame = new JFrame("XChart Swing Demo");
    frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);

    // Add content to the window.
    JPanel chartPanel = new XChartPanel(new AreaChart01().getChart());
    frame.add(chartPanel);

    // Display the window.
    frame.pack();
    frame.setVisible(true);
  }
210790
private void buildUI() {
		// build the configuration options UI.
		WFieldLayout layout = new WFieldLayout(WFieldLayout.LAYOUT_STACKED);
		layout.setMargin(new Margin(null, null, Size.LARGE, null));
		add(layout);
		layout.addField("Autoplay", cbAutoPlay);
		layout.addField("Loop", cbLoop);
		layout.addField("Disable", cbDisable);
		layout.addField("Show only play/pause", cbControls);
		layout.addField((WLabel) null, btnApply);

		// enable disable option only when control PLAY_PAUSE is used.
		WSubordinateControl control = new WSubordinateControl();
		add(control);
		Rule rule = new Rule();
		rule.setCondition(new Equal(cbControls, Boolean.TRUE.toString()));
		rule.addActionOnTrue(new Enable(cbDisable));
		rule.addActionOnFalse(new Disable(cbDisable));
		control.addRule(rule);

		// allow config to change without reloading the whole page.
		add(new WAjaxControl(btnApply, audio));

		// add the audio to the UI
		add(audio);
	}
221234
def _generate_graph_controls(self):
        
        # setup mode radio buttons
        stress_modes = self.controller.stress_conroller.get_modes()
        group = []
        for mode in stress_modes:
            self.mode_buttons.append(radio_button(group, mode,
                                                  self.on_mode_button))

        # Set default radio button to "Monitor" mode
        self.mode_buttons[0].set_state(True, do_callback=False)

        # Create list of buttons
        control_options = list()
        control_options.append(button('Graphs',
                                      self.on_graphs_menu_open))
        control_options.append(button('Summaries',
                                      self.on_summary_menu_open))
        if self.controller.stress_exe:
            control_options.append(button('Stress Options',
                                          self.on_stress_menu_open))
        control_options.append(button("Reset", self.on_reset_button))
        control_options.append(button('Help', self.on_help_menu_open))
        control_options.append(button('About', self.on_about_menu_open))
        control_options.append(button("Save Settings",
                                      self.on_save_settings))
        control_options.append(button("Quit", self.on_exit_program))

        # Create the menu
        animate_controls = urwid.GridFlow(control_options, 18, 2, 0, 'center')

        # Create smooth graph selection button
        default_smooth = self.controller.smooth_graph_mode
        if urwid.get_encoding_mode() == "utf8":
            unicode_checkbox = urwid.CheckBox(
                "UTF-8", state=default_smooth,
                on_state_change=self.on_unicode_checkbox)
            # Init the state of the graph accoding to the selected mode
            self.on_unicode_checkbox(state=default_smooth)
        else:
            unicode_checkbox = urwid.Text(
                "[N/A] UTF-8")

        install_stress_message = urwid.Text("")
        if not self.controller.stress_exe:
            install_stress_message = urwid.Text(
                ('button normal', u"(N/A) install stress"))

        controls = [urwid.Text(('bold text', u"Modes"), align="center")]
        controls += self.mode_buttons
        controls += [
            install_stress_message,
            urwid.Text(('bold text', u"Stress Timer"), align="center"),
            self.clock_view,
            urwid.Divider(),
            urwid.Text(('bold text', u"Control Options"), align="center"),
            animate_controls,
            urwid.Divider(),
            urwid.Text(('bold text', u"Visual Options"), align="center"),
            unicode_checkbox,
            self.refresh_rate_ctrl,
            urwid.Divider(),
            urwid.Text(('bold text', u"Summaries"), align="center"),
        ]

        return controls
148489
def _build_gui(self):
        
        # remove all widgets (should destroy all children too)
        self._central_widget.deleteLater()

        # remove all references to other controls
        self._sliders               = []
        self._buttons_top_color     = []
        self._buttons_bottom_color  = []
        self._checkboxes            = []
        self._buttons_plus          = []
        self._buttons_minus         = []
        self._color_dialogs_top     = []
        self._color_dialogs_bottom  = []

        # create the new central widget
        self._central_widget = _qtw.QWidget()
        self._window.setCentralWidget(self._central_widget)

        # layout for main widget
        self._layout = _qtw.QGridLayout(self._central_widget)
        self._central_widget.setLayout(self._layout)

        # add the list of cmaps
        self._combobox_cmaps = _qtw.QComboBox(self._central_widget)
        self._combobox_cmaps.setEditable(True)
        self._load_cmap_list()

        # add the save and delete buttons
        self._button_save   = _qtw.QPushButton("Save",   self._central_widget)
        self._button_delete = _qtw.QPushButton("Delete", self._central_widget)
        self._button_save.setFixedWidth(70)
        self._button_delete.setFixedWidth(70)

        # layouts
        self._layout.addWidget(self._combobox_cmaps, 1,1, 1,3, _qtcore.Qt.Alignment(0))
        self._layout.addWidget(self._button_save,    1,5, 1,1, _qtcore.Qt.Alignment(1))
        self._layout.addWidget(self._button_delete,  1,6, 1,2, _qtcore.Qt.Alignment(1))

        # actions
        self._combobox_cmaps.currentIndexChanged.connect(self._signal_load)
        self._button_save  .clicked.connect(self._button_save_clicked)
        self._button_delete.clicked.connect(self._button_delete_clicked)

        # ensmallen the window
        self._window.resize(10,10)

        # now create a control set for each color point
        for n in range(len(self._colorpoint_list)):

            c1 = self._colorpoint_list[n][1]
            c2 = self._colorpoint_list[n][2]

            # create a top-color button
            self._buttons_top_color.append(_qtw.QPushButton(self._central_widget))
            self._buttons_top_color[-1].setStyleSheet("background-color: rgb("+str(int(c2[0]*255))+","+str(int(c2[1]*255))+","+str(int(c2[2]*255))+"); border-radius: 3px;")

            # create a bottom-color button
            self._buttons_bottom_color.append(_qtw.QPushButton(self._central_widget))
            self._buttons_bottom_color[-1].setStyleSheet("background-color: rgb("+str(int(c1[0]*255))+","+str(int(c1[1]*255))+","+str(int(c1[2]*255))+"); border-radius: 3px;")

            # create color dialogs
            self._color_dialogs_top.append(_qtw.QColorDialog(self._central_widget))
            self._color_dialogs_top[-1].setCurrentColor(self._buttons_top_color[-1].palette().color(1))

            self._color_dialogs_bottom.append(_qtw.QColorDialog(self._central_widget))
            self._color_dialogs_bottom[-1].setCurrentColor(self._buttons_top_color[-1].palette().color(1))

            # create link checkboxes
            self._checkboxes.append(_qtw.QCheckBox(self._central_widget))
            self._checkboxes[-1].setChecked(c1==c2)

            # create a slider
            self._sliders.append(_qtw.QSlider(self._central_widget))
            self._sliders[-1].setOrientation(_qtcore.Qt.Horizontal)
            self._sliders[-1].setMaximum(1000)
            self._sliders[-1].setValue(int(self._colorpoint_list[n][0]*1000))
            self._sliders[-1].setFixedWidth(250)

            # create + and - buttons
            self._buttons_plus.append(_qtw.QPushButton(self._central_widget))
            self._buttons_plus[-1].setText("+")
            self._buttons_plus[-1].setFixedWidth(25)

            self._buttons_minus.append(_qtw.QPushButton(self._central_widget))
            self._buttons_minus[-1].setText("-")
            self._buttons_minus[-1].setFixedWidth(25)

            # layout
            self._layout.addWidget(self._buttons_bottom_color[-1], n+3,1,      _qtcore.Qt.AlignCenter)
            self._layout.addWidget(self._checkboxes[-1],           n+3,2, 1,1, _qtcore.Qt.AlignCenter)
            self._layout.addWidget(self._buttons_top_color[-1],    n+3,3,      _qtcore.Qt.AlignCenter)
            self._layout.addWidget(self._sliders[-1],              n+3,4, 1,2, _qtcore.Qt.AlignCenter)
            self._layout.setColumnStretch(5,100)
            self._layout.addWidget(self._buttons_minus[-1],        n+3,7,      _qtcore.Qt.AlignCenter)
            self._layout.addWidget(self._buttons_plus[-1],         n+3,6,      _qtcore.Qt.AlignCenter)

            # connect the buttons and slider actions to the calls
            self._buttons_bottom_color[-1]            .clicked.connect(_partial(self._color_button_clicked, n, 0))
            self._buttons_top_color[-1]               .clicked.connect(_partial(self._color_button_clicked, n, 1))
            self._color_dialogs_bottom[-1].currentColorChanged.connect(_partial(self._color_dialog_changed, n, 0))
            self._color_dialogs_top[-1]   .currentColorChanged.connect(_partial(self._color_dialog_changed, n, 1))

            self._buttons_plus[-1]        .clicked.connect(_partial(self._button_plus_clicked,  n))
            self._buttons_minus[-1]       .clicked.connect(_partial(self._button_minus_clicked, n))
            self._sliders[-1]        .valueChanged.connect(_partial(self._slider_changed,   n))



        # disable the appropriate sliders
        self._sliders[0] .setDisabled(True)
        self._sliders[-1].setDisabled(True)
481217
@Override
    protected void prepareGUI(Container container)
    {
        probabilitiesPanel = new ProbabilitiesPanel();
        probabilitiesPanel.setBorder(BorderFactory.createTitledBorder("Evolution Probabilities"));        
        JPanel controls = new JPanel(new BorderLayout());
        controls.add(createParametersPanel(), BorderLayout.NORTH);
        controls.add(probabilitiesPanel, BorderLayout.SOUTH);
        container.add(controls, BorderLayout.NORTH);

        Renderer<List<ColouredPolygon>, JComponent> renderer = new PolygonImageSwingRenderer(targetImage);
        monitor = new EvolutionMonitor<List<ColouredPolygon>>(renderer, false);
        container.add(monitor.getGUIComponent(), BorderLayout.CENTER);
    }
484109
private DefaultPanel createTopPanel() {
		DefaultPanel top = new DefaultPanel();
		top.setLayout(new BoxLayout(top, BoxLayout.X_AXIS));
		top.setAlignmentX(Component.LEFT_ALIGNMENT);
		top.setPreferredSize(new Dimension(Short.MAX_VALUE, 40));

		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// property label
		JLabel propLabel = new JLabel("Property");
		propLabel.setBounds(10, 20, 40, 20);
		propLabel.setForeground(COLOR_LABEL);
		top.add(propLabel);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// add properties combobox
		properties = new JComboBox();
		properties.setMaximumSize(new Dimension(100, 20));
		properties.setMinimumSize(new Dimension(100, 20));
		properties.setPreferredSize(new Dimension(100, 20));
		properties.addItemListener(new ItemListener() {
			public void itemStateChanged(ItemEvent event) {
				String item = (String) event.getItem();
				LinearInterpolator currentValue = (LinearInterpolator) values
						.get(item);
				panel.setInterpolator(currentValue);
			}
		});
		top.add(properties);
		top.add(Box.createRigidArea(new Dimension(10, 0)));

		// min label
		JLabel minLabel = new JLabel("Min");
		minLabel.setMaximumSize(new Dimension(100, 20));
		minLabel.setForeground(COLOR_LABEL);
		top.add(minLabel);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// min spinner
		minSpinner = new JSpinner(new SpinnerNumberModel(0, -1000, 1000, 1));
		minSpinner.setMaximumSize(new Dimension(100, 20));
		minSpinner.addChangeListener(new ChangeListener() {
			public void stateChanged(ChangeEvent e) {
				fireUpdated(e.getSource());
			}
		});
		top.add(minSpinner);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// max label
		JLabel maxLabel = new JLabel("Max");
		maxLabel.setMaximumSize(new Dimension(100, 20));
		maxLabel.setForeground(COLOR_LABEL);
		top.add(maxLabel);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// max spinner
		maxSpinner = new JSpinner(new SpinnerNumberModel(255, -1000, 1000, 1));
		maxSpinner.setMaximumSize(new Dimension(100, 20));
		maxSpinner.addChangeListener(new ChangeListener() {
			public void stateChanged(ChangeEvent e) {
				fireUpdated(e.getSource());
			}
		});
		top.add(maxSpinner);
		top.add(Box.createRigidArea(new Dimension(5, 0)));

		// spacer
		top.add(Box.createHorizontalGlue());

		// value x label
		valueXLabel = new JLabel(TEXT_CURRENT_X);
		valueXLabel.setMaximumSize(new Dimension(100, 20));
		valueXLabel.setForeground(COLOR_LABEL);
		top.add(valueXLabel);
		top.add(Box.createRigidArea(new Dimension(10, 0)));

		// value y label
		valueYLabel = new JLabel(TEXT_CURRENT_Y);
		valueYLabel.setMaximumSize(new Dimension(100, 20));
		valueYLabel.setForeground(COLOR_LABEL);
		top.add(valueYLabel);
		top.add(Box.createRigidArea(new Dimension(10, 0)));

		return top;
	}
375588
private JPanel createSorterPane() {
        JPanel insidePanel = new JPanel();
        insidePanel.setLayout(new GridBagLayout());
        preview = new JTableHeader();
        Sortables[] sortables = MainFrame.getInstance().getAvailableSortables();
        preview.setColumnModel(new SorterTableColumnModel(sortables));

        for (Sortables s : sortables) {
            if (s != Sortables.DIVIDER) {
                checkBoxSortList.add(new SortableCheckBox(s));
            }
        }

        setSorterCheckBoxes();

        GridBagConstraints gbc = new GridBagConstraints();
        gbc.fill = GridBagConstraints.BOTH;
        gbc.gridx = 1;
        gbc.insets = new Insets(2,5,2,5);
        insidePanel.add(new JLabel("<html><h2>1. Choose bug properties"), gbc);
        insidePanel.add(new CheckBoxList<>(checkBoxSortList.toArray(new JCheckBox[checkBoxSortList.size()])), gbc);

        JTable t = new JTable(new DefaultTableModel(0, sortables.length));
        t.setTableHeader(preview);
        preview.setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
        insidePanel.add(new JLabel("<html><h2>2. Drag and drop to change grouping priority"), gbc);
        insidePanel.add(createAppropriatelySizedScrollPane(t), gbc);

        sortApply = new JButton(edu.umd.cs.findbugs.L10N.getLocalString("dlg.apply_btn", "Apply"));
        sortApply.addActionListener(e -> {
            MainFrame.getInstance().getSorter().createFrom((SorterTableColumnModel) preview.getColumnModel());
            ((BugTreeModel) MainFrame.getInstance().getTree().getModel()).checkSorter();
            SorterDialog.this.dispose();
        });
        gbc.fill = GridBagConstraints.NONE;
        insidePanel.add(sortApply, gbc);

        JPanel sorter = new JPanel();
        sorter.setLayout(new BorderLayout());
        sorter.add(new JScrollPane(insidePanel), BorderLayout.CENTER);

        return sorter;
    }
1244016
private JComponent createControls()
    {
        JPanel controls = new JPanel(new FlowLayout(FlowLayout.RIGHT));
        JButton gcButton = new JButton("Request GC");
        gcButton.setToolTipText("Perform garbage collection (the JVM may ignore this request).");
        gcButton.addActionListener(new ActionListener()
        {
            public void actionPerformed(ActionEvent ev)
            {
                memoryBean.gc();
            }
        });
        controls.add(gcButton);
        return controls;
    }
1317882
private static void createAndShowGUI() {
        //Create and set up the window.
        JFrame frame = new JFrame("TableFilterDemo");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        //Create and set up the content pane.
        TableFilterDemo newContentPane = new TableFilterDemo();
        newContentPane.setOpaque(true); //content panes must be opaque
        frame.setContentPane(newContentPane);

        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }
806902
private void initComponents()
    {
        ClassLoader cl = this.getClass().getClassLoader();

        this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));

        monthPanel = new JPanel();
        monthPanel.setName("monthPanel");
        monthPanel.setLayout (new BoxLayout(monthPanel, BoxLayout.X_AXIS));
        previousMonthButton = new JButton();
        previousMonthButton.setName("previousMonthButton");
        monthLabel = new JLabel();
        monthLabel.setName("monthLabel");
        try   {
            Icon icon  = new ImageIcon(cl.getResource("org/jbundle/util/jcalendarbutton/images/buttons/" + "Back" + ".gif"));
            previousMonthButton.setIcon(icon);
        } catch (Exception ex)  {
            previousMonthButton.setText("<");
        }
        previousMonthButton.setMargin(new Insets(2, 2, 2, 2));
        previousMonthButton.addActionListener(new ActionListener () {
            public void actionPerformed (ActionEvent evt) {
                prevMonthActionPerformed (evt);
            }
        }
        );
        monthPanel.add(previousMonthButton);
        monthPanel.add(Box.createHorizontalGlue());
        monthLabel.setText ("month");
        monthLabel.setHorizontalAlignment (SwingConstants.CENTER);
        monthPanel.add (monthLabel);

        nextMonthButton = new JButton();
        nextMonthButton.setName("nextMonthButton");
        nextMonthButton.setAlignmentX (1.0F);
        try   {
            Icon icon  = new ImageIcon(cl.getResource("org/jbundle/util/jcalendarbutton/images/buttons/" + "Forward" + ".gif"));
            nextMonthButton.setIcon(icon);
        } catch (Exception ex)  {
            nextMonthButton.setText(">");
        }
        nextMonthButton.setMargin (new Insets(2, 2, 2, 2));
        nextMonthButton.addActionListener (new ActionListener () {
            public void actionPerformed (ActionEvent evt) {
                nextMonthActionPerformed (evt);
            }
        }
        );
        monthPanel.add(Box.createHorizontalGlue());
        monthPanel.add (nextMonthButton);
        add (monthPanel);

        yearPanel = new JPanel();
        yearPanel.setName("yearPanel");
        yearPanel.setLayout (new BoxLayout (yearPanel, BoxLayout.X_AXIS));
        previousYearButton = new JButton();
        previousYearButton.setName("previousYearButton");
        yearLabel = new JLabel();
        yearLabel.setName("yearLabel");
        try   {
            Icon icon  = new ImageIcon(cl.getResource("org/jbundle/util/jcalendarbutton/images/buttons/" + "Back" + ".gif"));
            previousYearButton.setIcon(icon);
        } catch (Exception ex)  {
            previousYearButton.setText("<");
        }
        previousYearButton.setMargin (new Insets(2, 2, 2, 2));
        previousYearButton.addActionListener (new ActionListener () {
            public void actionPerformed (ActionEvent evt) {
                prevYearActionPerformed (evt);
            }
        }
        );
        yearPanel.add (previousYearButton);
        yearPanel.add(Box.createHorizontalGlue());
        yearLabel.setText ("Year");
        yearLabel.setHorizontalAlignment (SwingConstants.CENTER);
        yearPanel.add (yearLabel);

        yearPanel.add(Box.createHorizontalGlue());
        nextYearButton = new JButton();
        nextYearButton.setName("nextYearButton");
        nextYearButton.setAlignmentX (1.0F);
        try   {
            Icon icon  = new ImageIcon(cl.getResource("org/jbundle/util/jcalendarbutton/images/buttons/" + "Forward" + ".gif"));
            nextYearButton.setIcon(icon);
        } catch (Exception ex)  {
            nextYearButton.setText(">");
        }
        nextYearButton.setMargin (new Insets(2, 2, 2, 2));
        nextYearButton.addActionListener (new ActionListener () {
            public void actionPerformed (ActionEvent evt) {
                nextYearActionPerformed (evt);
            }
        }
        );
        yearPanel.add (nextYearButton);
        add (yearPanel);

        panelDays = new JPanel();
        panelDays.setName("panelDays");
        panelDays.setLayout (new GridLayout (7, 7));
        for (int i = 1; i <= 7; i++)
        {
            JLabel label = new JLabel();
            label.setText(Integer.toString(i));
            label.setHorizontalAlignment(SwingConstants.CENTER);
            panelDays.add(label);
        }

        for (int i = 1; i <= 7 * 6; i++)
        {
            JLabel label = new JLabel();
            label.setBorder(EMPTY_BORDER);
            label.setHorizontalAlignment(SwingConstants.CENTER);
            panelDays.add(label);
        }

        add (panelDays);
        
        this.setBorder(new EmptyBorder(2, 2, 2, 2));
    }
106280
def CreateControls(self, config_parser):
        """"""
        self.CreateMenuBar()
        self.SetupToolBar()
        self.CreateStatusBar()
        self.leftSplitter = wx.SplitterWindow(
            self
        )
        self.rightSplitter = wx.SplitterWindow(
            self.leftSplitter
        )
        self.listControl = listviews.DataView(
            self.leftSplitter,
            columns = PROFILE_VIEW_COLUMNS,
            name='mainlist',
        )
        self.squareMap = squaremap.SquareMap(
            self.rightSplitter,
            padding = 6,
            labels = True,
            adapter = self.adapter,
            square_style = True,
        )
        self.tabs = wx.Notebook(
            self.rightSplitter,
        )

        self.CreateSourceWindow(self.tabs)
        
        self.calleeListControl = listviews.DataView(
            self.tabs,
            columns = PROFILE_VIEW_COLUMNS,
            name='callee',
        )
        self.allCalleeListControl = listviews.DataView(
            self.tabs,
            columns = PROFILE_VIEW_COLUMNS,
            name='allcallee',
        )
        self.allCallerListControl = listviews.DataView(
            self.tabs,
            columns = PROFILE_VIEW_COLUMNS,
            name='allcaller',
        )
        self.callerListControl = listviews.DataView(
            self.tabs,
            columns = PROFILE_VIEW_COLUMNS,
            name='caller',
        )
        self.ProfileListControls = [
            self.listControl,
            self.calleeListControl,
            self.allCalleeListControl,
            self.callerListControl,
            self.allCallerListControl,
        ]
        self.tabs.AddPage(self.calleeListControl, _('Callees'), True)
        self.tabs.AddPage(self.allCalleeListControl, _('All Callees'), False)
        self.tabs.AddPage(self.callerListControl, _('Callers'), False)
        self.tabs.AddPage(self.allCallerListControl, _('All Callers'), False)
        if editor:
            self.tabs.AddPage(self.sourceCodeControl, _('Source Code'), False)
        self.rightSplitter.SetSashSize(10)
        # calculate size as proportional value for initial display...
        self.LoadState( config_parser )
        width, height = self.GetSizeTuple()
        rightsplit = 2 * (height // 3)
        leftsplit = width // 3
        self.rightSplitter.SplitHorizontally(self.squareMap, self.tabs,
                                             rightsplit)
        self.leftSplitter.SplitVertically(self.listControl, self.rightSplitter,
                                          leftsplit)
        squaremap.EVT_SQUARE_HIGHLIGHTED(self.squareMap,
                                         self.OnSquareHighlightedMap)
        squaremap.EVT_SQUARE_SELECTED(self.listControl,
                                      self.OnSquareSelectedList)
        squaremap.EVT_SQUARE_SELECTED(self.squareMap, self.OnSquareSelectedMap)
        squaremap.EVT_SQUARE_ACTIVATED(self.squareMap, self.OnNodeActivated)
        for control in self.ProfileListControls:
            squaremap.EVT_SQUARE_ACTIVATED(control, self.OnNodeActivated)
            squaremap.EVT_SQUARE_HIGHLIGHTED(control,
                                             self.OnSquareHighlightedList)
        self.moreSquareViewItem.Check(self.squareMap.square_style)
526861
public Control createControl(Composite parent) {
		this.control = SWTFactory.createComposite(
				parent, parent.getFont(), 1, 1, GridData.FILL_HORIZONTAL);

		final int nbColumns = this.enableSystemWideSelector ? 3 : 2;
		final Group group = SWTFactory.createGroup(this.control,
				MoreObjects.firstNonNull(this.title, Messages.SREConfigurationBlock_7),
				nbColumns, 1, GridData.FILL_HORIZONTAL);

		if (this.enableSystemWideSelector || !this.projectProviderFactories.isEmpty()) {
			createSystemWideSelector(group);
			createProjectSelector(group);
			this.specificSREButton = SWTFactory.createRadioButton(group,
					Messages.SREConfigurationBlock_2, 1);
			this.specificSREButton.addSelectionListener(new SelectionAdapter() {
				@SuppressWarnings("synthetic-access")
				@Override
				public void widgetSelected(SelectionEvent event) {
					if (SREConfigurationBlock.this.specificSREButton.getSelection()) {
						handleSpecificConfigurationSelected();
					}
				}
			});
		} else {
			this.systemSREButton = null;
			this.projectSREButton = null;
			this.specificSREButton = null;
		}

		createSRESelector(group);

		return getControl();
	}