List of usage examples for com.jgoodies.forms.layout CellConstraints CellConstraints
public CellConstraints()
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.l2fprod.skinbuilder.cmd.BuildStylePanel.java
License:Apache License
public BuildStylePanel() { super();/* www . ja v a 2s . c o m*/ setLayout(new FormLayout( new ColumnSpec[] { FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, new ColumnSpec("default:grow(1.0)") }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, new RowSpec("default") })); themeJarFileLabel = new JLabel(); themeJarFileLabel.setText("Theme Jar File:"); add(themeJarFileLabel, new CellConstraints()); themeClassnameLabel = new JLabel(); themeClassnameLabel.setText("Theme Classname:"); add(themeClassnameLabel, new CellConstraints(1, 3)); themeJarFileEditor = new FilePropertyEditor(false); themeJarFile = themeJarFileEditor.getCustomEditor(); add(themeJarFile, new CellConstraints(3, 1)); themeClassname = new JTextField(); themeClassname.setText("com.l2fprod.synth.Theme"); add(themeClassname, new CellConstraints(3, 3)); exampleComacmecorpthemesfirstthemeLabel = new JLabel(); exampleComacmecorpthemesfirstthemeLabel.setFont(new Font("", Font.ITALIC, 10)); exampleComacmecorpthemesfirstthemeLabel.setText("example: com.acmecorp.themes.FirstTheme"); add(exampleComacmecorpthemesfirstthemeLabel, new CellConstraints(3, 5)); themeClassname.setName("BuildStyle.classname"); UserPreferences.track(themeClassname); }
From source file:com.luxsoft.siipap.swing.views.WelcomeView.java
License:Open Source License
/** * Builds and returns the panel.//from w w w . j ava 2 s . c o 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 ww. j a v a2 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;/*w ww . j a va 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 ww w . ja v a 2 s . com 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));/*w w w .j av a 2 s . c o m*/ p.add(component, cc.xy(4, formY)); 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.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;//ww w. j av a 2s . c om }
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()); }//from w ww .j a v a2 s . c o m 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; }