Example usage for javax.swing JSeparator JSeparator

List of usage examples for javax.swing JSeparator JSeparator

Introduction

In this page you can find the example usage for javax.swing JSeparator JSeparator.

Prototype

public JSeparator() 

Source Link

Document

Creates a new horizontal separator.

Usage

From source file:net.sf.mzmine.modules.peaklistmethods.peakpicking.adap3decompositionV1_5.ADAP3DecompositionV1_5SetupDialog.java

@Override
protected void addDialogComponents() {
    super.addDialogComponents();

    comboPeakList = new JComboBox<>();
    comboClustersModel = new DefaultComboBoxModel<>();
    comboClusters = new JComboBox<>(comboClustersModel);
    retTimeMZPlot = new SimpleScatterPlot("Retention time", "m/z");
    retTimeIntensityPlot = new EICPlot();

    PeakList[] peakLists = MZmineCore.getDesktop().getSelectedPeakLists();

    // -----------------------------
    // Panel with preview parameters
    // -----------------------------

    preview = new JCheckBox("Show preview");
    preview.addActionListener(this);
    preview.setHorizontalAlignment(SwingConstants.CENTER);

    if (peakLists == null || peakLists.length == 0)
        preview.setEnabled(false);/*from   www  .  j a v a2 s  . c om*/
    else
        preview.setEnabled(true);

    final JPanel previewPanel = new JPanel(new BorderLayout());
    previewPanel.add(new JSeparator(), BorderLayout.NORTH);
    previewPanel.add(preview, BorderLayout.CENTER);
    previewPanel.add(Box.createVerticalStrut(10), BorderLayout.SOUTH);

    comboPeakList.setFont(COMBO_FONT);
    for (final PeakList peakList : peakLists)
        if (peakList.getNumberOfRawDataFiles() == 1)
            comboPeakList.addItem(peakList);
    comboPeakList.addActionListener(this);

    comboClusters.setFont(COMBO_FONT);
    comboClusters.addActionListener(this);

    pnlLabelsFields = GUIUtils.makeTablePanel(2, 2, new JComponent[] { new JLabel("Peak list"), comboPeakList,
            new JLabel("Cluster list"), comboClusters });

    pnlVisible = new JPanel(new BorderLayout());
    pnlVisible.add(previewPanel, BorderLayout.NORTH);

    // --------------------------------------------------------------------
    // ----- Tabbed panel with plots --------------------------------------
    // --------------------------------------------------------------------

    //        pnlTabs = new JTabbedPane();
    pnlTabs = new JPanel();
    pnlTabs.setLayout(new BoxLayout(pnlTabs, BoxLayout.Y_AXIS));

    retTimeMZPlot.setMinimumSize(MIN_DIMENSIONS);

    JPanel pnlPlotRetTimeClusters = new JPanel(new BorderLayout());
    pnlPlotRetTimeClusters.setBackground(Color.white);
    pnlPlotRetTimeClusters.add(retTimeMZPlot, BorderLayout.CENTER);
    GUIUtils.addMarginAndBorder(pnlPlotRetTimeClusters, 10);

    pnlTabs.add(pnlPlotRetTimeClusters);

    retTimeIntensityPlot.setMinimumSize(MIN_DIMENSIONS);

    JPanel pnlPlotShapeClusters = new JPanel(new BorderLayout());
    pnlPlotShapeClusters.setBackground(Color.white);
    pnlPlotShapeClusters.add(retTimeIntensityPlot, BorderLayout.CENTER);
    GUIUtils.addMarginAndBorder(pnlPlotShapeClusters, 10);

    pnlTabs.add(pnlPlotShapeClusters);

    super.mainPanel.add(pnlVisible, 0, super.getNumberOfParameters() + 3, 2, 1, 0, 0,
            GridBagConstraints.HORIZONTAL);
}

From source file:com.stonelion.zooviewer.ui.JZVNodePanel.java

/**
 * Returns the main node panel./*from  ww  w  .j a va  2 s  .  co m*/
 *
 * @return the panel
 */
