sky.monome.frame
Class AbstractInertiaFrameWindow<T extends Frame,F extends AbstractInertiaFrameWindow<T,F>>

java.lang.Object
  extended by sky.monome.frame.AbstractWindow<T,F>
      extended by sky.monome.frame.AbstractInertiaFrameWindow<T,F>
Type Parameters:
T - Type of viewed frame.
F - Type of frame window that extends this abstract frame window.
All Implemented Interfaces:
DynamicFrame<F>, Frame
Direct Known Subclasses:
InertiaBoundedFrameWindow, InertiaFrameWindow, InertiaMirroredFrameWindow

public abstract class AbstractInertiaFrameWindow<T extends Frame,F extends AbstractInertiaFrameWindow<T,F>>
extends AbstractWindow<T,F>

Window that makes a movable view over a frame with an inertia translation offset. This class is the based class for all windows with an inertia translation offset.

Author:
PJ Skyman

Nested Class Summary
 
Nested classes/interfaces inherited from class sky.monome.frame.AbstractWindow
AbstractWindow.WindowType
 
Field Summary
protected  int intX
          Truncated value of the offset on the X-axis.
protected  int intY
          Truncated value of the offset on the Y-axis.
protected static long LOOP_TIME
          Standard loop time for internal refreshing of the offset.
protected  long loopTime
          Loop time for internal refreshing of the offset.
protected  float x
          Real value of the offset on the X-axis.
protected  float xIncrement
          Value of the increment on the X-axis.
protected  float y
          Real value of the offset on the Y-axis.
protected  float yIncrement
          Value of the increment on the Y-axis.
 
Fields inherited from class sky.monome.frame.AbstractWindow
eventListenerList, frame, windowContainer
 
Constructor Summary
AbstractInertiaFrameWindow(T frame)
          Constructs an abstract inertia frame window with the specified frame.
 
Method Summary
protected  void applyXIncrement()
          Apply the increment on the X-axis.
protected  void applyYIncrement()
          Apply the increment on the Y-axis.
 long getLoopTime()
          Returns the loop time for internal refreshing of the offset, in milliseconds.
 void setLoopTime(long loopTime)
          Modified the loop time for internal refreshing of the offset, in milliseconds.
 void setXIncrement(float xIncrement)
          Modifies the increment on the X-axis.
 void setYIncrement(float yIncrement)
          Modifies the increment on the Y-axis.
 
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
 
Methods inherited from interface sky.monome.frame.Frame
get
 

Field Detail

x

protected float x
Real value of the offset on the X-axis.


y

protected float y
Real value of the offset on the Y-axis.


intX

protected int intX
Truncated value of the offset on the X-axis.


intY

protected int intY
Truncated value of the offset on the Y-axis.


xIncrement

protected float xIncrement
Value of the increment on the X-axis.


yIncrement

protected float yIncrement
Value of the increment on the Y-axis.


loopTime

protected long loopTime
Loop time for internal refreshing of the offset.

Since:
SkyMonome v1.3

LOOP_TIME

protected static final long LOOP_TIME
Standard loop time for internal refreshing of the offset. Since SkyMonome v1.3, this value is used by default, but the user can change it by calling setLoopTime(long) method.

See Also:
Constant Field Values
Constructor Detail

AbstractInertiaFrameWindow

public AbstractInertiaFrameWindow(T frame)
Constructs an abstract inertia frame window with the specified frame.

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

getLoopTime

public long getLoopTime()
Returns the loop time for internal refreshing of the offset, in milliseconds.

Returns:
The loop time for internal refreshing of the offset, in milliseconds.
Since:
SkyMonome v1.3

setLoopTime

public void setLoopTime(long loopTime)
Modified the loop time for internal refreshing of the offset, in milliseconds. The new value takes effect only at next loop cycle. However, with low values (around 25 milliseconds), you can consider that takes effect immediately. Warning ! A value of 0L (zero) may cause erratic behaviors !

Parameters:
loopTime - New loop time for internal refreshing of the offset, in milliseconds.
Since:
SkyMonome v1.3

setXIncrement

public void setXIncrement(float xIncrement)
Modifies the increment on the X-axis.

Parameters:
xIncrement - New increment to store.

setYIncrement

public void setYIncrement(float yIncrement)
Modifies the increment on the Y-axis.

Parameters:
yIncrement - New increment to store.

applyXIncrement

protected void applyXIncrement()
Apply the increment on the X-axis.

Since:
SkyMonome v1.3

applyYIncrement

protected void applyYIncrement()
Apply the increment on the Y-axis.

Since:
SkyMonome v1.3