/** * Appends a row specification to the builder's layout that represents * the given string encoding. * * @param encodedRowSpec the row specification to append in encoded form * * @see #appendRow(RowSpec) */ public final void appendRow(String encodedRowSpec) { appendRow(RowSpec.decode(encodedRowSpec)); }
/** * Appends a row specification to the builder's layout that represents * the given string encoding. * * @param encodedRowSpec the row specification to append in encoded form * * @see #appendRow(RowSpec) */ public final void appendRow(String encodedRowSpec) { appendRow(RowSpec.decode(encodedRowSpec)); }
/** * Parses the encoded row specification and returns a RowSpec object * that represents the string. Variables are expanded using the default * LayoutMap. * * @param encodedRowSpec the encoded row specification * * @return a RowSpec instance for the given specification * @throws NullPointerException if {@code encodedRowSpec} is {@code null} * * @see #decode(String, LayoutMap) * @see LayoutMap#getRoot() * * @since 1.2 */ public static RowSpec decode(String encodedRowSpec) { return decode(encodedRowSpec, LayoutMap.getRoot()); }
/** * Parses the encoded row specification and returns a RowSpec object * that represents the string. Variables are expanded using the default * LayoutMap. * * @param encodedRowSpec the encoded row specification * * @return a RowSpec instance for the given specification * @throws NullPointerException if {@code encodedRowSpec} is {@code null} * * @see #decode(String, LayoutMap) * @see LayoutMap#getRoot() * * @since 1.2 */ public static RowSpec decode(String encodedRowSpec) { return decode(encodedRowSpec, LayoutMap.getRoot()); }
public MessageSummaryDialog(List<String> messages) { super(BUNDLE.getString("summarywindow.title"), "messageSummary"); //$NON-NLS-1$ setBounds(5, 5, 1000, 590); messageList.addAll(messages); getContentPane().setLayout( new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("684px:grow"), FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("fill:265px:grow"), FormFactory.RELATED_GAP_ROWSPEC, })); JScrollPane scrollPane = new JScrollPane(); getContentPane().add(scrollPane, "2, 2, fill, fill"); listMessages = new JList(); scrollPane.setViewportView(listMessages); initDataBindings(); }
private void addAddColorButton() { formlayout.appendRow(RowSpec.decode("CENTER:DEFAULT:NONE")); JButton addColor = new JButton(); addColor.addActionListener(new ColorAdder(0)); addColor.setName("addColor"); addColor.setFont(BUTTON_FONT); addColor.setText(ADD); panel.add(addColor, cc.xy(11, 1)); }
public ImagePanel(List<MediaFile> mediaFiles) { this.mediaFiles = mediaFiles; setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("100px:grow"), }, new RowSpec[] { RowSpec.decode("100px:grow"), })); scrollPane = new JScrollPane(); add(scrollPane, "1, 1, fill, fill"); panelImages = new JPanel(); panelImages.setLayout(new WrapLayout(FlowLayout.LEFT)); scrollPane.setViewportView(panelImages); }
public LogDialog() { super(BUNDLE.getString("logwindow.title"), "log"); //$NON-NLS-1$ setBounds(5, 5, 1000, 590); timerRefresh = new Timer(REFRESH_PERIOD, this); timerRefresh.setInitialDelay(0); getContentPane().setLayout( new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, })); JScrollPane scrollPane = new JScrollPane(); getContentPane().add(scrollPane, "2, 2, fill, fill"); taLogs = new JTextArea(); scrollPane.setViewportView(taLogs); taLogs.setEditable(false); taLogs.setWrapStyleWord(true); taLogs.setLineWrap(true); taLogs.setText(TmmUILogCollector.instance.getLogOutput().getContent()); { JButton btnClose = new JButton(BUNDLE.getString("Button.close")); //$NON-NLS-1$ btnClose.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent arg0) { setVisible(false); } }); getContentPane().add(btnClose, "2, 4, right, default"); } timerRefresh.start(); }
private void initComponents() { setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("50dlu"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("50dlu"), FormSpecs.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormSpecs.LINE_GAP_ROWSPEC, RowSpec.decode("50dlu"), FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("50dlu"), RowSpec.decode("default:grow"), FormSpecs.PARAGRAPH_GAP_ROWSPEC, })); final JTextPane tpGreetingHeader = new JTextPane(); tpGreetingHeader.setEditable(false); tpGreetingHeader.setOpaque(false); tpGreetingHeader.setEditorKit(new HTMLEditorKit()); tpGreetingHeader.setText(BUNDLE.getString("wizard.greeting.header")); //$NON-NLS-1$ add(tpGreetingHeader, "2, 2, 7, 1, center, bottom"); JLabel lblLogo = new JLabel(""); lblLogo.setIcon(new Logo(96)); add(lblLogo, "4, 5, default, top"); JTextPane tpGreetingText = new JTextPane(); tpGreetingText.setEditable(false); tpGreetingText.setText(BUNDLE.getString("wizard.greeting.text")); //$NON-NLS-1$ tpGreetingText.setOpaque(false); add(tpGreetingText, "6, 5, fill, fill"); } }
private void initComponents() { JPanel panelSizing = new JPanel(); panelSizing.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("450dlu:grow") }, new RowSpec[] { RowSpec.decode("300dlu:grow") })); getContentPane().add(panelSizing, BorderLayout.CENTER); panelContent = new JPanel(); panelContent.setLayout(new CardLayout()); panelSizing.add(panelContent, "1, 1, fill, fill"); final JPanel panelSouth = new JPanel(); panelSouth .setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("default:grow"), FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormSpecs.LINE_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.LINE_GAP_ROWSPEC, })); final JPanel panelButtons = new JPanel(); EqualsLayout layout = new EqualsLayout(5); layout.setMinWidth(75); layout.setAlignment(EqualsLayout.RIGHT); panelButtons.setLayout(layout); panelSouth.add(panelButtons, "2, 2, fill, fill"); getContentPane().add(panelSouth, BorderLayout.SOUTH); btnBack = new JButton(); btnBack.setAction(new BackAction()); panelButtons.add(btnBack); btnNext = new JButton(); btnNext.setAction(new NextAction()); panelButtons.add(btnNext); btnCancel = new JButton(); btnCancel.setAction(new FinishAction()); panelButtons.add(btnCancel); }
new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("150dlu:grow"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, }));
private void initComponents() { setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.LABEL_COMPONENT_GAP_COLSPEC, }, new RowSpec[] { FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("top:default"), FormSpecs.LINE_GAP_ROWSPEC, }));
@Override public void add(JPanel panel, JComponent component, Object constraint) { FormLayout layout = (FormLayout) panel.getLayout(); // Field row layout.appendRow(RowSpec.decode("default")); int row = layout.getRowCount(); // Constraints CellConstraints cc = new CellConstraints(); // Decoration component = decorate(component); // Field panel.add(component, cc.xy(3, row)); // Label String key = (String) constraint; if (StringUtils.isNotBlank(key) && GUIStrings.isDefined(key)) { String text = GUIStrings.get(key); JLabel label = new JLabel(text); panel.add(label, cc.xy(1, row)); label.setLabelFor(component); } // Separator layout.appendRow(RowSpec.decode("2dlu")); }
imagePanel.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("75px:grow"), }, new RowSpec[] { RowSpec.decode("fill:75px:grow"), })); imagePanel.setSize(new Dimension((int) (frame.getContentPane().getWidth() * 0.95), (int) (frame.getContentPane().getHeight() * 0.95))); imagePanel.setOpaque(false);
public MediaFilesPanel(EventList<MediaFile> mediaFiles) { this.mediaFileEventList = mediaFiles; setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("default:grow"), }, new RowSpec[] { RowSpec.decode("default:grow"), })); mediaFileTableModel = new DefaultEventTableModel<>(GlazedListsSwing.swingThreadProxyList(mediaFileEventList), new MediaTableFormat()); tableFiles = new ZebraJTable(mediaFileTableModel); tableFiles.setAutoResizeMode(JTable.AUTO_RESIZE_OFF); LinkListener linkListener = new LinkListener(); tableFiles.addMouseListener(linkListener); tableFiles.addMouseMotionListener(linkListener); scrollPaneFiles = ZebraJTable.createStripedJScrollPane(tableFiles); add(scrollPaneFiles, "1, 1, fill, fill"); scrollPaneFiles.setViewportView(tableFiles); // align the runtime to the right DefaultTableCellRenderer rightRenderer = new DefaultTableCellRenderer(); rightRenderer.setHorizontalAlignment(SwingConstants.RIGHT); tableFiles.getColumnModel().getColumn(6).setCellRenderer(rightRenderer); }
ColumnSpec.decode("100px:grow"), FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.NARROW_LINE_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.NARROW_LINE_GAP_ROWSPEC, RowSpec.decode("80px"), RowSpec.decode("default:grow"), FormFactory.NARROW_LINE_GAP_ROWSPEC, }));
FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, RowSpec.decode("top:default:grow"),})); if (warning != null) { JLabel warningLabel = createWarningLabel(addOn);
this.movieSelectionModel = model; setLayout(new FormLayout(new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, RowSpec.decode("default:grow"), }));