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;
}
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);
}
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;
}
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;
}
Aggregations