/** * Convenience method for creating a left-aligned, * vertically centered cell constraints object. */ private CellConstraints xyw(CellConstraints cc, int x, int y, int w) { return cc.xyw(x, y, w, CellConstraints.LEFT, CellConstraints.CENTER); }
private JComponent buildEditorPanel() { FormLayout layout = new FormLayout("RIGHT:MAX(40DLU;DEFAULT):NONE,FILL:4DLU:NONE,FILL:200DLU:NONE,FILL:DEFAULT:GROW(1.0)", //$NON-NLS-1$ "CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:30DLU:NONE,CENTER:DEFAULT:GROW(1.0)"); //$NON-NLS-1$ PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.addLabel(StaticWidgetHelper.getSynaptixWidgetConstantsBundle().comment(), cc.xy(1, 3)); builder.add(textLabel, cc.xyw(3, 1, 2)); builder.add(new JScrollPane(commentaireArea), cc.xywh(3, 3, 2, 3)); return builder.getPanel(); }
/** * Convenience method for creating a left-aligned, * vertically centered cell constraints object. */ private CellConstraints xyw(CellConstraints cc, int x, int y, int w) { return cc.xyw(x, y, w, CellConstraints.LEFT, CellConstraints.CENTER); }
JPanel panel = new JPanel(); FormLayout layout = new FormLayout("100dlu, 20dlu:grow", "pref, pref, pref"); panel.setLayout(layout); JTextField t1 = new JTextField(); JTextField t2 = new JTextField(); JTable tb = new JTable(); JScrollPane sp = new JScrollPane(); sp.setViewportView(tb); CellConstraints cc = new CellConstraints(); panel.add(t1, cc.xy(1, 1)); panel.add(t2, cc.xy(1, 3)); panel.add(sp, cc.xyw(1, 2, 2));
/** * Define the layout for common fields of all GlyphBoard classes. */ private void defineLayout () { final CellConstraints cst = new CellConstraints(); int r = 1; // -------------------------------- builder.add(groupField, cst.xyw(5, r, 3)); } }
FormLayout layout = new FormLayout( "pref,fill:pref:grow", // cols "pref,3dlu,fill:pref:grow,3dlu,pref" // rows ); JPanel panel = new JPanel(layout); CellConstraints cc = new CellConstraints(); panel.add(redrawBtn, cc.xy(1, 1)); panel.add(textPane, cc.xyw(1, 3, 2)); // span 2 columns panel.add(addBtn, cc.xy(1, 5)); frame.setContentPane(panel);
private JPanel getSimpleReportText() { final String[] columnSpecs = new String[]{"5dlu", "fill:default:grow", "5dlu"}; final String[] rowSpecs = new String[]{"5dlu", "pref", "5dlu", "fill:default:grow", "5dlu"}; final PanelBuilder builder = ComponentFactory.createBuilder(columnSpecs, rowSpecs); final CellConstraints cc = new CellConstraints(); builder.addSeparator("Detailed Report XML", cc.xyw(2, 2, 1)); builder.add(ComponentFactory.createScrollPane(simpleReportText), cc.xyw(2, 4, 1)); return ComponentFactory.createPanel(builder); }
private JPanel getDiagnosticPanelText() { final String[] columnSpecs = new String[]{"5dlu", "fill:default:grow", "5dlu"}; final String[] rowSpecs = new String[]{"5dlu", "pref", "5dlu", "fill:default:grow", "5dlu"}; final PanelBuilder builder = ComponentFactory.createBuilder(columnSpecs, rowSpecs); final CellConstraints cc = new CellConstraints(); builder.addSeparator("Diagnostic XML", cc.xyw(2, 2, 1)); builder.add(ComponentFactory.createScrollPane(diagnosticText), cc.xyw(2, 4, 1)); return ComponentFactory.createPanel(builder); }
private JComponent buildEditorPanel() { FormLayout layout = new FormLayout("RIGHT:MAX(40DLU;DEFAULT):NONE,FILL:4DLU:NONE,FILL:200DLU:NONE,FILL:DEFAULT:GROW(1.0)", //$NON-NLS-1$ "CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:MAX(22DLU;PREF):NONE"); //$NON-NLS-1$ PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.addLabel(StaticWidgetHelper.getSynaptixWidgetConstantsBundle().meaning(), cc.xy(1, 3)); builder.add(textLabel, cc.xyw(3, 1, 2)); builder.add(libelleField, cc.xyw(3, 3, 2)); builder.add(keyTypedResultView, cc.xyw(1, 5, 4)); return new IconFeedbackPanel(validationResultModel, builder.getPanel()); }
@Override protected Container doLayout() { final FormLayout layout = new FormLayout("5dlu, pref, 5dlu, pref, 5dlu ,pref:grow ,5dlu", "5dlu, pref, 5dlu, pref, 5dlu"); final PanelBuilder builder = ComponentFactory.createBuilder(layout); final CellConstraints cc = new CellConstraints(); builder.addSeparator(ResourceUtils.getI18n("CHOOSE_DESTINATION"), cc.xyw(2, 2, 5)); builder.add(selectFileTarget, cc.xy(2, 4)); builder.add(fileTargetLabel, cc.xyw(4, 4, 3)); return ComponentFactory.createPanel(builder); }
private JComponent buildEditorPanel() { FormLayout layout = new FormLayout("FILL:DEFAULT:NONE,FILL:250DLU:GROW(1.0)", //$NON-NLS-1$ "CENTER:DEFAULT:NONE,FILL:250DLU:GROW(1.0)"); //$NON-NLS-1$ PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.add(enableButton, cc.xy(1, 1)); builder.add(new JScrollPane(ta), cc.xyw(1, 2, 2)); return builder.getPanel(); }
private JComponent buildEditorPanel() { FormLayout layout = new FormLayout( "FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE", //$NON-NLS-1$ "FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)"); //$NON-NLS-1$ PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(new JButton(previousMonthAction), cc.xy(1, 1)); builder.add(new JButton(nextMonthAction), cc.xy(3, 1)); builder.add(label, cc.xy(2, 1)); builder.add(buildDays(), cc.xyw(1, 2, 3)); return builder.getPanel(); }
private JComponent buildEditorPanel() { FormLayout layout = new FormLayout( "FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:DEFAULT:NONE", //$NON-NLS-1$ "FILL:12DLU:NONE,FILL:DEFAULT:GROW(1.0)"); //$NON-NLS-1$ PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(new JButton(previousMonthAction), cc.xy(1, 1)); builder.add(new JButton(nextMonthAction), cc.xy(3, 1)); builder.add(label, cc.xy(2, 1)); builder.add(buildDays(), cc.xyw(1, 2, 3)); return builder.getPanel(); }
protected JComponent buildCenter() { FormLayout layout = new FormLayout("FILL:147DLU:GROW(1.0),3DLU,FILL:10DLU:NONE", //$NON-NLS-1$ "FILL:DEFAULT:NONE,3DLU,FILL:DEFAULT:GROW(1.0)"); //$NON-NLS-1$ PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(getActionToolbar(), cc.xy(1, 1)); builder.add(minimizeButton, cc.xy(3, 1)); builder.add(new JArrowScrollPane(getPanel()), cc.xyw(1, 3, 3)); return builder.getPanel(); }