edu.umd.cs.piccolo
Class PCamera

java.lang.Object
  extended by edu.umd.cs.piccolo.PNode
      extended by edu.umd.cs.piccolo.PCamera
All Implemented Interfaces:
Printable, Serializable, Cloneable

public class PCamera
extends PNode

PCamera represents a viewport onto a list of layer nodes. Each camera maintains a view transform through which it views these layers. Translating and scaling this view transform is how zooming and panning are implemented.

Cameras are also the point through which all PInputEvents enter Piccolo. The canvas coordinate system, and the local coordinate system of the topmost camera should always be the same.

Version:
1.0
Author:
Jesse Grosjean
See Also:
PLayer, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class edu.umd.cs.piccolo.PNode
PNode.PSceneGraphDelegate
 
Field Summary
static int PROPERTY_CODE_LAYERS
          The property code that identifies a change in the set of this camera's layers (see getLayer, getLayerCount, getLayersReference).
static int PROPERTY_CODE_VIEW_TRANSFORM
          The property code that identifies a change in this camera's view transform (see getViewTransform, getViewTransformReference).
static String PROPERTY_LAYERS
          The property name that identifies a change in the set of this camera's layers (see getLayer, getLayerCount, getLayersReference).
static String PROPERTY_VIEW_TRANSFORM
          The property name that identifies a change in this camera's view transform (see getViewTransform, getViewTransformReference).
static int VIEW_CONSTRAINT_ALL
           
static int VIEW_CONSTRAINT_CENTER
           
static int VIEW_CONSTRAINT_NONE
          Denotes that the view has no constraints.
 
Fields inherited from class edu.umd.cs.piccolo.PNode
FILL_STRATEGY_ASPECT_COVER, FILL_STRATEGY_ASPECT_FIT, FILL_STRATEGY_EXACT_FIT, PROPERTY_BOUNDS, PROPERTY_CHILDREN, PROPERTY_CHILDREN_PICKABLE, PROPERTY_CLIENT_PROPERTIES, PROPERTY_CODE_BOUNDS, PROPERTY_CODE_CHILDREN, PROPERTY_CODE_CHILDREN_PICKABLE, PROPERTY_CODE_CLIENT_PROPERTIES, PROPERTY_CODE_FULL_BOUNDS, PROPERTY_CODE_PAINT, PROPERTY_CODE_PARENT, PROPERTY_CODE_PICKABLE, PROPERTY_CODE_TRANSFORM, PROPERTY_CODE_TRANSPARENCY, PROPERTY_CODE_VISIBLE, PROPERTY_FULL_BOUNDS, PROPERTY_PAINT, PROPERTY_PARENT, PROPERTY_PICKABLE, PROPERTY_TRANSFORM, PROPERTY_TRANSPARENCY, PROPERTY_VISIBLE, SCENE_GRAPH_DELEGATE
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
PCamera()
          Construct a new camera with no layers and a default white color.
 
Method Summary
 void addLayer(int index, PLayer layer)
          Add the layer at the given index in this camera's list of layers.
 void addLayer(PLayer layer)
          Add the layer to the end of this camera's list of layers.
 PTransformActivity animateViewToCenterBounds(Rectangle2D centerBounds, boolean shouldScaleToFit, long duration)
          Animate the camera's view from its current transform when the activity starts to a new transform that centers the given bounds in the camera layers coordinate system into the cameras view bounds.
 PTransformActivity animateViewToIncludeBounds(Rectangle2D includeBounds, long duration)
          Deprecated. Renamed to animateViewToPanToBounds
 PTransformActivity animateViewToPanToBounds(Rectangle2D panToBounds, long duration)
          Pan the camera's view from its current transform when the activity starts to a new transform so that the view bounds will contain (if possible, intersect if not possible) the new bounds in the camera layers coordinate system.
 PTransformActivity animateViewToTransform(AffineTransform destination, long duration)
          Animate the cameras view transform from its current value when the activity starts to the new destination transform value.