private void initUI() {

    // TOP;
    JPanel top = new JPanel();
    top.setLayout(new VerticalFlowLayout(VerticalFlowLayout.FILL));
    top.setBorder(BorderFactory.createEmptyBorder(10, 5, 5, 10));
    // Top node path.
    AlignmentGridPanel pathPanel = new AlignmentGridPanel();
    pathText.setEditable(false);
    pathPanel.addLine(new Component[] { new JLabel("Path: "), pathText });

    // Top buttons
    CButtonPane topButtons = new CButtonPane(CButtonPane.HORIZONTAL, CButtonPane.HEAD);
    topButtons.add(jbDelete);
    topButtons.add(jbNewChild);
    topButtons.add(jbUpdate);
    topButtons.add(jbRefresh);

    topButtons.add(jbEnableEdit, CButtonPane.TAIL);
    top.add(pathPanel);
    top.add(new JSeparator());
    top.add(this.jzvStat);
    top.add(new JSeparator());
    top.add(topButtons);
    //top.add(new JSeparator());

    // Center.
    JPanel center = new JPanel(new BorderLayout(5, 5));
    center.add(new RTextScrollPane(this.taUpdate), "Center");

    center.setBorder(BorderFactory.createEmptyBorder(0, 10, 10, 10));

    this.add(top, "North");
    this.add(center, "Center");
}

From source file:cool.pandora.modeller.ui.jpanel.base.NewBagInPlaceFrame.java

/**
 * createComponents.//w  ww.j  a va  2s  .co  m
 *
 * @return pageControl
 */
private JPanel createComponents() {

    final TitlePane titlePane = new TitlePane();
    initStandardCommands();
    final JPanel pageControl = new JPanel(new BorderLayout());
    final JPanel titlePaneContainer = new JPanel(new BorderLayout());
    titlePane.setTitle(bagView.getPropertyMessage("NewBagInPlace.title"));
    titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("NewBagInPlace" + ".description")));
    titlePaneContainer.add(titlePane.getControl());
    titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH);
    pageControl.add(titlePaneContainer, BorderLayout.NORTH);

    final JPanel contentPanel = new JPanel(new GridBagLayout());
    contentPanel.setBorder(new EmptyBorder(10, 10, 10, 10));

    int row = 0;
    layoutSelectDataContent(contentPanel, row++);
    layoutProfileSelectionContent(contentPanel, row++);
    layoutAddKeepFilesToEmptyCheckBox(contentPanel, row++);
    layoutSpacer(contentPanel, row++);

    GuiStandardUtils.attachDialogBorder(contentPanel);
    pageControl.add(contentPanel);
    final JComponent buttonBar = createButtonBar();
    pageControl.add(buttonBar, BorderLayout.SOUTH);

    this.pack();
    return pageControl;

}

From source file:org.esa.snap.rcp.statistics.StatisticsPanel.java

