private JPanel buildMiscPanel() { FormLayout layout = new FormLayout( "right:max(50dlu;pref), 3dlu, 50dlu, 3dlu, 50dlu", "p, 3dlu, p, 3dlu, p, 3dlu, p"); layout.setRowGroups(new int[][] {{1, 3, 5}}); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); Action chooseAction = new ChooseColorAction( builder.getPanel(), presentationModel.getModel(ExampleBean.PROPERTYNAME_COLOR)); CellConstraints cc = new CellConstraints(); builder.addLabel("JCheckBox", cc.xy(1, 1)); builder.add(checkBox, cc.xy(3, 1)); builder.addLabel("JSlider", cc.xy(1, 3)); builder.add(slider, cc.xy(3, 3)); builder.add(floatLabel, cc.xy(5, 3)); builder.addLabel("JSpinner", cc.xy(1, 5)); builder.add(spinner, cc.xy(3, 5)); builder.addLabel("JColorChooser", cc.xy(1, 7)); builder.add(colorPreview, cc.xy(3, 7, "fill, fill")); builder.add(new JButton(chooseAction), cc.xy(5, 7, "left, center")); return builder.getPanel(); }
protected JComponent createMainPanel() { final FormLayout layout = new FormLayout("max(p;380dlu)", "p,3dlu,220dlu,3dlu,50dlu"); CellConstraints cc = new CellConstraints(); PanelBuilder builder = new PanelBuilder(layout); builder.add(createMasterPanel(), cc.xy(1, 1)); builder.add(createDetailsPanel(), cc.xy(1, 3)); builder.add(createValidationView(), cc.xy(1, 5)); // model.updateValidation(); updateComponentTreeMandatoryAndSeverity( model.getValidationModel().getResult(), builder.getPanel()); return builder.getPanel(); }
private JPanel getAbschnitt1(String rez_nr) { FormLayout abschnitt1Pan = new FormLayout( "10dlu,p,5dlu,40dlu,10dlu,p,p,40dlu,20dlu,2dlu,20dlu,2dlu,40dlu,10dlu", "10dlu,p,p,p,3dlu,p,10dlu"); PanelBuilder pabschnitt1 = new PanelBuilder(abschnitt1Pan); pabschnitt1.getPanel().setOpaque(false); CellConstraints ca1 = new CellConstraints(); JLabel lbl1 = new JLabel("<html><u>Rehadaten:</u>"); pabschnitt1.add(lbl1, ca1.xy(2, 2)); JLabel lbl2 = new JLabel("Rehanummer:"); pabschnitt1.add(lbl2, ca1.xy(2, 4)); tf1[0] = new JRtaTextField("ZAHLEN", true); if (rez_nr != null) { tf1[0].setText(rez_nr.replace("RH", "")); } pabschnitt1.add(tf1[0], ca1.xy(2, 6)); bnr1 = new JButton("Connect"); bnr1.setActionCommand("connect"); bnr1.addActionListener(this); pabschnitt1.add(bnr1, ca1.xy(4, 6)); JLabel lbl3 = new JLabel("Rehatage: "); pabschnitt1.add(lbl3, ca1.xy(6, 6)); tagelab = new JLabel("0"); pabschnitt1.add(tagelab, ca1.xy(7, 6)); bnr4 = new JButton("+"); bnr4.setActionCommand("plus"); bnr4.addActionListener(this); pabschnitt1.add(bnr4, ca1.xy(9, 4)); bnr5 = new JButton("-"); bnr5.setActionCommand("minus"); bnr5.addActionListener(this); pabschnitt1.add(bnr5, ca1.xy(11, 4)); bnr6 = new JButton("sort."); bnr6.setActionCommand("sortieren"); bnr6.addActionListener(this); bnr6.setEnabled(false); pabschnitt1.add(bnr6, ca1.xy(13, 4)); JLabel lbl4 = new JLabel("Anwesenheitsliste:"); pabschnitt1.add(lbl4, ca1.xyw(9, 3, 5)); combobox1 = new JRtaComboBox(new Vector<Vector<String>>(), 0, 1); pabschnitt1.add(combobox1, ca1.xyw(9, 6, 5)); pabschnitt1.getPanel().validate(); return pabschnitt1.getPanel(); }
private Component buildSettingsPanel() { FormLayout layout = new FormLayout( "right:pref, $lcgap, pref, 10dlu, right:pref, $lcgap, pref", "p, 3dlu, p, 7dlu, p, 3dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); builder.setOpaque(false); CellConstraints cc = new CellConstraints(); builder.addSeparator("Host", cc.xyw(1, 1, 7)); builder.addLabel("URI", cc.xy(1, 3)); builder.add(jtflHost, cc.xyw(3, 3, 5)); builder.addSeparator("User", cc.xyw(1, 5, 7)); builder.addLabel("Name", cc.xy(1, 7)); builder.add(jtflUser, cc.xy(3, 7)); builder.addLabel("Password", cc.xy(5, 7)); builder.add(jpflPwd, cc.xy(7, 7)); JPanel panel = builder.getPanel(); panel.setOpaque(false); return panel; }
public ConfigurationPanel(KeyListener al) { this.al = al; createFields(); FormLayout layout = new FormLayout( "right:max(40dlu;p), 4dlu, 90dlu", "p, 4dlu, p, 2dlu, p, 2dlu, p, 4dlu, p, 2dlu, p, 2dlu, p, 4dlu, p, 2dlu, p, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.addSeparator(trayi18n.getString("IDENTIFICATION"), cc.xyw(1, 1, 3)); builder.addLabel(trayi18n.getString("IDENTIFIANT"), cc.xy(1, 3)); builder.add(login, cc.xy(3, 3)); builder.addLabel(trayi18n.getString("PASSWORD"), cc.xy(1, 5)); builder.add(password, cc.xy(3, 5)); builder.addSeparator(trayi18n.getString("FSNET"), cc.xyw(1, 7, 3)); builder.addLabel(trayi18n.getString("FSNETADRESSE"), cc.xy(1, 9)); builder.add(fsneturl, cc.xy(3, 9)); builder.addSeparator(trayi18n.getString("MISC"), cc.xyw(1, 13, 3)); builder.addLabel(trayi18n.getString("LANGUAGE"), cc.xy(1, 15)); builder.add(language, cc.xy(3, 15)); builder.addLabel(trayi18n.getString("LAG"), cc.xy(1, 17)); builder.add(lag, cc.xy(3, 17)); builder.addLabel(trayi18n.getString("MINUTES"), cc.xy(1, 18)); panel = builder.getPanel(); }
/** * Builds the Music information panel. * * <p> * * @return the panel to display the music info */ private JComponent buildMusicPanel() { FormLayout layout = new FormLayout( "right:max(14dlu;pref), 4dlu, left:min(80dlu;pref), 100px, right:max(14dlu;pref),pref:grow, 4px", "p, 4px, p, 4px, p, 4px, p, 4px, p, 4px"); layout.setRowGroups(new int[][] {{1, 3}}); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.addLabel(Resources.getString("label.file") + ": ", cc.xy(1, 1)); builder.add(location, cc.xyw(3, 1, 5)); builder.addLabel(Resources.getString("label.duration") + ": ", cc.xy(1, 3)); builder.add(duration, cc.xy(3, 3)); builder.addLabel(Resources.getString("label.layer") + ": ", cc.xy(5, 3)); builder.add(layer, cc.xy(6, 3)); builder.addLabel(Resources.getString("label.bitrate") + ": ", cc.xy(1, 5)); builder.add(bitRate, cc.xyw(3, 5, 4)); builder.addLabel(Resources.getString("label.version") + ": ", cc.xy(5, 5)); builder.add(version, cc.xy(6, 5)); builder.addLabel(Resources.getString("label.frequency") + ": ", cc.xy(1, 7)); builder.add(frequency, cc.xy(3, 7)); builder.addLabel(Resources.getString("label.mode") + ": ", cc.xy(5, 7)); builder.add(mode, cc.xy(6, 7)); builder.addLabel(Resources.getString("label.filesize") + ": ", cc.xy(1, 9)); builder.add(fileSize, cc.xy(3, 9)); builder.addLabel(Resources.getString("label.copyright") + ": ", cc.xy(5, 9)); builder.add(copyrighted, cc.xy(6, 9)); return builder.getPanel(); }
@Override public void prepare() { d_pm.rebuildArmSelection(); removeAll(); FormLayout layout = new FormLayout("3dlu, left:pref, 3dlu, pref:grow", "p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); int row = 1; for (Study curStudy : d_pm.getSelectableStudyListPM().getSelectedStudiesModel()) { builder.addSeparator(curStudy.toString(), cc.xyw(1, row, 4)); row = LayoutUtil.addRow(layout, row); for (TreatmentDefinition def : d_pm.getSelectedRefinedTreatmentDefinitions()) { if (!d_pm.getArmsPerStudyPerDefinition(curStudy, def).isEmpty()) { row = createArmSelect(builder, row, curStudy, def, cc); } } } JScrollPane sp = new JScrollPane(builder.getPanel()); add(sp, BorderLayout.CENTER); sp.getVerticalScrollBar().setUnitIncrement(16); setComplete(true); }
@Override public JComponent config() { FormLayout layout = new FormLayout("left:pref, 0:grow", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, 0:grow"); PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(Borders.EMPTY_BORDER); builder.setOpaque(false); CellConstraints cc = new CellConstraints(); JComponent cmp = builder.addSeparator("Audio settings", cc.xyw(2, 1, 1)); cmp = (JComponent) cmp.getComponent(0); cmp.setFont(cmp.getFont().deriveFont(Font.BOLD)); noresample = new JCheckBox(Messages.getString("TrTab2.22")); noresample.setContentAreaFilled(false); noresample.setSelected(configuration.isAudioResample()); noresample.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { configuration.setAudioResample(e.getStateChange() == ItemEvent.SELECTED); } }); builder.add(noresample, cc.xy(2, 3)); return builder.getPanel(); }
private void initView() { cancelButton = new JButton("Cancel"); proceedButton = new JButton("Continue"); attributesTable = new JTable(); // assemble CellConstraints cc = new CellConstraints(); PanelBuilder builder = new PanelBuilder(new FormLayout("fill:200dlu:grow", "pref, 3dlu, top:40dlu:grow")); builder.setDefaultDialogBorder(); builder.addLabel("Select actions for duplicated attributes:", cc.xy(1, 1)); builder.add(new JScrollPane(attributesTable), cc.xy(1, 3)); JPanel buttons = new JPanel(new FlowLayout(FlowLayout.RIGHT)); buttons.add(cancelButton); buttons.add(proceedButton); getContentPane().setLayout(new BorderLayout()); getContentPane().add(builder.getPanel(), BorderLayout.CENTER); getContentPane().add(buttons, BorderLayout.SOUTH); // TODO: use preferences setSize(450, 350); }
@Override public JComponent config() { FormLayout layout = new FormLayout("left:pref, 3dlu, p, 3dlu, 0:grow", "p, 3dlu, p, 3dlu, 0:grow"); PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(Borders.EMPTY_BORDER); builder.setOpaque(false); CellConstraints cc = new CellConstraints(); JComponent cmp = builder.addSeparator(Messages.getString("NetworkTab.5"), cc.xyw(1, 1, 5)); cmp = (JComponent) cmp.getComponent(0); cmp.setFont(cmp.getFont().deriveFont(Font.BOLD)); builder.addLabel(Messages.getString("FFMpegDVRMSRemux.0"), cc.xy(1, 3)); altffpath = new JTextField(PMS.getConfiguration().getFfmpegAlternativePath()); altffpath.addKeyListener( new KeyListener() { @Override public void keyPressed(KeyEvent e) {} @Override public void keyTyped(KeyEvent e) {} @Override public void keyReleased(KeyEvent e) { PMS.getConfiguration().setFfmpegAlternativePath(altffpath.getText()); } }); builder.add(altffpath, cc.xyw(3, 3, 3)); return builder.getPanel(); }
private Component buildMainPanel() { FormLayout layout = new FormLayout("pref, $lcgap, pref, 15dlu, p", "p, 5dlu, p, 5dlu, p, 5dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); builder.setOpaque(false); CellConstraints cc = new CellConstraints(); builder.addSeparator(entity.getId(), cc.xyw(1, 1, 3)); builder.addLabel("Start", cc.xy(1, 3)); builder.add(jtflStart, cc.xy(3, 3)); builder.addLabel("End", cc.xy(1, 5)); builder.add(jtflEnd, cc.xy(3, 5)); builder.addLabel("Increment", cc.xy(1, 7)); builder.add(jtflInc, cc.xy(3, 7)); builder.add(jbtnOK, cc.xy(5, 1)); builder.add(jbtnCancel, cc.xy(5, 3)); JPanel panel = builder.getPanel(); panel.setOpaque(false); return panel; }
private JPanel buildChoicesPanel() { FormLayout layout = new FormLayout( "right:max(50dlu;pref), 3dlu, p, 6dlu, p, 6dlu, p, 0:grow", "p, 3dlu, p, 3dlu, p, 9dlu, p, 3dlu, p, 3dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.addSeparator("Integer Choice", cc.xyw(1, 1, 8)); builder.addLabel("JRadioButton", cc.xy(1, 3)); builder.add(leftIntRadio, cc.xy(3, 3)); builder.add(centerIntRadio, cc.xy(5, 3)); builder.add(rightIntRadio, cc.xy(7, 3)); builder.addLabel("JComboBox", cc.xy(1, 5)); builder.add(alignmentIntCombo, cc.xyw(3, 5, 3)); builder.addSeparator("Object Choice", cc.xyw(1, 7, 8)); builder.addLabel("JRadioButton", cc.xy(1, 9)); builder.add(leftObjectRadio, cc.xy(3, 9)); builder.add(centerObjectRadio, cc.xy(5, 9)); builder.add(rightObjectRadio, cc.xy(7, 9)); builder.addLabel("JComboBox", cc.xy(1, 11)); builder.add(alignmentObjectCombo, cc.xyw(3, 11, 3)); return builder.getPanel(); }
private JPanel buildFilePropertyPreferencesPanel() { FormLayout layout = new FormLayout( "5px, f:p:g, 15px, f:p:g, 15px, f:p:g, 15px, f:p:g, 15px, f:p:g, 15px, f:p:g, 5px", "5px, t:p, 15px, t:p, 15px, t:p, 5px"); PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(new TitledBorder("Properties")); builder.setOpaque(true); CellConstraints cc = new CellConstraints(); if (fssps != null) { // create grid with file types and engine names int index = 0; int x = 0; int y = 0; for (FileScannerSelectorPanel fssp : fssps) { if (index % 6 == 0) { x = 2; y += 2; } builder.add(fssp, cc.xy(x, y)); x += 2; index++; } } else { log.warn( "No FileSelectorPanels will be added because fpps is null. This should never happen!"); } return builder.getPanel(); }
private Component buildTagsPanel() { FormLayout layout = new FormLayout( "5px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 10px, p, 5px", "f:130, 5px"); PanelBuilder builder = new PanelBuilder(layout); builder.setBorder(new TitledBorder("Tags")); builder.setOpaque(true); CellConstraints cc = new CellConstraints(); int x = 2; int y = 1; for (String engineName : lTagsPerEngine.keySet()) { if (x > 20) { break; } JScrollPane sp = new JScrollPane(lTagsPerEngine.get(engineName)); sp.setBorder(BorderFactory.createEmptyBorder()); JPanel p = new JPanel(new BorderLayout(0, 3)); p.add(new JHeader(engineName), BorderLayout.NORTH); p.add(sp, BorderLayout.CENTER); builder.add(p, cc.xy(x, y)); x += 2; } return builder.getPanel(); }
private JComponent buildMainPanel() { final FormLayout layout = new FormLayout("450dlu", "p,3dlu,p,3dlu,p"); CellConstraints cc = new CellConstraints(); PanelBuilder builder = new PanelBuilder(layout); builder.add(buildFormPanel(), cc.xy(1, 1)); builder.add(buildGridPanel(), cc.xy(1, 3)); // builder.add(createValidationView(),cc.xy(1,3)) return builder.getPanel(); }
protected JComponent buildFilterPanel() { FormLayout layout = new FormLayout("40dlu,3dlu,f:p:g,3dlu,p", "f:p"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.addLabel("Filtrar: ", cc.xy(1, 1)); builder.add(inputField, cc.xy(3, 1)); builder.add(loadBtn, cc.xy(5, 1)); // builder.setDefaultDialogBorder(); return builder.getPanel(); }
private JPanel getAbschnitt3() { FormLayout abschnitt3Pan = new FormLayout("100dlu,60dlu,50dlu,60dlu,10dlu", "10dlu,p,10dlu"); PanelBuilder pabschnitt3 = new PanelBuilder(abschnitt3Pan); pabschnitt3.getPanel().setOpaque(false); CellConstraints ca3 = new CellConstraints(); bnr2 = new JButton("Drucken"); bnr2.setActionCommand("drucken"); bnr2.addActionListener(this); pabschnitt3.add(bnr2, ca3.xy(2, 2)); bnr3 = new JButton("Schliessen"); bnr3.setActionCommand("schliessen"); bnr3.addActionListener(this); pabschnitt3.add(bnr3, ca3.xy(4, 2)); pabschnitt3.getPanel().validate(); return pabschnitt3.getPanel(); }
private void genUI() { prepareComponent(); FormLayout layout = new FormLayout("3dlu:grow, pref, 3dlu:grow", "3dlu:grow, pref, 3dlu:grow"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(mStart, cc.xy(2, 2)); setLayout(new BorderLayout()); add(builder.getPanel(), BorderLayout.CENTER); }
private JComponent buildForma() { FormLayout layout = new FormLayout("50dlu,4dlu,50dlu,40dlu", "pref,20dlu,pref"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(new JLabel("Año"), cc.xyw(1, 2, 2)); builder.add(año, cc.xyw(3, 2, 2)); builder.add(new JLabel("Mes"), cc.xyw(1, 3, 2)); builder.add(mes, cc.xyw(3, 3, 2)); return builder.getPanel(); }
@Override public JComponent getContent() { if (this.obj == null) { throw new IllegalStateException("No object set."); } // TODO: Make this nicer later. if (this.obj instanceof Chapter) { Chapter c = (Chapter) this.obj; JComponent t = UIUtils.getChapterInfoPreview(c, null, this.viewer); if (t == null) { // May be a fake chapter, return null. return null; } t.setSize(new Dimension(300, Short.MAX_VALUE)); return t; } else { String firstLine = "<b><i>No description.</i></b>"; String t = (obj.getDescription() != null ? obj.getDescription().getText() : null); if ((t != null) && (t.length() > 0)) { firstLine = new Paragraph(t, 0).getFirstSentence().getText(); } JEditorPane desc = UIUtils.createHelpTextPane(firstLine, null); FormLayout fl = new FormLayout("380px", "p"); PanelBuilder pb = new PanelBuilder(fl); CellConstraints cc = new CellConstraints(); pb.add(desc, cc.xy(1, 1)); desc.setAlignmentX(Component.LEFT_ALIGNMENT); JPanel p = pb.getPanel(); p.setOpaque(true); p.setBackground(UIUtils.getComponentColor()); return p; } }
private void initView() { // create widgets name = new TextAdapter(new JTextField()) { @Override protected void updateModel(String text) { setQueryName(text); } }; queryRoot = Application.getWidgetFactory().createComboBox(); AutoCompletion.enable(queryRoot); queryRoot.setRenderer(CellRenderers.listRendererWithIcons()); qualifier = new ValidatorTextAdapter(new JTextField()) { @Override protected void updateModel(String text) { setQueryQualifier(text); } @Override protected void validate(String text) throws ValidationException { createQualifier(text); } }; distinct = new JCheckBox(); properties = new ObjectQueryPropertiesPanel(mediator); // assemble CellConstraints cc = new CellConstraints(); FormLayout layout = new FormLayout( "right:max(80dlu;pref), 3dlu, fill:200dlu", "p, 3dlu, p, 3dlu, p, 3dlu, p, 3dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); builder.addSeparator("SelectQuery Settings", cc.xywh(1, 1, 3, 1)); builder.addLabel("Query Name:", cc.xy(1, 3)); builder.add(name.getComponent(), cc.xy(3, 3)); builder.addLabel("Query Root:", cc.xy(1, 5)); builder.add(queryRoot, cc.xy(3, 5)); builder.addLabel("Qualifier:", cc.xy(1, 7)); builder.add(qualifier.getComponent(), cc.xy(3, 7)); builder.addLabel("Distinct:", cc.xy(1, 9)); builder.add(distinct, cc.xy(3, 9)); this.setLayout(new BorderLayout()); this.add(builder.getPanel(), BorderLayout.NORTH); this.add(properties, BorderLayout.CENTER); }
/** Constructs a JPanel containing a label and a JTextField */ private JPanel makePanelFrom(final String label, final JTextField textField) { final FormLayout fl = new FormLayout("pref, 3dlu, pref", "pref"); final PanelBuilder builder = new PanelBuilder(fl); final CellConstraints cc = new CellConstraints(); builder.addLabel(label, cc.xy(1, 1)); builder.add(textField, cc.xy(3, 1)); return builder.getPanel(); }
private JPanel getSchluessel() { tfs[0] = new JRtaTextField("GROSS", true); tfs[0].addKeyListener(kli); tfs[1] = new JRtaTextField("GROSS", true); tfs[1].addKeyListener(kli); buts[0] = new JButton("Ok"); buts[0].addKeyListener(kli); buts[0].setActionCommand("ok"); buts[0].setName("ok"); buts[0].addActionListener(acli); buts[1] = new JButton("Abbrechen"); buts[1].addKeyListener(kli); buts[1].setActionCommand("abbrechen"); buts[1].setName("abbrechen"); buts[1].addActionListener(acli); FormLayout lay = new FormLayout( "0dlu,right:max(40dlu;p),10dlu,120dlu,50dlu", "10dlu,p,10dlu,p,10dlu,p,10dlu,p,10dlu"); PanelBuilder pb = new PanelBuilder(lay); CellConstraints cc = new CellConstraints(); pb.addLabel("Schlüssel", cc.xy(2, 2)); schluessellab = new JLabel(schluessel); schluessellab.setFont(fon); pb.add(schluessellab, cc.xy(4, 2)); pb.addLabel("Name", cc.xy(2, 4)); pb.add(tfs[0], cc.xy(4, 4)); pb.addLabel("Pfand", cc.xy(2, 6)); pb.add(tfs[1], cc.xy(4, 6)); FormLayout lay2 = new FormLayout("fill:0:grow(0.5),60dlu,20dlu,60dlu,fill:0:grow(0.5)", "5dlu,p,5dlu"); PanelBuilder pb2 = new PanelBuilder(lay2); CellConstraints cc2 = new CellConstraints(); pb2.add(buts[0], cc2.xy(2, 2)); pb2.add(buts[1], cc2.xy(4, 2)); pb2.getPanel().validate(); pb.add(pb2.getPanel(), cc.xyw(1, 8, 5)); pb.getPanel().validate(); return pb.getPanel(); }
public JPanel buildPanel(WindowInterface window) { initComponents(window); FormLayout layout = new FormLayout("p", "240dlu,3dlu,p"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.add(new JScrollPane(tableCommission), cc.xy(1, 1)); builder.add(ButtonBarFactory.buildCenteredBar(buttonExcel), cc.xy(1, 3)); JPanel panel = builder.getPanel(); panel.addComponentListener(viewHandler.getClaimComponentListener(window)); return panel; }
private Component buildMainPanel() { FormLayout layout = new FormLayout("center:pref", "p, 10dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); builder.setOpaque(false); CellConstraints cc = new CellConstraints(); builder.add(buildSettingsPanel(), cc.xy(1, 1)); builder.add(buildButtonsPanel(), cc.xy(1, 3)); return builder.getPanel(); }
private JPanel buildFormattedPanel() { FormLayout layout = new FormLayout("right:max(50dlu;pref), 3dlu, 50dlu", "p, 3dlu, p, 3dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.addLabel("Date", cc.xy(1, 1)); builder.add(dateField, cc.xy(3, 1)); builder.addLabel("Integer", cc.xy(1, 3)); builder.add(integerField, cc.xy(3, 3)); builder.addLabel("Long", cc.xy(1, 5)); builder.add(longField, cc.xy(3, 5)); return builder.getPanel(); }
private JPanel buildListPanel() { FormLayout layout = new FormLayout( "right:max(50dlu;pref), 3dlu, 150dlu", "fill:60dlu, 6dlu, fill:60dlu, 6dlu, p"); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.addLabel("JList", cc.xy(1, 1, "right, top")); builder.add(new JScrollPane(list), cc.xy(3, 1)); builder.addLabel("JTable", cc.xy(1, 3, "right, top")); builder.add(new JScrollPane(table), cc.xy(3, 3)); builder.addLabel("JComboBox", cc.xy(1, 5)); builder.add(comboBox, cc.xy(3, 5)); return builder.getPanel(); }
public void buildView() { super.buildView(); this.setHeaderInfo(getModel().getHeaderInfo()); FormLayout layout = new FormLayout("20dlu, pref, pref, 1dlu:grow", "pref, 2dlu, pref, 2dlu, pref"); CellConstraints cc = new CellConstraints(); PanelBuilder builder = new PanelBuilder(layout); builder.addSeparator("Benutzeroberflaeche", cc.xyw(1, 1, 4)); builder.add(cPathActive, cc.xyw(1, 3, 4)); builder.addLabel("Position: ", cc.xy(2, 5)); builder.add(cbPathPosition, cc.xy(3, 5)); this.addToContentPanel(builder.getPanel()); }
private void buildPanel() { FormLayout layout = new FormLayout("fill:0:grow", "p, 3dlu, p"); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); builder.setDefaultDialogBorder(); // Add Html to JLabel builder.add(new JLabel(d_d80Report), cc.xy(1, 1)); // Buttons Panel JPanel buttonsPanel = new JPanel(); // Export button JButton exportButton = new JButton("Export table as html"); exportButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { saveAsHtmlDialog((Component) getParent()); } }); buttonsPanel.add(exportButton); // Copy to clipboard button JButton clipboardButton = new JButton("Copy table to clipboard"); clipboardButton.addActionListener( new ActionListener() { @Override public void actionPerformed(ActionEvent e) { D80Transferable data = null; try { data = new D80Transferable(d_d80Report); } catch (ClassNotFoundException e1) { } Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); clipboard.setContents(data, data); } }); buttonsPanel.add(clipboardButton); builder.add(buttonsPanel, cc.xy(1, 3)); // put everything into a scrollpane and add it to the dialog JScrollPane scrollPane = new JScrollPane(builder.getPanel()); scrollPane.setViewportBorder(BorderFactory.createEmptyBorder()); scrollPane.getVerticalScrollBar().setUnitIncrement(6); add(scrollPane); }
private JPanel buildTextPanel() { FormLayout layout = new FormLayout("right:max(50dlu;pref), 3dlu, 50dlu", "p, 3dlu, p, 3dlu, p, 14dlu, 3dlu, p"); layout.setRowGroups(new int[][] {{1, 3, 5}}); PanelBuilder builder = new PanelBuilder(layout); builder.setDefaultDialogBorder(); CellConstraints cc = new CellConstraints(); builder.addLabel("JTextField", cc.xy(1, 1)); builder.add(textField, cc.xy(3, 1)); builder.addLabel("JPasswordField", cc.xy(1, 3)); builder.add(passwordField, cc.xy(3, 3)); builder.addLabel("JTextArea", cc.xy(1, 5)); builder.add(new JScrollPane(textArea), cc.xywh(3, 5, 1, 2)); builder.addLabel("JLabel", cc.xy(1, 8)); builder.add(textLabel, cc.xy(3, 8)); return builder.getPanel(); }