Search in sources :

Example 11 with VBox

use of org.cytoscape.internal.prefs.lib.VBox 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)

Example 12 with VBox

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

the class PrefsColor method initUI.

@Override
public void initUI() {
    super.initUI();
    Box page = Box.createVerticalBox();
    page.add(Box.createRigidArea(new Dimension(20, 10)));
    String s = "The Brewer Colors are a set of color palettes that are appropriate for visualizations.\n" + "Sequential and Divergent palettes are used for continuous mapping functions. \n" + "Use a divergent palette when the range of values spans negative to positive numbers. \n" + "Qualitative palettes are suitable for discrete maps (i.e., for categorical data).";
    JTextArea text = new JTextArea(s);
    text.setOpaque(false);
    text.setFont(ital11);
    text.setMargin(new Insets(20, 30, 20, 10));
    page.add(text);
    VBox controlBox = new VBox("controls");
    controlBox.setBorder(doubleRaised);
    JRadioButton[] btns = new JRadioButton[3];
    for (int i = 0; i < 3; i++) {
        btns[i] = makeRadioButton(categories[i]);
        controlBox.add(new HBox(true, true, btns[i]));
    }
    btns[0].setSelected(true);
    controlBox.add(Box.createVerticalStrut(30));
    colorBlindSafeCheckBox = makeCheckBox("Color blind safe");
    controlBox.add(new HBox(true, true, colorBlindSafeCheckBox));
    controlBox.add(Box.createVerticalStrut(30));
    controlBox.setPreferredSize(new Dimension(160, 270));
    controlBox.setMaximumSize(new Dimension(160, 270));
    controlBox.add(Box.createVerticalGlue());
    HBox combined = new HBox(true, false, Box.createHorizontalStrut(18), controlBox, Box.createHorizontalStrut(30), makeColorLine(), Box.createHorizontalStrut(30));
    combined.setSpacer(new Dimension(30, 30));
    page.add(combined);
    populate(paletteChoices.get("Sequential"));
    add(page);
}
Also used : HBox(org.cytoscape.internal.prefs.lib.HBox) JTextArea(javax.swing.JTextArea) Insets(java.awt.Insets) JRadioButton(javax.swing.JRadioButton) 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 13 with VBox

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

the class PrefsColor method makeColorLine.

VBox makeColorLine() {
    String name = "Color scheme: ";
    HBox line = new HBox();
    JLabel label = new JLabel(name);
    HBox justLabel = new HBox(true, true, Box.createRigidArea(new Dimension(32, 7)), label, schemeName);
    VBox box = new VBox(true, true, justLabel, line);
    box.setAlignmentX(CENTER_ALIGNMENT);
    box.setBorder(doubleRaised);
    box.setMaximumSize(new Dimension(420, 270));
    box.add(lineOfPalettes);
    box.add(lineOfPalettes2);
    box.add(Box.createRigidArea(new Dimension(8, 20)));
    box.add(Box.createVerticalGlue());
    return box;
}
Also used : HBox(org.cytoscape.internal.prefs.lib.HBox) JLabel(javax.swing.JLabel) Dimension(java.awt.Dimension) VBox(org.cytoscape.internal.prefs.lib.VBox)

Example 14 with VBox

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

the class PrefsColor method makeColorColumn.

VBox makeColorColumn(String description, Color[] colors, String selection) {
    VBox box = new VBox(false, false);
    int row = 0;
    for (Color color : colors) {
        ColorPane c = new ColorPane(row++, 0, color, null);
        c.setEnabled(false);
        c.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseClicked(MouseEvent e) {
                select(box, description);
            }
        });
        box.add(c);
    }
    box.setBorder(description.equals(selection) ? red4 : orange4);
    box.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseClicked(MouseEvent e) {
            select(box, description);
        }
    });
    allVisPalettes.put(description, box);
    return box;
}
Also used : MouseEvent(java.awt.event.MouseEvent) Color(java.awt.Color) MouseAdapter(java.awt.event.MouseAdapter) ColorPane(org.cytoscape.internal.prefs.lib.ColorPane) VBox(org.cytoscape.internal.prefs.lib.VBox)

Aggregations

VBox (org.cytoscape.internal.prefs.lib.VBox)14 HBox (org.cytoscape.internal.prefs.lib.HBox)11 JLabel (javax.swing.JLabel)8 Dimension (java.awt.Dimension)7 Box (javax.swing.Box)3 JCheckBox (javax.swing.JCheckBox)3 JScrollPane (javax.swing.JScrollPane)3 CheckList (org.cytoscape.internal.prefs.lib.CheckList)3 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 JButton (javax.swing.JButton)2 JRadioButton (javax.swing.JRadioButton)2 ColorMenuButton (org.cytoscape.internal.prefs.lib.ColorMenuButton)2 Color (java.awt.Color)1 Insets (java.awt.Insets)1 MouseAdapter (java.awt.event.MouseAdapter)1 MouseEvent (java.awt.event.MouseEvent)1 JEditorPane (javax.swing.JEditorPane)1 JTextArea (javax.swing.JTextArea)1 TableColumn (javax.swing.table.TableColumn)1