use of com.jgoodies.forms.layout.FormLayout in project jgnash by ccavanaugh.
the class ReportOptions method layoutMainPanel.
private void layoutMainPanel() {
initComponents();
FormLayout layout = new FormLayout("right:p, $lcgap, max(75dlu;p):g", "");
DefaultFormBuilder builder = new DefaultFormBuilder(layout, this);
builder.rowGroupingEnabled(true);
builder.border(Borders.DIALOG);
builder.appendSeparator(rb.getString("Title.Fonts"));
builder.append(rb.getString("Label.Monospace"), monoCombo);
builder.append(rb.getString("Label.Proportional"), proportionalCombo);
}
use of com.jgoodies.forms.layout.FormLayout in project chipKIT32-MAX by chipKIT32.
the class BasicForm method createPanel.
public JPanel createPanel() {
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:3DLU:NONE,FILL:26PX:NONE,FILL:7DLU:NONE", "CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
_outfileButton.setIcon(loadImage("images/open16.png"));
_outfileButton.setName("outfileButton");
jpanel1.add(_outfileButton, cc.xy(12, 2));
_outfileLabel.setIcon(loadImage("images/asterix.gif"));
_outfileLabel.setName("outfileLabel");
_outfileLabel.setText(Messages.getString("outfile"));
jpanel1.add(_outfileLabel, cc.xy(2, 2));
_iconLabel.setName("iconLabel");
_iconLabel.setText(Messages.getString("icon"));
jpanel1.add(_iconLabel, cc.xy(2, 10));
_jarLabel.setIcon(loadImage("images/asterix.gif"));
_jarLabel.setName("jarLabel");
_jarLabel.setText(Messages.getString("jar"));
jpanel1.add(_jarLabel, cc.xy(2, 4));
_jarButton.setIcon(loadImage("images/open16.png"));
_jarButton.setName("jarButton");
jpanel1.add(_jarButton, cc.xy(12, 4));
_iconButton.setIcon(loadImage("images/open16.png"));
_iconButton.setName("iconButton");
jpanel1.add(_iconButton, cc.xy(12, 10));
_cmdLineLabel.setName("cmdLineLabel");
_cmdLineLabel.setText(Messages.getString("cmdLine"));
_cmdLineLabel.setToolTipText("");
jpanel1.add(_cmdLineLabel, cc.xy(2, 14));
_optionsLabel.setName("optionsLabel");
_optionsLabel.setText(Messages.getString("options"));
jpanel1.add(_optionsLabel, cc.xy(2, 18));
_chdirLabel.setName("chdirLabel");
_chdirLabel.setText(Messages.getString("chdir"));
jpanel1.add(_chdirLabel, cc.xy(2, 12));
_processPriorityLabel.setName("processPriorityLabel");
_processPriorityLabel.setText(Messages.getString("priority"));
jpanel1.add(_processPriorityLabel, cc.xy(2, 16));
_normalPriorityRadio.setActionCommand(Messages.getString("normalPriority"));
_normalPriorityRadio.setName("normalPriorityRadio");
_normalPriorityRadio.setText(Messages.getString("normalPriority"));
_buttongroup1.add(_normalPriorityRadio);
jpanel1.add(_normalPriorityRadio, cc.xy(4, 16));
_idlePriorityRadio.setActionCommand(Messages.getString("idlePriority"));
_idlePriorityRadio.setName("idlePriorityRadio");
_idlePriorityRadio.setText(Messages.getString("idlePriority"));
_buttongroup1.add(_idlePriorityRadio);
jpanel1.add(_idlePriorityRadio, cc.xy(6, 16));
_highPriorityRadio.setActionCommand(Messages.getString("highPriority"));
_highPriorityRadio.setName("highPriorityRadio");
_highPriorityRadio.setText(Messages.getString("highPriority"));
_buttongroup1.add(_highPriorityRadio);
jpanel1.add(_highPriorityRadio, cc.xy(8, 16));
_customProcNameCheck.setActionCommand("Custom process name");
_customProcNameCheck.setName("customProcNameCheck");
_customProcNameCheck.setText(Messages.getString("customProcName"));
jpanel1.add(_customProcNameCheck, cc.xywh(4, 18, 7, 1));
_stayAliveCheck.setActionCommand("Stay alive after launching a GUI application");
_stayAliveCheck.setName("stayAliveCheck");
_stayAliveCheck.setText(Messages.getString("stayAlive"));
jpanel1.add(_stayAliveCheck, cc.xywh(4, 20, 7, 1));
_cmdLineField.setName("cmdLineField");
_cmdLineField.setToolTipText(Messages.getString("cmdLineTip"));
jpanel1.add(_cmdLineField, cc.xywh(4, 14, 7, 1));
_chdirField.setName("chdirField");
_chdirField.setToolTipText(Messages.getString("chdirTip"));
jpanel1.add(_chdirField, cc.xywh(4, 12, 7, 1));
_iconField.setName("iconField");
_iconField.setToolTipText(Messages.getString("iconTip"));
jpanel1.add(_iconField, cc.xywh(4, 10, 7, 1));
_dontWrapJarCheck.setActionCommand("Don't wrap the jar, launch it only");
_dontWrapJarCheck.setName("dontWrapJarCheck");
_dontWrapJarCheck.setText(Messages.getString("dontWrapJar"));
jpanel1.add(_dontWrapJarCheck, cc.xywh(4, 6, 7, 1));
_jarField.setName("jarField");
_jarField.setToolTipText(Messages.getString("jarTip"));
jpanel1.add(_jarField, cc.xywh(4, 4, 7, 1));
_outfileField.setName("outfileField");
_outfileField.setToolTipText(Messages.getString("outfileTip"));
jpanel1.add(_outfileField, cc.xywh(4, 2, 7, 1));
TitledSeparator titledseparator1 = new TitledSeparator();
titledseparator1.setText(Messages.getString("downloadAndSupport"));
jpanel1.add(titledseparator1, cc.xywh(2, 22, 11, 1));
_errorTitleLabel.setName("errorTitleLabel");
_errorTitleLabel.setText(Messages.getString("errorTitle"));
jpanel1.add(_errorTitleLabel, cc.xy(2, 24));
_errorTitleField.setName("errorTitleField");
_errorTitleField.setToolTipText(Messages.getString("errorTitleTip"));
jpanel1.add(_errorTitleField, cc.xywh(4, 24, 7, 1));
_downloadUrlLabel.setIcon(loadImage("images/asterix.gif"));
_downloadUrlLabel.setName("downloadUrlLabel");
_downloadUrlLabel.setText(Messages.getString("downloadUrl"));
jpanel1.add(_downloadUrlLabel, cc.xy(2, 26));
_downloadUrlField.setName("downloadUrlField");
jpanel1.add(_downloadUrlField, cc.xywh(4, 26, 7, 1));
_supportUrlLabel.setName("supportUrlLabel");
_supportUrlLabel.setText(Messages.getString("supportUrl"));
jpanel1.add(_supportUrlLabel, cc.xy(2, 28));
_supportUrlField.setName("supportUrlField");
jpanel1.add(_supportUrlField, cc.xywh(4, 28, 7, 1));
JLabel jlabel1 = new JLabel();
jlabel1.setText(Messages.getString("manifest"));
jpanel1.add(jlabel1, cc.xy(2, 8));
_manifestField.setName("manifestField");
_manifestField.setToolTipText(Messages.getString("manifestTip"));
jpanel1.add(_manifestField, cc.xywh(4, 8, 7, 1));
_manifestButton.setIcon(loadImage("images/open16.png"));
_manifestButton.setName("manifestButton");
jpanel1.add(_manifestButton, cc.xy(12, 8));
addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 }, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29 });
return jpanel1;
}
use of com.jgoodies.forms.layout.FormLayout in project chipKIT32-MAX by chipKIT32.
the class EnvironmentVarsForm method createPanel.
public JPanel createPanel() {
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:9DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
_envVarsTextArea.setName("envVarsTextArea");
JScrollPane jscrollpane1 = new JScrollPane();
jscrollpane1.setViewportView(_envVarsTextArea);
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpanel1.add(jscrollpane1, cc.xy(4, 2));
_envVarsLabel.setName("envVarsLabel");
_envVarsLabel.setText(Messages.getString("setVariables"));
jpanel1.add(_envVarsLabel, new CellConstraints(2, 2, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5 }, new int[] { 1, 2, 3 });
return jpanel1;
}
use of com.jgoodies.forms.layout.FormLayout in project chipKIT32-MAX by chipKIT32.
the class HeaderForm method createPanel.
public JPanel createPanel() {
JPanel jpanel1 = new JPanel();
FormLayout formlayout1 = new FormLayout("FILL:7DLU:NONE,RIGHT:MAX(65DLU;DEFAULT):NONE,FILL:3DLU:NONE,FILL:DEFAULT:NONE,FILL:7DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),FILL:7DLU:NONE", "CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:9DLU:NONE,CENTER:DEFAULT:NONE,CENTER:3DLU:NONE,FILL:DEFAULT:GROW(0.2),CENTER:3DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:9DLU:NONE");
CellConstraints cc = new CellConstraints();
jpanel1.setLayout(formlayout1);
_headerTypeLabel.setName("headerTypeLabel");
_headerTypeLabel.setText(Messages.getString("headerType"));
jpanel1.add(_headerTypeLabel, cc.xy(2, 2));
_guiHeaderRadio.setActionCommand("GUI");
_guiHeaderRadio.setName("guiHeaderRadio");
_guiHeaderRadio.setText(Messages.getString("gui"));
_headerButtonGroup.add(_guiHeaderRadio);
jpanel1.add(_guiHeaderRadio, cc.xy(4, 2));
_consoleHeaderRadio.setActionCommand("Console");
_consoleHeaderRadio.setName("consoleHeaderRadio");
_consoleHeaderRadio.setText(Messages.getString("console"));
_headerButtonGroup.add(_consoleHeaderRadio);
jpanel1.add(_consoleHeaderRadio, cc.xy(6, 2));
_headerObjectsTextArea.setName("headerObjectsTextArea");
JScrollPane jscrollpane1 = new JScrollPane();
jscrollpane1.setViewportView(_headerObjectsTextArea);
jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpanel1.add(jscrollpane1, cc.xywh(4, 6, 4, 1));
_libsTextArea.setName("libsTextArea");
JScrollPane jscrollpane2 = new JScrollPane();
jscrollpane2.setViewportView(_libsTextArea);
jscrollpane2.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
jscrollpane2.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
jpanel1.add(jscrollpane2, cc.xywh(4, 8, 4, 1));
_headerObjectsCheck.setActionCommand("Object files");
_headerObjectsCheck.setName("headerObjectsCheck");
_headerObjectsCheck.setText(Messages.getString("objectFiles"));
jpanel1.add(_headerObjectsCheck, new CellConstraints(2, 6, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
_libsCheck.setActionCommand("w32api");
_libsCheck.setName("libsCheck");
_libsCheck.setText(Messages.getString("libs"));
jpanel1.add(_libsCheck, new CellConstraints(2, 8, 1, 1, CellConstraints.DEFAULT, CellConstraints.TOP));
_linkerOptionsSeparator.setName("linkerOptionsSeparator");
_linkerOptionsSeparator.setText(Messages.getString("linkerOptions"));
jpanel1.add(_linkerOptionsSeparator, cc.xywh(2, 4, 6, 1));
addFillComponents(jpanel1, new int[] { 1, 2, 3, 4, 5, 6, 7, 8 }, new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
return jpanel1;
}
use of com.jgoodies.forms.layout.FormLayout in project jabref by JabRef.
the class ManageKeywordsAction method createDialog.
private void createDialog() {
if (diag != null) {
return;
}
// keyword to add
JTextField keyword = new JTextField();
keywordListModel = new DefaultListModel<>();
JList<Keyword> keywordList = new JList<>(keywordListModel);
keywordList.setVisibleRowCount(8);
JScrollPane kPane = new JScrollPane(keywordList);
diag = new JDialog(frame, Localization.lang("Manage keywords"), true);
JButton ok = new JButton(Localization.lang("OK"));
JButton cancel = new JButton(Localization.lang("Cancel"));
JButton add = new JButton(Localization.lang("Add"));
JButton remove = new JButton(Localization.lang("Remove"));
keywordList.setVisibleRowCount(10);
intersectKeywords = new JRadioButton(Localization.lang("Display keywords appearing in ALL entries"));
mergeKeywords = new JRadioButton(Localization.lang("Display keywords appearing in ANY entry"));
ButtonGroup group = new ButtonGroup();
group.add(intersectKeywords);
group.add(mergeKeywords);
ActionListener stateChanged = e -> fillKeyWordList();
intersectKeywords.addActionListener(stateChanged);
mergeKeywords.addActionListener(stateChanged);
intersectKeywords.setSelected(true);
FormBuilder builder = FormBuilder.create().layout(new FormLayout("fill:200dlu:grow, 4dlu, fill:pref", "pref, 2dlu, pref, 1dlu, pref, 2dlu, fill:100dlu:grow, 4dlu, pref, 4dlu, pref, "));
builder.addSeparator(Localization.lang("Keywords of selected entries")).xyw(1, 1, 3);
builder.add(intersectKeywords).xyw(1, 3, 3);
builder.add(mergeKeywords).xyw(1, 5, 3);
builder.add(kPane).xywh(1, 7, 1, 3);
builder.add(remove).xy(3, 9);
builder.add(keyword).xy(1, 11);
builder.add(add).xy(3, 11);
ButtonBarBuilder bb = new ButtonBarBuilder();
bb.addGlue();
bb.addButton(ok);
bb.addButton(cancel);
bb.addGlue();
builder.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
bb.getPanel().setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
ok.addActionListener(e -> {
canceled = false;
diag.dispose();
});
Action cancelAction = new AbstractAction() {
@Override
public void actionPerformed(ActionEvent e) {
canceled = true;
diag.dispose();
}
};
cancel.addActionListener(cancelAction);
final ActionListener addActionListener = arg0 -> addButtonActionListener(keyword);
add.addActionListener(addActionListener);
final ActionListener removeActionListenter = arg0 -> {
List<Keyword> values = keywordList.getSelectedValuesList();
for (Keyword val : values) {
keywordListModel.removeElement(val);
}
};
remove.addActionListener(removeActionListenter);
keywordList.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent arg0) {
// Do nothing
}
@Override
public void keyReleased(KeyEvent arg0) {
// Do nothing
}
@Override
public void keyPressed(KeyEvent arg0) {
if (arg0.getKeyCode() == KeyEvent.VK_DELETE) {
removeActionListenter.actionPerformed(null);
}
}
});
AutoCompleter<String> autoComp = JabRefGUI.getMainFrame().getCurrentBasePanel().getAutoCompleters().get(FieldName.KEYWORDS);
AutoCompleteListener acl = new AutoCompleteListener(autoComp);
keyword.addKeyListener(acl);
keyword.addFocusListener(acl);
keyword.addKeyListener(new KeyListener() {
@Override
public void keyTyped(KeyEvent e) {
// Do nothing
}
@Override
public void keyReleased(KeyEvent e) {
// Do nothing
}
@Override
public void keyPressed(KeyEvent e) {
if (e.getKeyCode() == KeyEvent.VK_ENTER) {
addActionListener.actionPerformed(null);
}
}
});
// Key bindings:
ActionMap am = builder.getPanel().getActionMap();
InputMap im = builder.getPanel().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW);
im.put(Globals.getKeyPrefs().getKey(KeyBinding.CLOSE_DIALOG), "close");
am.put("close", cancelAction);
diag.getContentPane().add(builder.getPanel(), BorderLayout.CENTER);
diag.getContentPane().add(bb.getPanel(), BorderLayout.SOUTH);
}
Aggregations