Example usage for com.jgoodies.forms.layout CellConstraints xyw

List of usage examples for com.jgoodies.forms.layout CellConstraints xyw

Introduction

In this page you can find the example usage for com.jgoodies.forms.layout CellConstraints xyw.

Prototype

public CellConstraints xyw(int col, int row, int colSpan) 

Source Link

Document

Sets the column, row, width, and height; uses a height (row span) of 1 and the horizontal and vertical default alignments.

Examples:

 cc.xyw(1, 3, 7); cc.xyw(1, 3, 2); 

Usage

From source file:idontwant2see.IDontWant2SeeSettingsTab.java

License:Open Source License

public JPanel createSettingsPanel() {
    final CellConstraints cc = new CellConstraints();
    final PanelBuilder pb = new PanelBuilder(new FormLayout("5dlu,default,0dlu:grow,default,5dlu",
            "default,10dlu,default,5dlu,default,5dlu,default,5dlu,fill:default:grow,10dlu,fill:default:grow"),
            new ScrollableJPanel());

    final PanelBuilder pb2 = new PanelBuilder(
            new FormLayout("default,2dlu,default", "default,1dlu,default,default"));

    mSimpleContextMenu = new JRadioButton(mLocalizer.msg("settings.menu.simple", "Direct in the context menu:"),
            mSettings.isSimpleMenu());//from  w w  w . j  a  va  2s . co m
    mSimpleContextMenu.setHorizontalTextPosition(JRadioButton.RIGHT);

    mCascadedContextMenu = new JRadioButton(mLocalizer.msg("settings.menu.cascaded", "In a sub menu:"),
            !mSettings.isSimpleMenu());
    mCascadedContextMenu.setHorizontalTextPosition(JRadioButton.RIGHT);
    mCascadedContextMenu.setVerticalAlignment(JRadioButton.TOP);

    final ButtonGroup bg = new ButtonGroup();

    bg.add(mSimpleContextMenu);
    bg.add(mCascadedContextMenu);

    pb2.add(mSimpleContextMenu, cc.xy(1, 1));
    pb2.addLabel(
            "-" + mLocalizer.msg("name", "I don't want to see!") + " ("
                    + mLocalizer.msg("menu.completeCaseSensitive", "Instant exclusion with title") + ")",
            cc.xy(3, 1));

    pb2.add(mCascadedContextMenu, cc.xy(1, 3));
    pb2.addLabel("-" + mLocalizer.msg("menu.completeCaseSensitive", "Instant exclusion with title"),
            cc.xy(3, 3));
    pb2.addLabel("-" + mLocalizer.msg("menu.userEntered", "User entered value"), cc.xy(3, 4));

    mAutoSwitchToMyFilter = new JCheckBox(
            mLocalizer.msg("settings.autoFilter", "Automatically activate filter on adding/removing"),
            mSettings.isSwitchToMyFilter());

    pb.add(mAutoSwitchToMyFilter, cc.xyw(2, 1, 3));
    pb.addSeparator(mLocalizer.msg("settings.contextMenu", "Context menu"), cc.xyw(1, 3, 5));
    pb.add(pb2.getPanel(), cc.xyw(2, 5, 3));
    pb.addSeparator(mLocalizer.msg("settings.search", "Search"), cc.xyw(1, 7, 5));
    pb.add(mExclusionPanel = new ExclusionTablePanel(mSettings), cc.xyw(2, 9, 3));

    mProgramImportancePanel = DefaultProgramImportanceSelectionPanel
            .createPanel(mSettings.getProgramImportance(), true, false);

    pb.add(mProgramImportancePanel, cc.xyw(2, 11, 3));

    final JPanel p = new JPanel(new FormLayout("0dlu,0dlu:grow", "5dlu,fill:default:grow"));

    JScrollPane scrollPane = new JScrollPane(pb.getPanel());
    scrollPane.setBorder(null);
    scrollPane.setViewportBorder(null);

    p.add(scrollPane, cc.xy(2, 2));

    return p;
}

From source file:imdbplugin.ImdbFilterComponent.java

License:Open Source License

@Override
public JPanel getSettingsPanel() {

    final FormLayout layout = new FormLayout("pref, 3dlu, fill:pref:grow, 3dlu, pref", "");
    final JPanel content = new JPanel(layout);
    content.setBorder(Borders.DIALOG_BORDER);

    final CellConstraints cc = new CellConstraints();
    int currentRow = 1;

    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));
    content.add(UiUtilities.createHelpTextArea(mLocalizer.msg("description", "")), cc.xyw(1, currentRow, 5));

    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("3dlu"));

    content.add(new JLabel(mLocalizer.msg("min.1", "Minimum")), cc.xy(1, currentRow += 2));
    mMinSpinner = new JSpinner(new SpinnerNumberModel(0.0, 0.0, 10.0, 0.1));
    mMinSpinner.setValue(mMinRating);//from   w  w w.j av  a2  s .  c o  m
    content.add(mMinSpinner, cc.xy(3, currentRow));
    content.add(new JLabel(mLocalizer.msg("min.2", "(of 10.0)")), cc.xy(5, currentRow));

    layout.appendRow(RowSpec.decode("pref"));

    content.add(new JLabel(mLocalizer.msg("max.1", "Maximum")), cc.xy(1, currentRow += 2));
    mMaxSpinner = new JSpinner(new SpinnerNumberModel(10.0, 0.0, 10.0, 0.1));
    mMaxSpinner.setValue(mMaxRating);
    content.add(mMaxSpinner, cc.xy(3, currentRow));
    content.add(new JLabel(mLocalizer.msg("max.2", "(of 10.0)")), cc.xy(5, currentRow));

    final JPanel centerPanel = new JPanel(new BorderLayout());
    centerPanel.add(content, BorderLayout.NORTH);
    return centerPanel;
}