protected  void applyViewConstraints()
          Transforms the view so that it conforms to the given constraint.
 void fullPaint(PPaintContext paintContext)
          Override fullPaint to push the camera onto the paintContext so that it can be later be accessed by PPaintContext.getCamera().
 PComponent getComponent()
          Get the canvas associated with this camera.
 PLayer getLayer(int index)
          Returns the layer at the given index.
 int getLayerCount()
          Returns the number of layers attached to this camera.
 List getLayersReference()
          Return a reference to the list of layers managed by this camera.
 PBounds getUnionOfLayerFullBounds()
          Return the total bounds of all the layers that this camera looks at.
 PBounds getViewBounds()
          Return the bounds of this camera in the view coordinate system.
 int getViewConstraint()
          Returns the constraint being applied to the view.
 double getViewScale()
          Return the scale applied by the view transform to the layers viewed by this camera.
 PAffineTransform getViewTransform()
          Get a copy of the view transform that is applied to the camera's layers.
 PAffineTransform getViewTransformReference()
          Get a reference to the view transform that is applied to the camera's layers.
 int indexOfLayer(PLayer layer)
          Returns the index of the given layer or -1 it not found.
 Dimension2D localToView(Dimension2D localDimension)
          Convert the dimension from the camera's local coordinate system to the camera's view coordinate system.
 Point2D localToView(Point2D localPoint)
          Convert the point from the camera's local coordinate system to the camera's view coordinate system.
 Rectangle2D localToView(Rectangle2D localRectangle)
          Convert the rectangle from the camera's local coordinate system to the camera's view coordinate system.
protected  void paint(PPaintContext paintContext)
          Paint this camera (default background color is white) and then paint the cameras view through the view transform.
protected  void paintCameraView(PPaintContext paintContext)
          Paint all the layers that the camera is looking at, this method is called after the cameras view transform and clip are applied to the paintContext.
protected  void paintDebugInfo(PPaintContext paintContext)
          Renders debug info onto the newly painted scene.
 PPickPath pick(double x, double y, double halo)
          Generate and return a PPickPath for the point x,y specified in the local coord system of this camera.
protected  boolean pickAfterChildren(PPickPath pickPath)
          After the direct children of the camera have been given a chance to be picked objects viewed by the camera are given a chance to be picked.
protected  boolean pickCameraView(PPickPath pickPath)
          Pick all the layers that the camera is looking at, this method is called after the cameras view transform and clip are applied to the pickPath.
 PLayer removeLayer(int index)
          Remove the layer at the given index from the list of layers managed by this camera.
 PLayer removeLayer(PLayer layer)
          Remove the given layer from the list of layers managed by this camera.
 void repaintFrom(PBounds localBounds, PNode sourceNode)
          Repaint this camera, and forward the repaint request to the camera's canvas if it is not null.
 void repaintFromLayer(PBounds viewBounds, PLayer repaintedLayer)
          Repaint from one of the cameras layers.
 void repaintFromLayer(PBounds viewBounds, PNode repaintedLayer)
          Deprecated. since a more specific repaintFromLayer method is available Repaint from one of the cameras layers. The repaint region needs to be transformed from view to local in this case. Unlike most repaint methods in piccolo this one must not modify the viewBounds parameter.
 void scaleView(double scale)
          Scale the view transform that is applied to the layers viewed by this camera by the given amount.
 void scaleViewAboutPoint(double scale, double x, double y)
          Scale the view transform that is applied to the layers viewed by this camera by the given amount about the given point.
 void setComponent(PComponent newComponent)
          Set the canvas associated with this camera.
 void setViewBounds(Rectangle2D centerBounds)
          Animates the camera's view so that the given bounds (in camera layer's coordinate system) are centered within the cameras view bounds.
 void setViewConstraint(int constraint)
          Sets the view constraint to apply to the view.
 void setViewOffset(double x, double y)
          Sets the offset of the view transform that is applied to the camera's layers.
 void setViewScale(double scale)
          Set the scale of the view transform that is applied to the layers viewed by this camera.
 void setViewTransform(AffineTransform aTransform)
          Set the view transform that is applied to the views layers.
 void translateView(double dx, double dy)
          Translate the view transform that is applied to the camera's layers.
 Dimension2D viewToLocal(Dimension2D viewDimension)
          Convert the dimension from the camera's view coordinate system to the camera's local coordinate system.
 Point2D viewToLocal(Point2D viewPoint)
          Convert the point from the camera's view coordinate system to the camera's local coordinate system.
 Rectangle2D viewToLocal(Rectangle2D viewRectangle)
          Convert the rectangle from the camera's view coordinate system to the camera's local coordinate system.
 
