public class LXSwatch extends LXComponent implements LXLoopTask, LXOscComponent, LXComponent.Renamable
| Modifier and Type | Class and Description |
|---|---|
static interface |
LXSwatch.Listener |
LXComponent.Placeholder, LXComponent.RenamableLXSerializable.Utils| Modifier and Type | Field and Description |
|---|---|
BooleanParameter |
autoCycleEligible |
List<LXDynamicColor> |
colors |
static int |
MAX_COLORS |
BooleanParameter |
recall |
controlSurfaceSemaphore, KEY_CLASS, KEY_COMPONENT_ID, KEY_ID, KEY_PARAMETER_PATH, KEY_PATH, label, lx, modulationColor| Modifier and Type | Method and Description |
|---|---|
LXDynamicColor |
addColor()
Adds a new dynamic color to the swatch
|
LXDynamicColor |
addColor(int index,
JsonObject colorObj) |
LXSwatch |
addListener(LXSwatch.Listener listener)
Registers a listener to the swatch
|
void |
dispose()
Invoked when a component is being removed from the system and will no longer be used at all.
|
LXDynamicColor |
getColor(int index)
Retrieves the color at a given index in the swatch.
|
int |
getIndex() |
String |
getPath()
Accessor for the path of this object.
|
void |
load(LX lx,
JsonObject obj)
Loads the LX component.
|
void |
loop(double deltaMs) |
void |
onParameterChanged(LXParameter p)
Subclasses are free to override this if desired.
|
LXDynamicColor |
removeColor()
Removes the last color from the swatch
|
LXDynamicColor |
removeColor(int index)
Removes the color at a specific index from the swatch
|
LXDynamicColor |
removeColor(LXDynamicColor color)
Removes a specific color from the swatch
|
LXSwatch |
removeListener(LXSwatch.Listener listener)
Unregisters a listener to the swatch
|
void |
save(LX lx,
JsonObject obj)
Serializes the LX component.
|
addArray, addChild, addInternalParameter, addParameter, addParameter, contains, copyParameters, getChild, getComponentName, getComponentName, getComponentName, getId, getLabel, getLX, getOscAddress, getOscLabel, getOscPath, getParameter, getParameters, getParent, handleOscMessage, loadParameters, removeParameter, removeParameter, saveParameters, setParent, toString, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetOscAddress, handleOscMessageget, get, getCanonicalLabel, getCanonicalLabel, getCanonicalPath, getCanonicalPath, getComponent, getComponent, getParameter, getParameterpublic static final int MAX_COLORS
public final List<LXDynamicColor> colors
public final BooleanParameter recall
public final BooleanParameter autoCycleEligible
public LXSwatch(LX lx)
public void onParameterChanged(LXParameter p)
LXComponentonParameterChanged in interface LXParameterListeneronParameterChanged in class LXComponentp - Parameter that has a value changepublic int getIndex()
public String getPath()
LXComponentgetPath in interface LXPathgetPath in class LXComponentpublic void loop(double deltaMs)
loop in interface LXLoopTaskpublic LXDynamicColor getColor(int index)
index - Indexpublic LXDynamicColor addColor()
public LXDynamicColor addColor(int index, JsonObject colorObj)
public LXDynamicColor removeColor()
public LXDynamicColor removeColor(LXDynamicColor color)
color - The color to removepublic LXDynamicColor removeColor(int index)
index - Index to removepublic LXSwatch addListener(LXSwatch.Listener listener)
listener - Swatch listenerpublic LXSwatch removeListener(LXSwatch.Listener listener)
listener - Swatch listenerpublic void save(LX lx, JsonObject obj)
LXComponentsuper.save(lx, obj)
at the appropriate time.save in interface LXSerializablesave in class LXComponentlx - LX instanceobj - Object to serialize intopublic void load(LX lx, JsonObject obj)
LXComponentload in interface LXSerializableload in class LXComponentlx - LX instanceobj - Object to deserializepublic void dispose()
LXComponentsuper.dispose() at the appropriate
time to perform the basic cleanup, which may need to happen either before or after cleaning
up other objects.dispose in class LXComponentLX library by Mark C. Slee. © 2012-2020