From source file:imdbplugin.ImdbSettingsTab.java

License:Open Source License

public JPanel createSettingsPanel() {
    final PanelBuilder panel = new PanelBuilder(new FormLayout("3dlu, fill:pref:grow, 3dlu, pref, 3dlu",
            "pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref"));

    final CellConstraints cc = new CellConstraints();

    final JLabel excludedChannels = new JLabel(createExcludeChannelsLabelText());
    panel.add(excludedChannels, cc.xy(2, panel.getRow()));
    final JButton channelConfig = new JButton(Localizer.getLocalization(Localizer.I18N_EDIT));
    channelConfig.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
            ChannelChooserDlg chooser;//from   w  w  w  .  ja v a 2  s  . c o  m

            final Component parent = UiUtilities.getBestDialogParent(mParent);
            if (parent instanceof JFrame) {
                chooser = new ChannelChooserDlg((JFrame) parent, mExcludedChannels, null,
                        ChannelChooserDlg.SELECTABLE_ITEM_LIST);
            } else {
                chooser = new ChannelChooserDlg((JDialog) parent, mExcludedChannels, null,
                        ChannelChooserDlg.SELECTABLE_ITEM_LIST);
            }
            UiUtilities.centerAndShow(chooser);

            mExcludedChannels = chooser.getChannels();
            excludedChannels.setText(createExcludeChannelsLabelText());
        }
    });

    panel.add(channelConfig, cc.xy(4, panel.getRow()));
    panel.nextRow(2);

    panel.add(new JLabel(mLocalizer.msg("minimumRating", "Minimum rating to show in plugin tree")),
            cc.xy(2, panel.getRow()));
    mMinRating = new JSpinner(new SpinnerNumberModel(mSettings.getMinimumRating() / 10.0, 0.0, 10.0, 0.1));
    panel.add(mMinRating, cc.xy(4, panel.getRow()));
    panel.nextRow(2);

    panel.addSeparator(mLocalizer.msg("titleDatabase", "Database"), cc.xyw(1, panel.getRow(), 5));
    panel.nextRow(2);

    panel.add(new JLabel(mLocalizer.msg("lastUpdate", "Last update")), cc.xy(2, panel.getRow()));
    mLabelUpdate = new JLabel();
    panel.add(mLabelUpdate, cc.xy(4, panel.getRow()));
    panel.nextRow(2);

    panel.add(new JLabel(mLocalizer.msg("movies", "Movies")), cc.xy(2, panel.getRow()));
    mLabelRatings = new JLabel();
    panel.add(mLabelRatings, cc.xy(4, panel.getRow()));
    panel.nextRow(2);

    panel.add(new JLabel(mLocalizer.msg("size", "Size")), cc.xy(2, panel.getRow()));
    mLabelSize = new JLabel();
    panel.add(mLabelSize, cc.xy(4, panel.getRow()));
    panel.nextRow(2);

    updateStatistics();

    final JButton update = new JButton(mLocalizer.msg("updateDB", "Update Database"));
    update.addActionListener(new ActionListener() {

        public void actionPerformed(final ActionEvent e) {
            mImdbPlugin.showUpdateDialog();
            updateStatistics();
        }
    });

    final JPanel buttons = new JPanel(new FlowLayout(FlowLayout.LEFT));
    buttons.add(update);

    panel.add(buttons, cc.xyw(2, panel.getRow(), 3));
    panel.nextRow(2);

    return panel.getPanel();
}

From source file:imdbplugin.VoteCountFilterComponent.java

License:Open Source License

@Override
public JPanel getSettingsPanel() {

    final FormLayout layout = new FormLayout("pref, 3dlu, fill:pref:grow, 3dlu, pref", "");
    final JPanel content = new JPanel(layout);
    content.setBorder(Borders.DIALOG_BORDER);

    final CellConstraints cc = new CellConstraints();
    int currentRow = 1;

    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("5dlu"));
    content.add(UiUtilities.createHelpTextArea(mLocalizer.msg("description", "")), cc.xyw(1, currentRow, 5));

    layout.appendRow(RowSpec.decode("pref"));
    layout.appendRow(RowSpec.decode("3dlu"));

    content.add(new JLabel(mLocalizer.msg("min.1", "Minimum")), cc.xy(1, currentRow += 2));
    mMinSpinner = new JSpinner(new SpinnerNumberModel(0, 0, MAX_VOTES, INCREMENT));
    mMinSpinner.setValue(mMinVotes);/*from   w  w  w  .  ja  va  2 s.  c  o  m*/
    content.add(mMinSpinner, cc.xy(3, currentRow));
    content.add(new JLabel(mLocalizer.msg("min.2", "(of 10.0)")), cc.xy(5, currentRow));

    layout.appendRow(RowSpec.decode("pref"));

    content.add(new JLabel(mLocalizer.msg("max.1", "Maximum")), cc.xy(1, currentRow += 2));
    mMaxSpinner = new JSpinner(new SpinnerNumberModel(MAX_VOTES, 0, MAX_VOTES, INCREMENT));
    mMaxSpinner.setValue(mMaxVotes);
    content.add(mMaxSpinner, cc.xy(3, currentRow));
    content.add(new JLabel(mLocalizer.msg("max.2", "(of 10.0)")), cc.xy(5, currentRow));

    final JPanel centerPanel = new JPanel(new BorderLayout());
    centerPanel.add(content, BorderLayout.NORTH);
    return centerPanel;
}

