net.jinx.video
Class View2D

java.lang.Object
  extended by net.jinx.video.View2D
All Implemented Interfaces:
View
Direct Known Subclasses:
MessageView

public class View2D
extends java.lang.Object
implements View

View implementation that sets OpenGL into a two dimensional drawing mode.

API Stability: Stable.


Constructor Summary
View2D(Visible drawable)
          Same as View2D(drawable, -1d, 1d, -1d, 1d).
View2D(Visible drawable, double left, double right, double bottom, double top)
          Constructs a View2D.
 
Method Summary
 void deinit(Context opt)
          Deinitializes this View.
 double getBottom()
          Provides the bottom of the cliping pane.
 double getLeft()
          Provides the left of the cliping pane.
 double getRight()
          Provides the right of the cliping pane.
 double getTop()
          Provides the top of the cliping pane.
 Visible getVisible()
          Provides the Visible object that should be rendered in the viewport.
 void init(Context opt)
          Initializes this View.
 void view(Context options, java.awt.Rectangle viewport)
          Disables lighting, sets the projection matrix to an indentity matrix and sets the model view matrix via a call to GL.gluOrtho2D using the clipping values given in the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

View2D

public View2D(Visible drawable)
Same as View2D(drawable, -1d, 1d, -1d, 1d).

Parameters:
drawable - the Visible to use for this View. This may be null, indicating that the default Visible for the renderer should be used instead.

View2D

public View2D(Visible drawable,
              double left,
              double right,
              double bottom,
              double top)
Constructs a View2D.

Parameters:
left - the left edge of the clipping plane.
right - the right edge of the clipping plane.
bottom - the bottom edge of the clipping plane.
top - the top edge of the clipping plane.
drawable - the Visible to use for this View. This may be null, indicating that the default Visible for the renderer should be used instead.
Method Detail

getLeft

public double getLeft()
Provides the left of the cliping pane.

Returns:
the left as a double

getRight

public double getRight()
Provides the right of the cliping pane.

Returns:
the right as a double

getBottom

public double getBottom()
Provides the bottom of the cliping pane.

Returns:
the bottom as a double

getTop

public double getTop()
Provides the top of the cliping pane.

Returns:
the top as a double

init

public void init(Context opt)
Description copied from interface: View
Initializes this View. happen.

Specified by:
init in interface View
Parameters:
opt - the Context object providing data on how rendering should proceed.

deinit

public void deinit(Context opt)
Description copied from interface: View
Deinitializes this View.

Specified by:
deinit in interface View
Parameters:
opt - the Context object providing data on how rendering should proceed.

view

public void view(Context options,
                 java.awt.Rectangle viewport)
Disables lighting, sets the projection matrix to an indentity matrix and sets the model view matrix via a call to GL.gluOrtho2D using the clipping values given in the constructor.

Specified by:
view in interface View
Parameters:
options - the Context object containing rendering attributes to use.
viewport - the Rectangle describing the region of the window this view will be displayed in. Remember that the coordinates are from the lower left corner, not the upper left.

getVisible

public Visible getVisible()
Description copied from interface: View
Provides the Visible object that should be rendered in the viewport. If this is null, the default Visible for the SplitScreenRenderer will be used instead.

Specified by:
getVisible in interface View
Returns:
the Visible to draw.