List of usage examples for com.jgoodies.forms.layout CellConstraints RIGHT
Alignment RIGHT
To view the source code for com.jgoodies.forms.layout CellConstraints RIGHT.
Click Source Link
From source file:org.archiviststoolkit.editor.IndexFields.java
License:Open Source License
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license panel3 = new JPanel(); internalOnly = ATBasicComponentFactory.createCheckBox(detailsModel, ArchDescriptionStructuredData.PROPERTYNAME_ARCH_DESCRIPTION_NOTE_INTERNAL_ONLY, Index.class); panel4 = new JPanel(); label4 = new JLabel(); persistentId2 = ATBasicComponentFactory .createTextField(detailsModel.getModel(ArchDescriptionRepeatingData.PROPERTYNAME_PERSISTENT_ID)); label_title = new JLabel(); title = ATBasicComponentFactory.createTextField(detailsModel.getModel(Index.PROPERTYNAME_TITLE)); label_description = new JLabel(); scrollPane1 = new JScrollPane(); note = ATBasicComponentFactory.createTextArea(detailsModel.getModel(Index.PROPERTYNAME_NOTE), false); tagApplicatorPanel = new JPanel(); insertInlineTag = ATBasicComponentFactory.createUnboundComboBox(InLineTagsUtils.getInLineTagList()); label_ingestProblems = new JLabel(); scrollPane2 = new JScrollPane(); ingestProblems = ATBasicComponentFactory .createTextArea(detailsModel.getModel(Index.PROPERTYNAME_EAD_INGEST_PROBLEMS)); scrollPane7 = new JScrollPane(); itemsTable = new DomainSortedTable(IndexItems.class); panel1 = new JPanel(); panel30 = new JPanel(); addItemButton = new JButton(); removeItemButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setBorder(Borders.DLU4_BORDER);// ww w .j av a 2 s . c o m 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, 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, FormFactory.DEFAULT_ROWSPEC })); //======== panel3 ======== { panel3.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, RowSpec.decodeSpecs("default"))); //---- internalOnly ---- internalOnly.setBackground(new Color(231, 188, 251)); internalOnly.setText("Internal Only"); internalOnly.setOpaque(false); internalOnly.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel3.add(internalOnly, cc.xy(1, 1)); //======== panel4 ======== { panel4.setLayout( new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- label4 ---- label4.setText("Persistent ID"); label4.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel4.add(label4, cc.xy(1, 1)); //---- persistentId2 ---- persistentId2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); persistentId2.setColumns(3); persistentId2.setBorder(null); persistentId2.setEditable(false); persistentId2.setOpaque(false); panel4.add(persistentId2, cc.xywh(3, 1, 1, 1, CellConstraints.FILL, CellConstraints.DEFAULT)); } panel3.add(panel4, cc.xywh(5, 1, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); } add(panel3, cc.xywh(1, 1, 3, 1)); //---- label_title ---- label_title.setText("Title"); label_title.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); ATFieldInfo.assignLabelInfo(label_title, Index.class, Index.PROPERTYNAME_TITLE); add(label_title, cc.xy(1, 3)); add(title, cc.xy(3, 3)); //---- label_description ---- label_description.setText("Note"); label_description.setVerticalAlignment(SwingConstants.TOP); label_description.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); ATFieldInfo.assignLabelInfo(label_description, Index.class, Index.PROPERTYNAME_NOTE); add(label_description, cc.xywh(1, 5, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== scrollPane1 ======== { scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane1.setMaximumSize(new Dimension(32767, 100)); scrollPane1.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); //---- note ---- note.setRows(4); note.setLineWrap(true); note.setTabSize(20); note.setWrapStyleWord(true); scrollPane1.setViewportView(note); } add(scrollPane1, cc.xy(3, 5)); //======== tagApplicatorPanel ======== { tagApplicatorPanel.setOpaque(false); tagApplicatorPanel .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"))); //---- insertInlineTag ---- insertInlineTag.setOpaque(false); insertInlineTag.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); insertInlineTag.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { insertInlineTagActionPerformed(); } }); tagApplicatorPanel.add(insertInlineTag, cc.xy(1, 1)); } add(tagApplicatorPanel, cc.xy(3, 7)); //---- label_ingestProblems ---- label_ingestProblems.setText("Ingest Problems"); label_ingestProblems.setVerticalAlignment(SwingConstants.TOP); label_ingestProblems.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); ATFieldInfo.assignLabelInfo(label_ingestProblems, Index.class, Index.PROPERTYNAME_EAD_INGEST_PROBLEMS); add(label_ingestProblems, cc.xywh(1, 9, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); //======== scrollPane2 ======== { scrollPane2.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane2.setMaximumSize(new Dimension(32767, 100)); scrollPane2.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); //---- ingestProblems ---- ingestProblems.setRows(4); ingestProblems.setLineWrap(true); ingestProblems.setTabSize(20); ingestProblems.setWrapStyleWord(true); scrollPane2.setViewportView(ingestProblems); } add(scrollPane2, cc.xy(3, 9)); //======== scrollPane7 ======== { scrollPane7.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane7.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); //---- itemsTable ---- itemsTable.setFocusable(false); itemsTable.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { itemsTableMouseClicked(e); } @Override public void mousePressed(MouseEvent e) { itemsTableMousePressed(e); } @Override public void mouseReleased(MouseEvent e) { itemsTableMouseReleased(e); } }); scrollPane7.setViewportView(itemsTable); } add(scrollPane7, cc.xywh(1, 11, 3, 1)); //======== 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) }, RowSpec.decodeSpecs("default"))); ((FormLayout) panel1.getLayout()).setColumnGroups(new int[][] { { 1, 3, 5 } }); //======== panel30 ======== { panel30.setBackground(new Color(231, 188, 251)); panel30.setOpaque(false); panel30.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); panel30.setLayout( new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("default"))); //---- addItemButton ---- addItemButton.setText("Add Item"); addItemButton.setOpaque(false); addItemButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); addItemButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addItemButtonActionPerformed(e); } }); panel30.add(addItemButton, cc.xy(1, 1)); //---- removeItemButton ---- removeItemButton.setBackground(new Color(231, 188, 251)); removeItemButton.setText("Remove Item"); removeItemButton.setOpaque(false); removeItemButton.setFont(new Font("Trebuchet MS", Font.PLAIN, 13)); removeItemButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { removeItemButtonActionPerformed(e); } }); panel30.add(removeItemButton, cc.xy(3, 1)); } panel1.add(panel30, cc.xy(3, 1)); } add(panel1, cc.xywh(1, 13, 3, 1)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
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);//www . ja v a 2s . c om 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.columba.addressbook.gui.dialog.contact.ContactEditorDialog.java
License:Mozilla Public License
private void layoutComponents() { CellConstraints cc = new CellConstraints(); // ======== this ======== Container contentPane2 = getContentPane(); contentPane2.setLayout(new BorderLayout()); // ======== dialogPane ======== {// ww w. j a v a2s . c o m dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setLayout(new BorderLayout()); // ======== contentPane ======== { contentPane.setLayout(new BorderLayout()); // ======== tabbedPane2 ======== { tabbedPane2.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT); // ======== contactPanel ======== { contactPanel.setBorder(Borders.DIALOG_BORDER); contactPanel.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, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.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, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), 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.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), 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.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW) })); ((FormLayout) contactPanel.getLayout()) .setRowGroups(new int[][] { { 7, 9, 11, 17, 19, 25, 27 } }); // ======== panel7 ======== { panel7.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), }, new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW) })); ((FormLayout) panel7.getLayout()).setRowGroups(new int[][] { { 1, 3, 5 } }); // ---- pictureButton ---- panel7.add(pictureButton, cc.xywh(1, 1, 1, 5)); // ---- fullnameButton ---- formattedNameButton.setText(bundle.getString("formattedNameButton.text")); panel7.add(formattedNameButton, cc.xy(3, 1)); panel7.add(formattedNameTextField, cc.xy(5, 1)); // ---- nicknameLabel ---- nicknameLabel.setText(bundle.getString("nicknameLabel.text")); nicknameLabel.setLabelFor(nicknameTextField); panel7.add(nicknameLabel, cc.xywh(7, 1, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); panel7.add(nicknameTextField, cc.xy(9, 1)); // ---- fileunderLabel ---- fileunderLabel.setText(bundle.getString("fileunderLabel.text")); fileunderLabel.setLabelFor(fileunderComboBox); panel7.add(fileunderLabel, cc.xywh(3, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); panel7.add(fileunderComboBox, cc.xy(5, 3)); panel7.add(whereLabel, cc.xywh(7, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); panel7.add(whereComboBox, cc.xy(9, 3)); // ---- categoriesButton ---- categoriesButton.setText(bundle.getString("categoriesButton.text")); panel7.add(categoriesButton, cc.xy(3, 5)); panel7.add(categoriesTextField, cc.xywh(5, 5, 5, 1)); } contactPanel.add(panel7, cc.xywh(1, 1, 7, 1)); contactPanel.add(emailSeparator, cc.xywh(1, 5, 7, 1)); contactPanel.add(emailComboBox1, cc.xy(1, 7)); // ---- emailTextField1 ---- emailTextField1.setColumns(20); contactPanel.add(emailTextField1, cc.xy(3, 7)); contactPanel.add(emailComboBox2, cc.xy(5, 7)); // ---- emailTextField2 ---- emailTextField2.setColumns(20); contactPanel.add(emailTextField2, cc.xy(7, 7)); contactPanel.add(emailComboBox3, cc.xy(1, 9)); // ---- emailTextField3 ---- emailTextField3.setColumns(20); contactPanel.add(emailTextField3, cc.xy(3, 9)); contactPanel.add(emailComboBox4, cc.xy(5, 9)); // ---- emailTextField4 ---- emailTextField4.setColumns(20); contactPanel.add(emailTextField4, cc.xy(7, 9)); // ---- preferHtmlCheckBox ---- preferHtmlCheckBox.setText(bundle.getString("preferHtmlCheckBox.text")); contactPanel.add(preferHtmlCheckBox, cc.xy(3, 11)); contactPanel.add(telephoneSeparator, cc.xywh(1, 15, 7, 1)); contactPanel.add(telephoneComboBox1, cc.xy(1, 17)); // ---- telephoneTextField1 ---- telephoneTextField1.setColumns(20); contactPanel.add(telephoneTextField1, cc.xy(3, 17)); contactPanel.add(telephoneComboBox2, cc.xy(5, 17)); // ---- telephoneTextField2 ---- telephoneTextField2.setColumns(20); contactPanel.add(telephoneTextField2, cc.xy(7, 17)); contactPanel.add(telephoneComboBox3, cc.xy(1, 19)); // ---- telephoneTextField3 ---- telephoneTextField3.setColumns(20); contactPanel.add(telephoneTextField3, cc.xy(3, 19)); contactPanel.add(telephoneComboBox4, cc.xy(5, 19)); // ---- telephoneTextField4 ---- telephoneTextField4.setColumns(20); contactPanel.add(telephoneTextField4, cc.xy(7, 19)); contactPanel.add(imSeparator, cc.xywh(1, 23, 7, 1)); contactPanel.add(imComboBox1, cc.xy(1, 25)); // ---- imTextField1 ---- imTextField1.setColumns(20); contactPanel.add(imTextField1, cc.xy(3, 25)); contactPanel.add(imComboBox2, cc.xy(5, 25)); // ---- imTextField2 ---- imTextField2.setColumns(20); contactPanel.add(imTextField2, cc.xy(7, 25)); contactPanel.add(imComboBox3, cc.xy(1, 27)); // ---- imTextField3 ---- imTextField3.setColumns(20); contactPanel.add(imTextField3, cc.xy(3, 27)); contactPanel.add(imComboBox4, cc.xy(5, 27)); // ---- imTextField4 ---- imTextField4.setColumns(20); contactPanel.add(imTextField4, cc.xy(7, 27)); } tabbedPane2.addTab(bundle.getString("contactPanel.tab.title"), contactPanel); // ======== personalInfoPanel ======== { personalInfoPanel.setBorder(Borders.DIALOG_BORDER); personalInfoPanel.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, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), 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.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), 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.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); ((FormLayout) personalInfoPanel.getLayout()) .setRowGroups(new int[][] { { 3, 5, 7, 9, 15, 17, 19, 25 } }); personalInfoPanel.add(webAddressSeparator, cc.xywh(1, 1, 7, 1)); // ---- homepageLabel ---- homepageLabel.setText(bundle.getString("homepageLabel.text")); homepageLabel.setLabelFor(homepageTextField); personalInfoPanel.add(homepageLabel, cc.xywh(1, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ======== panel1 ======== { panel1.setLayout( new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.CENTER, Sizes.DEFAULT, FormSpec.NO_GROW) }, RowSpec.decodeSpecs("fill:default"))); // ---- homepageTextField ---- homepageTextField.setColumns(20); panel1.add(homepageTextField, cc.xy(1, 1)); // ---- homepageButton ---- panel1.add(homepageButton, cc.xy(3, 1)); } personalInfoPanel.add(panel1, cc.xywh(3, 3, 5, 1)); // ---- weblogLabel ---- weblogLabel.setText(bundle.getString("weblogLabel.text")); weblogLabel.setLabelFor(weblogTextField); personalInfoPanel.add(weblogLabel, cc.xywh(1, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ======== panel5 ======== { panel5.setLayout( new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:default"))); // ---- weblogTextField ---- weblogTextField.setColumns(20); panel5.add(weblogTextField, cc.xy(1, 1)); // ---- weblogButton ---- panel5.add(weblogButton, cc.xy(3, 1)); } personalInfoPanel.add(panel5, cc.xywh(3, 5, 5, 1)); // ---- calendarLabel ---- calendarLabel.setText(bundle.getString("calendarLabel.text")); calendarLabel.setLabelFor(calendarTextField); personalInfoPanel.add(calendarLabel, cc.xywh(1, 7, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ======== panel6 ======== { panel6.setLayout( new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:default"))); // ---- calendarTextField ---- calendarTextField.setColumns(20); panel6.add(calendarTextField, cc.xy(1, 1)); // ---- calendarButton ---- panel6.add(calendarButton, cc.xy(3, 1)); } personalInfoPanel.add(panel6, cc.xywh(3, 7, 5, 1)); // ---- freebusyLabel ---- freebusyLabel.setText(bundle.getString("freebusyLabel.text")); freebusyLabel.setLabelFor(freebusyTextField); personalInfoPanel.add(freebusyLabel, cc.xywh(1, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ======== panel8 ======== { panel8.setLayout( new FormLayout( new ColumnSpec[] { new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:default"))); // ---- freebusyTextField ---- freebusyTextField.setColumns(20); panel8.add(freebusyTextField, cc.xy(1, 1)); // ---- freebusyButton ---- panel8.add(freebusyButton, cc.xy(3, 1)); } personalInfoPanel.add(panel8, cc.xywh(3, 9, 5, 1)); personalInfoPanel.add(jobSeparator, cc.xywh(1, 13, 7, 1)); // ---- professionLabel ---- professionLabel.setText(bundle.getString("professionLabel.text")); professionLabel.setLabelFor(professionTextField); personalInfoPanel.add(professionLabel, cc.xywh(1, 15, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ---- professionTextField ---- professionTextField.setColumns(20); personalInfoPanel.add(professionTextField, cc.xy(3, 15)); // ---- titleLabel ---- titleLabel.setText(bundle.getString("titleLabel.text")); titleLabel.setLabelFor(titleTextField); personalInfoPanel.add(titleLabel, cc.xywh(5, 15, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ---- titleTextField ---- titleTextField.setColumns(20); personalInfoPanel.add(titleTextField, cc.xy(7, 15)); // ---- companyLabel ---- companyLabel.setText(bundle.getString("companyLabel.text")); companyLabel.setLabelFor(companyTextField); personalInfoPanel.add(companyLabel, cc.xywh(1, 17, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ---- companyTextField ---- companyTextField.setColumns(20); personalInfoPanel.add(companyTextField, cc.xy(3, 17)); // ---- departmentLabel ---- departmentLabel.setText(bundle.getString("departmentLabel.text")); departmentLabel.setLabelFor(departmentTextField); personalInfoPanel.add(departmentLabel, cc.xywh(5, 17, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ---- departmentTextField ---- departmentTextField.setColumns(20); personalInfoPanel.add(departmentTextField, cc.xy(7, 17)); // ---- managerLabel ---- managerLabel.setText(bundle.getString("managerLabel.text")); managerLabel.setLabelFor(managerTextField); personalInfoPanel.add(managerLabel, cc.xywh(1, 19, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ---- managerTextField ---- managerTextField.setColumns(20); personalInfoPanel.add(managerTextField, cc.xy(3, 19)); // ---- officeLabel ---- officeLabel.setText(bundle.getString("officeLabel.text")); officeLabel.setLabelFor(officeTextField); personalInfoPanel.add(officeLabel, cc.xywh(5, 19, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ---- officeTextField ---- officeTextField.setColumns(10); personalInfoPanel.add(officeTextField, cc.xy(7, 19)); personalInfoPanel.add(miscellaneousSeparator, cc.xywh(1, 23, 7, 1)); // ---- birthdayLabel ---- birthdayLabel.setText(bundle.getString("birthdayLabel.text")); personalInfoPanel.add(birthdayLabel, cc.xywh(1, 25, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ======== panel9 ======== { panel9.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, RowSpec.decodeSpecs("fill:default"))); // ---- birthdayCheckBox ---- birthdayCheckBox.setSelected(false); panel9.add(birthdayCheckBox, cc.xy(1, 1)); // ---- birthdayDatePicker ---- birthdayDatePicker.setEnabled(false); panel9.add(birthdayDatePicker, cc.xy(3, 1)); } personalInfoPanel.add(panel9, cc.xywh(3, 25, 5, 1)); birthdayLabel.setLabelFor(panel9); // ---- notesLabel ---- notesLabel.setText(bundle.getString("notesLabel.text")); notesLabel.setLabelFor(notesTextArea); personalInfoPanel.add(notesLabel, cc.xywh(1, 27, 1, 1, CellConstraints.RIGHT, CellConstraints.TOP)); // ======== scrollPane3 ======== { scrollPane3.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); // ---- notesTextArea ---- notesTextArea.setRows(5); notesTextArea.setColumns(20); notesTextArea.setTabSize(4); scrollPane3.setViewportView(notesTextArea); } personalInfoPanel.add(scrollPane3, cc.xywh(3, 27, 5, 1)); } tabbedPane2.addTab(bundle.getString("personalInfoPanel.tab.title"), personalInfoPanel); // ======== mailingAddressPanel ======== { mailingAddressPanel.setBorder(Borders.DIALOG_BORDER); mailingAddressPanel.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, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), 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.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), 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.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW), FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); mailingAddressPanel.add(privateSeparator, cc.xywh(1, 1, 7, 1)); // ---- privateAddressLabel ---- privateAddressLabel.setText(bundle.getString("privateAddressLabel.text")); privateAddressLabel.setLabelFor(privateAddressTextArea); mailingAddressPanel.add(privateAddressLabel, cc.xywh(1, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ======== scrollPane1 ======== { scrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); scrollPane1.setViewportView(privateAddressTextArea); } mailingAddressPanel.add(scrollPane1, cc.xywh(3, 3, 1, 3)); // ---- privateCityLabel ---- privateCityLabel.setText(bundle.getString("privateCityLabel.text")); privateCityLabel.setLabelFor(privateCityTextField); mailingAddressPanel.add(privateCityLabel, cc.xywh(5, 3, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ---- privateCityTextField ---- privateCityTextField.setColumns(5); mailingAddressPanel.add(privateCityTextField, cc.xy(7, 3)); // ---- privateZipPostalCodeLabel ---- privateZipPostalCodeLabel.setText(bundle.getString("privateZipPostalCodeLabel.text")); privateZipPostalCodeLabel.setLabelFor(privateZipPostalCodeTextField); mailingAddressPanel.add(privateZipPostalCodeLabel, cc.xywh(5, 5, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(privateZipPostalCodeTextField, cc.xy(7, 5)); // ---- label1 ---- label1.setText(bundle.getString("streetLabel.text")); label1.setLabelFor(privateStreetTextField); mailingAddressPanel.add(label1, cc.xywh(1, 7, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(privateStreetTextField, cc.xy(3, 7)); // ---- privateStateProvinceCountyLabel ---- privateStateProvinceCountyLabel .setText(bundle.getString("privateStateProvinceCountyLabel.text")); privateStateProvinceCountyLabel.setLabelFor(privateStateProvinceCountyTextField); mailingAddressPanel.add(privateStateProvinceCountyLabel, cc.xywh(5, 7, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(privateStateProvinceCountyTextField, cc.xy(7, 7)); // ---- privatePOBoxLabel ---- privatePOBoxLabel.setText(bundle.getString("privatePOBoxLabel.text")); privatePOBoxLabel.setLabelFor(privatePOBoxTextField); mailingAddressPanel.add(privatePOBoxLabel, cc.xywh(1, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(privatePOBoxTextField, cc.xy(3, 9)); // ---- privateCountryLabel ---- privateCountryLabel.setText(bundle.getString("privateCountryLabel.text")); privateCountryLabel.setLabelFor(privateCountryTextField); mailingAddressPanel.add(privateCountryLabel, cc.xywh(5, 9, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(privateCountryTextField, cc.xy(7, 9)); mailingAddressPanel.add(workSeparator, cc.xywh(1, 13, 7, 1)); // ---- workAddressLabel ---- workAddressLabel.setText(bundle.getString("workAddressLabel.text")); workAddressLabel.setLabelFor(workAddressTextArea); mailingAddressPanel.add(workAddressLabel, cc.xywh(1, 15, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ======== scrollPane2 ======== { scrollPane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); scrollPane2.setViewportView(workAddressTextArea); } mailingAddressPanel.add(scrollPane2, cc.xywh(3, 15, 1, 3)); // ---- workCityLabel ---- workCityLabel.setText(bundle.getString("workCityLabel.text")); workCityLabel.setLabelFor(workCityTextField); mailingAddressPanel.add(workCityLabel, cc.xywh(5, 15, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ---- workCityTextField ---- workCityTextField.setColumns(5); mailingAddressPanel.add(workCityTextField, cc.xy(7, 15)); // ---- workZipPostalCodeLabel ---- workZipPostalCodeLabel.setText(bundle.getString("workZipPostalCodeLabel.text")); workZipPostalCodeLabel.setLabelFor(workZipPostalCodeTextField); mailingAddressPanel.add(workZipPostalCodeLabel, cc.xywh(5, 17, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(workZipPostalCodeTextField, cc.xy(7, 17)); // ---- label2 ---- label2.setText(bundle.getString("streetLabel.text")); label2.setLabelFor(workStreetTextField); mailingAddressPanel.add(label2, cc.xywh(1, 19, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(workStreetTextField, cc.xy(3, 19)); // ---- workStateProvinceCountyLabel ---- workStateProvinceCountyLabel.setText(bundle.getString("workStateProvinceCountyLabel.text")); workStateProvinceCountyLabel.setLabelFor(workStateProvinceCountyTextField); mailingAddressPanel.add(workStateProvinceCountyLabel, cc.xywh(5, 19, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(workStateProvinceCountyTextField, cc.xy(7, 19)); // ---- workPOBoxLabel ---- workPOBoxLabel.setText(bundle.getString("workPOBoxLabel.text")); workPOBoxLabel.setLabelFor(workPOBoxTextField); mailingAddressPanel.add(workPOBoxLabel, cc.xywh(1, 21, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(workPOBoxTextField, cc.xy(3, 21)); // ---- workCountryLabel ---- workCountryLabel.setText(bundle.getString("workCountryLabel.text")); workCountryLabel.setLabelFor(workCountryTextField); mailingAddressPanel.add(workCountryLabel, cc.xywh(5, 21, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(workCountryTextField, cc.xy(7, 21)); mailingAddressPanel.add(otherSeparator, cc.xywh(1, 25, 7, 1)); // ---- otherAddressLabel ---- otherAddressLabel.setLabelFor(otherAddressTextArea); mailingAddressPanel.add(otherAddressLabel, cc.xywh(1, 27, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); // ======== scrollPane4 ======== { scrollPane4.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS); scrollPane4.setViewportView(otherAddressTextArea); } mailingAddressPanel.add(scrollPane4, cc.xywh(3, 27, 1, 3)); // ---- otherCityLabel ---- otherCityLabel.setText(bundle.getString("otherCityLabel.text")); otherCityLabel.setLabelFor(otherCityTextField); mailingAddressPanel.add(otherCityLabel, cc.xywh(5, 27, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(otherCityTextField, cc.xy(7, 27)); // ---- otherZipPostalCodeLabel ---- otherZipPostalCodeLabel.setText(bundle.getString("otherZipPostalCodeLabel.text")); otherZipPostalCodeLabel.setLabelFor(otherZipPostalCodeTextField); mailingAddressPanel.add(otherZipPostalCodeLabel, cc.xywh(5, 29, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(otherZipPostalCodeTextField, cc.xy(7, 29)); // ---- label3 ---- label3.setText(bundle.getString("streetLabel.text")); label3.setLabelFor(otherStreetTextField); mailingAddressPanel.add(label3, cc.xywh(1, 31, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(otherStreetTextField, cc.xy(3, 31)); // ---- otherStateProvinceCountyLabel ---- otherStateProvinceCountyLabel .setText(bundle.getString("otherStateProvinceCountyLabel.text")); otherStateProvinceCountyLabel.setLabelFor(otherStateProvinceCountyTextField); mailingAddressPanel.add(otherStateProvinceCountyLabel, cc.xywh(5, 31, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(otherStateProvinceCountyTextField, cc.xy(7, 31)); // ---- otherPOBoxLabel ---- otherPOBoxLabel.setText(bundle.getString("otherPOBoxLabel.text")); otherPOBoxLabel.setLabelFor(otherPOBoxTextField); mailingAddressPanel.add(otherPOBoxLabel, cc.xywh(1, 33, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(otherPOBoxTextField, cc.xy(3, 33)); // ---- otherCountryLabel ---- otherCountryLabel.setText(bundle.getString("otherCountryLabel.text")); otherCountryLabel.setLabelFor(otherCountryTextField); mailingAddressPanel.add(otherCountryLabel, cc.xywh(5, 33, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); mailingAddressPanel.add(otherCountryTextField, cc.xy(7, 33)); } tabbedPane2.addTab(bundle.getString("mailingAddressPanel.tab.title"), mailingAddressPanel); } contentPane.add(tabbedPane2, BorderLayout.NORTH); } dialogPane.add(contentPane, 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(bundle.getString("okButton.text")); buttonBar.add(okButton, cc.xy(2, 1)); // ---- cancelButton ---- cancelButton.setText(bundle.getString("cancelButton.text")); buttonBar.add(cancelButton, cc.xy(4, 1)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane2.add(dialogPane, BorderLayout.CENTER); }
From source file:org.columba.calendar.ui.dialog.EditEventDialog.java
License:Mozilla Public License
private JPanel createPanel1() { JPanel jpanel1 = new JPanel(); FormLayout formlayout1 = new FormLayout( "3dlu,FILL:DEFAULT:NONE,3dlu,FILL:DEFAULT:GROW(1.0),3dlu,FILL:DEFAULT:NONE,3dlu,FILL:DEFAULT:NONE", "3dlu,CENTER:DEFAULT:NONE,3dlu,CENTER:DEFAULT:NONE,3dlu,CENTER:DEFAULT:NONE,3dlu,CENTER:DEFAULT:NONE,3dlu,FILL:DEFAULT:GROW(1.0)"); CellConstraints cc = new CellConstraints(); jpanel1.setLayout(formlayout1);//from www . j a v a 2 s.c om JLabel jlabel1 = new JLabel(); jlabel1.setText("Summary:"); jpanel1.add(jlabel1, new CellConstraints(2, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT)); JLabel jlabel2 = new JLabel(); jlabel2.setText("Location:"); jpanel1.add(jlabel2, new CellConstraints(2, 4, CellConstraints.RIGHT, CellConstraints.DEFAULT)); JLabel jlabel3 = new JLabel(); jlabel3.setText("Description:"); jpanel1.add(jlabel3, new CellConstraints(2, 10, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP)); JLabel jlabel4 = new JLabel(); jlabel4.setText("Class:"); jpanel1.add(jlabel4, new CellConstraints(2, 6, CellConstraints.RIGHT, CellConstraints.DEFAULT)); jpanel1.add(summaryTextField, cc.xywh(4, 2, 5, 1)); jpanel1.add(locationTextField, cc.xywh(4, 4, 5, 1)); JScrollPane jscrollpane1 = new JScrollPane(); jscrollpane1.setViewportView(descriptionTextArea); jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED); jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED); jpanel1.add(jscrollpane1, cc.xywh(4, 10, 5, 1)); jpanel1.add(classComboBox, cc.xy(4, 6)); JLabel jlabel5 = new JLabel(); jlabel5.setText("Calendar:"); jpanel1.add(jlabel5, new CellConstraints(6, 6, CellConstraints.RIGHT, CellConstraints.DEFAULT)); jpanel1.add(calendarPicker, cc.xy(8, 6)); jpanel1.add(new JLabel("Categories:"), new CellConstraints(2, 8, CellConstraints.RIGHT, CellConstraints.DEFAULT)); jpanel1.add(categoriesTextField, cc.xywh(4, 8, 3, 1)); categoriesButton.setActionCommand("Categories..."); categoriesButton.setText("Select ..."); jpanel1.add(categoriesButton, cc.xy(8, 8)); return jpanel1; }
From source file:org.columba.calendar.ui.dialog.EditEventDialog.java
License:Mozilla Public License
private JPanel createPanel2() { JPanel jpanel1 = new JPanel(); FormLayout formlayout1 = new FormLayout( "3dlu,FILL:DEFAULT:NONE,3dlu,FILL:DEFAULT:GROW(1.0),3dlu,FILL:DEFAULT:GROW(1.0),3dlu,FILL:DEFAULT:NONE", "3dlu,FILL:DEFAULT:NONE,3dlu,FILL:DEFAULT:NONE,3dlu,FILL:DEFAULT:NONE,3dlu,FILL:DEFAULT:NONE,3dlu"); CellConstraints cc = new CellConstraints(); jpanel1.setLayout(formlayout1);//from www .j av a 2 s .c o m JLabel jlabel1 = new JLabel(); jlabel1.setText("Start Time:"); jpanel1.add(jlabel1, new CellConstraints(2, 2, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); allDayCheckBox.setActionCommand("All Day"); allDayCheckBox.addActionListener(this); allDayCheckBox.setText("All Day"); jpanel1.add(allDayCheckBox, cc.xy(8, 2)); JLabel jlabel2 = new JLabel(); jlabel2.setText("End Time:"); jpanel1.add(jlabel2, new CellConstraints(2, 4, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); jpanel1.add(startDayDatePicker, cc.xy(4, 2)); jpanel1.add(endDayDatePicker, cc.xy(4, 4)); jpanel1.add(startTimePicker, cc.xy(6, 2)); jpanel1.add(endTimePicker, cc.xy(6, 4)); alarmCheckBox.setActionCommand("Alarm"); alarmCheckBox.setText("Alarm"); jpanel1.add(alarmCheckBox, new CellConstraints(2, 6, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); jpanel1.add(createPanel3(), cc.xywh(4, 6, 3, 1)); recurrenceCheckBox.setText("Recurrence"); recurrenceCheckBox.setActionCommand("Recurrence"); recurrenceCheckBox.addActionListener(this); jpanel1.add(recurrenceCheckBox, new CellConstraints(2, 8, 1, 1, CellConstraints.RIGHT, CellConstraints.DEFAULT)); jpanel1.add(createPanel4(), cc.xywh(4, 8, 3, 1)); return jpanel1; }
From source file:org.deegree.igeo.views.swing.style.EditSymbollibraryPanel.java
License:Open Source License
private void init() { // init//from w w w.j ava 2s.c om // add own newSymbolNameTF = new JTextField(); selectFileBt = new JButton(get("$MD10771")); selectFileBt.addActionListener(this); newSymbolTF = new JTextField(); addSymbolBt = new JButton(get("$MD10772")); addSymbolBt.addActionListener(this); // remove own removeSymbolBt = new JButton(get("$MD11165")); removeSymbolBt.addActionListener(this); removeSymbolBt.setEnabled(false); exportLibBt = new JButton(get("$MD11838")); exportLibBt.setEnabled(false); exportLibBt.addActionListener(this); importLibBt = new JButton(get("$MD11843")); importLibBt.addActionListener(this); symbolTableModel = new SymbolTableModel(); symbolTable = new JTable(symbolTableModel); symbolTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); TableColumn iconCol = symbolTable.getColumnModel().getColumn(0); iconCol.setPreferredWidth(50); iconCol.setCellRenderer(new SymbolRenderer()); symbolTable.getColumnModel().getColumn(1).setPreferredWidth(75); symbolTable.getColumnModel().getColumn(2).setPreferredWidth(500); symbolTable.getColumnModel().getColumn(2).setCellRenderer(new URLCellRenderer()); symbolTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent arg0) { if (symbolTable.getSelectedRowCount() > 0) { removeSymbolBt.setEnabled(true); exportLibBt.setEnabled(true); } else { removeSymbolBt.setEnabled(false); exportLibBt.setEnabled(false); } } }); JScrollPane scrollPane = new JScrollPane(symbolTable); // layout FormLayout fl = new FormLayout( "left:$rgap, left:min, $ugap, fill:default:grow(0.5), $ugap, fill:default:grow(0.5)", "$cpheight, 150dlu, $btheight, " + "$sepheight, $cpheight, $btheight, $cpheight, $btheight," + "$sepheight, $btheight"); DefaultFormBuilder builder = new DefaultFormBuilder(fl); CellConstraints cc = new CellConstraints(); builder.addSeparator(get("$MD11842"), cc.xyw(1, 1, 6)); builder.add(scrollPane, cc.xyw(2, 2, 5, CellConstraints.FILL, CellConstraints.CENTER)); builder.add(buildTableButtonBar(), cc.xyw(1, 3, 6, CellConstraints.CENTER, CellConstraints.CENTER)); builder.addSeparator(get("$MD10775"), cc.xyw(1, 4, 6)); builder.addLabel(get("$MD10776"), cc.xy(2, 5)); builder.add(newSymbolNameTF, cc.xyw(4, 5, 3)); builder.addLabel(get("$MD10777"), cc.xy(2, 6)); builder.add(selectFileBt, cc.xy(4, 6, CellConstraints.RIGHT, CellConstraints.CENTER)); builder.add(newSymbolTF, cc.xyw(2, 7, 5)); builder.add(addSymbolBt, cc.xyw(2, 8, 5, CellConstraints.CENTER, CellConstraints.CENTER)); builder.addSeparator(get("$MD11837"), cc.xyw(1, 9, 6)); builder.add(importLibBt, cc.xyw(2, 10, 5, CellConstraints.CENTER, CellConstraints.CENTER)); add(builder.getPanel()); }
From source file:org.deegree.igeo.views.swing.style.FillGraphicPanel.java
License:Open Source License
private void init() { // init//w ww . ja v a 2 s. c o m // well known fixedGraphicFillCB = new JComboBox(); fixedGraphicFillCB.setRenderer(new SymbolRenderer()); fixedGraphicFillCB.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { fireFillGraphicChangedEvent(); } }); // size defaultSizeRB = new JRadioButton(get("$MD11113")); defaultSizeRB.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { fireFillGraphicChangedEvent(); } }); setSizeRB = new JRadioButton(); setSizeRB.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { fireFillGraphicChangedEvent(); } }); ButtonGroup bg = new ButtonGroup(); bg.add(defaultSizeRB); bg.add(setSizeRB); defaultSizeRB.setSelected(true); SpinnerModel model = new SpinnerNumberModel(6.0, 1.0, Integer.MAX_VALUE, 1.0); sizeSpinner = new JSpinner(model); sizeSpinner.setMaximumSize(new Dimension(StyleDialogUtils.PREF_COMPONENT_WIDTH, StyleDialogUtils.PREF_ONELINE_COMPONENT_HEIGHT)); sizeSpinner.setMinimumSize(new Dimension(StyleDialogUtils.PREF_COMPONENT_WIDTH, StyleDialogUtils.PREF_ONELINE_COMPONENT_HEIGHT)); sizeSpinner.setPreferredSize(new Dimension(StyleDialogUtils.PREF_COMPONENT_WIDTH, StyleDialogUtils.PREF_ONELINE_COMPONENT_HEIGHT)); sizeSpinner.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(ChangeEvent e) { setSizeRB.setSelected(true); fireFillGraphicChangedEvent(); } }); // add own selectGraphicBt = new JButton(get("$MD10753")); selectGraphicBt.addActionListener(this); fixedGraphicFillUrlTF = new JTextField(); addNewGraphicBt = new JButton(get("$MD10754")); addNewGraphicBt.addActionListener(this); fixedGraphicFillNameTF = new JTextField(); // remove own graphicToRemoveCB = new JComboBox(); graphicToRemoveCB.setRenderer(new SymbolRenderer()); removeGraphicBt = new JButton(get("$MD11161")); removeGraphicBt.addActionListener(this); // layout FormLayout fl = new FormLayout("left:$rgap, left:min, left:min, fill:default:grow(1), min", "$sepheight, $cpheight, " + "$sepheight, $cpheight, $cpheight, " + "$sepheight, $cpheight, $btheight, $cpheight, $btheight, " + "$sepheight, $cpheight, $btheight"); DefaultFormBuilder builder = new DefaultFormBuilder(fl); CellConstraints cc = new CellConstraints(); builder.addSeparator(get("$MD10756"), cc.xyw(1, 1, 5)); builder.add(fixedGraphicFillCB, cc.xyw(2, 2, 4)); builder.addSeparator(get("$MD11112"), cc.xyw(1, 3, 4)); builder.add(defaultSizeRB, cc.xyw(2, 4, 3)); builder.add(setSizeRB, cc.xy(2, 5)); builder.add(sizeSpinner, cc.xy(3, 5)); builder.addSeparator(get("$MD10757"), cc.xyw(1, 6, 5)); builder.addLabel(get("$MD10758"), cc.xyw(2, 7, 2)); builder.add(fixedGraphicFillNameTF, cc.xyw(4, 7, 2)); builder.addLabel(get("$MD10759"), cc.xyw(2, 8, 2)); builder.add(selectGraphicBt, cc.xyw(4, 8, 2, CellConstraints.RIGHT, CellConstraints.CENTER)); builder.add(fixedGraphicFillUrlTF, cc.xyw(2, 9, 4)); builder.add(addNewGraphicBt, cc.xyw(2, 10, 4, CellConstraints.CENTER, CellConstraints.CENTER)); builder.addSeparator(get("$MD11160"), cc.xyw(1, 11, 5)); builder.add(graphicToRemoveCB, cc.xyw(2, 12, 4)); builder.add(removeGraphicBt, cc.xyw(2, 13, 4, CellConstraints.CENTER, CellConstraints.CENTER)); add(builder.getPanel(), BorderLayout.CENTER); }
From source file:org.deegree.igeo.views.swing.style.RuleDialog.java
License:Open Source License
private void initRuleDialog() { FormLayout fl = new FormLayout("left:default:grow(0.5), right:default:grow(0.5)", "top:default, $btheight:grow(1.0), $btheight:grow(1.0)"); DefaultFormBuilder builder = new DefaultFormBuilder(fl); builder.setDefaultDialogBorder();/*from w w w. j a v a 2 s. c om*/ CellConstraints cc = new CellConstraints(); builder.add(rules, cc.xyw(1, 1, 2)); builder.add(helpBt, cc.xy(1, 2)); builder.add(applyBt, cc.xy(2, 2)); builder.add(buildMainButtonBar(), cc.xywh(1, 3, 2, 1, CellConstraints.RIGHT, CellConstraints.BOTTOM)); setJMenuBar(menuBar); getContentPane().add(builder.getPanel()); }
From source file:org.drugis.addis.gui.components.progressgraph.ProgressGraph.java
License:Open Source License
public JPanel createPanel() { final FormLayout layout = new FormLayout(createFormSpec("pref", d_numCols), "p, " + createFormSpec("3dlu, p", d_numTotalRows - 1)); CellConstraints cc = new CellConstraints(); JPanel progressPanel = new JPanel(layout); Dimension cellSize = new Dimension(d_edgeLength, d_arrowSize); Dimension circleSize = new Dimension(d_circleDiameter, d_circleDiameter); for (int i = 0; i < d_numberOfChains; ++i) { int rowIdx = (2 * i) + 1; Task tuningTask = d_model.getModel().getActivityTask().getModel() .getStateByName(MCMCModel.TUNING_CHAIN_PREFIX + i); progressPanel.add(new GraphLine(cellSize, 2, SwingConstants.EAST), cc.xy(6, rowIdx)); progressPanel.add(new GraphProgressNode(d_gridCellSize, tuningTask), cc.xy(7, rowIdx)); Task simulationTask = d_model.getModel().getActivityTask().getModel() .getStateByName(MCMCModel.SIMULATION_CHAIN_PREFIX + i); progressPanel.add(new GraphLine(new Dimension(d_edgeLength * 2, d_arrowSize), 2, SwingConstants.EAST), cc.xy(9, rowIdx));// w ww . j a v a 2 s .co m progressPanel.add(new GraphProgressNode(d_gridCellSize, simulationTask), cc.xy(10, rowIdx)); progressPanel.add(new GraphLine(cellSize, 2, SwingConstants.EAST), cc.xy(11, rowIdx)); } /** Placement needed for the calculated preferred size */ progressPanel.add(new GraphSimpleNode(circleSize, GraphSimpleNodeType.START), centerCell(cc, d_numMainRows, 1)); progressPanel.add(new GraphLine(cellSize, 2, SwingConstants.EAST), centerCell(cc, d_numMainRows, 2)); Task startTask = d_model.getModel().getActivityTask().getModel() .getStateByName(MCMCModel.STARTING_SIMULATION_PHASE); progressPanel.add(new GraphProgressNode(d_gridCellSize, startTask, false), centerCell(cc, d_numMainRows, 3)); progressPanel.add(new GraphLine(cellSize, 2, SwingConstants.EAST), centerCell(cc, d_numMainRows, 4)); //NOTE: it is a mystery why numMainRows - 1 is the correct count instead of just numMainRows progressPanel.add( new GraphBar(new Dimension(d_barWidth, (int) progressPanel.getPreferredSize().getHeight())), centerCell(cc, d_numMainRows - 1, 5)); progressPanel.add( new GraphBar(new Dimension(d_barWidth, (int) progressPanel.getPreferredSize().getHeight())), centerCell(cc, d_numMainRows - 1, 12)); Task assessConvergence = d_model.getModel().getActivityTask().getModel() .getStateByName(MCMCModel.CALCULATING_SUMMARIES_PHASE); progressPanel.add(new GraphLine(cellSize, 2, SwingConstants.EAST), centerCell(cc, d_numMainRows, 13)); progressPanel.add(new GraphProgressNode(d_gridCellSize, assessConvergence, false), centerCell(cc, d_numMainRows, 14)); progressPanel.add(new GraphLine(new Dimension(d_arrowSize, 50), 2, SwingConstants.SOUTH), cc.xywh(14, d_numMainRows / 2 + 2, 1, d_numMainRows / 2 + 1, CellConstraints.CENTER, CellConstraints.BOTTOM)); progressPanel.add(new GraphSimpleNode(circleSize, GraphSimpleNodeType.DECISION), cc.xywh(14, d_numMainRows + 2, 1, 1, CellConstraints.CENTER, CellConstraints.CENTER)); progressPanel.add( new GraphLine(new Dimension((int) (d_edgeLength + (d_edgeLength)), d_arrowSize), 2, SwingConstants.EAST), cc.xyw(14, d_numMainRows + 2, 2, CellConstraints.RIGHT, CellConstraints.DEFAULT)); progressPanel.add(new GraphSimpleNode(circleSize, GraphSimpleNodeType.END), cc.xy(16, d_numMainRows + 2)); progressPanel.add(new GraphLine(new Dimension(d_edgeLength * 9, d_arrowSize), 2, SwingConstants.WEST), cc.xyw(10, d_numMainRows + 2, 14 - 7, CellConstraints.LEFT, CellConstraints.DEFAULT)); progressPanel.add(new GraphBar(new Dimension(d_edgeLength * 2, d_barWidth)), cc.xy(9, d_numMainRows + 2)); int totalHeight = (int) progressPanel.getPreferredSize().getHeight(); progressPanel.add( new GraphConnector(new Dimension(d_edgeLength * 2, totalHeight), d_cellHeight + Sizes.DLUY3.getPixelSize(progressPanel), totalHeight - 30, d_numberOfChains), cc.xywh(9, 1, 1, d_numTotalRows)); PanelBuilder builder = new PanelBuilder(new FormLayout("pref", "p")); builder.setDefaultDialogBorder(); builder.add(progressPanel); return builder.getPanel(); }
From source file:org.eclipse.wb.internal.swing.FormLayout.gef.FormSelectionEditPolicy.java
License:Open Source License
@Override public void performRequest(Request request) { if (request instanceof KeyRequest) { KeyRequest keyRequest = (KeyRequest) request; if (keyRequest.isPressed()) { char c = keyRequest.getCharacter(); // horizontal if (c == 'd') { setAlignment(true, CellConstraints.DEFAULT); } else if (c == 'l') { setAlignment(true, CellConstraints.LEFT); } else if (c == 'f') { setAlignment(true, CellConstraints.FILL); } else if (c == 'c') { setAlignment(true, CellConstraints.CENTER); } else if (c == 'r') { setAlignment(true, CellConstraints.RIGHT); }//from w w w . j a v a 2s. c o m // vertical if (c == 'D') { setAlignment(false, CellConstraints.DEFAULT); } else if (c == 't') { setAlignment(false, CellConstraints.TOP); } else if (c == 'F') { setAlignment(false, CellConstraints.FILL); } else if (c == 'm') { setAlignment(false, CellConstraints.CENTER); } else if (c == 'b') { setAlignment(false, CellConstraints.BOTTOM); } } } }