Methods inherited from class edu.umd.cs.piccolo.PNode
addActivity, addAttribute, addChild, addChild, addChildren, addClientProperty, addInputEventListener, addPropertyChangeListener, addPropertyChangeListener, animateToBounds, animateToColor, animateToPositionScaleRotation, animateToRelativePosition, animateToTransform, animateToTransparency, animateTransformToBounds, centerBoundsOnPoint, centerFullBoundsOnPoint, clone, computeFullBounds, endResizeBounds, findIntersectingNodes, fireChildPropertyChange, firePropertyChange, fullIntersects, fullPick, getAllNodes, getAllNodes, getAttribute, getAttribute, getBooleanAttribute, getBounds, getBoundsChanged, getBoundsReference, getBoundsVolatile, getChild, getChildBoundsInvalid, getChildBoundsVolatile, getChildPaintInvalid, getChildrenCount, getChildrenIterator, getChildrenPickable, getChildrenReference, getClientProperties, getClientProperty, getClientPropertyKeysEnumeration, getClientPropertyKeysIterator, getDoubleAttribute, getFullBounds, getFullBoundsInvalid, getFullBoundsReference, getGlobalBounds, getGlobalFullBounds, getGlobalRotation, getGlobalScale, getGlobalToLocalTransform, getGlobalTranslation, getHeight, getInputEventListeners, getIntegerAttribute, getInverseTransform, getListenerList, getLocalToGlobalTransform, getName, getOccluded, getOffset, getPaint, getPaintInvalid, getParent, getPickable, getPropertyChangeParentMask, getRoot, getRotation, getScale, getTransform, getTransformReference, getTransparency, getUnionOfChildrenBounds, getVisible, getWidth, getX, getXOffset, getY, getYOffset, globalToLocal, globalToLocal, globalToLocal, indexOfChild, internalUpdateBounds, intersects, invalidateFullBounds, invalidateLayout, invalidatePaint, isAncestorOf, isDescendentOf, isDescendentOfRoot, isOpaque, layoutChildren, lerp, localToGlobal, localToGlobal, localToGlobal, localToParent, localToParent, localToParent, moveInBackOf, moveInFrontOf, moveToBack, moveToFront, offset, paintAfterChildren, paramString, parentBoundsChanged, parentToLocal, parentToLocal, parentToLocal, pick, position, print, print, removeAllChildren, removeChild, removeChild, removeChildren, removeFromParent, removeInputEventListener, removePropertyChangeListener, removePropertyChangeListener, repaint, reparent, replaceWith, resetBounds, rotate, rotateAboutPoint, rotateAboutPoint, rotateInPlace, scale, scaleAboutPoint, scaleAboutPoint, setBounds, setBounds, setBoundsChanged, setChildBoundsInvalid, setChildBoundsVolatile, setChildPaintInvalid, setChildrenPickable, setFullBoundsInvalid, setGlobalRotation, setGlobalScale, setGlobalTranslation, setHeight, setName, setOccluded, setOffset, setOffset, setPaint, setPaintInvalid, setParent, setPickable, setPropertyChangeParentMask, setRotation, setScale, setTransform, setTransparency, setVisible, setWidth, setX, setY, signalBoundsChanged, startResizeBounds, toImage, toImage, toImage, toImage, transformBy, translate, validateFullBounds, validateFullPaint
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_LAYERS

public static final String PROPERTY_LAYERS
The property name that identifies a change in the set of this camera's layers (see getLayer, getLayerCount, getLayersReference). A property change event's new value will be a reference to the list of this nodes layers, but old value will always be null.

See Also:
Constant Field Values

PROPERTY_CODE_LAYERS

public static final int PROPERTY_CODE_LAYERS
The property code that identifies a change in the set of this camera's layers (see getLayer, getLayerCount, getLayersReference). A property change event's new value will be a reference to the list of this nodes layers, but old value will always be null.

See Also:
Constant Field Values

PROPERTY_VIEW_TRANSFORM

public static final String PROPERTY_VIEW_TRANSFORM
The property name that identifies a change in this camera's view transform (see getViewTransform, getViewTransformReference). A property change event's new value will be a reference to the view transform, but old value will always be null.

See Also:
Constant Field Values

PROPERTY_CODE_VIEW_TRANSFORM

