sky.monome.frame
Class BoundedFrameWindow

java.lang.Object
  extended by sky.monome.frame.AbstractWindow<T,F>
      extended by sky.monome.frame.AbstractFrameWindow<SizedFrame,BoundedFrameWindow>
          extended by sky.monome.frame.BoundedFrameWindow
All Implemented Interfaces:
DynamicFrame<BoundedFrameWindow>, Frame

public class BoundedFrameWindow
extends AbstractFrameWindow<SizedFrame,BoundedFrameWindow>

Window that makes a movable view over a frame with a static translation offset that cannot exceed frame bounds. The bounding effect needs an instance of SizedFrame instead of Frame.

Since:
SkyMonome v1.3
Author:
PJ Skyman

Nested Class Summary
 
Nested classes/interfaces inherited from class sky.monome.frame.AbstractWindow
AbstractWindow.WindowType
 
Field Summary
 
Fields inherited from class sky.monome.frame.AbstractFrameWindow
xOffset, yOffset
 
Fields inherited from class sky.monome.frame.AbstractWindow
eventListenerList, frame, windowContainer
 
Constructor Summary
BoundedFrameWindow(SizedFrame sizedFrame)
          Constructs a bounded frame window with the specified sized frame.
 
Method Summary
 LedButtonCouple.LedState get(int x, int y)
          Returns the led state at specified coordinates.
 void move(int newX, int newY)
          Changes the translation over the frame.
 void translate(int xOffset, int yOffset)
          Makes a translation on the frame by the specified offset.
 
Methods inherited from class sky.monome.frame.AbstractWindow
addFrameListener, fireFrameChanged, getFrameListeners, getOnFrame, removeFrameListener, set, setOnFrame, setWindowContainer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BoundedFrameWindow

public BoundedFrameWindow(SizedFrame sizedFrame)
Constructs a bounded frame window with the specified sized frame.

Parameters:
sizedFrame - Sized frame over which this windows makes a view.
Method Detail

get

public LedButtonCouple.LedState get(int x,
                                    int y)
Returns the led state at specified coordinates.

Parameters:
x - X-coordinate of the led state needed.
y - Y-coordinate of the led state needed.
Returns:
The led state at specified coordinates.

move

public void move(int newX,
                 int newY)
Changes the translation over the frame.

Overrides:
move in class AbstractFrameWindow<SizedFrame,BoundedFrameWindow>
Parameters:
newX - New offset on the X-axis.
newY - New offset on the Y-axis.

translate

public void translate(int xOffset,
                      int yOffset)
Makes a translation on the frame by the specified offset.

Overrides:
translate in class AbstractFrameWindow<SizedFrame,BoundedFrameWindow>
Parameters:
xOffset - Offset on the X-axis to add to the current offset.
yOffset - Offset on the Y-axis to add to the current offset.