|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.gui.Component
com.threerings.opengl.gui.ColorPicker
public class ColorPicker
Allows the selection of a single color from a set of swatches.
| Field Summary | |
|---|---|
protected Color4f[] |
_colorizedRoots
The colorized roots corresponding to each record. |
protected ColorPository.ColorRecord[] |
_colors
The colors available for selection. |
protected int |
_sidx
The currently selected index. |
protected int |
_swatchHeight
The dimensions of the swatches. |
protected int |
_swatchWidth
The dimensions of the swatches. |
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
_alpha, _backgrounds, _borders, _ctx, _cursor, _enabled, _height, _hover, _hoverable, _insets, _listeners, _parent, _preferredSize, _properties, _rect, _styleConfigs, _tipmouse, _tiptext, _tooltipStyle, _transferHandler, _valid, _visible, _width, _x, _y, DEFAULT, DISABLED, HOVER, STATE_COUNT, STATE_PCLASSES |
| Fields inherited from interface com.threerings.opengl.gui.Selectable |
|---|
SELECT |
| Constructor Summary | |
|---|---|
ColorPicker(GlContext ctx)
Creates an uninitialized color picker. |
|
ColorPicker(GlContext ctx,
String colorClass,
int swatchWidth,
int swatchHeight)
Creates a new color picker. |
|
| Method Summary | |
|---|---|
protected Dimension |
computePreferredSize(int whint,
int hhint)
Computes and returns a preferred size for this component. |
boolean |
dispatchEvent(Event event)
Instructs this component to process the supplied event. |
protected String |
getDefaultStyleConfig()
Returns the name of the default config to be used for all instances of this component. |
ColorPository.ColorRecord |
getSelected()
Get the selected item, if any. |
ColorPository.ColorRecord |
getSelectedColor()
Deprecated. |
int |
getSelectedIndex()
Get the index of the selected item, or -1. |
protected void |
renderComponent(Renderer renderer)
Renders any custom bits for this component. |
void |
setColorClass(String colorClass)
Sets the color class from which we select. |
void |
setColorClass(String colorClass,
boolean starters)
Sets the color class from which we select. |
void |
setSelected(ColorPository.ColorRecord color)
Set the selected item. |
void |
setSelectedColor(ColorPository.ColorRecord color)
Deprecated. |
void |
setSelectedIndex(int sidx)
Set the index of the selected item. |
void |
setSwatchSize(int swatchWidth,
int swatchHeight)
Sets the dimensions of the swatches. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected ColorPository.ColorRecord[] _colors
protected Color4f[] _colorizedRoots
protected int _swatchWidth
protected int _swatchHeight
protected int _sidx
| Constructor Detail |
|---|
public ColorPicker(GlContext ctx,
String colorClass,
int swatchWidth,
int swatchHeight)
colorClass - the color class from which we select.swatchWidth - the width of the swatches.swatchHeight - the height of the swatches.public ColorPicker(GlContext ctx)
| Method Detail |
|---|
public void setColorClass(String colorClass)
public void setColorClass(String colorClass,
boolean starters)
starters - if true, only allow the starter colors.
public void setSwatchSize(int swatchWidth,
int swatchHeight)
public ColorPository.ColorRecord getSelected()
Selectable
getSelected in interface Selectable<ColorPository.ColorRecord>public void setSelected(ColorPository.ColorRecord color)
Selectable
setSelected in interface Selectable<ColorPository.ColorRecord>@Deprecated public void setSelectedColor(ColorPository.ColorRecord color)
@Deprecated public ColorPository.ColorRecord getSelectedColor()
public void setSelectedIndex(int sidx)
Selectable
setSelectedIndex in interface Selectable<ColorPository.ColorRecord>public int getSelectedIndex()
Selectable
getSelectedIndex in interface Selectable<ColorPository.ColorRecord>public boolean dispatchEvent(Event event)
Componentsuper.dispatchEvent for events that they did not "consume".
dispatchEvent in class Componentprotected String getDefaultStyleConfig()
Component
getDefaultStyleConfig in class Component
protected Dimension computePreferredSize(int whint,
int hhint)
Component
computePreferredSize in class Componentprotected void renderComponent(Renderer renderer)
Component
renderComponent in class Component
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||