public static final int PROPERTY_CODE_VIEW_TRANSFORM
The property code that identifies a change in this camera's view transform (see getViewTransform, getViewTransformReference). A property change event's new value will be a reference to the view transform, but old value will always be null.

See Also:
Constant Field Values

VIEW_CONSTRAINT_NONE

public static final int VIEW_CONSTRAINT_NONE
Denotes that the view has no constraints.

See Also:
Constant Field Values

VIEW_CONSTRAINT_ALL

public static final int VIEW_CONSTRAINT_ALL
See Also:
Constant Field Values

VIEW_CONSTRAINT_CENTER

public static final int VIEW_CONSTRAINT_CENTER
See Also:
Constant Field Values
Constructor Detail

PCamera

public PCamera()
Construct a new camera with no layers and a default white color.

Method Detail

getComponent

public PComponent getComponent()
Get the canvas associated with this camera. This will return null if not canvas has been associated, as may be the case for internal cameras.

Returns:
the canvas associated with this camera

setComponent

public void setComponent(PComponent newComponent)
Set the canvas associated with this camera. When the camera is repainted it will request repaints on this canvas.

Parameters:
newComponent - the component to which this camera will dispatch repaint requests to

repaintFrom

public void repaintFrom(PBounds localBounds,
                        PNode sourceNode)
Repaint this camera, and forward the repaint request to the camera's canvas if it is not null.

Overrides:
repaintFrom in class PNode
Parameters:
localBounds - the area that requires repainting
sourceNode - the node from which the repaint message originates, may be the camera itself

repaintFromLayer

public void repaintFromLayer(PBounds viewBounds,
                             PLayer repaintedLayer)
Repaint from one of the cameras layers. The repaint region needs to be transformed from view to local in this case. Unlike most repaint methods in Piccolo2d this one must not modify the viewBounds parameter.

Parameters:
viewBounds - the bounds of the region needing painting
repaintedLayer - layer dispatching the repaint notification

repaintFromLayer

public void repaintFromLayer(PBounds viewBounds,
                             PNode repaintedLayer)
Deprecated. since a more specific repaintFromLayer method is available Repaint from one of the cameras layers. The repaint region needs to be transformed from view to local in this case. Unlike most repaint methods in piccolo this one must not modify the viewBounds parameter.

Parameters:
viewBounds - the bounds of the region needing painting
repaintedLayer - layer dispatching the repaint notification

getLayersReference

public List getLayersReference()
Return a reference to the list of layers managed by this camera.

Returns:
list of layers attached to this camera

getLayerCount

public int getLayerCount()
Returns the number of layers attached to this camera.

Returns:
number of layers attached to this camera

getLayer

public PLayer getLayer(int index)
Returns the layer at the given index.

Parameters:
index - the index of the layer
Returns:
layer at the given index

indexOfLayer

public int indexOfLayer(PLayer layer)
Returns the index of the given layer or -1 it not found.

Parameters:
layer - layer to search for
Returns:
the index of the given layer or -1 it not found

addLayer

public void addLayer(PLayer layer)
Add the layer to the end of this camera's list of layers. Layers may be viewed by multiple cameras at once.

Parameters:
layer - layer to add to this camera

addLayer

public void addLayer(int index,
                     PLayer layer)
Add the layer at the given index in this camera's list of layers. Layers may be viewed by multiple cameras at once.

Parameters:
index - index before which to add this layer
layer - Layer to add

removeLayer

public PLayer removeLayer(PLayer layer)
Remove the given layer from the list of layers managed by this camera. If the layer is not found, it leaves the camera unchanged.

Parameters:
layer - the layer to be removed
Returns:
layer that was passed in

removeLayer

public PLayer removeLayer(int index)
Remove the layer at the given index from the list of layers managed by this camera.

Parameters:
index - the index of the layer to remove
Returns:
layer that was removed

getUnionOfLayerFullBounds

public PBounds getUnionOfLayerFullBounds()
Return the total bounds of all the layers that this camera looks at.

Returns:
the bounds of all the layers taken together

paint

protected void paint(PPaintContext paintContext)
Paint this camera (default background color is white) and then paint the cameras view through the view transform.

Overrides:
paint in class PNode
Parameters:
paintContext - the context in which the painting occurs

paintCameraView

