use of info.clearthought.layout.TableLayout in project ramus by Vitaliy-Yakovchuk.
the class AttributeOrderEditPanel method createUpDown.
private JComponent createUpDown() {
TableLayout layout = new TableLayout(new double[] { TableLayout.FILL }, new double[] { TableLayout.FILL, 5, TableLayout.FILL });
JPanel panel = new JPanel(layout);
JButton upButton = new JButton(up);
upButton.setFocusable(false);
JButton downButton = new JButton(down);
downButton.setFocusable(false);
panel.add(upButton, "0,0");
panel.add(downButton, "0,2");
JPanel p = new JPanel(new FlowLayout());
p.add(panel);
return p;
}
use of info.clearthought.layout.TableLayout in project datawarrior by thsa.
the class DETaskSelectRowsRandomly method createDialogContent.
@Override
public JComponent createDialogContent() {
double[][] size = { { 8, TableLayout.PREFERRED, 4, TableLayout.PREFERRED, 4, TableLayout.PREFERRED, 8 }, { 8, TableLayout.PREFERRED, 8 } };
JPanel content = new JPanel();
content.setLayout(new TableLayout(size));
content.add(new JLabel("Select"), "1,1");
mTextFieldPercentage = new JTextField(3);
content.add(mTextFieldPercentage, "3,1");
content.add(new JLabel("percent of all rows."), "5,1");
return content;
}
use of info.clearthought.layout.TableLayout in project datawarrior by thsa.
the class MyCheckBoxMenuItem method buildMenu.
protected void buildMenu() {
add(buildFileMenu());
add(buildEditMenu());
add(buildDataMenu());
if (!SUPPRESS_CHEMISTRY)
add(buildChemistryMenu());
add(buildDatabaseMenu());
add(buildListMenu());
add(buildMacroMenu());
add(buildHelpMenu());
double[][] size = { { TableLayout.FILL, TableLayout.PREFERRED, TableLayout.FILL }, { HiDPIHelper.scale(2), TableLayout.PREFERRED } };
JPanel msgPanel = new JPanel();
mMessageLabel = new JLabel();
mMessageLabel.setForeground(Color.RED);
msgPanel.setLayout(new TableLayout(size));
msgPanel.add(mMessageLabel, "1,1");
add(msgPanel);
}
use of info.clearthought.layout.TableLayout in project datawarrior by thsa.
the class AbstractMultiColumnTask method createDialogContent.
@Override
public JPanel createDialogContent() {
int gap = HiDPIHelper.scale(8);
double[][] size = { { gap, TableLayout.PREFERRED, gap / 2, TableLayout.PREFERRED, gap / 2, TableLayout.FILL, gap }, { TableLayout.PREFERRED, gap, TableLayout.PREFERRED, gap, TableLayout.PREFERRED, gap / 2, TableLayout.FILL, gap } };
JPanel content = new JPanel();
content.setLayout(new TableLayout(size));
JPanel innerPanel = createInnerDialogContent();
if (innerPanel != null)
content.add(innerPanel, "0,0,6,0");
content.add(new JLabel("Column name"), "1,2");
mComboBoxMode = new JComboBox(MODE_OPTIONS);
mComboBoxMode.setSelectedIndex(MODE_LIST);
mComboBoxMode.addActionListener(this);
content.add(mComboBoxMode, "3,2");
mTextFieldCriterion = new JTextField(8);
content.add(mTextFieldCriterion, "5,2");
JScrollPane scrollPane;
if (isInteractive()) {
mLabelMessage = new JLabel("Select one or multiple column names!");
ArrayList<String> columnList = new ArrayList<String>();
for (int column = 0; column < mTableModel.getTotalColumnCount(); column++) if (isCompatibleColumn(column))
columnList.add(mTableModel.getColumnTitle(column));
String[] itemList = columnList.toArray(new String[0]);
Arrays.sort(itemList, (s1, s2) -> s1.compareToIgnoreCase(s2));
mListColumns = new JList(itemList);
scrollPane = new JScrollPane(mListColumns);
// scrollPane.setPreferredSize(new Dimension(240,240)); de-facto limits width when long column names need more space
} else {
int wh = HiDPIHelper.scale(240);
mLabelMessage = new JLabel("Type one or multiple column names!");
mTextArea = new JTextArea();
scrollPane = new JScrollPane(mTextArea);
scrollPane.setPreferredSize(new Dimension(wh, wh));
}
content.add(mLabelMessage, "1,4,5,4");
content.add(scrollPane, "1,6,5,6");
return content;
}
use of info.clearthought.layout.TableLayout in project datawarrior by thsa.
the class AbstractTask method createButtonPanel.
/**
* Creates the default button panel with OK and Cancel buttons on the right.
* A Help button is shown in addition, if getHelpURL() != null.
* Override this if more buttons are needed. Make this class an ActionListener
* of OK and Cancel buttons and make the OK button the default button of the
* getDialog()s root pane.
* @return
*/
private JPanel createButtonPanel() {
ActionListener al = e -> {
if (e.getActionCommand().equals("Help")) {
FXHelpFrame.showResource(getHelpURL(), getParentFrame());
return;
}
mStatusOK = false;
if (e.getActionCommand().equals("Cancel"))
doCancelAction();
if (e.getActionCommand().equals("OK"))
doOKAction();
};
int gap = HiDPIHelper.scale(8);
double[][] size = { { gap, TableLayout.PREFERRED, gap, TableLayout.FILL, TableLayout.PREFERRED, gap, TableLayout.PREFERRED, gap }, { gap, TableLayout.PREFERRED, gap } };
JPanel buttonPanel = new JPanel();
buttonPanel.setLayout(new TableLayout(size));
JButton[] optionButtons = getAccessoryButtons();
if (optionButtons != null || getHelpURL() != null) {
JPanel libp = new JPanel();
int count = (optionButtons == null ? 0 : optionButtons.length) + (getHelpURL() == null ? 0 : 1);
libp.setLayout(new GridLayout(1, count, gap, 0));
if (getHelpURL() != null) {
JButton bhelp = new JButton("Help");
bhelp.addActionListener(al);
libp.add(bhelp);
}
if (optionButtons != null)
for (JButton b : optionButtons) libp.add(b);
buttonPanel.add(libp, "1,1");
}
JButton bcancel = new JButton("Cancel");
bcancel.addActionListener(al);
buttonPanel.add(bcancel, "4,1");
JButton bok = new JButton("OK");
bok.addActionListener(al);
buttonPanel.add(bok, "6,1");
mDialog.getRootPane().setDefaultButton(bok);
return buttonPanel;
}
Aggregations