Documentation of 'net.java.dev.colorchooser.Palette' Java class
Palette
net.java.dev.colorchooser

Class Palette



  • public abstract class Palette
    extends java.lang.Object
    Model for a palette that can be painted, and from which colors may be selected. An array of palettes to use may be supplied to a ColorChooser via the setPalettes method.
    • Constructor Summary

      Constructors 
      Constructor and Description
      Palette() 
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      static Palette createContinuousPalette(java.lang.String name, java.awt.Dimension size, float saturation) 
      static Palette createPredefinedPalette(java.lang.String name, java.awt.Color[] colors, java.lang.String[] names) 
      abstract java.awt.Color getColorAt(int x, int y)
      Returns the color at the specified point, or null if the point is beyond the bounds of the palette or in an area that does not indicate a color
      static Palette[] getDefaultPalettes(boolean continuousFirst)
      Get the default set of 8 palettes used by the color chooser.
      abstract java.lang.String getDisplayName() 
      abstract java.lang.String getNameAt(int x, int y)
      Returns a string description of the color at the point.
      abstract java.awt.Dimension getSize()
      Get the on-screen size of this palette
      abstract void paintTo(java.awt.Graphics g)
      Paint this palette to a graphics context.
      abstract void setSize(int w, int h)
      Get a localized name for this palette or null if a display name is not warranted
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Palette

        public Palette()
    • Method Detail

      • getColorAt

        public abstract java.awt.Color getColorAt(int x,
                                                  int y)
        Returns the color at the specified point, or null if the point is beyond the bounds of the palette or in an area that does not indicate a color
        Parameters:
        x - - an horizontal coordinate in the coordinate space of the palette
        y - - a vertical coordinate in the coordinate space of the palette
        Returns:
        - a color or null
      • getNameAt

        public abstract java.lang.String getNameAt(int x,
                                                   int y)
        Returns a string description of the color at the point. May be a name or a set of RGB values, but should not be longer than 30 characters. Returns null if the position is outside the bounds of the palette or has no description associated with it. Generally getNameAt() should return null from the same coordinates that getColorAt() would.
        Parameters:
        x - an horizontal coordinate in the coordinate space of the palette
        y - a vertical coordinate in the coordinate space of the palette
        Returns:
        a string describing the color at this coordinate or null
        See Also:
        getColorAt(int, int)
      • paintTo

        public abstract void paintTo(java.awt.Graphics g)
        Paint this palette to a graphics context.
        Parameters:
        g - - a graphics context to paint into
      • getSize

        public abstract java.awt.Dimension getSize()
        Get the on-screen size of this palette
        Returns:
        the size of this palette - corresponding to the screen space required to display it and defining the coordinate space of this palette.
      • setSize

        public abstract void setSize(int w,
                                     int h)
        Get a localized name for this palette or null if a display name is not warranted
      • getDisplayName

        public abstract java.lang.String getDisplayName()
      • getDefaultPalettes

        public static final Palette[] getDefaultPalettes(boolean continuousFirst)
        Get the default set of 8 palettes used by the color chooser. If continuousFirst is true, the first four will be continuous palettes and the second four swatches with named colors, system colors, etc.
      • createContinuousPalette

        public static final Palette createContinuousPalette(java.lang.String name,
                                                            java.awt.Dimension size,
                                                            float saturation)
      • createPredefinedPalette

        public static final Palette createPredefinedPalette(java.lang.String name,
                                                            java.awt.Color[] colors,
                                                            java.lang.String[] names)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.