/** * Appends a column specification to the builder's layout * that represents the given string encoding. * * @param encodedColumnSpec the column specification to append in encoded form * * @see #appendColumn(ColumnSpec) */ public final void appendColumn(String encodedColumnSpec) { appendColumn(ColumnSpec.decode(encodedColumnSpec)); }
/** * Appends a column specification to the builder's layout * that represents the given string encoding. * * @param encodedColumnSpec the column specification to append in encoded form * * @see #appendColumn(ColumnSpec) */ public final void appendColumn(String encodedColumnSpec) { appendColumn(ColumnSpec.decode(encodedColumnSpec)); }
/** * Parses the encoded column specification and returns a ColumnSpec object * that represents the string. Variables are expanded using the default * LayoutMap. * * @param encodedColumnSpec the encoded column specification * * @return a ColumnSpec instance for the given specification * @throws NullPointerException if {@code encodedColumnSpec} is {@code null} * * @see #decode(String, LayoutMap) * @see LayoutMap#getRoot() * * @since 1.2 */ public static ColumnSpec decode(String encodedColumnSpec) { return decode(encodedColumnSpec, LayoutMap.getRoot()); }
/** * Parses the encoded column specification and returns a ColumnSpec object * that represents the string. Variables are expanded using the default * LayoutMap. * * @param encodedColumnSpec the encoded column specification * * @return a ColumnSpec instance for the given specification * @throws NullPointerException if {@code encodedColumnSpec} is {@code null} * * @see #decode(String, LayoutMap) * @see LayoutMap#getRoot() * * @since 1.2 */ public static ColumnSpec decode(String encodedColumnSpec) { return decode(encodedColumnSpec, LayoutMap.getRoot()); }
public MovieSetTreeCellRenderer() { movieSetPanel.setLayout( new FormLayout(new ColumnSpec[] { ColumnSpec.decode("min:grow"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("center:20px"), ColumnSpec.decode("center:20px") }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, })); TmmFontHelper.changeFont(movieSetTitle, Font.BOLD); movieSetTitle.setHorizontalAlignment(JLabel.LEFT); movieSetTitle.setMinimumSize(new Dimension(0, 0)); movieSetPanel.add(movieSetTitle, "1, 1"); movieSetPanel.add(movieSetImageLabel, "4, 1, 1, 2"); TmmFontHelper.changeFont(movieSetInfo, 0.816); movieSetInfo.setHorizontalAlignment(JLabel.LEFT); movieSetInfo.setMinimumSize(new Dimension(0, 0)); movieSetPanel.add(movieSetInfo, "1, 2"); moviePanel.setLayout(new FormLayout(new ColumnSpec[] { ColumnSpec.decode("min:grow"), FormFactory.LABEL_COMPONENT_GAP_COLSPEC, ColumnSpec.decode("center:20px"), ColumnSpec.decode("center:20px") }, new RowSpec[] { FormFactory.DEFAULT_ROWSPEC })); movieTitle.setMinimumSize(new Dimension(0, 0)); moviePanel.add(movieTitle, "1, 1"); moviePanel.add(movieNfoLabel, "3, 1"); moviePanel.add(movieImageLabel, "4, 1"); }
public ReferenceCameraCalibrationConfigurationWizard(ReferenceCamera referenceCamera) { this.referenceCamera = referenceCamera; panelLensCalibration = new JPanel(); panelLensCalibration.setBorder(new TitledBorder(null, "Lens Calibration", TitledBorder.LEADING, TitledBorder.TOP, null, null)); contentPanel.add(panelLensCalibration); panelLensCalibration.setLayout(new FormLayout( new ColumnSpec[] {FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),}, new RowSpec[] {FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,})); startLensCalibrationBtn = new JButton(startCalibration); panelLensCalibration.add(startLensCalibrationBtn, "2, 2, 3, 1"); lblApplyCalibration = new JLabel("Apply Calibration?"); panelLensCalibration.add(lblApplyCalibration, "2, 4, right, default"); calibrationEnabledChk = new JCheckBox(""); panelLensCalibration.add(calibrationEnabledChk, "4, 4"); }
public ImageCameraConfigurationWizard(ImageCamera camera) { this.camera = camera; panelGeneral = new JPanel(); contentPanel.add(panelGeneral); panelGeneral.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "General", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); panelGeneral.setLayout(new FormLayout( new ColumnSpec[] {FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC,}, new RowSpec[] {FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,})); lblSourceUrl = new JLabel("Source URL"); panelGeneral.add(lblSourceUrl, "2, 2, right, default"); textFieldSourceUrl = new JTextField(); panelGeneral.add(textFieldSourceUrl, "4, 2, fill, default"); textFieldSourceUrl.setColumns(10); btnBrowse = new JButton(browseAction); panelGeneral.add(btnBrowse, "6, 2"); }
public WebcamConfigurationWizard(Webcams camera) { this.camera = camera; panelGeneral = new JPanel(); contentPanel.add(panelGeneral); panelGeneral.setBorder(new TitledBorder(new EtchedBorder(EtchedBorder.LOWERED, null, null), "General", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(0, 0, 0))); panelGeneral.setLayout(new FormLayout( new ColumnSpec[] {FormSpecs.RELATED_GAP_COLSPEC, FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),}, new RowSpec[] {FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,})); JLabel lblDeviceId = new JLabel("Device ID"); panelGeneral.add(lblDeviceId, "2, 2, right, default"); Object[] deviceIds = null; try { deviceIds = camera.getDeviceIds().toArray(new String[] {}); } catch (Exception e) { // TODO: Show an error to the use when we can't get the list of device IDs } comboBoxDeviceId = new JComboBox(deviceIds); panelGeneral.add(comboBoxDeviceId, "4, 2, left, default"); chckbxGray = new JCheckBox("Force Grayscale?"); panelGeneral.add(chckbxGray, "2, 4, 3, 1"); }
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(); }
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); }
/** * constructor for creating a device */ public WolDeviceDialog() { super(BUNDLE.getString("tmm.wakeonlandevice"), "wolDialog"); //$NON-NLS-1$ setResizable(false); getContentPane().setLayout(new FormLayout( new ColumnSpec[] { FormFactory.RELATED_GAP_COLSPEC, FormFactory.DEFAULT_COLSPEC, FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(100px;default)"), FormFactory.RELATED_GAP_COLSPEC, ColumnSpec.decode("max(100px;default)"), FormFactory.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, FormFactory.DEFAULT_ROWSPEC, FormFactory.RELATED_GAP_ROWSPEC, })); JLabel lblDeviceName = new JLabel(BUNDLE.getString("Settings.devicename")); //$NON-NLS-1$ getContentPane().add(lblDeviceName, "2, 2, right, default"); tfName = new JTextField(); getContentPane().add(tfName, "4, 2, 5, 1, fill, default"); tfName.setColumns(10); JLabel lblMacAddress = new JLabel(BUNDLE.getString("Settings.macaddress")); //$NON-NLS-1$ getContentPane().add(lblMacAddress, "2, 4, right, default"); tfMacAddress = new JTextField(); getContentPane().add(tfMacAddress, "4, 4, 5, 1, fill, default"); tfMacAddress.setColumns(10); JButton btnSave = new JButton(BUNDLE.getString("Button.save")); //$NON-NLS-1$ btnSave.setAction(actionSave); getContentPane().add(btnSave, "6, 6"); JButton btnCancel = new JButton(BUNDLE.getString("Button.cancel")); //$NON-NLS-1$ btnCancel.setAction(actionCancel); getContentPane().add(btnCancel, "8, 6"); }
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, })); add(innerPanel, "2, 2, fill, default"); innerPanel.setLayout(new FormLayout( new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("25dlu"), FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("50dlu:grow"), FormSpecs.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormSpecs.LABEL_COMPONENT_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC,
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); }
public static final JComponent buildToolBar(Action... actions) { List<ColumnSpec> columnSpecList = new ArrayList<ColumnSpec>(); for (int i = 0; i < actions.length; i++) { Action a = actions[i]; if (a != null) { columnSpecList.add(ColumnSpec.decode("FILL:D")); } else { columnSpecList.add(ColumnSpec.decode("FILL:4PX")); } } columnSpecList.add(ColumnSpec.decode("FILL:D:GROW(1.0)")); FormLayout layout = new FormLayout(columnSpecList.toArray(new ColumnSpec[columnSpecList.size()]), ROW_SPECS); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); int x = 1; for (int i = 0; i < actions.length; i++) { Action a = actions[i]; if (a != null) { builder.add(decoreButton(new JButton(a)), cc.xy(x, 1)); } else { builder.add(new MySeparator(), cc.xy(x, 1, CellConstraints.FILL, CellConstraints.FILL)); } x++; } return decorePanel(builder.getPanel()); }
public static final JComponent buildToolBar(Component... components) { List<ColumnSpec> columnSpecList = new ArrayList<ColumnSpec>(); for (int i = 0; i < components.length; i++) { Component b = components[i]; if (b != null) { columnSpecList.add(ColumnSpec.decode("FILL:D")); } else { columnSpecList.add(ColumnSpec.decode("FILL:4PX")); } } columnSpecList.add(ColumnSpec.decode("FILL:D:GROW(1.0)")); FormLayout layout = new FormLayout(columnSpecList.toArray(new ColumnSpec[columnSpecList.size()]), ROW_SPECS); PanelBuilder builder = new PanelBuilder(layout); CellConstraints cc = new CellConstraints(); int x = 1; for (int i = 0; i < components.length; i++) { Component b = components[i]; if (b != null) { builder.add(decoreButton(b), cc.xy(x, 1)); } else { builder.add(new MySeparator(), cc.xy(x, 1, CellConstraints.FILL, CellConstraints.FILL)); } x++; } return decorePanel(builder.getPanel()); }
new FormLayout(new ColumnSpec[] { FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("300dlu:grow"), FormSpecs.RELATED_GAP_COLSPEC, }, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC, RowSpec.decode("150dlu:grow"), FormSpecs.RELATED_GAP_ROWSPEC, FormSpecs.DEFAULT_ROWSPEC, FormSpecs.RELATED_GAP_ROWSPEC, }));
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); }
FormSpecs.DEFAULT_COLSPEC, FormSpecs.RELATED_GAP_COLSPEC, ColumnSpec.decode("default:grow"),}, new RowSpec[] { FormSpecs.RELATED_GAP_ROWSPEC,