protected void paintCameraView(PPaintContext paintContext)
Paint all the layers that the camera is looking at, this method is called after the cameras view transform and clip are applied to the paintContext.

Parameters:
paintContext - the context in which the painting occurs

paintDebugInfo

protected void paintDebugInfo(PPaintContext paintContext)
Renders debug info onto the newly painted scene. Things like full bounds and bounds are painted as filled and outlines.

Parameters:
paintContext - the context in which the painting occurs

fullPaint

public void fullPaint(PPaintContext paintContext)
Override fullPaint to push the camera onto the paintContext so that it can be later be accessed by PPaintContext.getCamera().

Overrides:
fullPaint in class PNode
Parameters:
paintContext - the context in which the painting occurs

pick

public PPickPath pick(double x,
                      double y,
                      double halo)
Generate and return a PPickPath for the point x,y specified in the local coord system of this camera. Picking is done with a rectangle, halo specifies how large that rectangle will be.

Parameters:
x - the x coordinate of the pick path given in local coordinates
y - the y coordinate of the pick path given in local coordinates
halo - the distance from the x,y coordinate that is considered for inclusion in the pick path
Returns:
the picked path

pickAfterChildren

protected boolean pickAfterChildren(PPickPath pickPath)
After the direct children of the camera have been given a chance to be picked objects viewed by the camera are given a chance to be picked.

Overrides:
pickAfterChildren in class PNode
Parameters:
pickPath - picked layer children add added to this pick path
Returns:
whether the pickPath has changed

pickCameraView

protected boolean pickCameraView(PPickPath pickPath)
Pick all the layers that the camera is looking at, this method is called after the cameras view transform and clip are applied to the pickPath.

Parameters:
pickPath - picked layer children add added to this pick path
Returns:
whether the pickPath has changed

getViewBounds

public PBounds getViewBounds()
Return the bounds of this camera in the view coordinate system.

Returns:
the bounds of this camera in the view coordinate system

setViewBounds

public void setViewBounds(Rectangle2D centerBounds)
Animates the camera's view so that the given bounds (in camera layer's coordinate system) are centered within the cameras view bounds. Use this method to point the camera at a given location.

Parameters:
centerBounds - the targetBounds

getViewScale

public double getViewScale()
Return the scale applied by the view transform to the layers viewed by this camera.

Returns:
The scale of the viewTransform viewing the layers

scaleView

public void scaleView(double scale)
Scale the view transform that is applied to the layers viewed by this camera by the given amount.

Parameters:
scale - the scale to change the Layers' view transform

scaleViewAboutPoint

public void scaleViewAboutPoint(double scale,
                                double x,
                                double y)
Scale the view transform that is applied to the layers viewed by this camera by the given amount about the given point.

Parameters:
scale - the scale at which the view should be
x - the x coordinate the view should change to
y - the y coordinate the view should change to

setViewScale

public void setViewScale(double scale)
Set the scale of the view transform that is applied to the layers viewed by this camera.

Parameters:
scale - the scale of the transform viewing the layers

translateView

public void translateView(double dx,
                          double dy)
Translate the view transform that is applied to the camera's layers.

Parameters:
dx - the delta which the x coordinate should be increased by
dy - the delta which the y coordinate should be increased by

setViewOffset

public void setViewOffset(double x,
                          double y)
Sets the offset of the view transform that is applied to the camera's layers.

Parameters:
x - the new x translation of the view transform
y - the new y translation of the view transform

getViewTransform

public PAffineTransform getViewTransform()
Get a copy of the view transform that is applied to the camera's layers.

Returns:
the viewTransform being applied to the layers

getViewTransformReference

public PAffineTransform getViewTransformReference()
Get a reference to the view transform that is applied to the camera's layers.

Returns:
a direct reference to the view transform being applied to the layers

setViewTransform

public void setViewTransform(AffineTransform aTransform)
Set the view transform that is applied to the views layers.

Parameters:
aTransform - the new view transform

animateViewToCenterBounds

public PTransformActivity animateViewToCenterBounds(Rectangle2D centerBounds,
                                                    boolean shouldScaleToFit,
                                                    long duration)
