|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sky.monome.Component sky.monome.LedButtonCouple
public class LedButtonCouple
Couple of a led and a button on the Monome device.
Nested Class Summary | |
---|---|
static class |
LedButtonCouple.ButtonState
Button state. |
static class |
LedButtonCouple.LedState
Led state. |
Field Summary | |
---|---|
protected Behavior |
behavior
Behavior of this led. |
protected LedButtonCouple.ButtonState |
buttonState
State of this button. |
protected LedButtonCouple.LedState |
ledState
State of this led. |
protected LedStateModificationLayer |
ledStateModificationLayer
Modification layer for the led state of this led. |
Fields inherited from class sky.monome.Component |
---|
container, eventListenerList, lockObject, name, x, y |
Constructor Summary | |
---|---|
LedButtonCouple(java.lang.String name,
Container container,
int x,
int y)
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor. |
|
LedButtonCouple(java.lang.String name,
Container container,
int x,
int y,
Behavior behavior)
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor. |
|
LedButtonCouple(java.lang.String name,
Container container,
int x,
int y,
BehaviorFactory behaviorFactory)
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor. |
|
LedButtonCouple(java.lang.String name,
int x,
int y)
Constructs a led/button couple with the specified name and specified coordinates. |
|
LedButtonCouple(java.lang.String name,
int x,
int y,
Behavior behavior)
Constructs a led/button couple with the specified name, specified coordinates and the specified behavior. |
|
LedButtonCouple(java.lang.String name,
int x,
int y,
BehaviorFactory behaviorFactory)
Constructs a led/button couple with the specified name, specified coordinates and the specified behavior factory. |
Method Summary | |
---|---|
void |
addButtonListener(ButtonListener<LedButtonCouple> buttonListener)
Adds the specified listener to the listeners list of this button. |
boolean |
canHaveParentContainer()
Indicates whether this led/button couple can have a parent container in the Monome assembling tree. |
void |
doClick()
Programmatically does a click on this led/button couple. |
void |
fireButtonActionned(LedButtonCouple buttonManager,
ButtonEvent.ButtonAction buttonAction)
Notifies all the listeners that a new button action occured. |
int |
getAbsoluteX()
Returns the absolute X-coordinate of this led/button couple. |
int |
getAbsoluteY()
Returns the absolute Y-coordinate of this led/button couple. |
Behavior |
getBehavior()
Returns the behavior of this led. |
java.awt.Rectangle |
getBounds()
Returns the bounds of this led/button couple in the local context of its container. |
ButtonListener<LedButtonCouple>[] |
getButtonListeners()
Returns an array of all listeners contained in the listeners list of this button. |
LedButtonCouple.ButtonState |
getButtonState()
Returns the state of this button. |
LedButtonCouple.LedState |
getLedState()
Returns the state of this led. |
Monome |
getMonome()
Returns the logical Monome device that contains this led/button couple. |
void |
initLedState(boolean ledState)
Initializes the state of this led. |
boolean |
isVisible()
Indicates whether this led/button couple is actually visible. |
void |
notify(OSCMessageDigester messageDigester)
Notifies this led/button couple that a message comes from the Monome device. |
void |
removeButtonListener(ButtonListener<LedButtonCouple> buttonListener)
Removes the specified listener from the listeners list of this button. |
protected void |
setButtonState(LedButtonCouple.ButtonState buttonState)
Modifies the state of this button. |
void |
setLedState(LedButtonCouple.LedState ledState,
boolean mustRefresh)
Modifies the state of this led. |
java.lang.String |
toString()
Returns a string representation of this led/button couple. |
void |
writeOn(Frame frame)
Writes this led on the specified frame in order to refresh the Monome device. |
Methods inherited from class sky.monome.Component |
---|
getContainer, getLockObject, getName, getX, getY |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected LedButtonCouple.ButtonState buttonState
protected LedButtonCouple.LedState ledState
protected final Behavior behavior
protected LedStateModificationLayer ledStateModificationLayer
Constructor Detail |
---|
@Deprecated public LedButtonCouple(java.lang.String name, Container container, int x, int y) throws MonomeException
LightOnPush
behavior is used.
name
- Name of this led/button couple.container
- Container which contains this led/button couple.x
- X-coordinate of this led/button couple in the local context of its container.y
- Y-coordinate of this led/button couple in the local context of its container.
MonomeException
- When the led/button couple can't initialize itself.public LedButtonCouple(java.lang.String name, int x, int y) throws MonomeException
LightOnPush
behavior is used.
name
- Name of this led/button couple.x
- X-coordinate of this led/button couple in the local context of its container.y
- Y-coordinate of this led/button couple in the local context of its container.
MonomeException
- When the led/button couple can't initialize itself.@Deprecated public LedButtonCouple(java.lang.String name, Container container, int x, int y, Behavior behavior) throws MonomeException
name
- Name of this led/button couple.container
- Container which contains this led/button couple.x
- X-coordinate of this led/button couple in the local context of its container.y
- Y-coordinate of this led/button couple in the local context of its container.behavior
- Behavior of this led.
MonomeException
- When the led/button couple can't initialize itself.public LedButtonCouple(java.lang.String name, int x, int y, Behavior behavior) throws MonomeException
name
- Name of this led/button couple.x
- X-coordinate of this led/button couple in the local context of its container.y
- Y-coordinate of this led/button couple in the local context of its container.behavior
- Behavior of this led.
MonomeException
- When the led/button couple can't initialize itself.@Deprecated public LedButtonCouple(java.lang.String name, Container container, int x, int y, BehaviorFactory behaviorFactory) throws MonomeException
name
- Name of this led/button couple.container
- Container which contains this led/button couple.x
- X-coordinate of this led/button couple in the local context of its container.y
- Y-coordinate of this led/button couple in the local context of its container.behaviorFactory
- Factory for the behavior of this led.
MonomeException
- When the led/button couple can't initialize itself,
or when the behavior factory can't operate successfully.public LedButtonCouple(java.lang.String name, int x, int y, BehaviorFactory behaviorFactory) throws MonomeException
name
- Name of this led/button couple.x
- X-coordinate of this led/button couple in the local context of its container.y
- Y-coordinate of this led/button couple in the local context of its container.behaviorFactory
- Factory for the behavior of this led.
MonomeException
- When the led/button couple can't initialize itself,
or when the behavior factory can't operate successfully.Method Detail |
---|
public Monome getMonome()
getMonome
in class Component
public Behavior getBehavior()
public LedButtonCouple.LedState getLedState()
public void initLedState(boolean ledState)
ledState
- Initial state to give to this led.public void setLedState(LedButtonCouple.LedState ledState, boolean mustRefresh) throws MonomeException
ledState
- New state to give to this led, among LedState.ON
and LedState.OFF
.mustRefresh
- true
if the Monome device must be updated immediately, false
otherwise.
MonomeException
- When the Monome device can't be updated.public LedButtonCouple.ButtonState getButtonState()
protected void setButtonState(LedButtonCouple.ButtonState buttonState)
buttonState
- state New state of this button, among ButtonState.BUTTON_PUSHED
and ButtonState.BUTTON_RELEASED
.public void addButtonListener(ButtonListener<LedButtonCouple> buttonListener)
addButtonListener
in interface ButtonManager<LedButtonCouple>
buttonListener
- Listener to add to the listeners list of this button.public void removeButtonListener(ButtonListener<LedButtonCouple> buttonListener)
removeButtonListener
in interface ButtonManager<LedButtonCouple>
buttonListener
- Listener to remove from the listeners list of this button.public ButtonListener<LedButtonCouple>[] getButtonListeners()
getButtonListeners
in interface ButtonManager<LedButtonCouple>
public void fireButtonActionned(LedButtonCouple buttonManager, ButtonEvent.ButtonAction buttonAction)
fireButtonActionned
in interface ButtonManager<LedButtonCouple>
buttonManager
- Button manager that triggered the button event.buttonAction
- Button action performed on the specified button manager.public void notify(OSCMessageDigester messageDigester) throws MonomeException
notify
in class Component
messageDigester
- Message digester that prepares and encapsulates the message for an easy access of informations contained in the message.
MonomeException
- When a problem has occured when treating the message.
By example, a led/button couple can treat a message by lighting on the led, and lighting on a led is a potentially risked operation.public void doClick() throws MonomeException
MonomeException
- Only with a few behaviors, when a led state can't be modified, by example.public void writeOn(Frame frame)
writeOn
in class Component
frame
- Frame in which this led must write its led state.Monome.refresh()
public int getAbsoluteX()
getAbsoluteX
in class Component
public int getAbsoluteY()
getAbsoluteY
in class Component
public boolean isVisible()
isVisible
in class Component
true
if this led/button couple is actually visible, false
otherwise.public java.lang.String toString()
toString
in class Component
public boolean canHaveParentContainer()
canHaveParentContainer
in class Component
true
.public java.awt.Rectangle getBounds()
getBounds
in class Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |