Search in sources :

Example 1 with TableLayout

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;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JButton(javax.swing.JButton) TableLayout(info.clearthought.layout.TableLayout)

Example 2 with TableLayout

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;
}
Also used : TableLayout(info.clearthought.layout.TableLayout)

Example 3 with TableLayout

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);
}
Also used : TableLayout(info.clearthought.layout.TableLayout)

Example 4 with TableLayout

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;
}
Also used : ArrayList(java.util.ArrayList) TableLayout(info.clearthought.layout.TableLayout)

Example 5 with TableLayout

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;
}
Also used : DEFrame(com.actelion.research.datawarrior.DEFrame) GenericTaskRunMacro(com.actelion.research.datawarrior.task.macro.GenericTaskRunMacro) ActionListener(java.awt.event.ActionListener) Properties(java.util.Properties) DataWarrior(com.actelion.research.datawarrior.DataWarrior) HiDPIHelper(com.actelion.research.gui.hidpi.HiDPIHelper) TableLayout(info.clearthought.layout.TableLayout) CompoundTableModel(com.actelion.research.table.model.CompoundTableModel) java.awt(java.awt) List(java.util.List) ProgressController(com.actelion.research.calc.ProgressController) java.io(java.io) TreeMap(java.util.TreeMap) JProgressDialog(com.actelion.research.gui.JProgressDialog) FXHelpFrame(com.actelion.research.datawarrior.help.FXHelpFrame) javax.swing(javax.swing) ActionListener(java.awt.event.ActionListener) TableLayout(info.clearthought.layout.TableLayout)

Aggregations

TableLayout (info.clearthought.layout.TableLayout)261 JPanel (javax.swing.JPanel)84 JLabel (javax.swing.JLabel)56 JComboBox (javax.swing.JComboBox)17 JScrollPane (javax.swing.JScrollPane)16 BorderLayout (java.awt.BorderLayout)14 BoxLayout (javax.swing.BoxLayout)14 JTextField (javax.swing.JTextField)14 Dimension (java.awt.Dimension)12 ActionEvent (java.awt.event.ActionEvent)9 ArrayList (java.util.ArrayList)9 JButton (javax.swing.JButton)9 JFilePathLabel (com.actelion.research.datawarrior.task.file.JFilePathLabel)8 KeyEvent (java.awt.event.KeyEvent)8 JComponent (javax.swing.JComponent)8 ClipboardHandler (com.actelion.research.gui.clipboard.ClipboardHandler)7 KeyAdapter (java.awt.event.KeyAdapter)7 Entry (java.util.Map.Entry)7 Point (java.awt.Point)6 JCheckBox (javax.swing.JCheckBox)6