|
||||||||||
| 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 |
|---|
| Fields inherited from class com.threerings.opengl.gui.Component |
|---|
DEFAULT, DISABLED, HOVER |
| 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 | |
|---|---|
boolean |
dispatchEvent(Event event)
Instructs this component to process the supplied event. |
com.threerings.media.image.ColorPository.ColorRecord |
getSelected()
Get the selected item, if any. |
com.threerings.media.image.ColorPository.ColorRecord |
getSelectedColor()
Deprecated. |
int |
getSelectedIndex()
Get the index of the selected item, or -1. |
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(com.threerings.media.image.ColorPository.ColorRecord color)
Set the selected item. |
void |
setSelectedColor(com.threerings.media.image.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 |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 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 com.threerings.media.image.ColorPository.ColorRecord getSelected()
Selectable
getSelected in interface Selectable<com.threerings.media.image.ColorPository.ColorRecord>public void setSelected(com.threerings.media.image.ColorPository.ColorRecord color)
Selectable
setSelected in interface Selectable<com.threerings.media.image.ColorPository.ColorRecord>@Deprecated public void setSelectedColor(com.threerings.media.image.ColorPository.ColorRecord color)
@Deprecated public com.threerings.media.image.ColorPository.ColorRecord getSelectedColor()
public void setSelectedIndex(int sidx)
Selectable
setSelectedIndex in interface Selectable<com.threerings.media.image.ColorPository.ColorRecord>public int getSelectedIndex()
Selectable
getSelectedIndex in interface Selectable<com.threerings.media.image.ColorPository.ColorRecord>public boolean dispatchEvent(Event event)
Componentsuper.dispatchEvent for events that they did not "consume".
dispatchEvent in class Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||