List of usage examples for com.jgoodies.forms.layout CellConstraints xyw
public CellConstraints xyw(int col, int row, int colSpan)
Examples:
cc.xyw(1, 3, 7); cc.xyw(1, 3, 2);
From source file:com.jhash.oimadmin.ui.EventHandlerDetails.java
License:Apache License
private JPanel buildDetailScreen() { JPanel eventHandlerDetailPanel = new JPanel(new BorderLayout()); JideSplitPane splitPane = new JideSplitPane(JideSplitPane.VERTICAL_SPLIT); FormLayout eventHandlerFormLayout = new FormLayout( "right:pref, 3dlu, pref:grow, 7dlu, right:pref, 3dlu, pref:grow", "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(nameLabel, cellConstraint.xy(3, 1)); switch (connection.getVersion()) { case OIM11GR2PS2: builder.addLabel("Custom", cellConstraint.xy(5, 1)); builder.add(customLabel, cellConstraint.xy(7, 1)); break;//from w w w . j a v a2 s.co m default: builder.addLabel("Sync", cellConstraint.xy(5, 1)); builder.add(sync, cellConstraint.xy(7, 1)); break; } builder.addLabel("Stage", cellConstraint.xy(1, 3)); builder.add(stageLabel, cellConstraint.xy(3, 3)); builder.addLabel("Order", cellConstraint.xy(5, 3)); builder.add(orderLabel, cellConstraint.xy(7, 3)); builder.addLabel("Conditional", cellConstraint.xy(1, 5)); builder.add(conditionalLabel, cellConstraint.xy(3, 5)); switch (connection.getVersion()) { case OIM11GR2PS2: builder.addLabel("Off Band", cellConstraint.xy(5, 5)); builder.add(offBandLabel, cellConstraint.xy(7, 5)); break; default: builder.addLabel("Exception", cellConstraint.xy(5, 5)); builder.add(exception, cellConstraint.xy(7, 5)); break; } builder.addLabel("Location", cellConstraint.xy(1, 7)); builder.add(locationLabel, cellConstraint.xyw(3, 7, 5)); builder.addLabel("Class", cellConstraint.xy(1, 9)); builder.add(classNameLabel, cellConstraint.xyw(3, 9, 5)); switch (connection.getVersion()) { case OIM11GR2PS2: break; default: builder.addLabel("Transactional", cellConstraint.xy(1, 11)); builder.add(transactional, cellConstraint.xyw(3, 11, 5)); break; } splitPane.add(new JideScrollPane(table), 0); splitPane.add(builder.getPanel(), 1); splitPane.setProportionalLayout(true); splitPane.setProportions(new double[] { 0.6 }); eventHandlerDetailPanel.add(splitPane, BorderLayout.CENTER); logger.debug("Returning the developed component {}", eventHandlerDetailPanel); return eventHandlerDetailPanel; }
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.luxsoft.siipap.swing.views.WelcomeView.java
License:Open Source License
/** * Builds and returns the panel./*from w w w. ja v a2 s . co m*/ */ protected JComponent buildContent() { initComponents(); FormLayout layout = new FormLayout("9dlu, left:pref:grow", "b:pref, c:pref, t:pref, 9dlu, pref, 6dlu, pref"); PanelBuilder builder = new PanelBuilder(layout, new GradientBackgroundPanel(false)); builder.getPanel().setOpaque(false); builder.setBorder(Borders.DLU14_BORDER); CellConstraints cc = new CellConstraints(); builder.add(welcomeLabel, cc.xyw(1, 1, 2)); builder.add(logoLabel, cc.xyw(1, 2, 2, "left, center")); builder.add(selectLabel, cc.xyw(1, 3, 2)); return builder.getPanel(); }
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 a va2 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 getLicensePane() { 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 } }); String doc = ""; JButton button;/*from ww w . j a v a 2 s .c o m*/ PanelBuilder builder = new PanelBuilder(layout, new ScrollPanel()); CellConstraints constraints = new CellConstraints(); try { doc = getLicense(); } catch (IOException e) { logger.err(e, "err.readLicense"); } JEditorPane changelog = new JEditorPane("text/html", doc); //$NON-NLS-1$ changelog.setOpaque(false); changelog.setEditable(false); changelog.setFont(Font.decode("Monospaced-15")); //$NON-NLS-1$ JScrollPane pane = new JScrollPane(changelog); 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.reportOffense"), UIUtils.getIcon("problem-s.png")); //$NON-NLS-1$ //$NON-NLS-2$ button.setHorizontalTextPosition(SwingConstants.CENTER); button.setVerticalTextPosition(SwingConstants.BOTTOM); button.setActionCommand("reportOffense"); //$NON-NLS-1$ button.addActionListener(this); builder.add(new ToolTip(Locale.explain("ui.reportOffenceTip"), button), constraints.xyw(3, 4, 3)); 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 ww . java 2 s . c o m 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.view.ConnectionDialog.java
License:Apache License
private JPanel createFormPanel() { JPanel p = new JPanel(); p.setLayout(new FormLayout("6dlu, pref, 5dlu, 200px, 6dlu", "6dlu, pref, 4dlu, pref, 4dlu, pref, 20dlu, pref, 4dlu, pref, 6dlu")); serverField = new JTextField(20); serverField.setText("localhost"); FormHelper.addFormRow(p, Bundle.Key.Server, serverField, 2); portField = new JTextField(20); portField.setDocument(new IntegerDocument()); portField.setText("9160"); FormHelper.addFormRow(p, Bundle.Key.Port, portField, 4); randomServerCheckBox = new JCheckBox(Bundle.getString(Bundle.Key.UseRandomServer)); CellConstraints cc = new CellConstraints(); p.add(randomServerCheckBox, cc.xyw(2, 6, 4)); userNameField = new JTextField(20); FormHelper.addFormRow(p, Bundle.Key.UserName, userNameField, 8); passwordField = new JPasswordField(20); FormHelper.addFormRow(p, Bundle.Key.Password, passwordField, 10); p.setBorder(BorderFactory.createEmptyBorder(20, 10, 10, 10)); return p;//from w w w. j a v a2 s.c o m }
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 w w . j av a 2s. com 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.polycasso.SettingsDialog.java
License:Apache License
/** * creates the options (settings) panel/* w w w . ja v a 2 s .co m*/ * * @return the options panel */ private JPanel createOptionsPanel() { JPanel optPanel = new JPanel(); optPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder(PolycassoBundle.getString(PolycassoBundle.Key.ImageOptions)), BorderFactory.createEmptyBorder(10, 10, 10, 10))); optPanel.setLayout(new FormLayout("pref, 3dlu, 100px, 5dlu, pref, 3dlu, 100px", "pref, 1dlu, pref, 15dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref")); CellConstraints cc = new CellConstraints(); JLabel maxSizeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaxImageSize)); optPanel.add(maxSizeLabel, cc.xyw(1, 1, 7)); JLabel widthLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.Width)); optPanel.add(widthLabel, cc.xy(1, 3)); widthField = new JTextField(4); widthField.setDocument(new IntegerDocument()); widthLabel.setLabelFor(widthField); optPanel.add(widthField, cc.xy(3, 3)); widthField.addFocusListener(focuser); JLabel heightLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.Height)); optPanel.add(heightLabel, cc.xy(5, 3)); heightField = new JTextField(4); heightField.setDocument(new IntegerDocument()); heightLabel.setLabelFor(heightField); optPanel.add(heightField, cc.xy(7, 3)); heightField.addFocusListener(focuser); JLabel maxPolyLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPolygons)); optPanel.add(maxPolyLabel, cc.xyw(1, 5, 5)); maxPolygonField = new JTextField(4); maxPolygonField.setDocument(new IntegerDocument()); maxPolyLabel.setLabelFor(maxPolygonField); optPanel.add(maxPolygonField, cc.xy(7, 5)); maxPolygonField.addFocusListener(focuser); JLabel maxPolyPointLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPolygonPoints)); optPanel.add(maxPolyPointLabel, cc.xyw(1, 7, 7)); maxPolygonPointsField = new JTextField(4); maxPolygonPointsField.setDocument(new IntegerDocument()); maxPolyPointLabel.setLabelFor(maxPolygonPointsField); optPanel.add(maxPolygonPointsField, cc.xy(7, 7)); maxPolygonPointsField.addFocusListener(focuser); JLabel maxPtMoveLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumPointMovement)); optPanel.add(maxPtMoveLabel, cc.xyw(1, 9, 5)); maxPtMoveField = new JTextField(4); maxPtMoveField.setDocument(new IntegerDocument()); maxPtMoveLabel.setLabelFor(maxPtMoveField); optPanel.add(maxPtMoveField, cc.xy(7, 9)); maxPtMoveField.addFocusListener(focuser); JLabel maxColorChangeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.MaximumColorChange)); optPanel.add(maxColorChangeLabel, cc.xyw(1, 11, 5)); maxColorChangeField = new JTextField(4); maxColorChangeField.setDocument(new IntegerDocument()); maxColorChangeLabel.setLabelFor(maxColorChangeField); optPanel.add(maxColorChangeField, cc.xy(7, 11)); maxColorChangeField.addFocusListener(focuser); populateValues(); return optPanel; }
From source file:com.mebigfatguy.polycasso.SettingsDialog.java
License:Apache License
private JPanel createGeneticsPanel() { JPanel geneticsPanel = new JPanel(); geneticsPanel.setBorder(BorderFactory.createCompoundBorder( BorderFactory.createTitledBorder(PolycassoBundle.getString(PolycassoBundle.Key.GeneticsOptions)), BorderFactory.createEmptyBorder(10, 10, 10, 10))); geneticsPanel.setLayout(new FormLayout("6dlu, pref, 3dlu, 100px, 3dlu", "pref, 1dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref, 1dlu, pref")); CellConstraints cc = new CellConstraints(); JLabel generationSizeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.GenerationSize)); geneticsPanel.add(generationSizeLabel, cc.xyw(1, 1, 2)); generationSizeField = new JTextField(4); generationSizeField.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.GenerationSizeToolTip)); generationSizeField.setDocument(new IntegerDocument()); generationSizeLabel.setLabelFor(generationSizeField); geneticsPanel.add(generationSizeField, cc.xy(4, 1)); generationSizeField.addFocusListener(focuser); JLabel eliteSizeLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.EliteSize)); geneticsPanel.add(eliteSizeLabel, cc.xyw(1, 3, 2)); eliteSizeField = new JTextField(4); eliteSizeField.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.EliteSizeToolTip)); eliteSizeField.setDocument(new IntegerDocument()); eliteSizeLabel.setLabelFor(eliteSizeField); geneticsPanel.add(eliteSizeField, cc.xy(4, 3)); eliteSizeField.addFocusListener(focuser); useAnnealingButton = new JCheckBox(PolycassoBundle.getString(PolycassoBundle.Key.UseAnnealing)); useAnnealingButton.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.UseAnnealingToolTip)); geneticsPanel.add(useAnnealingButton, cc.xyw(1, 5, 5)); JLabel startTemperatureLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.StartTemperature)); geneticsPanel.add(startTemperatureLabel, cc.xy(2, 7)); startTemperatureField = new JTextField(4); startTemperatureField//from w w w .ja v a2 s. co m .setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.StartTemperatureToolTip)); startTemperatureField.setDocument(new DoubleDocument()); startTemperatureLabel.setLabelFor(startTemperatureField); geneticsPanel.add(startTemperatureField, cc.xy(4, 7)); startTemperatureField.addFocusListener(focuser); JLabel coolingRateLabel = new JLabel(PolycassoBundle.getString(PolycassoBundle.Key.CoolingRate)); geneticsPanel.add(coolingRateLabel, cc.xy(2, 9)); coolingRateField = new JTextField(4); coolingRateField.setToolTipText(PolycassoBundle.getString(PolycassoBundle.Key.CoolingRateToolTip)); coolingRateField.setDocument(new DoubleDocument()); coolingRateLabel.setLabelFor(coolingRateField); geneticsPanel.add(coolingRateField, cc.xy(4, 9)); coolingRateField.addFocusListener(focuser); return geneticsPanel; }