List of usage examples for com.jgoodies.forms.layout CellConstraints xy
public CellConstraints xy(int col, int row)
Examples:
cc.xy(1, 1); cc.xy(1, 3);
From source file:com.jhash.oimadmin.ui.EventHandlerUI.java
License:Apache License
public JPanel buildEventHandlerUI() { logger.debug("Trying to create New Event Handler screen"); JPanel newEventHandlerPanel = new JPanel(new BorderLayout()); FormLayout eventHandlerFormLayout = new FormLayout( "right:pref, 3dlu, pref, 7dlu, right:pref, 3dlu, pref:grow", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu"); eventHandlerFormLayout.setColumnGroups(new int[][] { { 1, 5 } }); CellConstraints cellConstraint = new CellConstraints(); PanelBuilder builder = new PanelBuilder(eventHandlerFormLayout); builder.addLabel("Name", cellConstraint.xy(1, 1)); builder.add(nameField, cellConstraint.xy(3, 1)); builder.addLabel("Type", cellConstraint.xy(5, 1)); builder.add(eventHandlerTypes, cellConstraint.xy(7, 1)); builder.addLabel("Entity Type", cellConstraint.xy(1, 3)); builder.add(entityType, cellConstraint.xy(3, 3)); builder.addLabel("Operation", cellConstraint.xy(5, 3)); builder.add(operationType, cellConstraint.xy(7, 3)); builder.addLabel("Order", cellConstraint.xy(1, 5)); builder.add(orderField, cellConstraint.xy(3, 5)); builder.addLabel("Type of orchestration", cellConstraint.xy(5, 5)); builder.add(orcTargetLabel, cellConstraint.xy(7, 5)); builder.addLabel("Synchronous ?", cellConstraint.xy(1, 7)); builder.add(syncCheckBox, cellConstraint.xy(3, 7)); builder.addLabel("Internal Transaction ?", cellConstraint.xy(1, 9)); builder.add(txCheckBox, cellConstraint.xy(3, 9)); builder.addLabel("Stage", cellConstraint.xy(5, 7)); builder.add(stageComboBox, cellConstraint.xy(7, 7)); builder.addLabel("Class", cellConstraint.xy(1, 11)); builder.add(classNameText, cellConstraint.xyw(3, 11, 5)); // builder.addLabel("MDS Location", cellConstraint.xy(1, 13)); // builder.add(new JGTextField("/custom/eventhandler.xml"), // cellConstraint.xyw(3, 13, 5)); JideTabbedPane newEventHandlerControlPane = new JideTabbedPane(); newEventHandlerControlPane.setTabShape(JideTabbedPane.SHAPE_ROUNDED_FLAT); newEventHandlerControlPane.setColorTheme(JideTabbedPane.COLOR_THEME_OFFICE2003); newEventHandlerControlPane.setTabResizeMode(JideTabbedPane.RESIZE_MODE_NONE); newEventHandlerControlPane.setUseDefaultShowCloseButtonOnTab(false); newEventHandlerControlPane.setBoldActiveTab(true); newEventHandlerControlPane.setShowCloseButtonOnTab(true); newEventHandlerControlPane.addTab(javaCompiler.getName(), javaCompiler.getComponent()); newEventHandlerControlPane.addTab("Configure", configurationPanel.getComponent()); newEventHandlerControlPane.addTab("Package", packagePanel.getComponent()); JideSplitPane eventHandlerSplitPane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT); eventHandlerSplitPane.add(builder.build(), 0); eventHandlerSplitPane.add(newEventHandlerControlPane, 1); eventHandlerSplitPane.setProportionalLayout(true); eventHandlerSplitPane.setProportions(new double[] { 0.3 }); newEventHandlerPanel.add(eventHandlerSplitPane); logger.debug("Completed creation of New Event Handler screen"); return newEventHandlerPanel; }
From source file:com.lyndir.lhunath.opal.gui.template.shade.AbstractUi.java
License:Apache License
private JComponent getOperationsPane() { FormLayout layout = new FormLayout("10dlu, 15dlu, p:g, 10dlu, p:g, 15dlu, 10dlu", //$NON-NLS-1$ "0dlu, f:1dlu:g, 5dlu, p, 10dlu"); //$NON-NLS-1$ layout.setColumnGroups(new int[][] { { 3, 5 } }); JButton button;/*from w w w. j ava2 s . c o m*/ PanelBuilder builder = new PanelBuilder(layout, new ScrollPanel()); CellConstraints constraints = new CellConstraints(); log = new JEditorPane("text/html", ""); log.setOpaque(false); log.setEditable(false); JScrollPane pane = new JScrollPane(log); pane.setBorder(Borders.EMPTY_BORDER); pane.setOpaque(false); pane.getViewport().setOpaque(false); builder.add(pane, constraints.xyw(2, 2, 5)); button = new JButton(Locale.explain("ui.clearLog"), UIUtils.getIcon("clear-s.png")); //$NON-NLS-1$ //$NON-NLS-2$ button.setHorizontalTextPosition(SwingConstants.CENTER); button.setVerticalTextPosition(SwingConstants.BOTTOM); button.setActionCommand("logClear"); //$NON-NLS-1$ button.addActionListener(this); builder.add(button, constraints.xy(3, 4)); button = new JButton(Locale.explain("ui.saveLog"), UIUtils.getIcon("save-s.png")); //$NON-NLS-1$ //$NON-NLS-2$ button.setHorizontalTextPosition(SwingConstants.CENTER); button.setVerticalTextPosition(SwingConstants.BOTTOM); button.setActionCommand("logSave"); //$NON-NLS-1$ button.addActionListener(this); builder.add(button, constraints.xy(5, 4)); builder.getPanel().setOpaque(false); return builder.getPanel(); }
From source file:com.lyndir.lhunath.opal.gui.template.shade.AbstractUi.java
License:Apache License
private JComponent getDevelopmentPane() { FormLayout layout = new FormLayout("10dlu, 15dlu, p:g, 10dlu, p:g, 15dlu, 10dlu", //$NON-NLS-1$ "0dlu, f:1dlu:g, 5dlu, p, 10dlu"); //$NON-NLS-1$ layout.setColumnGroups(new int[][] { { 3, 5 } }); JButton button;/*from w w w . j a v a 2 s . c om*/ PanelBuilder builder = new PanelBuilder(layout, new ScrollPanel()); CellConstraints constraints = new CellConstraints(); builder.add(getDevelopmentComponent(), constraints.xyw(2, 2, 5)); button = new JButton(Locale.explain("ui.reportProblem"), UIUtils.getIcon("problem-s.png")); //$NON-NLS-1$ //$NON-NLS-2$ button.setHorizontalTextPosition(SwingConstants.CENTER); button.setVerticalTextPosition(SwingConstants.BOTTOM); button.setActionCommand("reportIssue"); //$NON-NLS-1$ button.addActionListener(this); builder.add(new ToolTip(Locale.explain("ui.reportProblemTip"), button), constraints.xy(3, 4)); button = new JButton(Locale.explain("ui.toggleConsole"), UIUtils.getIcon("terminal-s.png")); //$NON-NLS-1$ //$NON-NLS-2$ button.setHorizontalTextPosition(SwingConstants.CENTER); button.setVerticalTextPosition(SwingConstants.BOTTOM); button.setActionCommand("toggleConsole"); //$NON-NLS-1$ button.addActionListener(this); builder.add(new ToolTip(Locale.explain("ui.toggleConsoleTip"), button), constraints.xy(5, 4)); builder.getPanel().setOpaque(false); return builder.getPanel(); }
From source file:com.mebigfatguy.clytemnestra.FormHelper.java
License:Apache License
public static void addFormRow(JPanel p, Bundle.Key key, JComponent component, int formY) { JLabel label = new JLabel(Bundle.getString(key)); CellConstraints cc = new CellConstraints(); p.add(label, cc.xy(2, formY)); p.add(component, cc.xy(4, formY));/* w w w. j a va2 s .com*/ label.setLabelFor(component); }
From source file:com.mebigfatguy.clytemnestra.FormHelper.java
License:Apache License
public static void addFormItem(JPanel p, JComponent component, int formX, int formY) { CellConstraints cc = new CellConstraints(); p.add(component, cc.xy(formX, formY)); }
From source file:com.mebigfatguy.clytemnestra.view.CreateKeySpaceDialog.java
License:Apache License
private JPanel createFormPanel() { JPanel p = new JPanel(); p.setLayout(new FormLayout("6dlu, pref, 5dlu, 200px, 6dlu", "6dlu, pref, 4dlu, pref, 8dlu, pref, 4dlu, pref, 4dlu, pref, 6dlu")); CellConstraints cc = new CellConstraints(); keySpaceName = new JTextField(20); FormHelper.addFormRow(p, Bundle.Key.KeySpaceName, keySpaceName, 2); durableWritesRadio = new JRadioButton(Bundle.getString(Bundle.Key.DurableWrites)); p.add(durableWritesRadio, cc.xyw(2, 4, 4)); strategyClassCombo = new JComboBox(); for (ReplicationStrategy strategy : ReplicationStrategy.values()) { strategyClassCombo.addItem(strategy.name()); }// w ww . ja v a 2 s .c om strategyClassCombo.setEditable(true); FormHelper.addFormRow(p, Bundle.Key.StrategyClass, strategyClassCombo, 6); JLabel optionsLabel = new JLabel(Bundle.getString(Bundle.Key.StrategicOptions)); p.add(optionsLabel, cc.xy(2, 8)); optionsTable = new JTable(new StrategicOptionsTableModel((String) strategyClassCombo.getSelectedItem())); p.add(new JScrollPane(optionsTable), cc.xyw(2, 10, 4)); Dimension dim = optionsTable.getPreferredSize(); dim.height = 100; optionsTable.setPreferredScrollableViewportSize(dim); optionsLabel.setLabelFor(optionsTable); p.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10)); return p; }
From source file:com.mebigfatguy.mongobrowser.dialogs.ConnectionDialog.java
License:Apache License
/** * create the panel that houses the input form * /*from w w w. java2 s . co m*/ * @return the form panel */ private JPanel createFormPanel() { JPanel p = new JPanel(); p.setLayout(new FormLayout("6dlu, pref, 5dlu, 200px, 6dlu", "6dlu, pref, 2dlu, pref, 6dlu")); CellConstraints cc = new CellConstraints(); JLabel serverLabel = new JLabel(MongoBundle.getString(MongoBundle.Key.Server)); p.add(serverLabel, cc.xy(2, 2)); serverField = new JTextField(); p.add(serverField, cc.xy(4, 2)); serverField.setText("localhost"); serverLabel.setLabelFor(serverField); JLabel portLabel = new JLabel(MongoBundle.getString(MongoBundle.Key.Port)); p.add(portLabel, cc.xy(2, 4)); portField = new JTextField(); portField.setDocument(new IntegerDocument()); p.add(portField, cc.xy(4, 4)); portField.setText("27017"); portLabel.setLabelFor(portField); return p; }
From source file:com.mebigfatguy.mongobrowser.dialogs.ManageIndicesDialog.java
License:Apache License
private JPanel createIndicesListPanel(List<IndexDescription> indices) { JPanel p = new JPanel(); p.setLayout(new FormLayout("6dlu, pref:grow, 5dlu, pref, 6dlu", "6dlu, 12dlu:grow, pref, 3dlu, pref, 12dlu:grow, 6dlu, pref, 6dlu")); CellConstraints cc = new CellConstraints(); ManageIndicesModel model = new ManageIndicesModel(indices); indicesTable = new JTable(model); indicesTable.setDefaultEditor(String.class, new DefaultCellEditor(new JTextField())); indicesTable.setDefaultEditor(IndexFieldList.class, new IndexFieldListCellEditor()); indicesTable.setDefaultRenderer(IndexFieldList.class, new IndexFieldListCellRenderer()); p.add(new JScrollPane(indicesTable), cc.xywh(2, 2, 1, 5)); addIndexButton = new JButton(MongoBundle.getString(MongoBundle.Key.AddIndex)); p.add(addIndexButton, cc.xy(4, 3)); removeIndexButton = new JButton(MongoBundle.getString(MongoBundle.Key.RemoveIndex)); p.add(removeIndexButton, cc.xy(4, 5)); return p;/*from w w w. ja v a 2 s.c o m*/ }
From source file:com.mebigfatguy.mongobrowser.dialogs.MongoControlPanel.java
License:Apache License
private void initComponents() { setBorder(BorderFactory.createLineBorder(Color.BLACK)); setLayout(//from w ww. j a v a 2s . com new FormLayout("3dlu, pref, 1dlu, 150px, 3dlu, pref, 3dlu, pref, 3dlu, pref, 3dlu, pref", "pref")); CellConstraints cc = new CellConstraints(); JLabel dbLabel = new JLabel(MongoBundle.getString(MongoBundle.Key.Database)); dbComboBox = new JComboBox(new DefaultComboBoxModel()); dbComboBox.setEnabled(false); dbLabel.setLabelFor(dbComboBox); add(dbLabel, cc.xy(2, 1)); add(dbComboBox, cc.xy(4, 1)); dbNewCollectionButton = new JButton(new NewCollectionAction(context)); ImageIcon icon = new ImageIcon( MongoControlPanel.class.getResource("/com/mebigfatguy/mongobrowser/resources/newcollection.png")); dbNewCollectionButton.setIcon(icon); dbNewCollectionButton.setText(""); dbNewCollectionButton.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight())); dbNewCollectionButton.setToolTipText(MongoBundle.getString(MongoBundle.Key.NewCollection)); add(dbNewCollectionButton, cc.xy(6, 1)); dbNewCollectionButton.setEnabled(false); dbNewObjectButton = new JButton(new NewObjectAction(context)); icon = new ImageIcon( MongoControlPanel.class.getResource("/com/mebigfatguy/mongobrowser/resources/newobject.png")); dbNewObjectButton.setIcon(icon); dbNewObjectButton.setText(""); dbNewObjectButton.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight())); dbNewObjectButton.setToolTipText(MongoBundle.getString(MongoBundle.Key.NewObject)); add(dbNewObjectButton, cc.xy(8, 1)); dbNewObjectButton.setEnabled(false); dbNewKeyValueButton = new JButton(new NewKeyValueAction(context)); icon = new ImageIcon( MongoControlPanel.class.getResource("/com/mebigfatguy/mongobrowser/resources/newkeyvalue.png")); dbNewKeyValueButton.setIcon(icon); dbNewKeyValueButton.setText(""); dbNewKeyValueButton.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight())); dbNewKeyValueButton.setToolTipText(MongoBundle.getString(MongoBundle.Key.NewKeyValue)); add(dbNewKeyValueButton, cc.xy(10, 1)); dbNewKeyValueButton.setEnabled(false); dbDeleteButton = new JButton(new DeleteAction(context)); icon = new ImageIcon( MongoControlPanel.class.getResource("/com/mebigfatguy/mongobrowser/resources/delete.png")); dbDeleteButton.setIcon(icon); dbDeleteButton.setText(null); dbDeleteButton.setPreferredSize(new Dimension(icon.getIconWidth(), icon.getIconHeight())); dbDeleteButton.setToolTipText(MongoBundle.getString(MongoBundle.Key.Delete)); add(dbDeleteButton, cc.xy(12, 1)); dbDeleteButton.setEnabled(false); }
From source file:com.mebigfatguy.polycasso.ProxyDialog.java
License:Apache License
/** * creates the proxy settings panel//from w w w . j av a 2s. com * * @return the proxy panel */ private JPanel createProxyPanel() { JPanel proxyPanel = new JPanel(); proxyPanel.setLayout(new FormLayout("6dlu, pref, 3dlu, 200px:grow, 6dlu", "5dlu, pref, 3dlu, pref, 5dlu")); CellConstraints cc = new CellConstraints(); JLabel hostLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.ProxyHost)); proxyPanel.add(hostLabel, cc.xy(2, 2)); proxyHostField = new JTextField(); proxyPanel.add(proxyHostField, cc.xy(4, 2)); hostLabel.setLabelFor(proxyHostField); JLabel portLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.ProxyPort)); proxyPanel.add(portLabel, cc.xy(2, 4)); proxyPortField = new JTextField(); proxyPortField.setDocument(new IntegerDocument()); proxyPanel.add(proxyPortField, cc.xy(4, 4)); portLabel.setLabelFor(proxyPortField); populateValues(); return proxyPanel; }