List of usage examples for com.jgoodies.forms.layout CellConstraints DEFAULT
Alignment DEFAULT
To view the source code for com.jgoodies.forms.layout CellConstraints DEFAULT.
Click Source Link
From source file:JPFamiliaGenerico.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown lblCodigo = new JLabel(); txtCodigo = new JTextField(); lblNombre = new JLabel(); txtNombre = new JTextField(); spTblFamiliaGenerico = new JScrollPane(); tblFamiliaGenerico = new JTable(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(10)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(50)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(150)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.dluX(60), FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes.dluX(10)) }, new RowSpec[] { new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(15)), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(Sizes.dluY(10)) })); //---- lblCodigo ---- lblCodigo.setText("C\u00f3digo:"); lblCodigo.setHorizontalAlignment(SwingConstants.RIGHT); add(lblCodigo, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL)); add(txtCodigo, cc.xywh(5, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); //---- lblNombre ---- lblNombre.setText("Nombre:"); lblNombre.setHorizontalAlignment(SwingConstants.RIGHT); add(lblNombre, cc.xywh(3, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.FILL)); add(txtNombre, cc.xywh(5, 5, 3, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); //======== spTblFamiliaGenerico ======== {/*from www . ja v a 2 s . c o m*/ //---- tblFamiliaGenerico ---- tblFamiliaGenerico .setModel(new DefaultTableModel(new Object[][] {}, new String[] { "C\u00f3digo", "Nombre" }) { boolean[] columnEditable = new boolean[] { false, false }; @Override public boolean isCellEditable(int rowIndex, int columnIndex) { return columnEditable[columnIndex]; } }); spTblFamiliaGenerico.setViewportView(tblFamiliaGenerico); } add(spTblFamiliaGenerico, cc.xywh(3, 9, 7, 5)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:MultipleSettingsDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("MultipleSettingsDialog"); JPanel dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); JLabel iconLabel = new JLabel(); titleLabel = new JLabel(); JLabel labelSize = new JLabel(); fieldSize = new JTextField(); JLabel labelDescription = new JLabel(); JScrollPane scrollPane1 = new JScrollPane(); descriptionArea = ComponentFactory.getTextArea(); JPanel optionsPanel = new JPanel(); JLabel saveToLabel = new JLabel(); comboPath = new JComboBox(); btnSelectPath = new JButton(); JXButtonPanel buttonBar = new JXButtonPanel(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from www. j a v a 2 s.co m*/ dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { //---- iconLabel ---- iconLabel.setText(bundle.getString("iconLabel.text")); //---- titleLabel ---- titleLabel.setText(bundle.getString("titleLabel.text")); titleLabel.setFont(new Font("Tahoma", Font.BOLD, 12)); //---- labelSize ---- labelSize.setText(bundle.getString("labelSize.text")); //---- fieldSize ---- fieldSize.setBorder(null); fieldSize.setOpaque(false); fieldSize.setEditable(false); //---- labelDescription ---- labelDescription.setText(bundle.getString("labelDescription.text")); //======== scrollPane1 ======== { scrollPane1.setViewportView(descriptionArea); } //======== optionsPanel ======== { //---- saveToLabel ---- saveToLabel.setText(bundle.getString("saveToLabel.text")); saveToLabel.setLabelFor(comboPath); //---- comboPath ---- comboPath.setEditable(true); //---- btnSelectPath ---- btnSelectPath.setText(bundle.getString("btnSelectPath.text")); PanelBuilder optionsPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default")), optionsPanel); optionsPanelBuilder.add(saveToLabel, cc.xy(1, 1)); optionsPanelBuilder.add(comboPath, cc.xy(3, 1)); optionsPanelBuilder.add(btnSelectPath, cc.xy(5, 1)); } PanelBuilder contentPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(49)), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("max(min;70dlu)") }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.TOP, Sizes.PREFERRED, FormSpec.NO_GROW), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.bounded(Sizes.PREFERRED, Sizes.dluY(40), Sizes.dluY(50)), FormSpec.DEFAULT_GROW), FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), contentPanel); contentPanelBuilder.add(iconLabel, cc.xywh(1, 1, 1, 5, CellConstraints.DEFAULT, CellConstraints.FILL)); contentPanelBuilder.add(titleLabel, cc.xywh(3, 1, 5, 1)); contentPanelBuilder.add(labelSize, cc.xy(3, 3)); contentPanelBuilder.add(fieldSize, cc.xywh(5, 3, 3, 1)); contentPanelBuilder.add(labelDescription, cc.xy(1, 7)); contentPanelBuilder.add(scrollPane1, cc.xywh(1, 9, 7, 1)); contentPanelBuilder.add(optionsPanel, cc.xywh(1, 11, 7, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(new EmptyBorder(12, 0, 0, 0)); //---- okButton ---- okButton.setText(bundle.getString("okButton.text")); //---- cancelButton ---- cancelButton.setText(bundle.getString("cancelButton.text")); PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.UNRELATED_GAP_COLSPEC, ColumnSpec.decode("max(pref;55dlu)"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:pref")), buttonBar); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 3, 5 } }); buttonBarBuilder.add(okButton, cc.xy(3, 1)); buttonBarBuilder.add(cancelButton, cc.xy(5, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:ConnectDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("ConnectDialog"); dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); JLabel labelHostName = new JLabel(); fieldHostName = new JTextField(); JLabel labelPortNumber = new JLabel(); fieldPort = new JTextField(); checkAuthentification = new JCheckBox(); labelLoginName = new JLabel(); fieldUserName = new JTextField(); labelPassword = new JLabel(); fieldPassword = new JPasswordField(); checkStorePassword = new JCheckBox(); labelWarning = new JLabel(); JXButtonPanel buttonBar = new JXButtonPanel(); btnOk = new JButton(); btnCancel = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle(bundle.getString("this.title")); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/* w w w . j a v a 2 s . c o m*/ dialogPane.setBorder(Borders.DIALOG); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.PREF_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC })); //---- labelHostName ---- labelHostName.setText(bundle.getString("labelHostName.text")); labelHostName.setLabelFor(fieldHostName); contentPanel.add(labelHostName, cc.xy(1, 1)); //---- fieldHostName ---- fieldHostName.setColumns(8); contentPanel.add(fieldHostName, cc.xy(3, 1)); //---- labelPortNumber ---- labelPortNumber.setText(bundle.getString("labelPortNumber.text")); labelPortNumber.setLabelFor(fieldPort); contentPanel.add(labelPortNumber, cc.xy(5, 1)); //---- fieldPort ---- fieldPort.setColumns(6); contentPanel.add(fieldPort, cc.xy(7, 1)); //---- checkAuthentification ---- checkAuthentification.setText(bundle.getString("checkAuthentification.text")); contentPanel.add(checkAuthentification, new CellConstraints(1, 3, 3, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 7, 0, 0))); //---- labelLoginName ---- labelLoginName.setText(bundle.getString("labelLoginName.text")); labelLoginName.setLabelFor(fieldUserName); contentPanel.add(labelLoginName, cc.xy(1, 5)); contentPanel.add(fieldUserName, cc.xy(3, 5)); //---- labelPassword ---- labelPassword.setText(bundle.getString("labelPassword.text")); labelPassword.setLabelFor(fieldPassword); contentPanel.add(labelPassword, cc.xy(1, 7)); contentPanel.add(fieldPassword, cc.xy(3, 7)); //---- checkStorePassword ---- checkStorePassword.setText(bundle.getString("checkStorePassword.text")); contentPanel.add(checkStorePassword, cc.xywh(5, 7, 3, 1)); //---- labelWarning ---- labelWarning.setText(bundle.getString("labelWarning.text")); labelWarning.setForeground(Color.red); contentPanel.add(labelWarning, cc.xywh(1, 9, 7, 1)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_PAD); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.GLUE_COLSPEC, FormSpecs.BUTTON_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 2, 4 } }); //---- btnOk ---- btnOk.setText(bundle.getString("btnOk.text")); buttonBar.add(btnOk, cc.xy(2, 1)); //---- btnCancel ---- btnCancel.setText(bundle.getString("btnCancel.text")); buttonBar.add(btnCancel, cc.xy(4, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:UserPreferencesDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner Open Source Project license - unknown ResourceBundle bundle = ResourceBundle.getBundle("UserPreferencesDialog"); JPanel dialogPane = new JPanel(); JPanel contentPanel = new JPanel(); toolbar = new JButtonBar(); panelCard = new JPanel(); JPanel panelGeneral = new JPanel(); JPanel panelGeneralSettings = new JPanel(); checkShowIconInSystemTray = new JCheckBox(); JPanel panelAlarm = new JPanel(); JPanel panelWhenAlarmGoesOff = new JPanel(); JPanel panelAlarmDefaults = new JPanel(); JPanel panelPlugins = new JPanel(); JTabbedPane pluginTabbedPane = new JTabbedPane(); JPanel pluginPanelSettings = new JPanel(); JScrollPane scrollPane1 = new JScrollPane(); pluginTable = new JXTable(); JXButtonPanel pluginsButtonPanel = new JXButtonPanel(); JLabel labelPluginInfo = new JLabel(); popmenuButton = ComponentFactory.getPopdownButton(); btnPluginOptions = new JButton(); JPanel pluginPanelUpdates = new JPanel(); check4PluginUpdatesAutomatically = new JCheckBox(); JLabel labelAfterDetectUpdate = new JLabel(); comboHowToUpdate = new JComboBox(); checkDownloadNotExistingPlugins = new JCheckBox(); JLabel labelCheckForUpdateEvery = new JLabel(); spinnerUpdateHour = new JSpinner(); JLabel labelHours = new JLabel(); JLabel labelUpdateFromServer = new JLabel(); comboPluginServers = new JComboBox(); btnResetDefaultPluginServer = new JButton(); JLabel labelManualCheck = new JLabel(); buttonBar = new JXButtonPanel(); btnOK = new JButton(); btnCancel = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle(bundle.getString("this.title")); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== {/*from w w w . ja v a2 s .co m*/ dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new BorderLayout()); //======== toolbar ======== { toolbar.setBorder(LineBorder.createBlackLineBorder()); toolbar.setLayout(null); } contentPanel.add(toolbar, BorderLayout.NORTH); //======== panelCard ======== { panelCard.setLayout(new CardLayout()); //======== panelGeneral ======== { panelGeneral.setBorder(Borders.TABBED_DIALOG); //======== panelGeneralSettings ======== { panelGeneralSettings.setBorder( new TitledBorder(null, bundle.getString("panelGeneralSettings.border"), TitledBorder.LEADING, TitledBorder.TOP)); //---- checkShowIconInSystemTray ---- checkShowIconInSystemTray.setText(bundle.getString("checkShowIconInSystemTray.text")); PanelBuilder panelGeneralSettingsBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default")), panelGeneralSettings); panelGeneralSettingsBuilder.add(checkShowIconInSystemTray, cc.xy(3, 1)); } PanelBuilder panelGeneralBuilder = new PanelBuilder( new FormLayout(ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormSpecs.RELATED_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW) }), panelGeneral); panelGeneralBuilder.add(panelGeneralSettings, cc.xy(1, 1)); } panelCard.add(panelGeneral, "CARD1"); //======== panelAlarm ======== { panelAlarm.setBorder(Borders.TABBED_DIALOG); //======== panelWhenAlarmGoesOff ======== { panelWhenAlarmGoesOff.setBorder( new TitledBorder(null, bundle.getString("panelWhenAlarmGoesOff.border"), TitledBorder.LEADING, TitledBorder.TOP)); PanelBuilder panelWhenAlarmGoesOffBuilder = new PanelBuilder( new FormLayout(new ColumnSpec[] { new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), panelWhenAlarmGoesOff); ((FormLayout) panelWhenAlarmGoesOff.getLayout()) .setColumnGroups(new int[][] { { 9, 11 } }); } //======== panelAlarmDefaults ======== { panelAlarmDefaults .setBorder(new TitledBorder(null, bundle.getString("panelAlarmDefaults.border"), TitledBorder.LEADING, TitledBorder.TOP)); PanelBuilder panelAlarmDefaultsBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.LEFT, Sizes.dluX(0), FormSpec.NO_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.NARROW_LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), panelAlarmDefaults); } PanelBuilder panelAlarmBuilder = new PanelBuilder(new FormLayout( ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), panelAlarm); panelAlarmBuilder.add(panelWhenAlarmGoesOff, cc.xy(1, 1)); panelAlarmBuilder.add(panelAlarmDefaults, cc.xy(1, 3)); } panelCard.add(panelAlarm, "CARD2"); //======== panelPlugins ======== { panelPlugins.setBorder(Borders.TABBED_DIALOG); //======== pluginTabbedPane ======== { //======== pluginPanelSettings ======== { pluginPanelSettings.setBorder( new CompoundBorder(new EmptyBorder(4, 4, 4, 4), new EtchedBorder())); pluginPanelSettings.setLayout(new BorderLayout()); //======== scrollPane1 ======== { scrollPane1.setViewportView(pluginTable); } pluginPanelSettings.add(scrollPane1, BorderLayout.CENTER); //======== pluginsButtonPanel ======== { pluginsButtonPanel.setBorder(new EmptyBorder(4, 4, 4, 4)); //---- labelPluginInfo ---- labelPluginInfo.setText(bundle.getString("labelPluginInfo.text")); //---- popmenuButton ---- popmenuButton.setText(bundle.getString("popmenuButton.text")); //---- btnPluginOptions ---- btnPluginOptions.setText(bundle.getString("btnPluginOptions.text")); PanelBuilder pluginsButtonPanelBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.UNRELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.UNRELATED_GAP_COLSPEC }, RowSpec.decodeSpecs("default")), pluginsButtonPanel); pluginsButtonPanelBuilder.add(labelPluginInfo, cc.xy(3, 1)); pluginsButtonPanelBuilder.add(popmenuButton, cc.xy(5, 1)); pluginsButtonPanelBuilder.add(btnPluginOptions, cc.xy(7, 1)); } pluginPanelSettings.add(pluginsButtonPanel, BorderLayout.SOUTH); } pluginTabbedPane.addTab(bundle.getString("pluginPanelSettings.tab.title"), pluginPanelSettings); //======== pluginPanelUpdates ======== { pluginPanelUpdates.setBorder(new CompoundBorder(new EmptyBorder(4, 4, 4, 4), new TitledBorder(bundle.getString("pluginPanelUpdates.border")))); //---- check4PluginUpdatesAutomatically ---- check4PluginUpdatesAutomatically .setText(bundle.getString("check4PluginUpdatesAutomatically.text")); //---- labelAfterDetectUpdate ---- labelAfterDetectUpdate.setText(bundle.getString("labelAfterDetectUpdate.text")); //---- checkDownloadNotExistingPlugins ---- checkDownloadNotExistingPlugins .setText(bundle.getString("checkDownloadNotExistingPlugins.text")); //---- labelCheckForUpdateEvery ---- labelCheckForUpdateEvery.setText(bundle.getString("labelCheckForUpdateEvery.text")); //---- labelHours ---- labelHours.setText(bundle.getString("labelHours.text")); //---- labelUpdateFromServer ---- labelUpdateFromServer.setText(bundle.getString("labelUpdateFromServer.text")); labelUpdateFromServer.setLabelFor(comboPluginServers); //---- comboPluginServers ---- comboPluginServers.setEditable(true); //---- btnResetDefaultPluginServer ---- btnResetDefaultPluginServer .setText(bundle.getString("btnResetDefaultPluginServer.text")); //---- labelManualCheck ---- labelManualCheck.setText(bundle.getString("labelManualCheck.text")); PanelBuilder pluginPanelUpdatesBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(Sizes .bounded(Sizes.MINIMUM, Sizes.dluX(30), Sizes.dluX(30))), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.bounded(Sizes.DEFAULT, Sizes.dluX(50), Sizes.dluX(75)), FormSpec.DEFAULT_GROW), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, FormSpecs.UNRELATED_GAP_COLSPEC }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.UNRELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.UNRELATED_GAP_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC }), pluginPanelUpdates); pluginPanelUpdatesBuilder.add(check4PluginUpdatesAutomatically, cc.xywh(1, 1, 5, 1)); pluginPanelUpdatesBuilder.add(labelAfterDetectUpdate, cc.xywh(1, 3, 3, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); pluginPanelUpdatesBuilder.add(comboHowToUpdate, cc.xywh(5, 3, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); pluginPanelUpdatesBuilder.add(checkDownloadNotExistingPlugins, cc.xywh(1, 5, 5, 1)); pluginPanelUpdatesBuilder.add(labelCheckForUpdateEvery, cc.xywh(1, 7, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); pluginPanelUpdatesBuilder.add(spinnerUpdateHour, cc.xy(3, 7)); pluginPanelUpdatesBuilder.add(labelHours, cc.xy(5, 7)); pluginPanelUpdatesBuilder.add(labelUpdateFromServer, cc.xywh(1, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); pluginPanelUpdatesBuilder.add(comboPluginServers, cc.xywh(3, 9, 3, 1)); pluginPanelUpdatesBuilder.add(btnResetDefaultPluginServer, cc.xy(7, 9)); pluginPanelUpdatesBuilder.add(labelManualCheck, cc.xywh(1, 13, 7, 1)); } pluginTabbedPane.addTab(bundle.getString("pluginPanelUpdates.tab.title"), pluginPanelUpdates); } PanelBuilder panelPluginsBuilder = new PanelBuilder( new FormLayout(ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("5px") }), panelPlugins); panelPluginsBuilder.add(pluginTabbedPane, cc.xy(1, 1)); } panelCard.add(panelPlugins, "CARD6"); } contentPanel.add(panelCard, BorderLayout.CENTER); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_PAD); buttonBar.setCyclic(true); //---- btnOK ---- btnOK.setText(bundle.getString("btnOK.text")); //---- btnCancel ---- btnCancel.setText(bundle.getString("btnCancel.text")); PanelBuilder buttonBarBuilder = new PanelBuilder(new FormLayout( new ColumnSpec[] { FormSpecs.GLUE_COLSPEC, ColumnSpec.decode("max(pref;42dlu)"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.PREF_COLSPEC }, RowSpec.decodeSpecs("pref")), buttonBar); ((FormLayout) buttonBar.getLayout()).setColumnGroups(new int[][] { { 2, 4 } }); buttonBarBuilder.add(btnOK, cc.xy(2, 1)); buttonBarBuilder.add(btnCancel, cc.xy(4, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:ai.aitia.meme.utils.FormsUtils.java
License:Open Source License
/** * Returns a DefaultFormBuilder containing the specified components and layout. * @param cols This parameter corresponds to the <code>encodedColumnSpecs</code> * parameter of FormLayout's ctor. Besides the encoding defined by FormLayout, * the following extensions are also available: the characters defined in the * global <code>{@link #gapLength}</code> variable (hereafter: gap-characters) * can be used to insert gap-columns. Gap columns must not appear in the * cell-specification (explained below) and they're automatically included in * column spans. //w w w .j a v a 2 s. c o m * Consecutive gap-characters are coalesced into 1 gap column by calculating * their cumulated pixel size. * @param rows A string describing general builder settings + cell-specification * + row/colum spans + row heights + row groups. See the examples. * The digits and underscores specify which component goes into which cell(s) * of the layout grid (cell-specification). There can be at most one character * for every (non-gap) column specified by <code>cols</code>. Rows must be * separated by the '|' character. Only underscores, digits and letters are * allowed in the cell-specification (space isn't). Underscore means that a * cell is empty. A digit/letter character refers to a component in the varargs * list: '0'..'9', 'A'..'Z', 'a'..'z' (in this order) denote the first 62 * components of the <code>args</code> list. Repeating the same digit specifies * the component's column span (and row span, if repeated in consecutive rows * in the same columns, like '3' in the example).<br> * After the cell-specification, but before the newline ('|') character * the row height and row grouping can also be specified. It must begin * with a space to separate it from the cell-specification. The row * height can be a gap-character (for constant heights only) or a string * that is interpreted by RowSpec.decodeSpecs(). If omitted, the height * spec. of the most recent row is inherited. Content rows inherit the * height of the previous content row, gap rows inherit the height of * the previous gap row. A row is a gap row if its cell-specification is * omitted.<br> * Row grouping forces equal heights to every member of the group. It * can be specified by "grp?" strings using any character in place of * '?' (except space and '|'. In the example 'grp1' uses '1'). Rows * using the same grouping character will be in the same group. * By default there're no groups. * <br> * General builder-settings can be specified at the beginning of the * string, enclosed in square brackets ([..]). (No space is allowed * after the closing ']'). This is intended for future extensions, too. * The list of available settings is described at the {@link Prop} * enumeration. Note that setting names are case-sensitive, and should * be separated by commas. * @param args List of components. Besides java.awt.Component objects, * the caller may use plain strings and instances of the {@link Separator} * class. Plain strings are used to create labels (with mnemonic-expansion). * Separator objects will create and add separators to the form. * Any of these objects may be followed optionally by a {@link CellConstraints}, * a {@link CellConstraints.Alignment} or a {@link CellInsets} object, * which overrides the cell's default alignment, can extend its row/column * span and adjust its insets.<br> * If the first element of <code>args</code> is a java.util.Map object, * it is treated as an additional mapping for gap-characters. This * overrides the default global mapping. Note that gap-characters can * help you to set up uniform spacing on your forms. For example, if * you use "-" as normal column-gap and "~" as normal row-gap, fine-tuning * the sizes of these gaps later is as easy as changing the mapping for "-" * and "~" — there's no need to update all the dlu sizes in all layouts. * @see * Example1: <pre> * build("6dlu, p, 6dlu, 50dlu, 6dlu", * "_0_1_ pref| 6dlu|" + * "_2_33 pref:grow(0.5) grp1||" + * "_4_33 grp1", * component0, component1, component2, component3, * component4, cellConstraintsForComponent4).getPanel() * </pre> * The same exaple with gap-characters: <pre> * build("~ p ~ 50dlu, 6dlu", * "01_ pref|~|" + * "233 pref:grow(0.5) grp1||" + * "433 grp1", * component0, component1, component2, component3, * component4, cellConstraintsForComponent4).getPanel() * </pre> * Example3 (only the second argument): <pre> * "[LineGapSize=6dlu, ParagraphGapSize=20dlu]_0_1||_2_3||_4_5" * </pre> * Note: this method can be used with no components and empty cell-specification, * too. In this case only a {@link DefaultFormBuilder} is created, configured * and returned. Its operations can then be used to append components to the form. */ @SuppressWarnings("unchecked") public static DefaultFormBuilder build(String cols, String rows, Object... args) { Context ctx = new Context(); // Parse column widths // int firstArg = 0; if (args.length > 0 && args[0] instanceof java.util.Map) { ctx.localGapSpec = (java.util.Map<Character, String>) args[0]; firstArg += 1; } StringBuilder colstmp = new StringBuilder(); ctx.contentCol = parseColumnWidths(colstmp, cols, ctx.localGapSpec, 0); // Parse the list of components (may include individual cell-constraints) // ctx.components = new ArrayList<Rec>(args.length); for (int i = firstArg; i < args.length; ++i) { Rec r = new Rec(args[i]); if (i + 1 < args.length) { if (args[i + 1] instanceof CellConstraints) { r.cc = (CellConstraints) args[++i]; r.useAlignment = true; } else if (args[i + 1] instanceof CellConstraints.Alignment) { CellConstraints.Alignment a = (CellConstraints.Alignment) args[++i]; if (a == CellConstraints.BOTTOM || a == CellConstraints.TOP) r.cc = new CellConstraints(1, 1, CellConstraints.DEFAULT, a); else if (a == CellConstraints.LEFT || a == CellConstraints.RIGHT) r.cc = new CellConstraints(1, 1, a, CellConstraints.DEFAULT); else if (a == CellConstraints.CENTER || a == CellConstraints.FILL) r.cc = new CellConstraints(1, 1, a, a); r.useAlignment = (r.cc != null); } else if (args[i + 1] instanceof CellInsets) { CellInsets ci = ((CellInsets) args[++i]); r.cc = ci.cc; r.useAlignment = ci.useAlignment; r.useInsets = true; //} //else if (args[i+1] == null) { // this would allow superfluous 'null' values // i += 1; } } ctx.components.add(r); } // Parse general settings (but don't apply yet) // EnumMap<Prop, Object> props = null; int i = rows.indexOf(']'); if (i >= 0) { String defaults = rows.substring(0, i); rows = rows.substring(++i); i = defaults.indexOf('['); ctx.input = defaults.substring(++i); props = Prop.parseGeneralSettings(ctx); } // Parse cell-specification, row heights and row groups // String cells[] = rows.split("\\|", -1); StringBuilder rowstmp = new StringBuilder(); java.util.HashMap<Character, int[]> rowGroups = new HashMap<Character, int[]>(); String lastContentRowHeight = "p", lastGapRowHeight = null; int rowcnt = 0; for (i = 0; i < cells.length; ++i) { rowcnt += 1; // See if it begins with a gap-character String g = (cells[i].length() > 0) ? getGap(cells[i].charAt(0), ctx.localGapSpec) : null; if (g != null) cells[i] = ' ' + cells[i]; int j = cells[i].indexOf(' '); boolean gapRow = (j == 0) || (cells[i].length() == 0); String rh = null; if (j >= 0) { String tmp[] = cells[i].substring(j + 1).split("\\s"); // expect height and grouping specifications cells[i] = cells[i].substring(0, j); ArrayList<String> gaps = new ArrayList<String>(); for (j = 0; j < tmp.length; ++j) { if (tmp[j].length() == 0) continue; if (tmp[j].length() == 4 && tmp[j].toLowerCase().startsWith("grp")) { Character groupch = tmp[j].charAt(3); rowGroups.put(groupch, appendIntArray(rowGroups.get(groupch), rowcnt)); } else { rh = tmp[j]; for (int k = 0, n = tmp[j].length(); k < n && addGap(gaps, getGap(tmp[j].charAt(k), ctx.localGapSpec)); ++k) ; } } if (!gaps.isEmpty()) { StringBuilder sb = new StringBuilder(); flushGaps(gaps, sb, false); rh = sb.substring(0, sb.length() - 1); } } if (rh == null) { if (gapRow && lastGapRowHeight == null) { ctx.b = new DefaultFormBuilder(new FormLayout(colstmp.toString(), "")); Prop.setBuilder(props, ctx); lastGapRowHeight = parseableRowSpec(ctx.b.getLineGapSpec()); } rh = gapRow ? lastGapRowHeight : lastContentRowHeight; } else { if (gapRow) lastGapRowHeight = rh; else lastContentRowHeight = rh; } if (i > 0) rowstmp.append(','); rowstmp.append(rh); } // Create builder // FormLayout fml = new FormLayout(colstmp.toString(), rowstmp.toString()); ctx.b = new DefaultFormBuilder(fml, debuggable()); // Apply builder settings (e.g. column groups) // Prop.setBuilder(props, ctx); props = null; // Set row groups // if (!rowGroups.isEmpty()) { int[][] tmp = new int[rowGroups.size()][]; // ??? i = 0; for (int[] a : rowGroups.values()) tmp[i++] = a; fml.setRowGroups(tmp); } rowGroups = null; JLabel lastLabel = null; java.util.HashSet<Character> done = new java.util.HashSet<Character>(ctx.components.size()); int h = cells.length; for (int y = 0; y < cells.length; ++y) { int w = cells[y].length(); int first = -1; for (int x = 0; x < w; ++x) { char ch = cells[y].charAt(x); if (ch == '_' || done.contains(ch)) continue; int idx = intValue(ch); Rec rec; try { rec = ctx.components.get(idx); } catch (IndexOutOfBoundsException e) { throw new IndexOutOfBoundsException( String.format("build() cells=\"%s\" ch=%c rows=\"%s\"", cells[y], ch, rows)); } CellConstraints cc = (rec.cc == null) ? new CellConstraints() : (CellConstraints) rec.cc.clone(); int sx = cc.gridWidth, sy = cc.gridHeight; // span x, span y while (x + sx < w && cells[y].charAt(x + sx) == ch) sx += 1; while (y + sy < h && ((x < cells[y + sy].length() && cells[y + sy].charAt(x) == ch) || (cells[y + sy].length() == 0 && y + sy + 1 < h && x < cells[y + sy + 1].length() && cells[y + sy + 1].charAt(x) == ch))) { sy += 1; } int colSpan = ctx.contentCol[x + sx - 1] - ctx.contentCol[x] + 1; ctx.b.setBounds(ctx.contentCol[x] + 1, ctx.b.getRow(), colSpan, sy); ctx.b.setLeadingColumnOffset(first & ctx.contentCol[x]); // 0 vagy x (itt nem kell a +1) first = 0; x += (sx - 1); Object comp = ctx.components.get(idx).component; if (comp instanceof Component) { ctx.b.append((Component) comp, colSpan); if (comp instanceof JLabel) lastLabel = (JLabel) comp; else { if (lastLabel != null) lastLabel.setLabelFor((Component) comp); lastLabel = null; } } else if (comp instanceof Separator) { comp = ctx.b.appendSeparator(comp.toString()); lastLabel = null; } else { comp = lastLabel = ctx.b.getComponentFactory().createLabel(comp.toString()); ctx.b.append(lastLabel, colSpan); } if (rec.useAlignment || rec.useInsets) { CellConstraints cc2 = fml.getConstraints((Component) comp); cc2.insets = cc.insets; cc2.hAlign = cc.hAlign; cc2.vAlign = cc.vAlign; fml.setConstraints((Component) comp, cc2); } done.add(ch); } lastLabel = null; ctx.b.nextLine(); } return ctx.b; }
From source file:anl.verdi.plot.anim.MultiPlotAnimation.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); separator1 = compFactory.createSeparator("Select Plots"); scrollPane1 = new JScrollPane(); plotList = new CheckBoxList(); panel1 = new JPanel(); label1 = new JLabel(); startSpinner = new JSpinner(); startLbl = new JLabel(); label2 = new JLabel(); endSpinner = new JSpinner(); endLbl = new JLabel(); panel2 = new JPanel(); gifChk = new JCheckBox(); gifFileLbl = new JLabel(); gifFileBtn = new JButton(); separator2 = compFactory.createSeparator(""); CellConstraints cc = new CellConstraints(); //======== this ======== // 2014/*www. j a v a 2s.com*/ ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("default:grow"); RowSpec aRowSpec = new RowSpec(RowSpec.TOP, Sizes.dluY(84), 0.5); RowSpec bRowSpec = new RowSpec(RowSpec.FILL, Sizes.PREFERRED, 0.5); setLayout(new FormLayout(aColumnSpec, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, aRowSpec, FormFactory.RELATED_GAP_ROWSPEC, bRowSpec, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // setLayout(new FormLayout( // ColumnSpec.decodeSpecs("default:grow"), // new RowSpec[] { // FormFactory.DEFAULT_ROWSPEC, // FormFactory.RELATED_GAP_ROWSPEC, // new RowSpec(RowSpec.TOP, Sizes.dluY(84), 0.5), // FormFactory.RELATED_GAP_ROWSPEC, // new RowSpec(RowSpec.FILL, Sizes.PREFERRED, 0.5), // FormFactory.RELATED_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC // })); add(separator1, cc.xy(1, 1)); //======== scrollPane1 ======== { scrollPane1.setViewportView(plotList); } add(scrollPane1, cc.xy(1, 3)); //======== panel1 ======== { // 2014 ColumnSpec[] dColumnSpec = ColumnSpec.decodeSpecs("max(pref;40dlu)"); ColumnSpec[] eColumnSpec = ColumnSpec.decodeSpecs("max(pref;40dlu):grow"); panel1.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.dluX(71)), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, dColumnSpec[0], FormFactory.UNRELATED_GAP_COLSPEC, eColumnSpec[0] }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // panel1.setLayout(new FormLayout( // new ColumnSpec[] { // new ColumnSpec(Sizes.dluX(71)), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec("max(pref;40dlu)"), // FormFactory.UNRELATED_GAP_COLSPEC, // new ColumnSpec("max(pref;40dlu):grow") // }, // new RowSpec[] { // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC // })); //---- label1 ---- label1.setText("Starting Time Step:"); panel1.add(label1, cc.xy(1, 1)); panel1.add(startSpinner, cc.xy(3, 1)); //---- startLbl ---- startLbl.setFont(new Font("Tahoma", Font.BOLD, 11)); panel1.add(startLbl, cc.xy(5, 1)); //---- label2 ---- label2.setText("Ending Time Step:"); panel1.add(label2, cc.xy(1, 3)); panel1.add(endSpinner, cc.xy(3, 3)); //---- endLbl ---- endLbl.setFont(new Font("Tahoma", Font.BOLD, 11)); panel1.add(endLbl, cc.xy(5, 3)); } add(panel1, cc.xywh(1, 5, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== panel2 ======== { // 2014 ColumnSpec fColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); RowSpec[] fRowSpec = RowSpec.decodeSpecs("default"); panel2.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, fColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, fRowSpec)); // panel2.setLayout(new FormLayout( // new ColumnSpec[] { // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC // }, // RowSpec.decodeSpecs("default"))); //---- gifChk ---- gifChk.setText("Make Animated GIF(s)"); panel2.add(gifChk, cc.xy(1, 1)); panel2.add(gifFileLbl, cc.xy(3, 1)); //---- gifFileBtn ---- gifFileBtn.setText("..."); gifFileBtn.setMaximumSize(new Dimension(23, 23)); gifFileBtn.setMinimumSize(new Dimension(23, 23)); gifFileBtn.setPreferredSize(new Dimension(23, 23)); gifFileBtn.setEnabled(false); panel2.add(gifFileBtn, cc.xy(5, 1)); } add(panel2, cc.xy(1, 7)); add(separator2, cc.xy(1, 9)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:anl.verdi.plot.gui.ChartTitlePanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license label4 = new JLabel(); useBox = new JCheckBox(); label1 = new JLabel(); textFld = new JTextField(); label2 = new JLabel(); fontFld = new JTextField(); fontBtn = new JButton(); label3 = new JLabel(); colorFld = new JTextField(); colorBtn = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(new TitledBorder("Title")); // 2014//ww w. j a v a 2 s . com ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // setLayout(new FormLayout( // new ColumnSpec[]{ // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC // }, // new RowSpec[]{ // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC // })); //---- label4 ---- label4.setText("Show Title"); add(label4, cc.xy(1, 1)); add(useBox, cc.xy(3, 1)); //---- label1 ---- label1.setText("Text:"); add(label1, cc.xy(1, 3)); add(textFld, cc.xy(3, 3)); //---- label2 ---- label2.setText("Font:"); add(label2, cc.xy(1, 5)); //---- fontFld ---- fontFld.setEditable(false); add(fontFld, cc.xy(3, 5)); //---- fontBtn ---- fontBtn.setText("Select"); add(fontBtn, cc.xy(5, 5)); //---- label3 ---- label3.setText("Color:"); add(label3, cc.xy(1, 7)); //---- colorFld ---- colorFld.setBackground(Color.black); colorFld.setEditable(false); add(colorFld, new CellConstraints(3, 7, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(4, 0, 4, 0))); //---- colorBtn ---- colorBtn.setText("Select"); add(colorBtn, cc.xy(5, 7)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:anl.verdi.plot.gui.GridLinePanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license showBox = new JCheckBox(); colorLabel = new JLabel(); colorFld = new JTextField(); colorButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(new TitledBorder("Grid Lines")); // 2014/* ww w . j a v a 2 s .co m*/ ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // setLayout(new FormLayout( // new ColumnSpec[] { // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC // }, // new RowSpec[] { // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC // })); //---- showBox ---- showBox.setText("Show Grid Lines"); showBox.setHorizontalTextPosition(SwingConstants.LEFT); add(showBox, cc.xywh(1, 1, 3, 1)); //---- colorLabel ---- colorLabel.setText("Color:"); add(colorLabel, cc.xy(1, 3)); //---- colorFld ---- colorFld.setBackground(Color.black); colorFld.setEditable(false); add(colorFld, new CellConstraints(3, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(4, 0, 4, 0))); //---- colorButton ---- colorButton.setText("Select"); add(colorButton, cc.xy(5, 3)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:anl.verdi.plot.gui.LabelPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); separator1 = compFactory.createSeparator("Label"); label1 = new JLabel(); textFld = new JTextField(); label2 = new JLabel(); fontFld = new JTextField(); fontBtn = new JButton(); label3 = new JLabel(); colorFld = new JTextField(); colorBtn = new JButton(); tickSep = compFactory.createSeparator("Ticks"); tickChk = new JCheckBox(); number = new JLabel(); numberFld = new JTextField(); tickFontLbl = new JLabel(); tickFontFld = new JTextField(); tickFontBtn = new JButton(); tickColorLbl = new JLabel(); tickColorFld = new JTextField(); tickColorBtn = new JButton(); //====Added to configure domain axis labels format = new JLabel(); formatFld = new JTextField(); orientation = new JLabel(); orientationOption = new JPanel(); vRadio = new JRadioButton("Vertical"); hRadio = new JRadioButton("Horizontal"); lsRadio = new JRadioButton("Left Slant"); rsRadio = new JRadioButton("Right Slant"); radioGroup = new ButtonGroup(); radioGroup.add(vRadio);//from w ww . j a v a 2 s .co m radioGroup.add(hRadio); radioGroup.add(lsRadio); radioGroup.add(rsRadio); orientationOption.add(hRadio); orientationOption.add(vRadio); orientationOption.add(lsRadio); orientationOption.add(rsRadio); hRadio.setSelected(true); formatFld.setToolTipText("Use date and time patterns such as: MM/dd/yyyy HH:mm:ss"); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(new TitledBorder("Title")); // 2014 ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // setLayout(new FormLayout( // new ColumnSpec[]{ // FormFactory.RELATED_GAP_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC // }, // new RowSpec[]{ // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC // })); add(separator1, cc.xywh(1, 1, 7, 1)); //---- label1 ---- label1.setText("Text:"); add(label1, cc.xy(3, 3)); add(textFld, cc.xy(5, 3)); //---- label2 ---- label2.setText("Font:"); add(label2, cc.xy(3, 5)); //---- fontFld ---- fontFld.setEditable(false); add(fontFld, cc.xy(5, 5)); //---- fontBtn ---- fontBtn.setText("Select"); add(fontBtn, cc.xy(7, 5)); //---- label3 ---- label3.setText("Color:"); add(label3, cc.xy(3, 7)); //---- colorFld ---- colorFld.setBackground(Color.black); colorFld.setEditable(false); add(colorFld, new CellConstraints(5, 7, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(4, 0, 4, 0))); //---- colorBtn ---- colorBtn.setText("Select"); add(colorBtn, cc.xy(7, 7)); add(tickSep, cc.xywh(1, 9, 7, 1)); //---- tickChk ---- tickChk.setText("Show Tick Labels"); add(tickChk, cc.xywh(3, 11, 3, 1)); //---- number ---- number.setText("Number:"); add(number, cc.xy(3, 13)); add(numberFld, cc.xy(5, 13)); //---- tickFontLbl ---- tickFontLbl.setText("Font:"); add(tickFontLbl, cc.xy(3, 15)); //---- tickFontFld ---- tickFontFld.setEditable(false); add(tickFontFld, cc.xy(5, 15)); //---- tickFontBtn ---- tickFontBtn.setText("Select"); add(tickFontBtn, cc.xy(7, 15)); //---- tickColorLbl ---- tickColorLbl.setText("Color:"); add(tickColorLbl, cc.xy(3, 17)); //---- tickColorFld ---- tickColorFld.setBackground(Color.black); tickColorFld.setEditable(false); add(tickColorFld, cc.xy(5, 17)); //---- tickColorBtn ---- tickColorBtn.setText("Select"); add(tickColorBtn, cc.xy(7, 17)); //---- Format ---- format.setText("Format:"); add(format, cc.xy(3, 19)); add(formatFld, cc.xy(5, 19)); //---- Orientation ---- orientation.setText("Orientation:"); add(orientation, cc.xy(3, 21)); add(orientationOption, cc.xy(5, 21)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:anl.verdi.plot.gui.LegendLabelPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); legendChk = new JCheckBox(); separator1 = compFactory.createSeparator("Label"); label1 = new JLabel(); textFld = new JTextField(); label2 = new JLabel(); fontFld = new JTextField(); fontBtn = new JButton(); label3 = new JLabel(); colorFld = new JTextField(); colorBtn = new JButton(); tickSep = compFactory.createSeparator("Ticks"); tickChk = new JCheckBox(); number = new JLabel(); numberFld = new JTextField(); tickFontLbl = new JLabel(); tickFontFld = new JTextField(); tickFontBtn = new JButton(); tickColorLbl = new JLabel(); tickColorFld = new JTextField(); tickColorBtn = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(new TitledBorder("Title")); // 2014/*from w w w . ja va 2 s.c o m*/ ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // setLayout(new FormLayout( // new ColumnSpec[]{ // FormFactory.RELATED_GAP_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC // }, // new RowSpec[]{ // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC // })); //---- legendChk ---- legendChk.setText("Show Legend"); add(legendChk, cc.xywh(1, 1, 7, 1)); add(separator1, cc.xywh(1, 3, 7, 1)); //---- label1 ---- label1.setText("Text:"); add(label1, cc.xy(3, 5)); add(textFld, cc.xy(5, 5)); //---- label2 ---- label2.setText("Font:"); add(label2, cc.xy(3, 7)); //---- fontFld ---- fontFld.setEditable(false); add(fontFld, cc.xy(5, 7)); //---- fontBtn ---- fontBtn.setText("Select"); add(fontBtn, cc.xy(7, 7)); //---- label3 ---- label3.setText("Color:"); add(label3, cc.xy(3, 9)); //---- colorFld ---- colorFld.setBackground(Color.black); colorFld.setEditable(false); add(colorFld, new CellConstraints(5, 9, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(4, 0, 4, 0))); //---- colorBtn ---- colorBtn.setText("Select"); add(colorBtn, cc.xy(7, 9)); add(tickSep, cc.xywh(1, 11, 7, 1)); //---- tickChk ---- tickChk.setText("Show Tick Labels"); add(tickChk, cc.xywh(3, 13, 3, 1)); //---- number ---- number.setText("Number:"); add(number, cc.xy(3, 15)); add(numberFld, cc.xy(5, 15)); //---- tickFontLbl ---- tickFontLbl.setText("Font:"); add(tickFontLbl, cc.xy(3, 17)); //---- tickFontFld ---- tickFontFld.setEditable(false); add(tickFontFld, cc.xy(5, 17)); //---- tickFontBtn ---- tickFontBtn.setText("Select"); add(tickFontBtn, cc.xy(7, 17)); //---- tickColorLbl ---- tickColorLbl.setText("Color:"); add(tickColorLbl, cc.xy(3, 19)); //---- tickColorFld ---- tickColorFld.setBackground(Color.black); tickColorFld.setEditable(false); add(tickColorFld, cc.xy(5, 19)); //---- tickColorBtn ---- tickColorBtn.setText("Select"); add(tickColorBtn, cc.xy(7, 19)); // JFormDesigner - End of component initialization //GEN-END:initComponents }