Search in sources :

Example 1 with ColorMenuButton

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

the class PrefsTables method makeRightSide.

private Component makeRightSide() {
    Box right = Box.createVerticalBox();
    // right.add(makeCheckBoxLine("Close Tables Without Save", "", "", "If checked, tables will be disposed upon closing without asking you to save"));
    right.add(makeCheckBoxLine("Show Button Bar", "table.showButtonBar", "If checked, a tool bar is visible"));
    right.add(makeCheckBoxLine("Alternating Background", "table.stripedBackground", "If checked, a tool bar is visible"));
    // right.add(makeCheckBoxLine("Remember Column Names",  "", "If checked, a tool bar is visible"));
    // right.add(makeCheckBoxLine("Show as Heat Maps", "table.heatMaps", "If checked, all numerical columns in your table will be color coded based on normalized intensity"));
    right.add(makeLabeledField("Number Format String", "floatingPointColumnFormat", "%.2f", "The digit specifies the number of decimal places; use e for scientific notation, or f for floating point"));
    Box colorline = Box.createHorizontalBox();
    fGridLineColor = new ColorMenuButton();
    fGridLineColor.setText("Color");
    fGridLineColor.setToolTipText("Set the line color distinguishing cells in the table");
    components.put("table.gridlineColor", fGridLineColor);
    colorline.add(new HBox(Box.createRigidArea(new Dimension(12, 15)), new BoxComponent("Grid Color", fGridLineColor)));
    // 
    fGridFillColor = new ColorMenuButton();
    fGridFillColor.setText("Color");
    fGridFillColor.setToolTipText("Set the background color for alternate rows in the grid");
    components.put("table.gridFillColor", fGridLineColor);
    HBox colorline2 = new HBox(Box.createRigidArea(new Dimension(12, 15)), new BoxComponent("Fill Color:", fGridFillColor), Box.createHorizontalGlue());
    right.add(new VBox(true, colorline, colorline2));
    right.add(Box.createVerticalGlue());
    return right;
}
Also used : ColorMenuButton(org.cytoscape.internal.prefs.lib.ColorMenuButton) HBox(org.cytoscape.internal.prefs.lib.HBox) BoxComponent(org.cytoscape.internal.prefs.lib.BoxComponent) HBox(org.cytoscape.internal.prefs.lib.HBox) Box(javax.swing.Box) VBox(org.cytoscape.internal.prefs.lib.VBox) JCheckBox(javax.swing.JCheckBox) Dimension(java.awt.Dimension) VBox(org.cytoscape.internal.prefs.lib.VBox)

Example 2 with ColorMenuButton

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

the class PrefsText method initTextSettingsPanel.

private AntiAliasedPanel initTextSettingsPanel() {
    if (fTextSettingsPanel == null) {
        VBox settingsPanel = new VBox("Text Settings", true, true);
        AntiAliasedPanel.setSizes(settingsPanel, new Dimension(310, 220));
        fCbTextFont = new JComboBox<String>();
        fCbTextFont.setMaximumRowCount(32);
        AntiAliasedPanel.setSizes(fCbTextFont, new Dimension(230, 27));
        fCbTextFont.addItem(kDefaultFont);
        if (sFontFamilies == null)
            initFonts();
        for (String familyName : sFontFamilies) fCbTextFont.addItem(familyName);
        fCbTextFont.addActionListener(new ActionListener() {

            public void actionPerformed(ActionEvent e) {
                textSettingChanged();
            }
        });
        // settingsPanel.addLeading();
        fCbTextSize = new JComboBox<String>(new String[] { "8", "9", "10", "11", "12", "14", "18", "24" });
        fCbTextSize.setSelectedIndex(4);
        fCbTextSize.addActionListener(act);
        fCbTextSize.setMaximumSize(new Dimension(72, 27));
        fBtnTextColor = new ColorMenuButton();
        fBtnTextColor.setText("Color");
        fBtnTextColor.setColor(Color.black);
        fBtnTextColor.addActionListener(act);
        fLblTextColor = new JLabel("Color:");
        fCbTextStyle = new JComboBox<String>(kStringListTypeStyles);
        AntiAliasedPanel.setSizes(fCbTextStyle, new Dimension(136, 27));
        fCbTextStyle.addActionListener(act);
        fLblTextStyle = new JLabel("Style:");
        VBox sub = new VBox(false, true);
        sub.setBorder(BorderFactory.createEmptyBorder(0, 6, 0, 6));
        sub.add(new HBox(new JLabel("Font:"), fCbTextFont));
        fCbTextFont.setToolTipText("The family of font, such as Monospaced or SansSerif. to use.");
        sub.add(new HBox(new JLabel("Size:"), fCbTextSize));
        fCbTextSize.setToolTipText("The number of points measuring the height of characters.");
        sub.add(new HBox(fLblTextColor, fBtnTextColor));
        fBtnTextColor.setToolTipText("The color used to draw the text");
        sub.add(new HBox(fLblTextStyle, fCbTextStyle));
        fCbTextStyle.setToolTipText("The font style, such as bold or italic");
        sub.add(Box.createVerticalGlue());
        settingsPanel.add(sub);
        fTextSettingsPanel = settingsPanel;
    }
    return fTextSettingsPanel;
}
Also used : ColorMenuButton(org.cytoscape.internal.prefs.lib.ColorMenuButton) HBox(org.cytoscape.internal.prefs.lib.HBox) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) VBox(org.cytoscape.internal.prefs.lib.VBox)

Aggregations

Dimension (java.awt.Dimension)2 ColorMenuButton (org.cytoscape.internal.prefs.lib.ColorMenuButton)2 HBox (org.cytoscape.internal.prefs.lib.HBox)2 VBox (org.cytoscape.internal.prefs.lib.VBox)2 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 Box (javax.swing.Box)1 JCheckBox (javax.swing.JCheckBox)1 JLabel (javax.swing.JLabel)1 BoxComponent (org.cytoscape.internal.prefs.lib.BoxComponent)1