Search in sources :

Example 1 with RangedIntegerTextField

use of org.cytoscape.internal.prefs.lib.RangedIntegerTextField in project cytoscape-impl by cytoscape.

the class AbstractPrefsPanel method makeNumberFieldShort.

// ---------------------------------
protected HBox makeNumberFieldShort(String prompt, int promptLen, String property, int value, int min, int max) {
    JLabel label = new JLabel(prompt);
    setSizes(label, promptLen, 25);
    // new JTextField(5);
    RangedIntegerTextField fld = new RangedIntegerTextField(0, 9999, new Dimension(80, 27));
    fld.setInt(value);
    setSizes(fld, 60, 30);
    fld.setFont(smallFont);
    fld.setHorizontalAlignment(SwingConstants.RIGHT);
    components.put(property, fld);
    HBox line = new HBox(false, true, label, fld);
    return line;
}
Also used : HBox(org.cytoscape.internal.prefs.lib.HBox) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) RangedIntegerTextField(org.cytoscape.internal.prefs.lib.RangedIntegerTextField)

Example 2 with RangedIntegerTextField

use of org.cytoscape.internal.prefs.lib.RangedIntegerTextField in project cytoscape-impl by cytoscape.

the class PrefsNetwork method makeProxyPanel.

private AntiAliasedPanel makeProxyPanel() {
    AntiAliasedPanel panel = new AntiAliasedPanel("Proxy Settings");
    panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
    setSizes(panel, new Dimension(580, 120));
    fHost = new JTextField(25);
    // new JTextField(5);
    fPort = new RangedIntegerTextField(0, 9999, new Dimension(80, 27));
    fUsername = new JTextField(15);
    fPassword = new JPasswordField(15);
    fType = new JComboBox<String>(proxyTypes);
    setSizes(fType, new Dimension(100, 27));
    components.put("proxy.host", fHost);
    components.put("proxy.port", fPort);
    components.put("proxy.username", fUsername);
    components.put("proxy.password", fPassword);
    components.put("proxy.server.type", fType);
    JLabel[] labels = new JLabel[5];
    Font labelFont = new Font(Font.SANS_SERIF, Font.PLAIN, 10);
    for (int i = 0; i < 5; i++) {
        labels[i] = new JLabel(strs[i]);
        setSizes(labels[i], new Dimension(67, 27));
        labels[i].setFont(labelFont);
        labels[i].setHorizontalAlignment(SwingConstants.RIGHT);
        labels[i].setOpaque(false);
    }
    Dimension SPACE = new Dimension(20, 20);
    HBox lin0 = new HBox(true, false, labels[4], fType, Box.createHorizontalGlue());
    HBox lin1 = new HBox(true, true, Box.createRigidArea(SPACE), labels[0], fHost, labels[1], fPort);
    HBox lin2 = new HBox(true, true, labels[2], fUsername, labels[3], fPassword);
    panel.add(new HBox(lin0));
    panel.add(new HBox(lin1));
    panel.add(new HBox(lin2));
    return panel;
}
Also used : HBox(org.cytoscape.internal.prefs.lib.HBox) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField) Font(java.awt.Font) RangedIntegerTextField(org.cytoscape.internal.prefs.lib.RangedIntegerTextField) JPasswordField(javax.swing.JPasswordField) AntiAliasedPanel(org.cytoscape.internal.prefs.lib.AntiAliasedPanel)

Example 3 with RangedIntegerTextField

use of org.cytoscape.internal.prefs.lib.RangedIntegerTextField in project cytoscape-impl by cytoscape.

the class PrefsSecurity method makeRepositoryPanel.

AntiAliasedPanel makeRepositoryPanel() {
    AntiAliasedPanel panel = new AntiAliasedPanel("Proxy Settings");
    setSizes(panel, new Dimension(580, 120));
    fHost = new JTextField(25);
    // new JTextField(5);
    fPort = new RangedIntegerTextField(0, 9999, new Dimension(80, 27));
    fUsername = new JTextField(15);
    fPassword = new JPasswordField(15);
    components.put("proxy.host", fHost);
    components.put("proxy.port", fPort);
    components.put("proxy.username", fUsername);
    components.put("proxy.password", fPassword);
    JLabel[] labels = new JLabel[4];
    Font labelFont = new Font(Font.SANS_SERIF, Font.PLAIN, 10);
    for (int i = 0; i < 4; i++) {
        labels[i] = new JLabel(strs[i]);
        setSizes(labels[i], new Dimension(67, 27));
        labels[i].setFont(labelFont);
        labels[i].setHorizontalAlignment(SwingConstants.RIGHT);
        labels[i].setOpaque(false);
    }
    Dimension SPACE = new Dimension(20, 20);
    Box lin1 = Box.createHorizontalBox();
    Box lin2 = Box.createHorizontalBox();
    lin1.add(new HBox(true, true, Box.createRigidArea(SPACE), new BoxComponent(labels[0], fHost, new BoxComponent(labels[1], fPort))));
    lin2.add(new HBox(true, true, new BoxComponent(labels[2], fUsername, new BoxComponent(labels[3], fPassword))));
    panel.add(lin1);
    panel.add(lin2);
    return panel;
}
Also used : HBox(org.cytoscape.internal.prefs.lib.HBox) JPasswordField(javax.swing.JPasswordField) BoxComponent(org.cytoscape.internal.prefs.lib.BoxComponent) JLabel(javax.swing.JLabel) HBox(org.cytoscape.internal.prefs.lib.HBox) Box(javax.swing.Box) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField) Font(java.awt.Font) AntiAliasedPanel(org.cytoscape.internal.prefs.lib.AntiAliasedPanel) RangedIntegerTextField(org.cytoscape.internal.prefs.lib.RangedIntegerTextField)

Example 4 with RangedIntegerTextField

use of org.cytoscape.internal.prefs.lib.RangedIntegerTextField in project cytoscape-impl by cytoscape.

the class AbstractPrefsPanel method makeNumberField.

// ---------------------------------
protected Box makeNumberField(String prompt, String propname, int value, int min, int max) {
    Box line = Box.createHorizontalBox();
    JLabel label = new JLabel(prompt);
    line.add(label);
    setSizes(label, 180, 25);
    // JTextField fld = new JTextField("" + value);
    // new JTextField(5);
    RangedIntegerTextField fld = new RangedIntegerTextField(0, 9999, new Dimension(80, 27));
    fld.setInt(value);
    fld.setMaximumSize(new Dimension(80, 30));
    line.add(fld);
    fld.setHorizontalAlignment(SwingConstants.RIGHT);
    line.setMaximumSize(new Dimension(500, 25));
    components.put(propname, fld);
    return line;
}
Also used : JLabel(javax.swing.JLabel) HBox(org.cytoscape.internal.prefs.lib.HBox) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) JComboBox(javax.swing.JComboBox) Dimension(java.awt.Dimension) RangedIntegerTextField(org.cytoscape.internal.prefs.lib.RangedIntegerTextField)

Aggregations

Dimension (java.awt.Dimension)4 JLabel (javax.swing.JLabel)4 HBox (org.cytoscape.internal.prefs.lib.HBox)4 RangedIntegerTextField (org.cytoscape.internal.prefs.lib.RangedIntegerTextField)4 Font (java.awt.Font)2 Box (javax.swing.Box)2 JPasswordField (javax.swing.JPasswordField)2 JTextField (javax.swing.JTextField)2 AntiAliasedPanel (org.cytoscape.internal.prefs.lib.AntiAliasedPanel)2 BoxLayout (javax.swing.BoxLayout)1 JCheckBox (javax.swing.JCheckBox)1 JComboBox (javax.swing.JComboBox)1 BoxComponent (org.cytoscape.internal.prefs.lib.BoxComponent)1