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 Details

    • showDialog

      Color showDialog(Component parent, String title, Palette initialPalette, Color initialColor, int colorCount)
      Display the chooser and return the Color the user chooses--in case no color is selected or the action is cancelled, the return will be null.
      Parameters:
      parent - the component that the dialog should use to center on
      title - the dialog title
      initialPalette - a palette to use as the initial selected palette
      initialColor - the initial selected color
      colorCount - 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

      Palette showDialog(Component parent, String title, Palette initialPalette, int colorCount)
      Display the chooser and return the Palette the user chooses--in case no palette is selected or the action is cancelled, the return will be null.
      Parameters:
      parent - the component that the dialog should use to center on
      title - the dialog title
      initialPalette - a palette to use as the initial selected palette
      colorCount - 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 the Color the user selected.
      Returns:
      the Color the user selects or null if no color is selected
    • getSelectedPalette

      Palette getSelectedPalette()
      Return the Palette the user selected.
      Returns:
      the Palette the user selects or null if no palette is selected