sky.monome
Class StrictPageSwitcher
java.lang.Object
sky.monome.Component
sky.monome.Container
sky.monome.AbstractGroup<Page>
sky.monome.AbstractPageSwitcher
sky.monome.StrictPageSwitcher
public class StrictPageSwitcher
- extends AbstractPageSwitcher
Page switcher that needs to show permanently a page, even at the beginning (the first page need to be added immediately after creation
of this strict page switcher.
- Author:
- PJ Skyman
Constructor Summary |
StrictPageSwitcher(java.lang.String name,
Container container,
int x,
int y,
int width,
int height)
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. |
StrictPageSwitcher(java.lang.String name,
int x,
int y,
int width,
int height)
Constructs a page switcher with the specified name, specified coordinates and dimensions. |
Method Summary |
void |
removePage(Page page)
Removes the specified page from the list of contained pages. |
void |
showPage(Page page)
Shows the specified page, if this page is actually contained by this page switcher. |
java.lang.String |
toString()
Returns a string representation of this page switcher. |
void |
writeOn(Frame frame)
Writes this page switcher on the specified frame in order to refresh the Monome device. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
StrictPageSwitcher
@Deprecated
public StrictPageSwitcher(java.lang.String name,
Container container,
int x,
int y,
int width,
int height)
- 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.
- Constructs a page switcher with the specified name, specified coordinates and dimensions, and contained by the specified container.
- Parameters:
name
- Name of this page switcher.container
- Container that contains this page switcher.x
- X-coordinate of this page switcher in the local context of its container.y
- Y-coordinate of this page switcher in the local context of its container.width
- Width of this page switcher.height
- Height of this page switcher.
StrictPageSwitcher
public StrictPageSwitcher(java.lang.String name,
int x,
int y,
int width,
int height)
- Constructs a page switcher with the specified name, specified coordinates and dimensions.
- Parameters:
name
- Name of this page switcher.x
- X-coordinate of this page switcher in the local context of its container.y
- Y-coordinate of this page switcher in the local context of its container.width
- Width of this page switcher.height
- Height of this page switcher.- Since:
- SkyMonome v1.2
showPage
public void showPage(Page page)
throws MonomeException
- Shows the specified page, if this page is actually contained by this page switcher.
- Specified by:
showPage
in class AbstractPageSwitcher
- Parameters:
page
- Page to show. It will become the new active page.
- Throws:
MonomeException
- When the new active page can't be drawn.
removePage
public void removePage(Page page)
throws MonomeException
- Removes the specified page from the list of contained pages.
- Specified by:
removePage
in class AbstractPageSwitcher
- Parameters:
page
- Page to remove from the list of contained pages.
- Throws:
MonomeException
- When the active page is changed as a result of the call, and it can't be drawn.
toString
public java.lang.String toString()
- Returns a string representation of this page switcher.
- Specified by:
toString
in class Component
- Returns:
- A string representation of this page switcher.
writeOn
public void writeOn(Frame frame)
throws MonomeException
- Writes this page switcher on the specified frame in order to refresh the Monome device.
Once this frame is completed, it is sent to the Monome device.
- Overrides:
writeOn
in class AbstractPageSwitcher
- Parameters:
frame
- Frame in which this page switcher must write its led state.
- Throws:
MonomeException
- When this page switcher contains no page,
or when a problem has occured while getting the led state of a component inside this page switcher.- See Also:
Monome.refresh()