Animate the camera's view from its current transform when the activity starts to a new transform that centers the given bounds in the camera layers coordinate system into the cameras view bounds. If the duration is 0 then the view will be transformed immediately, and null will be returned. Else a new PTransformActivity will get returned that is set to animate the camera's view transform to the new bounds. If shouldScale is true, then the camera will also scale its view so that the given bounds fit fully within the cameras view bounds, else the camera will maintain its original scale.

Parameters:
centerBounds - the bounds which the animation will pace at the center of the view
shouldScaleToFit - whether the camera should scale the view while animating to it
duration - how many milliseconds the animations should take
Returns:
the scheduled PTransformActivity

animateViewToPanToBounds

public PTransformActivity animateViewToPanToBounds(Rectangle2D panToBounds,
                                                   long duration)
Pan the camera's view from its current transform when the activity starts to a new transform so that the view bounds will contain (if possible, intersect if not possible) the new bounds in the camera layers coordinate system. If the duration is 0 then the view will be transformed immediately, and null will be returned. Else a new PTransformActivity will get returned that is set to animate the camera's view transform to the new bounds.

Parameters:
panToBounds - the bounds to which the view will animate to
duration - the duration of the animation given in milliseconds
Returns:
the scheduled PTransformActivity

animateViewToIncludeBounds

public PTransformActivity animateViewToIncludeBounds(Rectangle2D includeBounds,
                                                     long duration)
Deprecated. Renamed to animateViewToPanToBounds

Pan the camera's view from its current transform when the activity starts to a new transform so that the view bounds will contain (if possible, intersect if not possible) the new bounds in the camera layers coordinate system. If the duration is 0 then the view will be transformed immediately, and null will be returned. Else a new PTransformActivity will get returned that is set to animate the camera's view transform to the new bounds.

Parameters:
includeBounds - the bounds to which the view will animate to
duration - the duration of the animation given in milliseconds
Returns:
the scheduled PTransformActivity

animateViewToTransform

public PTransformActivity animateViewToTransform(AffineTransform destination,
                                                 long duration)
Animate the cameras view transform from its current value when the activity starts to the new destination transform value.

Parameters:
destination - the transform to which the view should be transformed into
duration - the duraiton in milliseconds the animation should take
Returns:
the scheduled PTransformActivity

getViewConstraint

public int getViewConstraint()
Returns the constraint being applied to the view.

Returns:
the viewConstraint being applied to the view

setViewConstraint

public void setViewConstraint(int constraint)
Sets the view constraint to apply to the view.

Parameters:
constraint - the new constraint to apply to the view

applyViewConstraints

protected void applyViewConstraints()
Transforms the view so that it conforms to the given constraint.


viewToLocal

public Point2D viewToLocal(Point2D viewPoint)
Convert the point from the camera's view coordinate system to the camera's local coordinate system. The given point is modified by this.

Parameters:
viewPoint - the point to transform to the local coordinate system from the view's coordinate system
Returns:
the transformed point

viewToLocal

public Dimension2D viewToLocal(Dimension2D viewDimension)
Convert the dimension from the camera's view coordinate system to the camera's local coordinate system. The given dimension is modified by this.

Parameters:
viewDimension - the dimension to transform from the view system to the local coordinate system
Returns:
returns the transformed dimension

viewToLocal

public Rectangle2D viewToLocal(Rectangle2D viewRectangle)
Convert the rectangle from the camera's view coordinate system to the camera's local coordinate system. The given rectangle is modified by this method.

Parameters:
viewRectangle - the rectangle to transform from view to local coordinate System
Returns:
the transformed rectangle

localToView

public Point2D localToView(Point2D localPoint)
Convert the point from the camera's local coordinate system to the camera's view coordinate system. The given point is modified by this method.

Parameters:
localPoint - point to transform from local to view coordinate system
Returns:
the transformed point

localToView

public Dimension2D localToView(Dimension2D localDimension)
Convert the dimension from the camera's local coordinate system to the camera's view coordinate system. The given dimension is modified by this method.

Parameters:
localDimension - the dimension to transform from local to view coordinate systems
Returns:
the transformed dimension

localToView

public Rectangle2D localToView(Rectangle2D localRectangle)
Convert the rectangle from the camera's local coordinate system to the camera's view coordinate system. The given rectangle is modified by this method.

Parameters:
localRectangle - the rectangle to transform from local to view coordinate system
Returns:
the transformed rectangle


Copyright © 1995-2011 Piccolo2D. All Rights Reserved.