List of usage examples for com.jgoodies.forms.layout CellConstraints FILL
Alignment FILL
To view the source code for com.jgoodies.forms.layout CellConstraints FILL.
Click Source Link
From source file:org.archiviststoolkit.maintenance.upgrades.UpgradeWarning.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); contentPanel = new JPanel(); label1 = new JLabel(); scrollPane1 = new JScrollPane(); messageText = new JTextArea(); label2 = new JLabel(); buttonBar = new JPanel(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setModal(true);//from w ww .j a v a2 s . c o m Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout(ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.TOP, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- label1 ---- label1.setText( "This upgrade will make changes to your data. Please make sure you have done a backup."); contentPanel.add(label1, cc.xy(1, 1)); //======== scrollPane1 ======== { //---- messageText ---- messageText.setRows(15); messageText.setEditable(false); messageText.setLineWrap(true); messageText.setWrapStyleWord(true); scrollPane1.setViewportView(messageText); } contentPanel.add(scrollPane1, cc.xywh(1, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); //---- label2 ---- label2.setText("Do you want to continue?"); contentPanel.add(label2, cc.xy(1, 5)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- okButton ---- okButton.setText("Yes"); okButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { okButtonActionPerformed(e); } }); buttonBar.add(okButton, cc.xy(2, 1)); //---- cancelButton ---- cancelButton.setText("No"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelButtonActionPerformed(e); } }); buttonBar.add(cancelButton, 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:org.archiviststoolkit.structure.DatabaseFieldsForm.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license label1 = new JLabel(); fieldName = ATBasicComponentFactory/*from w w w .j a v a2 s .c o m*/ .createTextField(detailsModel.getModel(DatabaseFields.PROPERTYNAME_FIELD_NAME)); label16 = new JLabel(); fieldLabel = ATBasicComponentFactory .createTextField(detailsModel.getBufferedModel(DatabaseFields.PROPERTYNAME_FIELD_LABEL)); label12 = new JLabel(); dataType = ATBasicComponentFactory .createTextField(detailsModel.getModel(DatabaseFields.PROPERTYNAME_DATA_TYPE)); lookupListLabel = new JLabel(); lookupList = ATBasicComponentFactory .createTextField(detailsModel.getModel(DatabaseFields.PROPERTYNAME_LOOKUP_LIST)); panel1 = new JPanel(); includeInSearchEditor = ATBasicComponentFactory.createCheckBox(detailsModel, DatabaseFields.PROPERTYNAME_INCLUDE_IN_SEARCH_EDITOR, DatabaseFields.class, true); label17 = new JLabel(); returnScreenOrder = ATBasicComponentFactory.createBufferedIntegerField(detailsModel, DatabaseFields.PROPERTYNAME_RETURN_SCREEN_ORDER); label14 = new JLabel(); scrollPane2 = new JScrollPane(); definition = ATBasicComponentFactory .createTextArea(detailsModel.getBufferedModel(DatabaseFields.PROPERTYNAME_DEFINITION)); label13 = new JLabel(); scrollPane1 = new JScrollPane(); examples = ATBasicComponentFactory .createTextArea(detailsModel.getBufferedModel(DatabaseFields.PROPERTYNAME_EXAMPLES)); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(Borders.DLU4_BORDER); setOpaque(false); setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); setPreferredSize(new Dimension(600, 500)); setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("30px"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("max(default;400px):grow") }, 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, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) })); //---- label1 ---- label1.setText("Field Name"); label1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(label1, cc.xy(1, 1)); //---- fieldName ---- fieldName.setEditable(false); fieldName.setOpaque(false); fieldName.setBorder(null); fieldName.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(fieldName, cc.xywh(3, 1, 3, 1)); //---- label16 ---- label16.setText("Field Label"); label16.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(label16, cc.xy(1, 3)); //---- fieldLabel ---- fieldLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(fieldLabel, cc.xywh(3, 3, 3, 1)); //---- label12 ---- label12.setText("Data Type"); label12.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(label12, cc.xy(1, 5)); //---- dataType ---- dataType.setEditable(false); dataType.setBorder(null); dataType.setOpaque(false); dataType.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(dataType, cc.xywh(3, 5, 3, 1)); //---- lookupListLabel ---- lookupListLabel.setText("Lookup List"); lookupListLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(lookupListLabel, cc.xy(1, 7)); //---- lookupList ---- lookupList.setOpaque(false); lookupList.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); lookupList.setEditable(false); lookupList.setBorder(null); add(lookupList, cc.xywh(3, 7, 3, 1)); //======== panel1 ======== { panel1.setBackground(new Color(234, 201, 250)); panel1.setOpaque(false); panel1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel1.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- includeInSearchEditor ---- includeInSearchEditor.setBackground(new Color(234, 201, 250)); includeInSearchEditor.setText("Include In Search Editor"); includeInSearchEditor.setOpaque(false); includeInSearchEditor.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel1.add(includeInSearchEditor, cc.xy(1, 1)); } add(panel1, cc.xywh(3, 9, 3, 1)); //---- label17 ---- label17.setText("Return Screen Order"); label17.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(label17, cc.xy(1, 11)); //---- returnScreenOrder ---- returnScreenOrder.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(returnScreenOrder, cc.xywh(3, 11, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); //---- label14 ---- label14.setText("Definition"); label14.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(label14, cc.xywh(1, 13, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== scrollPane2 ======== { scrollPane2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); //---- definition ---- definition.setRows(5); definition.setLineWrap(true); definition.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); definition.setWrapStyleWord(true); scrollPane2.setViewportView(definition); } add(scrollPane2, cc.xywh(3, 13, 3, 1)); //---- label13 ---- label13.setText("Examples"); label13.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(label13, cc.xywh(1, 15, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== scrollPane1 ======== { scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); //---- examples ---- examples.setRows(5); examples.setLineWrap(true); examples.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); examples.setWrapStyleWord(true); scrollPane1.setViewportView(examples); } add(scrollPane1, cc.xywh(3, 15, 3, 1)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.archiviststoolkit.structure.DatabaseTablesForm.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license label1 = new JLabel(); tableName = ATBasicComponentFactory/*from w ww . j av a 2 s.c om*/ .createTextField(detailsModel.getModel(DatabaseTables.PROPERTYNAME_TABLE_NAME)); panel1 = new JPanel(); label2 = new JLabel(); scrollPane1 = new JScrollPane(); databaseFieldsTable = new DomainSortableTable(DatabaseFields.class, DatabaseFields.PROPERTYNAME_FIELD_NAME); panel2 = new JPanel(); deleteFieldButton = new JButton(); getFieldsButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(Borders.DLU4_BORDER); setOpaque(false); setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); setPreferredSize(new Dimension(800, 500)); setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("max(default;400px):grow") }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) })); //---- label1 ---- label1.setText("Table Name"); label1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(label1, cc.xy(1, 1)); //---- tableName ---- tableName.setEditable(false); tableName.setOpaque(false); tableName.setBorder(null); tableName.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(tableName, cc.xy(3, 1)); //======== panel1 ======== { panel1.setBackground(new Color(234, 201, 250)); panel1.setOpaque(false); panel1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel1.setLayout(new FormLayout(ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- label2 ---- label2.setText("Fields"); label2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel1.add(label2, cc.xy(1, 1)); //======== scrollPane1 ======== { scrollPane1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); //---- databaseFieldsTable ---- databaseFieldsTable.setPreferredScrollableViewportSize(new Dimension(450, 200)); scrollPane1.setViewportView(databaseFieldsTable); } panel1.add(scrollPane1, cc.xywh(1, 3, 1, 1, CellConstraints.FILL, CellConstraints.FILL)); //======== panel2 ======== { panel2.setBackground(new Color(234, 201, 250)); panel2.setOpaque(false); panel2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel2.setLayout( new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- deleteFieldButton ---- deleteFieldButton.setText("Delete Field"); deleteFieldButton.setBackground(new Color(234, 201, 250)); deleteFieldButton.setOpaque(false); deleteFieldButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel2.add(deleteFieldButton, cc.xy(1, 1)); //---- getFieldsButton ---- getFieldsButton.setText("Get Fields"); getFieldsButton.setBackground(new Color(234, 201, 250)); getFieldsButton.setOpaque(false); getFieldsButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); getFieldsButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { getFieldsActionPerformed(e); } }); panel2.add(getFieldsButton, cc.xy(3, 1)); } panel1.add(panel2, cc.xywh(1, 5, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); } add(panel1, cc.xywh(1, 3, 3, 1)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.archiviststoolkit.structure.DefaultValuesFields.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license lookupListLabel = new JLabel(); table = new JComboBox(new DefaultComboBoxModel(ATFieldInfo.getTableListForDefaultValues())); lookupListLabel2 = new JLabel(); field = new JComboBox(); label17 = new JLabel(); valuePlaceHolder = new JTextField(); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(Borders.DLU4_BORDER);/*w w w. j a va2 s . c o m*/ setOpaque(false); setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); setPreferredSize(new Dimension(400, 130)); setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("30px:grow") }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); //---- lookupListLabel ---- lookupListLabel.setText("Table"); lookupListLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(lookupListLabel, cc.xy(1, 1)); //---- table ---- table.setOpaque(false); table.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); table.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { tableActionPerformed(e); } }); add(table, cc.xywh(3, 1, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); //---- lookupListLabel2 ---- lookupListLabel2.setText("Field"); lookupListLabel2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(lookupListLabel2, cc.xy(1, 3)); //---- field ---- field.setOpaque(false); field.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); field.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fieldActionPerformed(e); } }); add(field, cc.xywh(3, 3, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); //---- label17 ---- label17.setText("Value"); label17.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(label17, cc.xy(1, 5)); //---- valuePlaceHolder ---- valuePlaceHolder.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); add(valuePlaceHolder, cc.xywh(3, 5, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.archiviststoolkit.swing.ImportOptionsMARC.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license label1 = new JLabel(); repositorySelector = new JComboBox(); label2 = new JLabel(); resourceLevelSelector = ATBasicComponentFactory .createUnboundComboBox(LookupListUtils.getLookupListValues("Resource levels")); label3 = new JLabel(); panel1 = new JPanel(); resourceIdentifier1 = new JTextField(); resourceIdentifier2 = new JTextField(); resourceIdentifier3 = new JTextField(); resourceIdentifier4 = new JTextField(); label4 = new JLabel(); panel2 = new JPanel(); entireMarcRecord = new JRadioButton(); subjectHeadingsOnly = new JRadioButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(Borders.DLU2_BORDER);// w w w . jav a 2s.c o m setLayout(new FormLayout(ColumnSpec.decodeSpecs("default:grow"), 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 })); //---- label1 ---- label1.setText("Select a Repository"); add(label1, cc.xy(1, 1)); add(repositorySelector, cc.xywh(1, 3, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); //---- label2 ---- label2.setText("Resource Level"); add(label2, cc.xy(1, 5)); add(resourceLevelSelector, cc.xywh(1, 7, 1, 1, CellConstraints.LEFT, CellConstraints.DEFAULT)); //---- label3 ---- label3.setText("Resource Identifier"); add(label3, cc.xy(1, 9)); //======== panel1 ======== { panel1.setLayout(new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, RowSpec.decodeSpecs("default"))); ((FormLayout) panel1.getLayout()).setColumnGroups(new int[][] { { 1, 3, 5, 7 } }); panel1.add(resourceIdentifier1, cc.xywh(1, 1, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); panel1.add(resourceIdentifier2, cc.xywh(3, 1, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); panel1.add(resourceIdentifier3, cc.xywh(5, 1, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); panel1.add(resourceIdentifier4, cc.xywh(7, 1, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); } add(panel1, cc.xywh(1, 11, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); //---- label4 ---- label4.setText("Import"); add(label4, cc.xy(1, 13)); //======== panel2 ======== { panel2.setLayout(new FormLayout(new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- entireMarcRecord ---- entireMarcRecord.setText("Entire MARC record"); panel2.add(entireMarcRecord, cc.xy(1, 1)); //---- subjectHeadingsOnly ---- subjectHeadingsOnly.setText("Subject headings only"); panel2.add(subjectHeadingsOnly, cc.xy(3, 1)); } add(panel2, cc.xy(1, 15)); //---- buttonGroup1 ---- ButtonGroup buttonGroup1 = new ButtonGroup(); buttonGroup1.add(entireMarcRecord); buttonGroup1.add(subjectHeadingsOnly); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:org.archiviststoolkit.swing.SelectFromTable.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dialogPane = new JPanel(); contentPanel = new JPanel(); message = new JLabel(); scrollPane1 = new JScrollPane(); contentTable = new DomainSortableTable(); buttonBar = new JPanel(); cancelButton = new JButton(); selectButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setTitle("title"); setModal(true);//from w ww . j a v a 2s.c o m Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setLayout(new FormLayout(ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.CENTER, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) })); //---- message ---- message.setText("Select an item"); contentPanel.add(message, cc.xy(1, 1)); //======== scrollPane1 ======== { //---- contentTable ---- contentTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { contentTableMouseClicked(e); } }); scrollPane1.setViewportView(contentTable); } contentPanel.add(scrollPane1, cc.xywh(1, 3, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); } dialogPane.add(contentPanel, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC }, RowSpec.decodeSpecs("pref"))); //---- cancelButton ---- cancelButton.setText("Cancel"); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { cancelButtonActionPerformed(); } }); buttonBar.add(cancelButton, cc.xy(4, 1)); //---- selectButton ---- selectButton.setText("Select"); selectButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { selectButtonActionPerformed(); } }); buttonBar.add(selectButton, cc.xy(6, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); // JFormDesigner - End of component initialization //GEN-END:initComponents contentTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); }
From source file:org.archiviststoolkit.swing.StandardEditor.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license mainPanel = new JPanel(); HeaderPanel = new JPanel(); mainHeaderPanel = new JPanel(); mainHeaderLabel = new JLabel(); subHeaderPanel = new JPanel(); subHeaderLabel = new JLabel(); recordPosition = new JLabel(); contentPanel = new JPanel(); button1 = new JButton(); separator1 = new JSeparator(); buttonPanel = new JPanel(); firstButton = new JButton(); previousButton = new JButton(); nextButton = new JButton(); lastButton = new JButton(); printButton = new JButton(); cancelButton = new JButton(); okButton = new JButton(); saveButton = new JButton(); okAndAnotherButton = new JButton(); firstLabel = new JLabel(); previousLabel = new JLabel(); nextLabel = new JLabel(); lastLabel = new JLabel(); printLabel = new JLabel(); cancelButtonLabel = new JLabel(); okButtonLabel = new JLabel(); saveButtonLabel = new JLabel(); okAndAnotherButtonLabel = new JLabel(); separator2 = new JSeparator(); gradientPanel2 = new JPanel(); auditLabel = new JLabel(); CellConstraints cc = new CellConstraints(); //======== this ======== setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); setBackground(new Color(200, 205, 232)); setModal(true);/*from w w w .jav a2 s .com*/ setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); addWindowListener(new WindowAdapter() { @Override public void windowClosing(WindowEvent e) { thisWindowClosing(e); } }); Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout("default:grow", "top:default:grow")); //======== mainPanel ======== { mainPanel.setBackground(new Color(200, 205, 232)); mainPanel.setLayout(new FormLayout(ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), 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 })); //======== HeaderPanel ======== { HeaderPanel.setBackground(new Color(80, 69, 57)); HeaderPanel.setOpaque(false); HeaderPanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); HeaderPanel.setPreferredSize(new Dimension(300, 30)); HeaderPanel .setLayout( new FormLayout( new ColumnSpec[] { new ColumnSpec(Sizes.bounded(Sizes.MINIMUM, Sizes.dluX(100), Sizes.dluX(200))), new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, RowSpec.decodeSpecs("fill:default"))); //======== mainHeaderPanel ======== { mainHeaderPanel.setBackground(new Color(80, 69, 57)); mainHeaderPanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); mainHeaderPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC })); //---- mainHeaderLabel ---- mainHeaderLabel.setText("Main Header"); mainHeaderLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 18)); mainHeaderLabel.setForeground(Color.white); mainHeaderPanel.add(mainHeaderLabel, cc.xy(2, 2)); } HeaderPanel.add(mainHeaderPanel, cc.xy(1, 1)); //======== subHeaderPanel ======== { subHeaderPanel.setBackground(new Color(66, 60, 111)); subHeaderPanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); subHeaderPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.UNRELATED_GAP_COLSPEC }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC })); //---- subHeaderLabel ---- subHeaderLabel.setText("Sub Header"); subHeaderLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 18)); subHeaderLabel.setForeground(Color.white); subHeaderPanel.add(subHeaderLabel, cc.xy(2, 2)); //---- recordPosition ---- recordPosition.setText("record x of n"); recordPosition.setForeground(Color.white); subHeaderPanel.add(recordPosition, cc.xywh(4, 2, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); } HeaderPanel.add(subHeaderPanel, cc.xy(2, 1)); } mainPanel.add(HeaderPanel, cc.xywh(1, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); //======== contentPanel ======== { contentPanel.setBorder(Borders.DLU4_BORDER); contentPanel.setBackground(new Color(200, 205, 232)); contentPanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); contentPanel.setLayout(new FormLayout("center:default:grow", "top:default:grow")); //---- button1 ---- button1.setText("text"); contentPanel.add(button1, cc.xywh(1, 1, 1, 1, CellConstraints.FILL, CellConstraints.FILL)); } mainPanel.add(contentPanel, cc.xy(1, 3)); //---- separator1 ---- separator1.setBackground(new Color(220, 220, 232)); separator1.setForeground(new Color(147, 131, 86)); separator1.setMinimumSize(new Dimension(1, 10)); separator1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); mainPanel.add(separator1, cc.xy(1, 5)); //======== buttonPanel ======== { buttonPanel.setBorder(null); buttonPanel.setBackground(new Color(200, 205, 232)); buttonPanel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.setMinimumSize(new Dimension(380, 60)); buttonPanel.setLayout(new FormLayout( "default, default, default, default, default, left:10dlu, default, 10dlu, default, default, default, default", "default, default")); //---- firstButton ---- firstButton.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/firstRecord.jpg"))); firstButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); firstButton.setOpaque(false); buttonPanel.add(firstButton, cc.xy(2, 1)); //---- previousButton ---- previousButton.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/prevRecord.jpg"))); previousButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); previousButton.setOpaque(false); buttonPanel.add(previousButton, cc.xy(3, 1)); //---- nextButton ---- nextButton.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/nextRecord.jpg"))); nextButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); nextButton.setOpaque(false); buttonPanel.add(nextButton, cc.xy(4, 1)); //---- lastButton ---- lastButton.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/lastRecord.jpg"))); lastButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); lastButton.setOpaque(false); buttonPanel.add(lastButton, cc.xy(5, 1)); //---- printButton ---- printButton.setIcon( new ImageIcon(getClass().getResource("/org/archiviststoolkit/resources/images/print.jpg"))); printButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); printButton.setOpaque(false); buttonPanel.add(printButton, cc.xy(7, 1)); //---- cancelButton ---- cancelButton.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/cancel.jpg"))); cancelButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); cancelButton.setOpaque(false); buttonPanel.add(cancelButton, cc.xy(9, 1)); //---- okButton ---- okButton.setIcon( new ImageIcon(getClass().getResource("/org/archiviststoolkit/resources/images/ok.jpg"))); okButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); okButton.setOpaque(false); buttonPanel.add(okButton, cc.xy(10, 1)); //---- saveButton ---- saveButton.setIcon( new ImageIcon(getClass().getResource("/org/archiviststoolkit/resources/images/save.jpg"))); saveButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); saveButton.setOpaque(false); buttonPanel.add(saveButton, cc.xy(11, 1)); //---- okAndAnotherButton ---- okAndAnotherButton.setIcon(new ImageIcon( getClass().getResource("/org/archiviststoolkit/resources/images/savePlus1.jpg"))); okAndAnotherButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); okAndAnotherButton.setOpaque(false); buttonPanel.add(okAndAnotherButton, cc.xy(12, 1)); //---- firstLabel ---- firstLabel.setText("First"); firstLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(firstLabel, cc.xywh(2, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- previousLabel ---- previousLabel.setText("Previous"); previousLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(previousLabel, cc.xywh(3, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- nextLabel ---- nextLabel.setText("Next"); nextLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(nextLabel, cc.xywh(4, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- lastLabel ---- lastLabel.setText("Last"); lastLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(lastLabel, cc.xywh(5, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- printLabel ---- printLabel.setText("Reports"); printLabel.setHorizontalAlignment(SwingConstants.CENTER); printLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(printLabel, cc.xy(7, 2)); //---- cancelButtonLabel ---- cancelButtonLabel.setText("Cancel"); cancelButtonLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(cancelButtonLabel, cc.xywh(9, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- okButtonLabel ---- okButtonLabel.setText("OK"); okButtonLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(okButtonLabel, cc.xywh(10, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- saveButtonLabel ---- saveButtonLabel.setText("Save"); saveButtonLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(saveButtonLabel, cc.xywh(11, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- okAndAnotherButtonLabel ---- okAndAnotherButtonLabel.setText("+ 1"); okAndAnotherButtonLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); buttonPanel.add(okAndAnotherButtonLabel, cc.xywh(12, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); } mainPanel.add(buttonPanel, cc.xywh(1, 7, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- separator2 ---- separator2.setBackground(new Color(220, 220, 232)); separator2.setForeground(new Color(147, 131, 86)); separator2.setMinimumSize(new Dimension(1, 10)); separator2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); mainPanel.add(separator2, cc.xy(1, 9)); //======== gradientPanel2 ======== { gradientPanel2.setBackground(new Color(200, 205, 232)); gradientPanel2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); gradientPanel2.setLayout(new FormLayout(ColumnSpec.decodeSpecs("default:grow"), new RowSpec[] { new RowSpec("35px"), FormFactory.UNRELATED_GAP_ROWSPEC })); //---- auditLabel ---- auditLabel.setText("created | modified"); auditLabel.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); gradientPanel2.add(auditLabel, new CellConstraints(1, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 10, 0, 0))); } mainPanel.add(gradientPanel2, cc.xy(1, 11)); } contentPane.add(mainPanel, cc.xywh(1, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.FILL)); pack(); setLocationRelativeTo(getOwner()); // JFormDesigner - End of component initialization //GEN-END:initComponents final StandardEditor editor = this; WindowAdapter windowAdapter = new WindowAdapter() { public void windowClosing(final WindowEvent windowEvent) { if (saveButton.isVisible()) { if (readOnly) { closeAndNoSave(); } else if (showCloseConfirmDialog(0) == JOptionPane.YES_OPTION) { if (!model.validateAndDisplayDialog(windowEvent)) { // didnot validate so don't save it choice = -1; } else { setVisible(false); } } } else if (JOptionPane.showConfirmDialog(editor, "Clicking the close box is the same as clicking cancel. All changes will not be saved.\n" + "Are you sure you wish to do this?", "Confirm cancel", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { myIsDialogCancelled = true; setVisible(false); } } }; addWindowListener(windowAdapter); this.getRootPane().setDefaultButton(this.getOkButton()); }
From source file:org.archiviststoolkit.swing.StandardQueryEditor.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license gradientPanel1 = new JGradientPanel(); headerLabel = new JLabel(); contentPanel = new JPanel(); label2 = new JLabel(); subjectTerm = new JTextField(); label12 = new JLabel(); subjectTermType = new JComboBox(); label13 = new JLabel(); subjectSource = new JTextField(); label14 = new JLabel(); scrollPane1 = new JScrollPane(); subjectScopeNote = new JTextArea(); buttonPanel = new JPanel(); cancelButton = new JButton(); okButton = new JButton(); label8 = new JLabel(); label9 = new JLabel(); gradientPanel2 = new JGradientPanel(); auditLabel = new JLabel(); CellConstraints cc = new CellConstraints(); //======== this ======== setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE); setBackground(new Color(231, 188, 251)); setModal(true);//from ww w . j a va 2 s. c om Container contentPane = getContentPane(); contentPane.setLayout(new FormLayout(ColumnSpec.decodeSpecs("default:grow"), 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 })); //======== gradientPanel1 ======== { gradientPanel1.setBackground(new Color(229, 211, 237)); gradientPanel1.setBackground2(new Color(204, 204, 255)); gradientPanel1.setDirection(JGradientPanel.WEST); gradientPanel1.setLayout(new FormLayout("default:grow", "35px")); //---- headerLabel ---- headerLabel.setText("Subjects"); headerLabel.setFont(new Font("Lucida Grande", Font.BOLD, 14)); gradientPanel1.add(headerLabel, new CellConstraints(1, 1, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT, new Insets(0, 10, 0, 0))); } contentPane.add(gradientPanel1, cc.xy(1, 1)); //======== contentPanel ======== { contentPanel.setBorder(Borders.DLU4_BORDER); contentPanel.setBackground(new Color(231, 188, 251)); contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec("max(default;400px):grow") }, 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 })); //---- label2 ---- label2.setText("Subject Term"); contentPanel.add(label2, cc.xy(1, 1)); contentPanel.add(subjectTerm, cc.xy(3, 1)); //---- label12 ---- label12.setText("Subject Term Type"); contentPanel.add(label12, cc.xy(1, 3)); //---- subjectTermType ---- subjectTermType.setBackground(new Color(231, 188, 251)); contentPanel.add(subjectTermType, cc.xy(3, 3)); //---- label13 ---- label13.setText("Source"); contentPanel.add(label13, cc.xy(1, 5)); contentPanel.add(subjectSource, cc.xy(3, 5)); //---- label14 ---- label14.setText("Scope Note"); label14.setVerticalAlignment(SwingConstants.TOP); contentPanel.add(label14, cc.xywh(1, 7, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== scrollPane1 ======== { scrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); scrollPane1.setMaximumSize(new Dimension(32767, 100)); //---- subjectScopeNote ---- subjectScopeNote.setRows(4); subjectScopeNote.setLineWrap(true); subjectScopeNote.setTabSize(20); subjectScopeNote.setWrapStyleWord(true); scrollPane1.setViewportView(subjectScopeNote); } contentPanel.add(scrollPane1, cc.xy(3, 7)); } contentPane.add(contentPanel, cc.xy(1, 3)); //======== buttonPanel ======== { buttonPanel.setBorder(new BevelBorder(BevelBorder.LOWERED)); buttonPanel.setLayout(new FormLayout("default, default", "default, default")); //---- cancelButton ---- cancelButton.setIcon( new ImageIcon(getClass().getResource("/org/archiviststoolkit/resources/images/cancel.jpg"))); buttonPanel.add(cancelButton, cc.xy(1, 1)); //---- okButton ---- okButton.setIcon( new ImageIcon(getClass().getResource("/org/archiviststoolkit/resources/images/ok.jpg"))); buttonPanel.add(okButton, cc.xy(2, 1)); //---- label8 ---- label8.setText("Cancel"); label8.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); buttonPanel.add(label8, cc.xywh(1, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //---- label9 ---- label9.setText("OK"); label9.setFont(new Font("Lucida Grande", Font.PLAIN, 10)); buttonPanel.add(label9, cc.xywh(2, 2, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); } contentPane.add(buttonPanel, cc.xywh(1, 5, 1, 1, CellConstraints.CENTER, CellConstraints.DEFAULT)); //======== gradientPanel2 ======== { gradientPanel2.setBackground(new Color(229, 211, 237)); gradientPanel2.setBackground2(new Color(204, 204, 255)); gradientPanel2.setDirection(JGradientPanel.EAST); gradientPanel2.setLayout(new FormLayout("default:grow", "35px")); //---- auditLabel ---- auditLabel.setText("created | modified"); gradientPanel2.add(auditLabel, new CellConstraints(1, 1, 1, 1, CellConstraints.DEFAULT, CellConstraints.DEFAULT, new Insets(0, 10, 0, 0))); } contentPane.add(gradientPanel2, cc.xy(1, 7)); // JFormDesigner - End of component initialization //GEN-END:initComponents WindowAdapter windowAdapter = new WindowAdapter() { public void windowClosing(final WindowEvent windowEvent) { myIsDialogCancelled = true; setVisible(false); } }; addWindowListener(windowAdapter); }
From source file:org.columba.mail.gui.composer.HeaderView.java
License:Mozilla Public License
/** * /* ww w. j a v a 2 s .co m*/ */ public void layoutComponents(JPanel panel) { CellConstraints cc = new CellConstraints(); panel.add(toButton, cc.xy(1, 3, CellConstraints.FILL, CellConstraints.DEFAULT)); panel.add(toComboBox, cc.xywh(3, 3, 5, 1)); panel.add(ccButton, cc.xy(1, 5, CellConstraints.FILL, CellConstraints.DEFAULT)); panel.add(ccComboBox, cc.xywh(3, 5, 5, 1)); panel.add(bccButton, cc.xy(1, 7, CellConstraints.FILL, CellConstraints.DEFAULT)); panel.add(bccComboBox, cc.xywh(3, 7, 5, 1)); }
From source file:org.deegree.igeo.views.swing.layerlist.InfoPanel.java
License:Open Source License
private void initGUI() { try {//from ww w . j ava 2s.com GridBagLayout thisLayout = new GridBagLayout(); this.setPreferredSize(new java.awt.Dimension(588, 351)); thisLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.1 }; thisLayout.rowHeights = new int[] { 166, 65, 83, -1, 7 }; thisLayout.columnWeights = new double[] { 0.0, 0.0, 0.0 }; thisLayout.columnWidths = new int[] { 166, 254, 147 }; this.setLayout(thisLayout); { pnLegend = new JPanel(); BorderLayout pn_legendLayout = new BorderLayout(); pnLegend.setLayout(pn_legendLayout); this.add(pnLegend, new GridBagConstraints(0, 1, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); pnLegend.setBorder(BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11128"))); { scLegend = new JScrollPane(); pnLegend.add(scLegend, BorderLayout.CENTER); { lbLegend = new JLabel(); scLegend.setViewportView(lbLegend); lbLegend.setPreferredSize(new java.awt.Dimension(143, 15)); } } } { pnState = new JPanel(); GridBagLayout pn_stateLayout = new GridBagLayout(); this.add(pnState, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); pnState.setBorder(BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11129"))); pn_stateLayout.rowWeights = new double[] { 0.0, 0.0, 0.0, 0.0, 0.1 }; pn_stateLayout.rowHeights = new int[] { 28, 28, 28, 28, 7 }; pn_stateLayout.columnWeights = new double[] { 0.1 }; pn_stateLayout.columnWidths = new int[] { 7 }; pnState.setLayout(pn_stateLayout); { Icon icon = new ImageIcon(InfoPanel.class.getResource("visible.png")); tbVisible = new JToggleButton(icon); pnState.add(tbVisible, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); tbVisible.setToolTipText(Messages.getMessage(getLocale(), "$MD10001")); } { Icon icon = new ImageIcon(InfoPanel.class.getResource("queryable.png")); tbQueryable = new JToggleButton(icon); pnState.add(tbQueryable, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); tbQueryable.setToolTipText(Messages.getMessage(getLocale(), "$MD10002")); } { Icon icon = new ImageIcon(InfoPanel.class.getResource("editable.png")); tbEditable = new JToggleButton(icon); pnState.add(tbEditable, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); tbEditable.setToolTipText(Messages.getMessage(getLocale(), "$MD10003")); } { Icon icon = new ImageIcon(InfoPanel.class.getResource("selected4edit.png")); tbSelectedForEdit = new JToggleButton(icon); pnState.add(tbSelectedForEdit, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); tbSelectedForEdit.setToolTipText(Messages.getMessage(getLocale(), "$MD10005")); } } { pnAbstract = new JPanel(); BorderLayout pn_abstractLayout = new BorderLayout(); pnAbstract.setLayout(pn_abstractLayout); this.add(pnAbstract, new GridBagConstraints(1, 0, 2, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); pnAbstract .setBorder(BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11130"))); { epDescription = new JEditorPane(); JScrollPane sc = new JScrollPane(epDescription); pnAbstract.add(sc, BorderLayout.CENTER); epDescription.setPreferredSize(new java.awt.Dimension(259, 218)); } } { pnButtons = new JPanel(); FlowLayout pn_buttonsLayout = new FlowLayout(); pn_buttonsLayout.setAlignment(FlowLayout.LEFT); pnButtons.setLayout(pn_buttonsLayout); this.add(pnButtons, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); { btTake = new JButton(Messages.getMessage(getLocale(), "$MD10006"), IconRegistry.getIcon("save.gif")); btTake.setToolTipText(Messages.getMessage(getLocale(), "$MD11125")); pnButtons.add(btTake); btTake.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { mme.setAbstract(epDescription.getText()); if (mme instanceof Layer) { double min = ((Number) spMin.getValue()).doubleValue(); double max = ((Number) spMax.getValue()).doubleValue(); double d = min; if (min > max) { min = max; max = d; } ((Layer) mme).setMinScaleDenominator(min); ((Layer) mme).setMaxScaleDenominator(max); } ((Layer) mme).fireRepaintEvent(); } }); } } { pnHelp = new JPanel(); FlowLayout jPanel1Layout = new FlowLayout(); jPanel1Layout.setAlignment(FlowLayout.RIGHT); pnHelp.setLayout(jPanel1Layout); this.add(pnHelp, new GridBagConstraints(2, 4, 1, 1, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); { btHelp = new JButton(Messages.getMessage(getLocale(), "$MD11126"), IconRegistry.getIcon("help.png")); pnHelp.add(btHelp); btHelp.setToolTipText(Messages.getMessage(getLocale(), "$MD11127")); btHelp.addActionListener(new ActionListener() { @SuppressWarnings("unchecked") public void actionPerformed(ActionEvent e) { ApplicationContainer<Container> appCont = (ApplicationContainer<Container>) mme .getOwner().getApplicationContainer(); HelpFrame hf = HelpFrame.getInstance(new HelpManager(appCont)); hf.setVisible(true); hf.gotoModule(LayerListTreeViewModule.class.getName()); } }); } } { pnScale = new JPanel(); FormLayout pnScaleLayout = new FormLayout("38dlu, 101dlu", "18dlu, 18dlu"); pnScale.setLayout(pnScaleLayout); this.add(pnScale, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.VERTICAL, new Insets(0, 0, 0, 0), 0, 0)); pnScale.setBorder(BorderFactory.createTitledBorder(Messages.getMessage(getLocale(), "$MD11207"))); { lnMin = new JLabel(); pnScale.add(lnMin, new CellConstraints("1, 1, 1, 1, default, default")); lnMin.setText(Messages.getMessage(getLocale(), "$MD11208")); } { lbMax = new JLabel(); pnScale.add(lbMax, new CellConstraints("1, 2, 1, 1, default, default")); lbMax.setText(Messages.getMessage(getLocale(), "$MD11209")); } { spMin = new JSpinner(new SpinnerNumberModel(0, 0, 9E99, 100)); pnScale.add(spMin, new CellConstraints(2, 1, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT, new Insets(0, 10, 0, 10))); } { spMax = new JSpinner(new SpinnerNumberModel(0, 0, 9E99, 100)); pnScale.add(spMax, new CellConstraints(2, 2, 1, 1, CellConstraints.FILL, CellConstraints.CENTER, new Insets(0, 10, 0, 10))); } } } catch (Exception e) { e.printStackTrace(); } }