Class marimba.gui.ColorPaletteWidget
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class marimba.gui.ColorPaletteWidget

java.lang.Object
   |
   +----marimba.gui.Widget
           |
           +----marimba.gui.ContainerWidget
                   |
                   +----marimba.gui.GroupWidget
                           |
                           +----marimba.gui.PopupWidget
                                   |
                                   +----marimba.gui.ColorPaletteWidget

public class ColorPaletteWidget
extends PopupWidget
A popup widget for choosing a color from a palette. It also displays a button at the bottom which, when clicked, shows a dialog with a color picker with which the color can be chosen.
Version:
1.6, 12/19/96
Author:
Klaas Waslander

Variable Index

 o button
The "other..." button in the palette.
 o colHash
A hashtable with the default colors.
 o colors
The default colors in an array.
 o COLS
The number of columns for this color palette.
 o customColor
Indicates whether the color is a custom color or one of the default colors in the palette.
 o GAP
The gap between the color fields.
 o pickerDialog
The dialog that pops up when the "other..." button is clicked.
 o ROWS
The number of rows for this color palette.
 o selected
The index of the currently selected color.
 o SIZE
The size of a color field.
 o target
The color button that uses this color palette.
 o value
The initial value of the color palette.

Constructor Index

 o ColorPaletteWidget(ColorButtonWidget)
Constructor, which takes the colorbutton this widget belongs to and pops up the palette immediatly.

Method Index

 o createPicker()
Creates the colorpicker presentation that is being shown in the colorpicker dialog.
 o findTarget(Event)
Find the target based on the given event, returns -1 if no target is found.
 o handleEvent(Event)
Handle Events.
 o lookup(Color)
Lookup a color in the color table, returns the index of the given color.
 o paint(Graphics)
Paint the colors.
 o paintColorField(Graphics, Color, int, int, boolean)
Paint a 3D style colorfield at the given position selected or unselected.

Variables

 o ROWS
  protected final static int ROWS
The number of rows for this color palette.
 o COLS
  protected final static int COLS
The number of columns for this color palette.
 o SIZE
  protected final static int SIZE
The size of a color field.
 o GAP
  protected final static int GAP
The gap between the color fields.
 o value
  public Color value
The initial value of the color palette.
 o selected
  public int selected
The index of the currently selected color.
 o target
  public ColorButtonWidget target
The color button that uses this color palette.
 o customColor
  public boolean customColor
Indicates whether the color is a custom color or one of the default colors in the palette.
 o colHash
  public static Hashtable colHash
A hashtable with the default colors.
 o colors
  public static Color colors[]
The default colors in an array.
 o button
  protected CommandButtonWidget button
The "other..." button in the palette.
 o pickerDialog
  protected WidgetDialog pickerDialog
The dialog that pops up when the "other..." button is clicked.

Constructors

 o ColorPaletteWidget
  public ColorPaletteWidget(ColorButtonWidget target)
Constructor, which takes the colorbutton this widget belongs to and pops up the palette immediatly.

Methods

 o lookup
  protected static int lookup(Color col)
Lookup a color in the color table, returns the index of the given color.
 o paint
  public void paint(Graphics g)
Paint the colors.
Overrides:
paint in class Widget
 o paintColorField
  protected void paintColorField(Graphics g,
                                 Color col,
                                 int x,
                                 int y,
                                 boolean selected)
Paint a 3D style colorfield at the given position selected or unselected.
 o findTarget
  protected int findTarget(Event evt)
Find the target based on the given event, returns -1 if no target is found.
 o createPicker
  protected Presentation createPicker()
Creates the colorpicker presentation that is being shown in the colorpicker dialog.
 o handleEvent
  public boolean handleEvent(Event evt)
Handle Events.
Overrides:
handleEvent in class Widget

All Packages  Class Hierarchy  This Package  Previous  Next  Index