@Override
protected void initComponents() {
    init = true;/*from w ww  .  jav  a  2  s .  c o m*/

    computePanel = new MultipleRoiComputePanel(this, getRaster());
    exportButton = getExportButton();

    final JPanel exportAndHelpPanel = GridBagUtils.createPanel();
    GridBagConstraints helpPanelConstraints = GridBagUtils
            .createConstraints("anchor=NORTHWEST,fill=HORIZONTAL,insets.top=2,weightx=1,ipadx=0");
    GridBagUtils.addToPanel(exportAndHelpPanel, new JSeparator(), helpPanelConstraints,
            "fill=HORIZONTAL,gridwidth=2,insets.left=5,insets.right=5");
    GridBagUtils.addToPanel(exportAndHelpPanel, exportButton, helpPanelConstraints,
            "gridy=1,anchor=WEST,fill=NONE");
    GridBagUtils.addToPanel(exportAndHelpPanel, getHelpButton(), helpPanelConstraints,
            "gridx=1,gridy=1,anchor=EAST,fill=NONE");

    final JPanel rightPanel = GridBagUtils.createPanel();
    GridBagConstraints extendedOptionsPanelConstraints = GridBagUtils
            .createConstraints("anchor=NORTHWEST,fill=HORIZONTAL,insets.top=2,weightx=1,insets.right=-2");
    GridBagUtils.addToPanel(rightPanel, computePanel, extendedOptionsPanelConstraints,
            "gridy=0,fill=BOTH,weighty=1");
    GridBagUtils.addToPanel(rightPanel, createAccuracyPanel(), extendedOptionsPanelConstraints,
            "gridy=1,fill=BOTH,weighty=1");
    GridBagUtils.addToPanel(rightPanel, exportAndHelpPanel, extendedOptionsPanelConstraints,
            "gridy=2,anchor=SOUTHWEST,fill=HORIZONTAL,weighty=0");

    final ImageIcon collapseIcon = UIUtils.loadImageIcon("icons/PanelRight12.png");
    final ImageIcon collapseRolloverIcon = ToolButtonFactory.createRolloverIcon(collapseIcon);
    final ImageIcon expandIcon = UIUtils.loadImageIcon("icons/PanelLeft12.png");
    final ImageIcon expandRolloverIcon = ToolButtonFactory.createRolloverIcon(expandIcon);

    hideAndShowButton = ToolButtonFactory.createButton(collapseIcon, false);
    hideAndShowButton.setToolTipText("Collapse Options Panel");
    hideAndShowButton.setName("switchToChartButton");
    hideAndShowButton.addActionListener(new ActionListener() {

        public boolean rightPanelShown;

        @Override
        public void actionPerformed(ActionEvent e) {
            rightPanel.setVisible(rightPanelShown);
            if (rightPanelShown) {
                hideAndShowButton.setIcon(collapseIcon);
                hideAndShowButton.setRolloverIcon(collapseRolloverIcon);
                hideAndShowButton.setToolTipText("Collapse Options Panel");
            } else {
                hideAndShowButton.setIcon(expandIcon);
                hideAndShowButton.setRolloverIcon(expandRolloverIcon);
                hideAndShowButton.setToolTipText("Expand Options Panel");
            }
            rightPanelShown = !rightPanelShown;
        }
    });

    contentPanel = new JPanel(new GridLayout(-1, 1));
    contentPanel.setBackground(Color.WHITE);
    contentPanel.addMouseListener(popupHandler);

    final JScrollPane contentScrollPane = new JScrollPane(contentPanel);
    contentScrollPane.setBorder(null);
    contentScrollPane.setBackground(Color.WHITE);

    backgroundPanel = new JPanel(new GridBagLayout());
    GridBagConstraints gbc = new GridBagConstraints();
    GridBagUtils.addToPanel(backgroundPanel, contentScrollPane, gbc,
            "fill=BOTH, weightx=1.0, weighty=1.0, anchor=NORTH");
    GridBagUtils.addToPanel(backgroundPanel, rightPanel, gbc, "gridx=1, fill=VERTICAL, weightx=0.0");

    JLayeredPane layeredPane = new JLayeredPane();
    layeredPane.add(backgroundPanel);
    layeredPane.add(hideAndShowButton);
    add(layeredPane);
}

From source file:com.floreantpos.config.ui.DatabaseConfigurationDialog.java

protected void initUI() {
    getContentPane().setLayout(new MigLayout("fill", "[][fill, grow]", "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    titlePanel = new TitlePanel();
    tfServerAddress = new POSTextField();
    tfServerPort = new POSTextField();
    tfDatabaseName = new POSTextField();
    tfUserName = new POSTextField();
    tfPassword = new POSPasswordField();
    databaseCombo = new JComboBox(Database.values());

    String databaseProviderName = AppConfig.getDatabaseProviderName();
    if (StringUtils.isNotEmpty(databaseProviderName)) {
        databaseCombo.setSelectedItem(Database.getByProviderName(databaseProviderName));
    }//from  w  w  w  .j  a  v  a2 s  .  co  m

    getContentPane().add(titlePanel, "span, grow, wrap"); //$NON-NLS-1$

    getContentPane().add(new JLabel(Messages.getString("DatabaseConfigurationDialog.8"))); //$NON-NLS-1$
    getContentPane().add(databaseCombo, "grow, wrap"); //$NON-NLS-1$
    lblServerAddress = new JLabel(Messages.getString("DatabaseConfigurationDialog.10") + ":"); //$NON-NLS-1$ //$NON-NLS-2$
    getContentPane().add(lblServerAddress);
    getContentPane().add(tfServerAddress, "grow, wrap"); //$NON-NLS-1$
    lblServerPort = new JLabel(Messages.getString("DatabaseConfigurationDialog.13") + ":"); //$NON-NLS-1$ //$NON-NLS-2$
    getContentPane().add(lblServerPort);
    getContentPane().add(tfServerPort, "grow, wrap"); //$NON-NLS-1$
    lblDbName = new JLabel(Messages.getString("DatabaseConfigurationDialog.16") + ":"); //$NON-NLS-1$ //$NON-NLS-2$
    getContentPane().add(lblDbName);
    getContentPane().add(tfDatabaseName, "grow, wrap"); //$NON-NLS-1$
    lblUserName = new JLabel(Messages.getString("DatabaseConfigurationDialog.19") + ":"); //$NON-NLS-1$ //$NON-NLS-2$
    getContentPane().add(lblUserName);
    getContentPane().add(tfUserName, "grow, wrap"); //$NON-NLS-1$
    lblDbPassword = new JLabel(Messages.getString("DatabaseConfigurationDialog.22") + ":"); //$NON-NLS-1$ //$NON-NLS-2$
    getContentPane().add(lblDbPassword);
    getContentPane().add(tfPassword, "grow, wrap"); //$NON-NLS-1$
    getContentPane().add(new JSeparator(), "span, grow, gaptop 10"); //$NON-NLS-1$

    btnTestConnection = new PosButton(Messages.getString("DatabaseConfigurationDialog.26").toUpperCase()); //$NON-NLS-1$
    btnTestConnection.setActionCommand(TEST);
    btnSave = new PosButton(Messages.getString("DatabaseConfigurationDialog.27").toUpperCase()); //$NON-NLS-1$
    btnSave.setActionCommand(SAVE);
    btnExit = new PosButton(Messages.getString("DatabaseConfigurationDialog.28").toUpperCase()); //$NON-NLS-1$
    btnExit.setActionCommand(CANCEL);

    JPanel buttonPanel = new JPanel(new MigLayout("inset 0, fill", "grow", "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    btnCreateDb = new PosButton(Messages.getString("DatabaseConfigurationDialog.29").toUpperCase()); //$NON-NLS-1$
    btnCreateDb.setActionCommand(CREATE_DATABASE);

    btnUpdateDb = new PosButton(Messages.getString("UPDATE_DATABASE").toUpperCase()); //$NON-NLS-1$
    btnUpdateDb.setActionCommand(UPDATE_DATABASE);

    buttonPanel.add(btnUpdateDb);
    buttonPanel.add(btnCreateDb);
    buttonPanel.add(btnTestConnection);
    buttonPanel.add(btnSave);
    buttonPanel.add(btnExit);

    getContentPane().add(buttonPanel, "span, grow"); //$NON-NLS-1$
}

From source file:com.mirth.connect.manager.HeapSizeDialog.java

private void initLayout() {
    setLayout(new MigLayout("insets 8, novisualpadding, hidemode 3, fill"));
    JPanel panel = new JPanel(new MigLayout("insets 4, novisualpadding, hidemode 3, fill"));
    panel.setBackground(Color.white);
    panel.setBorder(BorderFactory.createTitledBorder(
            BorderFactory.createMatteBorder(1, 1, 1, 1, new Color(204, 204, 204)), "Web Start Settings",
            TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, new Font("Tahoma", 1, 11)));

    panel.add(new JLabel("Max Heap Size:"), "split");
    panel.add(heapSizeComboBox, "w 75!, left, wrap");

    panel.add(warningLabel, "split");

    add(panel);//from w  ww  .j a v  a  2 s . co  m
    add(new JSeparator(), "newline, growx, sx");
    add(okButton, "newline, h 22!, w 56!, sx, right, split");
    add(cancelButton, "h 22!, w 56!");
}

From source file:gov.loc.repository.bagger.ui.SaveBagFrame.java

private JPanel createComponents() {
    Border border = new EmptyBorder(5, 5, 5, 5);

    TitlePane titlePane = new TitlePane();
    initStandardCommands();/*from   w  w  w . j  ava 2 s .  c om*/
    JPanel pageControl = new JPanel(new BorderLayout());
    JPanel titlePaneContainer = new JPanel(new BorderLayout());
    titlePane.setTitle(bagView.getPropertyMessage("SaveBagFrame.title"));
    titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Define the Bag settings")));
    titlePaneContainer.add(titlePane.getControl());
    titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH);
    pageControl.add(titlePaneContainer, BorderLayout.NORTH);
    JPanel contentPane = new JPanel();

    // TODO: Add bag name field
    // TODO: Add save name file selection button
    JLabel location = new JLabel("Save in:");
    browseButton = new JButton(getMessage("bag.button.browse"));
    browseButton.addActionListener(new SaveBagAsHandler());
    browseButton.setEnabled(true);
    browseButton.setToolTipText(getMessage("bag.button.browse.help"));
    String fileName = "";
    DefaultBag bag = bagView.getBag();
    if (bag != null) {
        fileName = bag.getName();
    }
    bagNameField = new JTextField(fileName);
    bagNameField.setCaretPosition(fileName.length());
    bagNameField.setEditable(false);
    bagNameField.setEnabled(false);

    // Holey bag control
    JLabel holeyLabel = new JLabel(bagView.getPropertyMessage("bag.label.isholey"));
    holeyLabel.setToolTipText(bagView.getPropertyMessage("bag.isholey.help"));
    holeyCheckbox = new JCheckBox(bagView.getPropertyMessage("bag.checkbox.isholey"));
    holeyCheckbox.setBorder(border);
    holeyCheckbox.setSelected(bag.isHoley());
    holeyCheckbox.addActionListener(new HoleyBagHandler());
    holeyCheckbox.setToolTipText(bagView.getPropertyMessage("bag.isholey.help"));

    urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label"));
    urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description"));
    urlLabel.setEnabled(bag.isHoley());
    urlField = new JTextField("");
    try {
        urlField.setText(bag.getFetch().getBaseURL());
    } catch (Exception e) {
        log.error("fetch baseURL: " + e.getMessage());
    }
    urlField.setEnabled(false);

    // TODO: Add format label
    JLabel serializeLabel;
    serializeLabel = new JLabel(getMessage("bag.label.ispackage"));
    serializeLabel.setToolTipText(getMessage("bag.serializetype.help"));

    // TODO: Add format selection panel
    noneButton = new JRadioButton(getMessage("bag.serializetype.none"));
    noneButton.setEnabled(true);
    AbstractAction serializeListener = new SerializeBagHandler();
    noneButton.addActionListener(serializeListener);
    noneButton.setToolTipText(getMessage("bag.serializetype.none.help"));

    zipButton = new JRadioButton(getMessage("bag.serializetype.zip"));
    zipButton.setEnabled(true);
    zipButton.addActionListener(serializeListener);
    zipButton.setToolTipText(getMessage("bag.serializetype.zip.help"));

    /*
    tarButton = new JRadioButton(getMessage("bag.serializetype.tar"));
    tarButton.setEnabled(true);
    tarButton.addActionListener(serializeListener);
    tarButton.setToolTipText(getMessage("bag.serializetype.tar.help"));
            
    tarGzButton = new JRadioButton(getMessage("bag.serializetype.targz"));
    tarGzButton.setEnabled(true);
    tarGzButton.addActionListener(serializeListener);
    tarGzButton.setToolTipText(getMessage("bag.serializetype.targz.help"));
            
    tarBz2Button = new JRadioButton(getMessage("bag.serializetype.tarbz2"));
    tarBz2Button.setEnabled(true);
    tarBz2Button.addActionListener(serializeListener);
    tarBz2Button.setToolTipText(getMessage("bag.serializetype.tarbz2.help"));
    */

    short mode = bag.getSerialMode();
    if (mode == DefaultBag.NO_MODE) {
        this.noneButton.setEnabled(true);
    } else if (mode == DefaultBag.ZIP_MODE) {
        this.zipButton.setEnabled(true);
    } /*else if (mode == DefaultBag.TAR_MODE) {
       this.tarButton.setEnabled(true);
      } else if (mode == DefaultBag.TAR_GZ_MODE) {
       this.tarGzButton.setEnabled(true);
      } else if (mode == DefaultBag.TAR_BZ2_MODE) {
       this.tarBz2Button.setEnabled(true);
      } */else {
        this.noneButton.setEnabled(true);
    }

    ButtonGroup serializeGroup = new ButtonGroup();
    serializeGroup.add(noneButton);
    serializeGroup.add(zipButton);
    //serializeGroup.add(tarButton);
    //serializeGroup.add(tarGzButton);
    //serializeGroup.add(tarBz2Button);
    serializeGroupPanel = new JPanel(new FlowLayout());
    serializeGroupPanel.add(serializeLabel);
    serializeGroupPanel.add(noneButton);
    serializeGroupPanel.add(zipButton);
    //serializeGroupPanel.add(tarButton);
    //serializeGroupPanel.add(tarGzButton);
    //serializeGroupPanel.add(tarBz2Button);
    serializeGroupPanel.setBorder(border);
    serializeGroupPanel.setEnabled(true);
    serializeGroupPanel.setToolTipText(bagView.getPropertyMessage("bag.serializetype.help"));

    JLabel tagLabel = new JLabel(getMessage("bag.label.istag"));
    tagLabel.setToolTipText(getMessage("bag.label.istag.help"));
    isTagCheckbox = new JCheckBox();
    isTagCheckbox.setBorder(border);
    isTagCheckbox.setSelected(bag.isBuildTagManifest());
    isTagCheckbox.addActionListener(new TagManifestHandler());
    isTagCheckbox.setToolTipText(getMessage("bag.checkbox.istag.help"));

    JLabel tagAlgorithmLabel = new JLabel(getMessage("bag.label.tagalgorithm"));
    tagAlgorithmLabel.setToolTipText(getMessage("bag.label.tagalgorithm.help"));
    ArrayList<String> listModel = new ArrayList<String>();
    for (Algorithm algorithm : Algorithm.values()) {
        listModel.add(algorithm.bagItAlgorithm);
    }
    tagAlgorithmList = new JComboBox(listModel.toArray());
    tagAlgorithmList.setName(getMessage("bag.tagalgorithmlist"));
    tagAlgorithmList.setSelectedItem(bag.getTagManifestAlgorithm());
    tagAlgorithmList.addActionListener(new TagAlgorithmListHandler());
    tagAlgorithmList.setToolTipText(getMessage("bag.tagalgorithmlist.help"));

    JLabel payloadLabel = new JLabel(getMessage("bag.label.ispayload"));
    payloadLabel.setToolTipText(getMessage("bag.ispayload.help"));
    isPayloadCheckbox = new JCheckBox();
    isPayloadCheckbox.setBorder(border);
    isPayloadCheckbox.setSelected(bag.isBuildPayloadManifest());
    isPayloadCheckbox.addActionListener(new PayloadManifestHandler());
    isPayloadCheckbox.setToolTipText(getMessage("bag.ispayload.help"));

    JLabel payAlgorithmLabel = new JLabel(bagView.getPropertyMessage("bag.label.payalgorithm"));
    payAlgorithmLabel.setToolTipText(getMessage("bag.payalgorithm.help"));
    payAlgorithmList = new JComboBox(listModel.toArray());
    payAlgorithmList.setName(getMessage("bag.payalgorithmlist"));
    payAlgorithmList.setSelectedItem(bag.getPayloadManifestAlgorithm());
    payAlgorithmList.addActionListener(new PayAlgorithmListHandler());
    payAlgorithmList.setToolTipText(getMessage("bag.payalgorithmlist.help"));

    GridBagLayout layout = new GridBagLayout();
    GridBagConstraints glbc = new GridBagConstraints();
    JPanel panel = new JPanel(layout);
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));

    int row = 0;

    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(location, glbc);
    panel.add(location);

    buildConstraints(glbc, 2, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.EAST);
    glbc.ipadx = 5;
    layout.setConstraints(browseButton, glbc);
    glbc.ipadx = 0;
    panel.add(browseButton);

    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
    glbc.ipadx = 5;
    layout.setConstraints(bagNameField, glbc);
    glbc.ipadx = 0;
    panel.add(bagNameField);

    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(holeyLabel, glbc);
    panel.add(holeyLabel);
    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.WEST, GridBagConstraints.WEST);
    layout.setConstraints(holeyCheckbox, glbc);
    panel.add(holeyCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(urlLabel, glbc);
    panel.add(urlLabel);
    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(urlField, glbc);
    panel.add(urlField);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(serializeLabel, glbc);
    panel.add(serializeLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.WEST);
    layout.setConstraints(serializeGroupPanel, glbc);
    panel.add(serializeGroupPanel);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(tagLabel, glbc);
    panel.add(tagLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(isTagCheckbox, glbc);
    panel.add(isTagCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(tagAlgorithmLabel, glbc);
    panel.add(tagAlgorithmLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(tagAlgorithmList, glbc);
    panel.add(tagAlgorithmList);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(payloadLabel, glbc);
    panel.add(payloadLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(isPayloadCheckbox, glbc);
    panel.add(isPayloadCheckbox);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(payAlgorithmLabel, glbc);
    panel.add(payAlgorithmLabel);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(payAlgorithmList, glbc);
    panel.add(payAlgorithmList);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);

    GuiStandardUtils.attachDialogBorder(contentPane);
    pageControl.add(panel);
    JComponent buttonBar = createButtonBar();
    pageControl.add(buttonBar, BorderLayout.SOUTH);

    this.pack();
    return pageControl;

}

From source file:flexflux.analyses.result.TDRFBAResult.java

public void plot() {

    JPanel panel = new JPanel();
    JScrollPane sp = new JScrollPane(panel);
    panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));

    // one chart by entity

    Color[] colors = new Color[] { Color.RED, Color.GREEN, Color.BLUE };
    int index = 0;
    for (String s : entities) {

        XYSeriesCollection dataset = new XYSeriesCollection();

        XYSeries series = new XYSeries(s);

        for (Double time : times) {
            series.add(time, resultMap.get(time).get(s));
        }//  ww w .j  av  a 2s.  co m

        final JFreeChart chart = ChartFactory.createXYLineChart(s, // chart
                // title
                "Time (h)", // domain axis label
                "Value", // range axis label
                dataset, // data
                PlotOrientation.VERTICAL, // orientation
                true, // include legend
                true, // tooltips
                false // urls
        );

        chart.setBackgroundPaint(Color.white);

        XYPlot plot = (XYPlot) chart.getPlot();

        plot.setBackgroundPaint(Color.WHITE);
        plot.setRangeGridlinePaint(Color.GRAY);
        plot.setDomainGridlinePaint(Color.GRAY);

        plot.getRenderer().setSeriesPaint(0, colors[index % colors.length]);

        index++;

        ChartPanel chartPanel = new ChartPanel(chart);

        dataset.addSeries(series);

        panel.add(chartPanel);
        panel.add(new JSeparator());

    }

    Dimension d = panel.getComponent(0).getPreferredSize();
    d.height *= 2;

    sp.getViewport().setPreferredSize(d);

    JFrame frame = new JFrame("Time-dependant FBA results");

    frame.add(sp);
    frame.pack();
    RefineryUtilities.centerFrameOnScreen(frame);
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    frame.setVisible(true);

}

From source file:cool.pandora.modeller.ui.jpanel.iiif.PatchCanvasFrame.java

private JPanel createComponents() {
    final Border border = new EmptyBorder(5, 5, 5, 5);

    final TitlePane titlePane = new TitlePane();
    initStandardCommands();/* w  ww  .j  ava 2  s  .c  o m*/
    final JPanel pageControl = new JPanel(new BorderLayout());
    final JPanel titlePaneContainer = new JPanel(new BorderLayout());
    titlePane.setTitle(bagView.getPropertyMessage("PatchCanvasFrame.title"));
    titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Patch Canvases")));
    titlePaneContainer.add(titlePane.getControl());
    titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH);
    pageControl.add(titlePaneContainer, BorderLayout.NORTH);
    final JPanel contentPane = new JPanel();

    final DefaultBag bag = bagView.getBag();
    if (bag != null) {
        map = bag.getInfo().getFieldMap();
    }

    final JLabel urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label"));
    urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description"));
    final JTextField urlField = new JTextField("");
    final URI uri = IIIFObjectURI.getCanvasContainerURI(map);
    try {
        urlField.setText(uri != null ? uri.toString() : null);
    } catch (final Exception e) {
        log.error("Failed to set url label", e);
    }

    final GridBagLayout layout = new GridBagLayout();
    final GridBagConstraints glbc = new GridBagConstraints();
    final JPanel panel = new JPanel(layout);
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));

    int row = 0;

    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(urlLabel, glbc);
    panel.add(urlLabel);
    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(urlField, glbc);
    panel.add(urlField);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);

    GuiStandardUtils.attachDialogBorder(contentPane);
    pageControl.add(panel);
    final JComponent buttonBar = createButtonBar();
    pageControl.add(buttonBar, BorderLayout.SOUTH);

    this.pack();
    return pageControl;

}

