Package org.cytoscape.util.swing
Interface CyColorPaletteChooser
public interface CyColorPaletteChooser
This defines a color chooser that allows users to choose colors from a
palette and (optionally) change palettes.
Module: swing-util-api
To use this in your app, include the following dependency in your POM:
<dependency> <groupId>org.cytoscape</groupId> <artifactId>swing-util-api</artifactId> </dependency>
-
Method Summary
Modifier and TypeMethodDescriptionReturn theColor
the user selected.Return thePalette
the user selected.showDialog
(Component parent, String title, Palette initialPalette, int colorCount) Display the chooser and return thePalette
the user chooses--in case no palette is selected or the action is cancelled, the return will benull
.showDialog
(Component parent, String title, Palette initialPalette, Color initialColor, int colorCount) Display the chooser and return theColor
the user chooses--in case no color is selected or the action is cancelled, the return will benull
.
-
Method Details
-
showDialog
Color showDialog(Component parent, String title, Palette initialPalette, Color initialColor, int colorCount) Display the chooser and return theColor
the user chooses--in case no color is selected or the action is cancelled, the return will benull
.- Parameters:
parent
- the component that the dialog should use to center ontitle
- the dialog titleinitialPalette
- a palette to use as the initial selected paletteinitialColor
- the initial selected colorcolorCount
- the number of colors to display for each palette- Returns:
- the Color the user selects or
null
if none is selected or the dialog is cancelled
-
showDialog
Display the chooser and return thePalette
the user chooses--in case no palette is selected or the action is cancelled, the return will benull
.- Parameters:
parent
- the component that the dialog should use to center ontitle
- the dialog titleinitialPalette
- a palette to use as the initial selected palettecolorCount
- the number of colors to display for each palette- Returns:
- the Palette the user selects or
null
if none is selected or the dialog is cancelled
-
getSelectedColor
Color getSelectedColor()Return theColor
the user selected.- Returns:
- the Color the user selects or
null
if no color is selected
-
getSelectedPalette
Palette getSelectedPalette()Return thePalette
the user selected.- Returns:
- the Palette the user selects or
null
if no palette is selected
-