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
-
button
- The "other..." button in the palette.
-
colHash
- A hashtable with the default colors.
-
colors
- The default colors in an array.
-
COLS
- The number of columns for this color palette.
-
customColor
- Indicates whether the color is a custom color
or one of the default colors in the palette.
-
GAP
- The gap between the color fields.
-
pickerDialog
- The dialog that pops up when the "other..." button is clicked.
-
ROWS
- The number of rows for this color palette.
-
selected
- The index of the currently selected color.
-
SIZE
- The size of a color field.
-
target
- The color button that uses this color palette.
-
value
- The initial value of the color palette.
-
ColorPaletteWidget(ColorButtonWidget)
- Constructor, which takes the colorbutton this widget
belongs to and pops up the palette immediatly.
-
createPicker()
- Creates the colorpicker presentation that
is being shown in the colorpicker dialog.
-
findTarget(Event)
- Find the target based on the given event,
returns -1 if no target is found.
-
handleEvent(Event)
- Handle Events.
-
lookup(Color)
- Lookup a color in the color table, returns
the index of the given color.
-
paint(Graphics)
- Paint the colors.
-
paintColorField(Graphics, Color, int, int, boolean)
- Paint a 3D style colorfield at the given position
selected or unselected.
ROWS
protected final static int ROWS
- The number of rows for this color palette.
COLS
protected final static int COLS
- The number of columns for this color palette.
SIZE
protected final static int SIZE
- The size of a color field.
GAP
protected final static int GAP
- The gap between the color fields.
value
public Color value
- The initial value of the color palette.
selected
public int selected
- The index of the currently selected color.
target
public ColorButtonWidget target
- The color button that uses this color palette.
customColor
public boolean customColor
- Indicates whether the color is a custom color
or one of the default colors in the palette.
colHash
public static Hashtable colHash
- A hashtable with the default colors.
colors
public static Color colors[]
- The default colors in an array.
button
protected CommandButtonWidget button
- The "other..." button in the palette.
pickerDialog
protected WidgetDialog pickerDialog
- The dialog that pops up when the "other..." button is clicked.
ColorPaletteWidget
public ColorPaletteWidget(ColorButtonWidget target)
- Constructor, which takes the colorbutton this widget
belongs to and pops up the palette immediatly.
lookup
protected static int lookup(Color col)
- Lookup a color in the color table, returns
the index of the given color.
paint
public void paint(Graphics g)
- Paint the colors.
- Overrides:
- paint in class Widget
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.
findTarget
protected int findTarget(Event evt)
- Find the target based on the given event,
returns -1 if no target is found.
createPicker
protected Presentation createPicker()
- Creates the colorpicker presentation that
is being shown in the colorpicker dialog.
handleEvent
public boolean handleEvent(Event evt)
- Handle Events.
- Overrides:
- handleEvent in class Widget
All Packages Class Hierarchy This Package Previous Next Index