sky.monome
Class PageSwitcher


java.lang.Object

  extended by sky.monome.Component

      extended by sky.monome.Container

          extended by sky.monome.AbstractGroup<Page>

              extended by sky.monome.AbstractPageSwitcher

                  extended by sky.monome.PageSwitcher


public class PageSwitcher
extends AbstractPageSwitcher

Page switcher that is capable to show no page if you want.

Author:
PJ Skyman

Field Summary
 
Fields inherited from class sky.monome.AbstractPageSwitcher
activePage
 
Fields inherited from class sky.monome.AbstractGroup
components
 
Fields inherited from class sky.monome.Container
height, width
 
Fields inherited from class sky.monome.Component
container, eventListenerList, lockObject, name, x, y
 
Constructor Summary
PageSwitcher(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.
PageSwitcher(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.
 
Methods inherited from class sky.monome.AbstractPageSwitcher
addPage, getActivePage, getPages, notify, writeOn
 
Methods inherited from class sky.monome.AbstractGroup
canHaveParentContainer, getAbsoluteX, getAbsoluteY, getBounds, getMonome, isVisible
 
Methods inherited from class sky.monome.Container
getHeight, getWidth
 
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
 

Constructor Detail

PageSwitcher


@Deprecated

public PageSwitcher(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.

PageSwitcher


public PageSwitcher(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
Method Detail

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.