From source file:cool.pandora.modeller.ui.jpanel.iiif.CreateListsFrame.java

private JPanel createComponents() {
    final Border border = new EmptyBorder(5, 5, 5, 5);

    final TitlePane titlePane = new TitlePane();
    initStandardCommands();//www.  ja  v a  2  s .c  o m
    final JPanel pageControl = new JPanel(new BorderLayout());
    final JPanel titlePaneContainer = new JPanel(new BorderLayout());
    titlePane.setTitle(bagView.getPropertyMessage("CreateListsFrame.title"));
    titlePane.setMessage(new DefaultMessage(bagView.getPropertyMessage("Create List in:")));
    titlePaneContainer.add(titlePane.getControl());
    titlePaneContainer.add(new JSeparator(), BorderLayout.SOUTH);
    pageControl.add(titlePaneContainer, BorderLayout.NORTH);
    final JPanel contentPane = new JPanel();

    final DefaultBag bag = bagView.getBag();
    if (bag != null) {
        map = bag.getInfo().getFieldMap();
    }

    final JLabel urlLabel = new JLabel(bagView.getPropertyMessage("baseURL.label"));
    urlLabel.setToolTipText(bagView.getPropertyMessage("baseURL.description"));
    final JTextField urlField = new JTextField("");
    final URI uri = IIIFObjectURI.getListContainerURI(map);
    try {
        urlField.setText(uri != null ? uri.toString() : null);
    } catch (final Exception e) {
        log.error("Failed to set url label", e);
    }

    final GridBagLayout layout = new GridBagLayout();
    final GridBagConstraints glbc = new GridBagConstraints();
    final JPanel panel = new JPanel(layout);
    panel.setBorder(new EmptyBorder(10, 10, 10, 10));

    int row = 0;

    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    layout.setConstraints(urlLabel, glbc);
    panel.add(urlLabel);
    buildConstraints(glbc, 1, row, 1, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);
    layout.setConstraints(urlField, glbc);
    panel.add(urlField);
    row++;
    buildConstraints(glbc, 0, row, 1, 1, 1, 50, GridBagConstraints.NONE, GridBagConstraints.WEST);
    buildConstraints(glbc, 1, row, 2, 1, 80, 50, GridBagConstraints.HORIZONTAL, GridBagConstraints.CENTER);

    GuiStandardUtils.attachDialogBorder(contentPane);
    pageControl.add(panel);
    final JComponent buttonBar = createButtonBar();
    pageControl.add(buttonBar, BorderLayout.SOUTH);

    this.pack();
    return pageControl;

}