List of usage examples for com.jgoodies.forms.layout CellConstraints xywh
public CellConstraints xywh(int col, int row, int colSpan, int rowSpan)
Examples:
cc.xywh(1, 3, 2, 1); cc.xywh(1, 3, 7, 3);
From source file:ambit2.dbui.QuerySimilarityEditor.java
License:Open Source License
public JComponent buildPanel() { FormLayout layout = new FormLayout("125dlu,3dlu,75dlu,3dlu,40dlu,3dlu,40dlu,2dlu,40dlu", "pref,3dlu,pref"); PanelBuilder panel = new PanelBuilder(layout); panel.setDefaultDialogBorder();/*from w w w . j a v a 2 s .c om*/ CellConstraints cc = new CellConstraints(); JComponent c = createFieldnameComponent(); panel.add(new JLabel("<html><b>Similarity</b></html>"), cc.xywh(1, 3, 1, 1)); if (c != null) panel.add(c, cc.xywh(3, 3, 1, 1)); c = createConditionComponent(); panel.add(new JLabel("Threshold"), cc.xywh(5, 3, 1, 1)); if (c != null) panel.add(c, cc.xywh(7, 3, 1, 1)); c = createThresholdComponent(); if (c != null) panel.add(c, cc.xywh(9, 3, 1, 1)); c = createStructureComponent(); panel.add(c, cc.xywh(1, 1, 9, 1)); return panel.getPanel(); }
From source file:ambit2.dbui.QueryStoredResultsEditor.java
License:Open Source License
@Override public JComponent buildPanel() { queries = new AmbitRows<IStoredQuery>(); searchStoredQuery = new SearchStoredQueries(); searchStoredQuery.setCondition(/*from w w w .jav a2 s . c o m*/ StringCondition.getInstance(StringCondition.STRING_CONDITION.S_STARTS_WITH.getName())); FormLayout layout = new FormLayout("125dlu,3dlu,75dlu,3dlu,125dlu", "pref,pref"); PanelBuilder panel = new PanelBuilder(layout); panel.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); panel.addSeparator("Query name [number of structures]", cc.xywh(1, 1, 5, 1)); JComponent c = createFieldnameComponent(); if (c != null) panel.add(c, cc.xywh(1, 2, 5, 1)); return panel.getPanel(); }
From source file:ambit2.ui.editors.SelectFieldsPanel.java
License:Open Source License
protected void buildPanel(String help) { FormLayout layout = new FormLayout( "3dlu,fill:40dlu:grow,fill:120dlu:grow,3dlu,32dlu, 3dlu, fill:40dlu:grow,fill:120dlu:grow,3dlu", //columns "3dlu,12dlu,3dlu,top:[pref,36dlu], 24dlu,3dlu,24dlu,3dlu,24dlu,3dlu,24dlu,bottom:[pref,72dlu]:grow,1dlu,pref,pref,pref,pref,pref"); //rows setLayout(layout);//from ww w. j a va 2 s .c om CellConstraints cc = new CellConstraints(); add(createSeparator("Available"), cc.xywh(2, 2, 2, 1)); add(createSeparator("Selected"), cc.xywh(7, 2, 2, 1)); tables = new JList[fieldsModel.length]; for (int i = 0; i < fieldsModel.length; i++) { tables[i] = new JList(fieldsModel[i]); SelectionInList<Property> selectionInList = new SelectionInList<Property>(fieldsModel[i]); Bindings.bind(tables[i], selectionInList); JScrollPane p = new JScrollPane(tables[i]); p.setBorder(BorderFactory.createEtchedBorder()); p.setPreferredSize(new Dimension(160, 280)); int offset = 2 + i * 5; add(p, cc.xywh(offset, 4, 2, 9)); BeanAdapter beanAdapter = new BeanAdapter(selectionInList); String[][] config = { { "name", "Name" }, { "label", "Alias" }, { "units", "Units" }, { "title", "url" }, { "url", "WWW" } }; for (int j = 0; j < config.length; j++) { String[] c = config[j]; ValueModel model = beanAdapter.getValueModel(c[0]); add(BasicComponentFactory.createLabel(new ValueHolder(c[1])), cc.xywh(offset, j + 14, 1, 1)); JTextField t = BasicComponentFactory.createTextField(model); t.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { super.mouseEntered(e); ((JTextField) e.getSource()).setToolTipText(((JTextField) e.getSource()).getText()); } }); add(t, cc.xywh(offset + 1, j + 14, 1, 1)); } /* ValueModel nameModel = beanAdapter.getValueModel("name"); ValueModel commentsModel = beanAdapter.getValueModel("label"); ValueModel titleModel = beanAdapter.getValueModel("title"); ValueModel urlModel = beanAdapter.getValueModel("url"); //p.add(BasicComponentFactory.createTextField(parentModel)); add(BasicComponentFactory.createLabel(new ValueHolder("Name")),cc.xywh(offset,14,1,1)); add(BasicComponentFactory.createTextField(nameModel),cc.xywh(offset+1,14,1,1)); add(BasicComponentFactory.createLabel(new ValueHolder("Alias")),cc.xywh(offset,15,1,1)); add(BasicComponentFactory.createTextField(commentsModel),cc.xywh(offset+1,15,1,1)); add(BasicComponentFactory.createLabel(new ValueHolder("Reference")),cc.xywh(offset,16,1,1)); add(BasicComponentFactory.createTextField(titleModel),cc.xywh(offset+1,16,1,1)); add(BasicComponentFactory.createLabel(new ValueHolder("WWW")),cc.xywh(offset,17,1,1)); add(BasicComponentFactory.createTextField(urlModel),cc.xywh(offset+1,17,1,1)); */ } buttons = new ArrayList<JButton>(); int i = 0; for (MOVE op : MOVE.values()) { JButton button = new JButton(op.display()); button.setPreferredSize(new Dimension(24, 24)); button.setMaximumSize(new Dimension(24, 24)); add(button, cc.xywh(5, 5 + (i * 2), 1, 1)); button.addActionListener(this); button.setActionCommand(op.toString()); i++; } /* JToolBar toolBar[] = new JToolBar[2]; toolBar[0] = new JToolBar(); toolBar[0].add(new JButton("Find")); toolBar[0].add(new JToolBar.Separator()); toolBar[0].add(new JButton("Select all")); toolBar[0].add(new JButton("Unselect all")); toolBar[0].setFloatable(false); add(toolBar[0],cc.xywh(2,14,1,1)); toolBar[1] = new JToolBar(); toolBar[1].add(new JButton("Move Up")); toolBar[1].add(new JButton("Move Down")); toolBar[1].add(new JToolBar.Separator()); toolBar[1].add(new JButton("Select all")); toolBar[1].add(new JButton("Unselect all")); toolBar[1].setFloatable(false); add(toolBar[1],cc.xywh(6,14,1,1)); */ /* helpArea = new JTextPane(); helpArea.setText(help); helpArea.setEditable(false); helpArea.setBackground(new Color(255,255,225)); helpArea.setPreferredSize(new Dimension(288,48)); add(new JScrollPane(helpArea),cc.xywh(2,16,5,1)); */ }
From source file:anl.verdi.area.AreaFilePanel.java
private void initComponents() { Logger.debug("in AreaFilePanel.initComponents"); // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license areaFilesPanel = new JPanel(); areaFiles = new JPanel(); btnAdd = new JButton(); btnDelete = new JButton(); scrollPaneAreaFiles = new JScrollPane(); areaFileList = new JList(); areasPanel = new JPanel(); scrollPane6 = new JScrollPane(); areaList = new JList(); CellConstraints cc = new CellConstraints(); //======== this ======== setLayout(new FormLayout("pref:grow", "fill:default:grow")); //======== areaFilesPanel ======== {//from www . j av a2s.co m areaFilesPanel.setBorder(null); // 2014 - underlying jgoodies class changed ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("pref:grow"); RowSpec[] aRowSpec = RowSpec.decodeSpecs("fill:max(pref;125dlu):grow"); areaFilesPanel.setLayout(new FormLayout(aColumnSpec, new RowSpec[] { new RowSpec(Sizes.dluY(108)), new RowSpec(Sizes.dluY(92)), FormFactory.PREF_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.PREF_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, aRowSpec[0] })); // areaFilesPanel.setLayout(new FormLayout( // ColumnSpec.decodeSpecs("pref:grow"), // new RowSpec[] { // new RowSpec(Sizes.dluY(108)), // new RowSpec(Sizes.dluY(92)), // FormFactory.PREF_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.PREF_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // new RowSpec("fill:max(pref;125dlu):grow") // })); //======== areaFiles ======== { areaFiles.setBorder(new TitledBorder("Area Files")); // 2014 ColumnSpec bColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); RowSpec bRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); areaFiles.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, bColumnSpec }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, bRowSpec })); // areaFiles.setLayout(new FormLayout( // new ColumnSpec[] { // FormFactory.DEFAULT_COLSPEC, // FormFactory.RELATED_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) // }, // new RowSpec[] { // FormFactory.DEFAULT_ROWSPEC, // FormFactory.RELATED_GAP_ROWSPEC, // new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) // })); // 2014 set up file names String verdiHome = Tools.getVerdiHome(); // 2014 new method for reading in an image file String separator = "/"; // use forward slash only for constructor ImageIcon(String filename); String pathName = verdiHome + separator + "plugins" + separator + "core" + separator + "icons" + separator; //---- btnAdd ---- String filePlus = new String(pathName + "plus.png"); // btnAdd.setIcon(new ImageIcon(getClass().getResource("/plus.png"))); btnAdd.setIcon(new ImageIcon(filePlus)); btnAdd.setToolTipText("Add Area File"); areaFiles.add(btnAdd, cc.xy(1, 1)); //---- btnDelete ---- String fileMinus = new String(pathName + "Minus.png"); // btnDelete.setIcon(new ImageIcon(getClass().getResource("/minus.png"))); btnDelete.setIcon(new ImageIcon(fileMinus)); btnDelete.setToolTipText("Delete Area File"); areaFiles.add(btnDelete, cc.xy(3, 1)); //======== scrollPaneAreaFiles ======== { //---- areaFileList ---- areaFileList.setSelectedIndex(0); areaFileList.setMaximumSize(new Dimension(300, 100)); areaFileList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); areaFileList.setPrototypeCellValue("RADM_CONC_!"); scrollPaneAreaFiles.setViewportView(areaFileList); } areaFiles.add(scrollPaneAreaFiles, cc.xywh(1, 3, 4, 1)); } areaFilesPanel.add(areaFiles, cc.xy(1, 1)); //======== areasPanel ======== { areasPanel.setBorder(new TitledBorder("Areas")); areasPanel.setLayout(new BorderLayout()); //======== scrollPane6 ======== { //---- areaList ---- areaList.setPrototypeCellValue("O3[1]"); scrollPane6.setViewportView(areaList); } areasPanel.add(scrollPane6, BorderLayout.CENTER); } areaFilesPanel.add(areasPanel, cc.xywh(1, 2, 1, 6)); } add(areaFilesPanel, cc.xy(1, 1)); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:anl.verdi.area.target.FormulaDialog.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license DefaultComponentFactory compFactory = DefaultComponentFactory.getInstance(); dialogPane = new JPanel(); contentPanel = new JPanel(); separator2 = compFactory.createSeparator("View Area Values for the Selected Formulas"); label2 = new JLabel(); radioButton1 = new JRadioButton(); radioButton2 = new JRadioButton(); label1 = new JLabel(); scrollPane1 = new JScrollPane(); formulaList = new JList(); buttonBar = new JPanel(); separator1 = new JSeparator(); errorMessage = new JLabel(); okButton = new JButton(); cancelButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== setModal(true);/*from w w w. j a va 2 s. co m*/ setTitle("Area Information"); Container contentPane = getContentPane(); contentPane.setLayout(new BorderLayout()); //======== dialogPane ======== { dialogPane.setBorder(Borders.DIALOG_BORDER); dialogPane.setMinimumSize(new Dimension(445, 400)); dialogPane.setLayout(new BorderLayout()); //======== contentPanel ======== { contentPanel.setPreferredSize(new Dimension(400, 75)); contentPanel.setMinimumSize(new Dimension(423, 75)); // 2014 - underlyaing jgoodies class changed ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("min(min;5dlu):grow"); ColumnSpec[] bColumnSpec = ColumnSpec.decodeSpecs("max(min;75dlu)"); contentPanel.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.PREF_COLSPEC, aColumnSpec[0], FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, bColumnSpec[0], FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // contentPanel.setLayout(new FormLayout( // new ColumnSpec[] { // FormFactory.DEFAULT_COLSPEC, // FormFactory.PREF_COLSPEC, // new ColumnSpec("min(min;5dlu):grow"), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.RELATED_GAP_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec("max(min;75dlu)"), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC // }, // new RowSpec[] { // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC // })); contentPanel.add(separator2, cc.xywh(1, 1, 13, 1)); //---- label2 ---- label2.setText("Areas:"); contentPanel.add(label2, cc.xy(1, 3)); //---- radioButton1 ---- radioButton1.setText("Selected"); radioButton1.setSelected(true); contentPanel.add(radioButton1, cc.xy(2, 3)); //---- radioButton2 ---- radioButton2.setText("All"); contentPanel.add(radioButton2, cc.xywh(3, 3, 9, 1)); //---- label1 ---- label1.setText("Formulas:"); contentPanel.add(label1, cc.xy(1, 5)); } dialogPane.add(contentPanel, BorderLayout.NORTH); //======== scrollPane1 ======== { scrollPane1.setMinimumSize(new Dimension(300, 400)); scrollPane1.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS); scrollPane1.setPreferredSize(new Dimension(350, 200)); scrollPane1.setMaximumSize(new Dimension(1000, 1000)); //---- formulaList ---- formulaList.setMinimumSize(new Dimension(300, 200)); formulaList.setMaximumSize(new Dimension(300, 500)); formulaList.setPreferredSize(new Dimension(300, 200)); scrollPane1.setViewportView(formulaList); } dialogPane.add(scrollPane1, BorderLayout.CENTER); //======== buttonBar ======== { buttonBar.setBorder(Borders.BUTTON_BAR_GAP_BORDER); buttonBar.setPreferredSize(new Dimension(181, 60)); buttonBar.setLayout(new FormLayout( new ColumnSpec[] { 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.GLUE_COLSPEC, FormFactory.BUTTON_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.BUTTON_COLSPEC }, new RowSpec[] { new RowSpec(Sizes.dluY(15)), FormFactory.PREF_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); buttonBar.add(separator1, cc.xywh(2, 1, 9, 1)); //---- errorMessage ---- errorMessage .setFont(errorMessage.getFont().deriveFont(errorMessage.getFont().getStyle() | Font.BOLD)); buttonBar.add(errorMessage, cc.xywh(2, 2, 6, 1)); //---- okButton ---- okButton.setText("OK"); buttonBar.add(okButton, cc.xy(8, 2)); //---- cancelButton ---- cancelButton.setText("Cancel"); buttonBar.add(cancelButton, cc.xy(10, 2)); } dialogPane.add(buttonBar, BorderLayout.SOUTH); } contentPane.add(dialogPane, BorderLayout.CENTER); setSize(375, 345); setLocationRelativeTo(getOwner()); //---- buttonGroup1 ---- ButtonGroup buttonGroup1 = new ButtonGroup(); buttonGroup1.add(radioButton1); buttonGroup1.add(radioButton2); // JFormDesigner - End of component initialization //GEN-END:initComponents }
From source file:anl.verdi.gis.FastTileLayerPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license scrollPane1 = new JScrollPane(); layerList = new JList(); // addBtn = new JButton(); moveUpButton = new JButton(); moveDownButton = new JButton(); removeLayerButton = new JButton(); // editLayerButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== // 2014/*from w ww. jav a 2 s .c o m*/ ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); RowSpec aRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); RowSpec bRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); setLayout(new FormLayout( new ColumnSpec[] { aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { aRowSpec, 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, bRowSpec })); // setLayout(new FormLayout( // new ColumnSpec[]{ // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC // }, // new 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, // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) // })); //======== scrollPane1 ======== { //---- layerList ---- layerList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { layerListValueChanged(e); } }); scrollPane1.setViewportView(layerList); } add(scrollPane1, cc.xywh(1, 1, 1, 13)); //---- addBtn ---- // addBtn.setText("Add Layer"); // 2014 removed button to avoid problems with Simphony // addBtn.addActionListener(new ActionListener() { // public void actionPerformed(ActionEvent e) { // addBtnActionPerformed(e); // } // }); // add(addBtn, cc.xy(3, 3)); //---- moveUpButton ---- moveUpButton.setText("Move Up"); moveUpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { moveUpButtonActionPerformed(e); } }); add(moveUpButton, cc.xy(3, 5)); //---- moveDownButton ---- moveDownButton.setText("Move Down"); moveDownButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { moveDownButtonActionPerformed(e); } }); add(moveDownButton, cc.xy(3, 7)); //---- removeLayerButton ---- removeLayerButton.setText("Remove Layer"); removeLayerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { removeLayerButtonActionPerformed(e); } }); add(removeLayerButton, cc.xy(3, 9)); //---- editLayerButton ---- // 2014 removed Edit Layer button from interface - causes crash by Simphony // editLayerButton.setText("Edit Layer"); // editLayerButton.addActionListener(new ActionListener() { // public void actionPerformed(ActionEvent e) { // editLayerButtonPerformed(e); // } // }); // add(editLayerButton, cc.xy(3, 11)); // editLayerButton.setEnabled(false); // //GEN-END:initComponents }
From source file:anl.verdi.gis.LayerEditorPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license scrollPane1 = new JScrollPane(); layerList = new JList(); addBtn = new JButton(); moveUpButton = new JButton(); moveDownButton = new JButton(); removeLayerButton = new JButton(); CellConstraints cc = new CellConstraints(); //======== this ======== // 2014/* ww w .j av a2s . c o m*/ ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); RowSpec aRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); RowSpec bRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); setLayout(new FormLayout( new ColumnSpec[] { aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { aRowSpec, 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, bRowSpec })); // setLayout(new FormLayout( // new ColumnSpec[]{ // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC // }, // new 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, // FormFactory.LINE_GAP_ROWSPEC, // new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW) // })); //======== scrollPane1 ======== { //---- layerList ---- layerList.addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { layerListValueChanged(e); } }); scrollPane1.setViewportView(layerList); } add(scrollPane1, cc.xywh(1, 1, 1, 11)); //---- addBtn ---- addBtn.setText("Add Layer"); addBtn.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { addBtnActionPerformed(e); } }); add(addBtn, cc.xy(3, 3)); //---- moveUpButton ---- moveUpButton.setText("Move Up"); moveUpButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { moveUpButtonActionPerformed(e); } }); add(moveUpButton, cc.xy(3, 5)); //---- moveDownButton ---- moveDownButton.setText("Move Down"); moveDownButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { moveDownButtonActionPerformed(e); } }); add(moveDownButton, cc.xy(3, 7)); //---- removeLayerButton ---- removeLayerButton.setText("Remove Layer"); removeLayerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { removeLayerButtonActionPerformed(e); } }); add(removeLayerButton, cc.xy(3, 9)); // //GEN-END:initComponents }
From source file:anl.verdi.gui.AddFormulaPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license btnDelete = new JButton(); scrollPane1 = new JScrollPane(); formulaList = new JList(); fldFormula = new JTextField(); btnAdd = new JButton(); CellConstraints cc = new CellConstraints(); // ======== this ======== setBorder(new TitledBorder("Formulas")); // 2014/* w w w .ja va2 s. c o m*/ ColumnSpec aColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); RowSpec aRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, aColumnSpec, FormFactory.LABEL_COMPONENT_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, aRowSpec, FormFactory.LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC })); // setLayout(new FormLayout(new ColumnSpec[] { // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, // FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC }, // new RowSpec[] { // FormFactory.DEFAULT_ROWSPEC, // FormFactory.LINE_GAP_ROWSPEC, // new RowSpec(RowSpec.FILL, Sizes.DEFAULT, // FormSpec.DEFAULT_GROW), // FormFactory.LINE_GAP_ROWSPEC, // FormFactory.DEFAULT_ROWSPEC })); // 2014 set up file names String verdiHome = Tools.getVerdiHome(); // 2014 new method for reading in an image file String separator = "/"; // use forward slash only for constructor ImageIcon(String filename); String pathName = verdiHome + separator + "plugins" + separator + "core" + separator + "icons" + separator; // ---- btnDelete ---- String fileMinus = new String(pathName + "Minus.png"); // btnDelete.setIcon(new ImageIcon(getClass().getResource("/minus.png"))); btnDelete.setIcon(new ImageIcon(fileMinus)); btnDelete.setToolTipText("Delete formula"); add(btnDelete, cc.xy(1, 1)); // ======== scrollPane1 ======== { scrollPane1.setViewportView(formulaList); } add(scrollPane1, cc.xywh(1, 3, 5, 1)); add(fldFormula, cc.xywh(1, 5, 3, 1)); // ---- btnAdd ---- btnAdd.setText("Add"); add(btnAdd, cc.xy(5, 5)); formulaList.addMouseListener(new MouseAdapter() { public void mousePressed(MouseEvent evt) { if (evt.isPopupTrigger()) { JPopupMenu menu = new JPopupMenu(); menu.add(addVariableToEditor).setEnabled(true); menu.show(evt.getComponent(), evt.getX(), evt.getY()); } } public void mouseReleased(MouseEvent evt) { if (evt.isPopupTrigger()) { JPopupMenu menu = new JPopupMenu(); menu.add(addVariableToEditor).setEnabled(true); menu.show(evt.getComponent(), evt.getX(), evt.getY()); } } public void mouseClicked(MouseEvent evt) { // } }); // JFormDesigner - End of component initialization // //GEN-END:initComponents }
From source file:anl.verdi.gui.DataSetPanel.java
private void initComponents() { Logger.debug("in DataSetPanel initComponents"); // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license dataSetPanel = new JPanel(); dataSets = new JPanel(); btnAdd = new JButton(); btnDelete = new JButton(); btnAddRemote = new JButton(); scrollPaneDataset = new JScrollPane(); dataList = new JList(); variablesPanel = new JPanel(); scrollPane6 = new JScrollPane(); variableList = new JList(); timePanel = new TimePanel(); layerPanel1 = new LayerPanel(); domainPanel1 = new DomainPanel(); CellConstraints cc = new CellConstraints(); // ======== this ======== setLayout(new FormLayout("pref:grow", "fill:default:grow")); // ======== dataSetPanel ======== {/*from w w w . jav a2 s . c om*/ dataSetPanel.setBorder(null); // 2014 RowSpec[] aRowSpec = RowSpec.decodeSpecs("fill:max(pref;125dlu):grow"); ColumnSpec[] aColumnSpec = ColumnSpec.decodeSpecs("pref:grow"); dataSetPanel.setLayout(new FormLayout(aColumnSpec, new RowSpec[] { new RowSpec(Sizes.dluY(108)), new RowSpec(Sizes.dluY(92)), FormFactory.PREF_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, FormFactory.PREF_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, aRowSpec[0] })); // dataSetPanel.setLayout(new FormLayout(ColumnSpec // .decodeSpecs("pref:grow"), new RowSpec[] { // new RowSpec(Sizes.dluY(108)), new RowSpec(Sizes.dluY(92)), // FormFactory.PREF_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, // FormFactory.PREF_ROWSPEC, FormFactory.LINE_GAP_ROWSPEC, // new RowSpec("fill:max(pref;125dlu):grow") })); // ======== dataSets ======== { dataSets.setBorder(new TitledBorder("Datasets")); // 2014 ColumnSpec cColumnSpec = new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); RowSpec cRowSpec = new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW); dataSets.setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, cColumnSpec }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, cRowSpec })); // dataSets.setLayout(new FormLayout(new ColumnSpec[] { // FormFactory.DEFAULT_COLSPEC, // FormFactory.RELATED_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC, // FormFactory.RELATED_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, // FormSpec.DEFAULT_GROW) }, new RowSpec[] { // FormFactory.DEFAULT_ROWSPEC, // FormFactory.RELATED_GAP_ROWSPEC, // new RowSpec(RowSpec.FILL, Sizes.DEFAULT, // FormSpec.DEFAULT_GROW) })); String verdiHome = Tools.getVerdiHome(); // 2014 new method for reading in an image file String separator = "/"; // use forward slash only for constructor ImageIcon(String filename); String pathName = verdiHome + separator + "plugins" + separator + "core" + separator + "icons" + separator; // ---- btnAdd ---- String filePlus = new String(pathName + "plus.png"); // btnAdd.setIcon(new ImageIcon(getClass().getResource("/plus.png"))); btnAdd.setIcon(new ImageIcon(filePlus)); btnAdd.setToolTipText("Add local dataset"); dataSets.add(btnAdd, cc.xy(1, 1)); // ---- btnDelete ---- String fileMinus = new String(pathName + "minus.png"); // btnDelete.setIcon(new ImageIcon(getClass().getResource("/minus.png"))); btnDelete.setIcon(new ImageIcon(fileMinus)); btnDelete.setToolTipText("Remove local dataset"); dataSets.add(btnDelete, cc.xy(3, 1)); // ---- btnAddRemote ---- String filePlusRemote = new String(pathName + "plus-remote.png"); // btnAddRemote.setIcon(new ImageIcon(getClass().getResource("/plus-remote.png"))); btnAddRemote.setIcon(new ImageIcon(filePlusRemote)); btnAddRemote.setToolTipText("Add remote dataset"); dataSets.add(btnAddRemote, cc.xy(5, 1)); // ======== scrollPaneDataset ======== { // ---- dataList ---- dataList.setSelectedIndex(0); dataList.setMaximumSize(new Dimension(300, 100)); dataList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); dataList.setPrototypeCellValue("RADM_CONC_!"); scrollPaneDataset.setViewportView(dataList); } dataSets.add(scrollPaneDataset, cc.xywh(1, 3, 6, 1)); } dataSetPanel.add(dataSets, cc.xy(1, 1)); // ======== variablesPanel ======== { variablesPanel.setBorder(new TitledBorder("Variables")); variablesPanel.setLayout(new BorderLayout(2, 5)); // ======== scrollPane6 ======== { // ---- variableList ---- variableList.setPrototypeCellValue("O3[1]"); scrollPane6.setViewportView(variableList); } variablesPanel.add(new JLabel("Double-click to add the variable as a formula."), BorderLayout.NORTH); variablesPanel.add(scrollPane6, BorderLayout.CENTER); } dataSetPanel.add(variablesPanel, cc.xy(1, 2)); dataSetPanel.add(timePanel, cc.xy(1, 3)); dataSetPanel.add(layerPanel1, cc.xy(1, 5)); dataSetPanel.add(domainPanel1, cc.xy(1, 7)); } add(dataSetPanel, cc.xy(1, 1)); // //GEN-END:initComponents }
From source file:anl.verdi.gui.DomainPanel.java
private void initComponents() { // JFormDesigner - Component initialization - DO NOT MODIFY // //GEN-BEGIN:initComponents // Generated using JFormDesigner non-commercial license piccoloMapPanel1 = new PiccoloMapPanel(context); CellConstraints cc = new CellConstraints(); // ======== this ======== setBorder(new TitledBorder("Domain")); // 2014/* w w w. j ava2 s . com*/ RowSpec[] aRowSpec = RowSpec.decodeSpecs("fill:default:grow"); 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 }, aRowSpec)); // setLayout(new FormLayout(new ColumnSpec[] { // FormFactory.DEFAULT_COLSPEC, // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, // FormSpec.DEFAULT_GROW), // FormFactory.LABEL_COMPONENT_GAP_COLSPEC, // FormFactory.DEFAULT_COLSPEC }, RowSpec // .decodeSpecs("fill:default:grow"))); add(piccoloMapPanel1, cc.xywh(1, 1, 5, 1)); // //GEN-END:initComponents piccoloMapPanel1.addComponentListener(new ComponentAdapter() { public void componentResized(ComponentEvent e) { // resize the grid setDomainValues(currentElement); } }); }