From source file:jflowmap.ui.ControlPanel.java

License:Apache License

/**
 * Method generated by IntelliJ IDEA GUI Designer
 * >>> IMPORTANT!! <<<
 * DO NOT edit this method OR call it in your code!
 *
 * @noinspection ALL//w  w  w. j  a v  a 2s .  c  o  m
 */
private void $$$setupUI$$$() {
    createUIComponents();
    panel1 = new JPanel();
    panel1.setLayout(new BorderLayout(0, 0));
    tabbedPane1 = new JTabbedPane();
    panel1.add(tabbedPane1, BorderLayout.CENTER);
    final JPanel panel2 = new JPanel();
    panel2.setLayout(new FormLayout(
            "fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:187px:noGrow,left:4dlu:noGrow,fill:20px:noGrow,left:4dlu:noGrow,fill:p:noGrow,left:4dlu:noGrow,fill:119px:noGrow,left:20dlu:noGrow,fill:max(d;4px):grow",
            "center:d:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:min(p;200px):grow"));
    tabbedPane1.addTab("Dataset", panel2);
    panel2.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), null));
    datasetCombo = new JComboBox();
    CellConstraints cc = new CellConstraints();
    panel2.add(datasetCombo, cc.xy(3, 1));
    final JLabel label1 = new JLabel();
    label1.setText("Flow weight attr:");
    panel2.add(label1, cc.xy(1, 1));
    final JSeparator separator1 = new JSeparator();
    separator1.setOrientation(1);
    panel2.add(separator1, cc.xywh(5, 1, 1, 9, CellConstraints.CENTER, CellConstraints.FILL));
    final JLabel label2 = new JLabel();
    label2.setEnabled(false);
    label2.setText("Edge weight field:");
    panel2.add(label2, cc.xy(7, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    comboBox4 = new JComboBox();
    comboBox4.setEnabled(false);
    panel2.add(comboBox4, cc.xy(9, 1));
    final JLabel label3 = new JLabel();
    label3.setEnabled(false);
    label3.setText("Node label field:");
    panel2.add(label3, cc.xy(7, 3, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    comboBox6 = new JComboBox();
    comboBox6.setEnabled(false);
    panel2.add(comboBox6, cc.xy(9, 3));
    final JSeparator separator2 = new JSeparator();
    separator2.setOrientation(1);
    panel2.add(separator2, cc.xywh(10, 1, 1, 9, CellConstraints.CENTER, CellConstraints.FILL));
    final JTabbedPane tabbedPane3 = new JTabbedPane();
    tabbedPane3.setTabPlacement(3);
    panel2.add(tabbedPane3, cc.xywh(11, 1, 1, 9, CellConstraints.DEFAULT, CellConstraints.FILL));
    final JScrollPane scrollPane1 = new JScrollPane();
    tabbedPane3.addTab("Flows", scrollPane1);
    scrollPane1.setBorder(BorderFactory.createTitledBorder(""));
    flowsTable.setPreferredScrollableViewportSize(new Dimension(450, 100));
    scrollPane1.setViewportView(flowsTable);
    final JLabel label4 = new JLabel();
    label4.setEnabled(false);
    label4.setText("Node X coord field:");
    panel2.add(label4, cc.xy(7, 5, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    comboBox2 = new JComboBox();
    comboBox2.setEnabled(false);
    panel2.add(comboBox2, cc.xy(9, 5));
    final JLabel label5 = new JLabel();
    label5.setEnabled(false);
    label5.setText("Node Y coord field:");
    panel2.add(label5, cc.xy(7, 7, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    comboBox3 = new JComboBox();
    comboBox3.setEnabled(false);
    panel2.add(comboBox3, cc.xy(9, 7));
    final JPanel panel3 = new JPanel();
    panel3.setLayout(new FormLayout(
            "right:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow(2.0),left:4dlu:noGrow,fill:p:noGrow,left:4dlu:noGrow,fill:20px:noGrow,left:4dlu:noGrow,right:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:grow,left:4dlu:noGrow,fill:p:noGrow",
            "center:26px:noGrow,top:4dlu:noGrow,center:24px:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:5dlu:noGrow,center:d:noGrow"));
    tabbedPane1.addTab("Filter", panel3);
    panel3.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), null));
    minWeightFilterSpinner = new JSpinner();
    panel3.add(minWeightFilterSpinner, cc.xy(5, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JSeparator separator3 = new JSeparator();
    separator3.setOrientation(1);
    panel3.add(separator3, cc.xywh(7, 1, 1, 5, CellConstraints.CENTER, CellConstraints.FILL));
    final JLabel label6 = new JLabel();
    label6.setText("Min length:");
    panel3.add(label6, cc.xy(9, 1));
    minLengthFilterSlider = new JSlider();
    panel3.add(minLengthFilterSlider, cc.xy(11, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
    minLengthFilterSpinner = new JSpinner();
    panel3.add(minLengthFilterSpinner, cc.xy(13, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label7 = new JLabel();
    label7.setText("Max edge weight:");
    panel3.add(label7, cc.xy(1, 3));
    maxWeightFilterSlider = new JSlider();
    panel3.add(maxWeightFilterSlider, cc.xy(3, 3, CellConstraints.FILL, CellConstraints.CENTER));
    maxWeightFilterSpinner = new JSpinner();
    panel3.add(maxWeightFilterSpinner, cc.xy(5, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    autoAdjustColorScaleCheckBox = new JCheckBox();
    autoAdjustColorScaleCheckBox.setEnabled(false);
    autoAdjustColorScaleCheckBox.setText("Auto adjust color scale");
    panel3.add(autoAdjustColorScaleCheckBox, cc.xyw(3, 5, 3));
    final JLabel label8 = new JLabel();
    label8.setText("Max length:");
    panel3.add(label8, cc.xy(9, 3));
    maxLengthFilterSlider = new JSlider();
    panel3.add(maxLengthFilterSlider, cc.xy(11, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    maxLengthFilterSpinner = new JSpinner();
    panel3.add(maxLengthFilterSpinner, cc.xy(13, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JPanel panel4 = new JPanel();
    panel4.setLayout(new FormLayout("fill:d:grow", "center:d:grow"));
    panel3.add(panel4, cc.xy(5, 7));
    final JLabel label9 = new JLabel();
    label9.setText("Min edge weight:");
    panel3.add(label9, cc.xy(1, 1));
    minWeightFilterSlider = new JSlider();
    panel3.add(minWeightFilterSlider, cc.xy(3, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JPanel panel5 = new JPanel();
    panel5.setLayout(new FormLayout(
            "fill:d:noGrow,left:p:noGrow,fill:20px:noGrow,left:4dlu:noGrow,fill:p:noGrow,left:20dlu:noGrow,fill:max(d;4px):grow",
            "center:max(d;4px):noGrow,top:4dlu:noGrow,center:24px:noGrow,top:6dlu:noGrow,top:4dlu:noGrow"));
    tabbedPane1.addTab("Scales", panel5);
    panel5.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), null));
    final JSeparator separator4 = new JSeparator();
    separator4.setOrientation(1);
    panel5.add(separator4, cc.xywh(3, 1, 1, 5, CellConstraints.CENTER, CellConstraints.FILL));
    useLogWidthScaleCheckbox = new JCheckBox();
    useLogWidthScaleCheckbox.setEnabled(true);
    useLogWidthScaleCheckbox.setText("Use log width scale");
    panel5.add(useLogWidthScaleCheckbox, cc.xy(2, 1));
    useLogColorScaleCheckbox = new JCheckBox();
    useLogColorScaleCheckbox.setEnabled(true);
    useLogColorScaleCheckbox.setText("Use log color scale");
    panel5.add(useLogColorScaleCheckbox, cc.xyw(1, 3, 2));
    mapEdgeValueToCheckBox = new JCheckBox();
    mapEdgeValueToCheckBox.setEnabled(false);
    mapEdgeValueToCheckBox.setText("Map edge value to color");
    panel5.add(mapEdgeValueToCheckBox, cc.xy(5, 1));
    mapEdgeValueToCheckBox1 = new JCheckBox();
    mapEdgeValueToCheckBox1.setEnabled(false);
    mapEdgeValueToCheckBox1.setText("Map edge value to width");
    panel5.add(mapEdgeValueToCheckBox1, cc.xy(5, 3));
    final JSeparator separator5 = new JSeparator();
    separator5.setOrientation(1);
    panel5.add(separator5, cc.xywh(6, 1, 1, 5, CellConstraints.CENTER, CellConstraints.FILL));
    final JPanel panel6 = new JPanel();
    panel6.setLayout(new FormLayout(
            "fill:d:noGrow,left:4dlu:noGrow,fill:110px:noGrow,left:4dlu:noGrow,fill:20px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,fill:20px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:max(d;4px):grow,left:4dlu:noGrow,fill:max(m;50px):noGrow",
            "center:d:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow"));
    tabbedPane1.addTab("Aesthetics", panel6);
    panel6.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), null));
    final JLabel label10 = new JLabel();
    label10.setEnabled(true);
    label10.setText("Color scheme:");
    panel6.add(label10, cc.xy(1, 1));
    colorSchemeCombo = new JComboBox();
    colorSchemeCombo.setEnabled(true);
    panel6.add(colorSchemeCombo, cc.xy(3, 1));
    final JSeparator separator6 = new JSeparator();
    separator6.setOrientation(1);
    panel6.add(separator6, cc.xywh(5, 1, 1, 7, CellConstraints.CENTER, CellConstraints.FILL));
    final JLabel label11 = new JLabel();
    label11.setText("Edge width:");
    panel6.add(label11, cc.xy(10, 1, CellConstraints.RIGHT, CellConstraints.CENTER));
    maxEdgeWidthSlider = new JSlider();
    maxEdgeWidthSlider.setPaintLabels(false);
    maxEdgeWidthSlider.setPaintTicks(false);
    maxEdgeWidthSlider.setPaintTrack(true);
    panel6.add(maxEdgeWidthSlider, cc.xy(12, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
    maxEdgeWidthSpinner = new JSpinner();
    panel6.add(maxEdgeWidthSpinner, cc.xy(14, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label12 = new JLabel();
    label12.setText("Edge opacity:");
    panel6.add(label12, cc.xy(10, 3, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    edgeOpacitySlider = new JSlider();
    panel6.add(edgeOpacitySlider, cc.xy(12, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    edgeOpacitySpinner = new JSpinner();
    panel6.add(edgeOpacitySpinner, cc.xy(14, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    showNodesCheckBox = new JCheckBox();
    showNodesCheckBox.setText("Show nodes");
    panel6.add(showNodesCheckBox, cc.xy(7, 1));
    final JSeparator separator7 = new JSeparator();
    separator7.setOrientation(1);
    panel6.add(separator7, cc.xywh(8, 1, 1, 7, CellConstraints.CENTER, CellConstraints.FILL));
    showDirectionMarkersCheckBox = new JCheckBox();
    showDirectionMarkersCheckBox.setText("Show direction markers");
    panel6.add(showDirectionMarkersCheckBox, cc.xy(7, 5));
    fillEdgesWithGradientCheckBox = new JCheckBox();
    fillEdgesWithGradientCheckBox.setText("Fill edges with gradient");
    panel6.add(fillEdgesWithGradientCheckBox, cc.xy(7, 3));
    proportionalDirectionMarkersCheckBox = new JCheckBox();
    proportionalDirectionMarkersCheckBox.setText("Proportional direction markers");
    panel6.add(proportionalDirectionMarkersCheckBox, cc.xy(7, 7));
    edgeMarkerSizeSpinner = new JSpinner();
    panel6.add(edgeMarkerSizeSpinner, cc.xy(14, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
    edgeMarkerSizeSlider = new JSlider();
    panel6.add(edgeMarkerSizeSlider, cc.xy(12, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
    edgeMarkerOpacitySpinner = new JSpinner();
    panel6.add(edgeMarkerOpacitySpinner, cc.xy(14, 7, CellConstraints.FILL, CellConstraints.DEFAULT));
    edgeMarkerOpacitySlider = new JSlider();
    panel6.add(edgeMarkerOpacitySlider, cc.xy(12, 7, CellConstraints.FILL, CellConstraints.DEFAULT));
    edgeMarkerSizeLabel = new JLabel();
    edgeMarkerSizeLabel.setText("Direction marker size:");
    panel6.add(edgeMarkerSizeLabel, cc.xy(10, 5, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    edgeMarkerOpacityLabel = new JLabel();
    edgeMarkerOpacityLabel.setText("Direction marker opacity:");
    panel6.add(edgeMarkerOpacityLabel, cc.xy(10, 7, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    final JPanel panel7 = new JPanel();
    panel7.setLayout(new FormLayout(
            "fill:d:noGrow,left:6dlu:noGrow,fill:p:noGrow,left:4dlu:noGrow,fill:p:noGrow,left:4dlu:noGrow,fill:p:noGrow,left:4dlu:noGrow,fill:12px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:p:noGrow,left:12dlu:noGrow,fill:p:noGrow,fill:d:noGrow,left:d:noGrow",
            "center:max(d;4px):noGrow,top:4dlu:noGrow,center:25px:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:d:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow"));
    tabbedPane1.addTab("Edge bundling", panel7);
    panel7.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), null));
    final JSeparator separator8 = new JSeparator();
    separator8.setOrientation(1);
    panel7.add(separator8, cc.xywh(9, 1, 1, 8, CellConstraints.CENTER, CellConstraints.FILL));
    final JLabel label13 = new JLabel();
    label13.setHorizontalAlignment(4);
    label13.setText("Step damping factor:");
    panel7.add(label13, cc.xy(11, 3));
    stepDampingFactorSpinner = new JSpinner();
    panel7.add(stepDampingFactorSpinner, cc.xy(13, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    stepSizeSpinner = new JSpinner();
    panel7.add(stepSizeSpinner, cc.xy(13, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label14 = new JLabel();
    label14.setHorizontalAlignment(4);
    label14.setText("Step size (S):");
    panel7.add(label14, cc.xy(11, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    final JLabel label15 = new JLabel();
    label15.setHorizontalAlignment(4);
    label15.setText("Edge stiffness (K):");
    panel7.add(label15, cc.xy(5, 3, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    edgeStiffnessSpinner = new JSpinner();
    panel7.add(edgeStiffnessSpinner, cc.xy(7, 3, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JSeparator separator9 = new JSeparator();
    separator9.setOrientation(1);
    panel7.add(separator9, cc.xywh(14, 1, 1, 8, CellConstraints.CENTER, CellConstraints.FILL));
    final JLabel label16 = new JLabel();
    label16.setHorizontalAlignment(4);
    label16.setText("Number of cycles:");
    panel7.add(label16, cc.xy(5, 1));
    numberOfCyclesSpinner = new JSpinner();
    panel7.add(numberOfCyclesSpinner, cc.xy(7, 1, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label17 = new JLabel();
    label17.setHorizontalAlignment(4);
    label17.setText("Compatibility threshold:");
    panel7.add(label17, cc.xy(5, 5));
    edgeCompatibilityThresholdSpinner = new JSpinner();
    panel7.add(edgeCompatibilityThresholdSpinner, cc.xy(7, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
    final JLabel label18 = new JLabel();
    label18.setHorizontalAlignment(4);
    label18.setText("Steps in 1st cycle (I):");
    panel7.add(label18, cc.xy(11, 5));
    stepsInCycleSpinner = new JSpinner();
    panel7.add(stepsInCycleSpinner, cc.xy(13, 5, CellConstraints.FILL, CellConstraints.DEFAULT));
    bundleButton = new JButton();
    bundleButton.setText("Bundle");
    panel7.add(bundleButton, cc.xy(1, 1));
    resetBundlingButton = new JButton();
    resetBundlingButton.setText("Reset");
    panel7.add(resetBundlingButton, cc.xy(1, 3));
    defaultValuesButton = new JButton();
    defaultValuesButton.setText("Default Values");
    panel7.add(defaultValuesButton, cc.xy(1, 5));
    final JSeparator separator10 = new JSeparator();
    separator10.setOrientation(1);
    panel7.add(separator10, cc.xywh(3, 1, 1, 8, CellConstraints.CENTER, CellConstraints.FILL));
    repulsiveEdgesCheckBox = new JCheckBox();
    repulsiveEdgesCheckBox.setText("Repulsion:");
    panel7.add(repulsiveEdgesCheckBox, cc.xy(5, 8, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    repulsionSpinner = new JSpinner();
    panel7.add(repulsionSpinner, cc.xy(7, 8, CellConstraints.FILL, CellConstraints.DEFAULT));
    inverseQuadraticModelCheckBox = new JCheckBox();
    inverseQuadraticModelCheckBox.setText("Inverse-quadratic model");
    panel7.add(inverseQuadraticModelCheckBox, cc.xyw(11, 8, 3, CellConstraints.LEFT, CellConstraints.DEFAULT));
    final JSeparator separator11 = new JSeparator();
    panel7.add(separator11, cc.xyw(1, 7, 2, CellConstraints.FILL, CellConstraints.FILL));
    aggregateEdgesButton = new JButton();
    aggregateEdgesButton.setText("Aggregate edges");
    panel7.add(aggregateEdgesButton, cc.xy(1, 8));
    directionAffectsCompatibilityCheckBox = new JCheckBox();
    directionAffectsCompatibilityCheckBox.setText("Direction affects compatibility");
    panel7.add(directionAffectsCompatibilityCheckBox,
            cc.xy(17, 1, CellConstraints.LEFT, CellConstraints.DEFAULT));
    edgeValueAffectsAttractionCheckBox = new JCheckBox();
    edgeValueAffectsAttractionCheckBox.setText("Edge value affects attraction");
    panel7.add(edgeValueAffectsAttractionCheckBox, cc.xy(17, 3));
    simpleCompatibilityMeasureCheckBox = new JCheckBox();
    simpleCompatibilityMeasureCheckBox.setText("Simple compatibility measure");
    panel7.add(simpleCompatibilityMeasureCheckBox, cc.xy(17, 5, CellConstraints.LEFT, CellConstraints.DEFAULT));
    binaryCompatibilityCheckBox = new JCheckBox();
    binaryCompatibilityCheckBox.setText("Binary compatibility");
    panel7.add(binaryCompatibilityCheckBox, cc.xy(17, 8, CellConstraints.LEFT, CellConstraints.DEFAULT));
    final JPanel panel8 = new JPanel();
    panel8.setLayout(new FormLayout(
            "fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:20px:noGrow,left:4dlu:noGrow,fill:max(d;4px):noGrow,left:4dlu:noGrow,fill:d:noGrow,left:4dlu:noGrow,fill:max(d;4px):grow,left:4dlu:noGrow,fill:max(p;75px):noGrow,left:10dlu:noGrow,fill:1px:noGrow,left:10dlu:noGrow,fill:max(p;200px):noGrow",
            "center:max(p;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:m:noGrow,top:d:noGrow,center:max(d;6px):noGrow,center:d:noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:max(d;4px):noGrow,top:4dlu:noGrow,center:min(p;200px):grow"));
    tabbedPane1.addTab("Node clustering", panel8);
    panel8.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10), null));
    panel8.add(distanceMeasureCombo, cc.xyw(7, 1, 5, CellConstraints.LEFT, CellConstraints.DEFAULT));
    final JLabel label19 = new JLabel();
    label19.setText("Distance measure:");
    panel8.add(label19, cc.xy(5, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    tabbedPane2 = new JTabbedPane();
    tabbedPane2.setTabPlacement(3);
    panel8.add(tabbedPane2, cc.xywh(15, 1, 1, 14, CellConstraints.DEFAULT, CellConstraints.FILL));
    final JPanel panel9 = new JPanel();
    panel9.setLayout(new FormLayout("fill:d:grow", "center:d:grow"));
    tabbedPane2.addTab("Clusters", panel9);
    final JScrollPane scrollPane2 = new JScrollPane();
    panel9.add(scrollPane2, cc.xy(1, 1, CellConstraints.DEFAULT, CellConstraints.FILL));
    scrollPane2.setBorder(BorderFactory.createTitledBorder(""));
    clustersTable.setPreferredScrollableViewportSize(new Dimension(450, 100));
    scrollPane2.setViewportView(clustersTable);
    final JScrollPane scrollPane3 = new JScrollPane();
    tabbedPane2.addTab("Nodes", scrollPane3);
    scrollPane3.setBorder(BorderFactory.createTitledBorder(""));
    clusterNodesTable.setPreferredScrollableViewportSize(new Dimension(450, 100));
    scrollPane3.setViewportView(clusterNodesTable);
    final JScrollPane scrollPane4 = new JScrollPane();
    tabbedPane2.addTab("Distances", scrollPane4);
    scrollPane4.setBorder(BorderFactory.createTitledBorder(""));
    clusterDistancesTable.setPreferredScrollableViewportSize(new Dimension(450, 100));
    scrollPane4.setViewportView(clusterDistancesTable);
    final JSeparator separator12 = new JSeparator();
    separator12.setOrientation(1);
    panel8.add(separator12, cc.xywh(13, 1, 1, 14, CellConstraints.CENTER, CellConstraints.FILL));
    final JLabel label20 = new JLabel();
    label20.setText("Linkage:");
    panel8.add(label20, cc.xy(5, 3, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    panel8.add(linkageComboBox, cc.xy(7, 3, CellConstraints.LEFT, CellConstraints.DEFAULT));
    maxClusterDistanceSlider = new JSlider();
    maxClusterDistanceSlider.setEnabled(false);
    panel8.add(maxClusterDistanceSlider, cc.xyw(6, 8, 4, CellConstraints.FILL, CellConstraints.DEFAULT));
    euclideanMaxClusterDistanceSlider = new JSlider();
    euclideanMaxClusterDistanceSlider.setEnabled(false);
    panel8.add(euclideanMaxClusterDistanceSlider,
            cc.xyw(6, 10, 4, CellConstraints.FILL, CellConstraints.DEFAULT));
    maxClusterDistanceSpinner = new JSpinner();
    maxClusterDistanceSpinner.setEnabled(false);
    panel8.add(maxClusterDistanceSpinner, cc.xy(11, 8, CellConstraints.FILL, CellConstraints.DEFAULT));
    euclideanMaxClusterDistanceSpinner = new JSpinner();
    euclideanMaxClusterDistanceSpinner.setEnabled(false);
    panel8.add(euclideanMaxClusterDistanceSpinner,
            cc.xy(11, 10, CellConstraints.FILL, CellConstraints.DEFAULT));
    euclideanMaxClusterDistanceLabel = new JLabel();
    euclideanMaxClusterDistanceLabel.setEnabled(false);
    euclideanMaxClusterDistanceLabel.setText("Euclidean max cluster distance:");
    panel8.add(euclideanMaxClusterDistanceLabel, cc.xy(5, 10, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    maxClusterDistanceLabel = new JLabel();
    maxClusterDistanceLabel.setEnabled(false);
    maxClusterDistanceLabel.setText("Max cluster distance:");
    panel8.add(maxClusterDistanceLabel, cc.xy(5, 8, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    final JSeparator separator13 = new JSeparator();
    separator13.setOrientation(1);
    panel8.add(separator13, cc.xywh(3, 1, 1, 4, CellConstraints.FILL, CellConstraints.FILL));
    clusterButton = new JButton();
    clusterButton.setText("Cluster");
    panel8.add(clusterButton, cc.xy(1, 1));
    final JSeparator separator14 = new JSeparator();
    panel8.add(separator14, cc.xyw(1, 5, 12, CellConstraints.FILL, CellConstraints.FILL));
    numberOfClustersLabel = new JLabel();
    numberOfClustersLabel.setEnabled(false);
    numberOfClustersLabel.setText("Number of clusters:");
    panel8.add(numberOfClustersLabel, cc.xy(5, 12, CellConstraints.RIGHT, CellConstraints.DEFAULT));
    numberOfClustersValueLabel = new JLabel();
    numberOfClustersValueLabel.setText("");
    panel8.add(numberOfClustersValueLabel, cc.xy(7, 12));
    joinClusterEdgesButton = new JButton();
    joinClusterEdgesButton.setEnabled(true);
    joinClusterEdgesButton.setText("Join edges");
    panel8.add(joinClusterEdgesButton, cc.xy(1, 8));
    resetClustersButton = new JButton();
    resetClustersButton.setEnabled(true);
    resetClustersButton.setText("Reset");
    panel8.add(resetClustersButton, cc.xy(1, 3));
    resetJoinedEdgesButton = new JButton();
    resetJoinedEdgesButton.setText("Reset");
    panel8.add(resetJoinedEdgesButton, cc.xy(1, 10));
    final JSeparator separator15 = new JSeparator();
    separator15.setOrientation(1);
    panel8.add(separator15, cc.xywh(3, 7, 1, 7, CellConstraints.FILL, CellConstraints.FILL));
    combineWithEuclideanClustersCheckBox = new JCheckBox();
    combineWithEuclideanClustersCheckBox.setEnabled(true);
    combineWithEuclideanClustersCheckBox.setSelected(false);
    combineWithEuclideanClustersCheckBox.setText("Combine with Euclidean clusters");
    panel8.add(combineWithEuclideanClustersCheckBox, cc.xyw(9, 3, 3));
}

From source file:jgnash.ui.budget.BudgetManagerDialog.java

License:Open Source License

private void layoutMainPanel() {
    initComponents();/*  w ww.j  av  a 2  s.com*/

    // build the button stack
    ButtonStackBuilder buttonStackBuilder = new ButtonStackBuilder();
    buttonStackBuilder.addButton(newAutoButton, newButton, duplicateButton, renameButton);
    buttonStackBuilder.addUnrelatedGap();
    buttonStackBuilder.addButton(deleteButton);

    FormLayout layout = new FormLayout("p:g, $lcgap, f:p", "f:max(35dlu;p):g, $ugap, p");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);

    builder.setDefaultDialogBorder();

    CellConstraints cc = new CellConstraints();

    builder.add(new JScrollPane(budgetList), cc.xy(1, 1));
    builder.add(buttonStackBuilder.getPanel(), cc.xy(3, 1));
    builder.add(ButtonBarFactory.buildCloseBar(closeButton), cc.xyw(1, 3, 3));

    getContentPane().add(builder.getPanel(), BorderLayout.CENTER);

    pack();

    setMinimumSize(getSize());
}

From source file:jgnash.ui.budget.BudgetPanel.java

License:Open Source License

private void layoutMainPanel() {
    initComponents();//from w  ww  .j a  v a  2  s .  co m

    FormLayout layout = new FormLayout("fill:p:g, 5dlu", "d, $rg, d, f:p:g, 5dlu");

    PanelBuilder builder = new PanelBuilder(layout, this);

    CellConstraints cc = new CellConstraints();

    JToolBar toolBar = new JToolBar();
    toolBar.setFloatable(false);
    toolBar.setRollover(true);

    toolBar.add(budgetCombo);
    toolBar.add(budgetPropertiesButton);
    toolBar.addSeparator();
    toolBar.add(budgetManagerButton);
    toolBar.addSeparator();
    toolBar.add(summaryRowVisibleCheckBox);
    toolBar.add(summaryColVisibleCheckBox);
    toolBar.addSeparator();
    toolBar.add(budgetExportButton);

    builder.add(toolBar, cc.xyw(1, 1, 2));

    scrollPane = new JideScrollPane();
    scrollPane.setPreferredSize(new Dimension(1, 1)); // force it something small so it will resize correctly
    scrollPane.setColumnHeadersHeightUnified(true);

    rowHeaderResizeHandler = new AccountRowHeaderResizeHandler(scrollPane);

    overviewPanel = new BudgetOverviewPanel(this);

    add(overviewPanel, cc.xyw(1, 3, 2));
    add(scrollPane, cc.xy(1, 4));

    // listen for budget events
    MessageBus.getInstance().registerListener(this, MessageChannel.BUDGET);

    if (budgetCombo.getSelectedBudget() != null) {
        showBudgetPane();
    }
}

From source file:jgnash.ui.budget.BudgetPropertiesDialog.java

License:Open Source License

private void layoutMainPanel() {
    initComponents();/*w w w.j  a v a 2 s.c  o  m*/

    FormLayout layout = new FormLayout("p, $lcgap, f:max(90dlu;p)",
            "f:p, $rgap, f:p, $ugap, f:p, $rgap, f:p, $rgap, f:p, $rgap, f:p, $rgap, f:p, $ugap, p");
    DefaultFormBuilder builder = new DefaultFormBuilder(layout);

    builder.setDefaultDialogBorder();

    CellConstraints cc = new CellConstraints();

    builder.add(new JLabel(rb.getString("Label.Description")), cc.xy(1, 1));
    builder.add(descriptionField, cc.xy(3, 1));

    builder.add(new JLabel(rb.getString("Label.Period")), cc.xy(1, 3));
    builder.add(budgetPeriodCombo, cc.xy(3, 3));

    builder.addSeparator(rb.getString("Title.AccountGroups"), cc.xyw(1, 5, 3));
    builder.add(incomeGroupCheckBox, cc.xyw(1, 7, 3));
    builder.add(expenseGroupCheckBox, cc.xyw(1, 9, 3));
    builder.add(assetGroupCheckBox, cc.xyw(1, 11, 3));
    builder.add(liabilityGroupCheckBox, cc.xyw(1, 13, 3));

    builder.add(ButtonBarFactory.buildOKCancelBar(okButton, cancelButton), cc.xyw(1, 15, 3));

    getContentPane().add(builder.getPanel(), BorderLayout.CENTER);

    pack();

    setResizable(false);

    DialogUtils.addBoundsListener(this);
}

From source file:jgnash.ui.components.wizard.WizardDialog.java

License:Open Source License

private void layoutMainPanel() {
    initComponents();/* ww w .j a v a  2s .co m*/

    CellConstraints cc = new CellConstraints();

    FormLayout lay = new FormLayout("p, $rgap, min(220dlu;d):g", "");
    DefaultFormBuilder builder = new DefaultFormBuilder(lay);
    builder.setDefaultDialogBorder();

    builder.appendRow(RowSpec.decode("f:p:g"));
    builder.append(buildTaskPanel(), pagePanel);
    builder.appendSeparator();
    builder.nextLine();
    builder.appendRelatedComponentsGapRow();
    builder.nextLine();
    builder.appendRow("p");
    builder.add(buildButtonPanel(), cc.xyw(1, builder.getRow(), 3));

    getContentPane().add(builder.getPanel());
}

From source file:jgnash.ui.recurring.MonthTab.java

License:Open Source License

private void layoutMainPanel() {
    FormLayout layout = new FormLayout(
            "right:p, $lcgap, f:p, 2dlu, max(48dlu;min), 2dlu, f:p, 10dlu, right:p, 4dlu, max(48dlu;min)",
            "f:p, $lgap, f:p, $lgap, f:p");
    layout.setRowGroups(new int[][] { { 1, 3, 5 } });
    setLayout(layout);/*from   w  w  w  .j a  v a2 s .c  om*/
    setBorder(Borders.DIALOG_BORDER);

    CellConstraints cc = new CellConstraints();

    noEndButton = new JRadioButton(rb.getString("Button.NoEndDate"));
    endButton = new JRadioButton();
    endDateField = new DatePanel();

    group.add(noEndButton);
    group.add(endButton);

    numberSpinner = new JSpinner(new SpinnerNumberModel(1, 1, 24, 1));
    typeComboBox = new JComboBox<>();

    typeComboBox.setModel(new DefaultComboBoxModel<>(
            new String[] { rb.getString("Column.Date"), rb.getString("Column.Day") }));

    add(new JLabel(rb.getString("Label.Every")), cc.xy(1, 1));
    add(numberSpinner, cc.xywh(3, 1, 3, 1));
    add(new JLabel(rb.getString("Tab.Month")), cc.xy(7, 1));

    add(new JLabel(rb.getString("Label.By")), cc.xy(9, 1));
    add(typeComboBox, cc.xy(11, 1));

    add(new JLabel(rb.getString("Label.EndOn")), cc.xy(1, 3));
    add(noEndButton, cc.xyw(3, 3, 5));

    add(endButton, cc.xy(3, 5));
    add(endDateField, cc.xy(5, 5));

}