UC Berkeley Group for User Interface Research
Updated November 17, 2000

edu.berkeley.guir.lib.satin.objects
Class ViewHandler

java.lang.Object
  |
  +--edu.berkeley.guir.lib.satin.objects.ViewHandler
All Implemented Interfaces:
Cloneable, SatinConstants, Serializable

public class ViewHandler
extends Object
implements SatinConstants, Serializable, Cloneable

Handles the view portions of GraphicalObjects.

Everything in here is in local coordinates. That is, (0,0) is defined to be the top-left corner of the GraphicalObject, without any transforms applied anywhere.

This software is distributed under the Berkeley Software License.

 Revisions:  - SATIN-v1.0-1.0.0, Oct 06 1998, JH
               Created class
             - SATIN-v2.1-1.0.0, Aug 11 2000, JH
               Touched for SATIN release
 

Since:
JDK 1.2
Version:
SATIN-v2.1-1.0.0, Aug 11 2000
Author:
Jason Hong ( jasonh@cs.berkeley.edu )
See Also:
Serialized Form

Inner classes inherited from class edu.berkeley.guir.lib.satin.SatinConstants
SatinConstants.ObjectPoolAffineTransform, SatinConstants.ObjectPoolPoint2D, SatinConstants.ObjectPoolPolygon2D, SatinConstants.ObjectPoolRectangle2D, SatinConstants.ObjectPoolStringBuffer, SatinConstants.UniqueAffineTransform, SatinConstants.UniquePoint2D, SatinConstants.UniquePolygon2D, SatinConstants.UniqueRectangle2D
 
Fields inherited from interface edu.berkeley.guir.lib.satin.SatinConstants
ABOVE, ALL, BAR, BELOW, clipboard, clprops, cmdqueue, cmdsubsys, CONTAINEDBY, CONTAINS, COORD_ABS, COORD_LOCAL, COORD_REL, DAMAGE_LATER, DAMAGE_NOW, DEBUG_GRAPHICS_OFFSET, DEBUG_STYLE_FILE, DEBUG_STYLE_GPROPERTY, DEEP, DEFAULT_POINT2D_POOL_SIZE, DEFAULT_POLYGON2D_POOL_SIZE, DEFAULT_RECTANGLE_POOL_SIZE, DEFAULT_REPAINT_THRESHOLD, DEFAULT_SELECT_THRESHOLD, DEFAULT_STRINGBUFFER_POOL_SIZE, DEFAULT_TRANSFORM_POOL_SIZE, DIR_CENTER, DIR_DOWN, DIR_DOWN_LEFT, DIR_DOWN_RIGHT, DIR_LEFT, DIR_RIGHT, DIR_UP, DIR_UP_LEFT, DIR_UP_RIGHT, FILTER_THRESHOLD, FIRST, FLOATING_PT_TOLERANCE, glprops, INTERSECTS, KEY_STYLE_DASHARRAY, KEY_STYLE_DASHPHASE, KEY_STYLE_DRAWCOLOR, KEY_STYLE_DRAWFONT, KEY_STYLE_DRAWTRANSPARENCY, KEY_STYLE_ENDCAP, KEY_STYLE_FILLCOLOR, KEY_STYLE_FILLTRANSPARENCY, KEY_STYLE_LINEJOIN, KEY_STYLE_LINEWIDTH, KEY_STYLE_MITERLIMIT, NEAR, NOTIFY_BOUNDS, NOTIFY_LAYER, NOTIFY_LOCATION, NOTIFY_STYLE, NOTIFY_TRANSFORM, poolPoints, poolPolys, poolRects, poolStrbuf, poolTx, rand, SATIN_DATA_DIRECTORY_DEFAULT, SATIN_DATA_DIRECTORY_GPROPERTY, SATIN_PROPERTIES_FILENAME, SHALLOW
 
Constructor Summary
ViewHandler(GraphicalObjectImpl gob)
          Set the GraphicalObject that this view is attached to.
ViewHandler(ViewHandler viewHandler)
          Copy constructor.
 
Method Summary
 AffineTransform applyNormalizingTransform(AffineTransform newTx)
          Apply a new transform to the normalizing transform, the one that specifies how to normalize the coordinates to (0,0).
 void clearNormalizingTransform()
          Set the normalizing transform to the identity if it is not already.
 Object clone()
           
 AffineTransform getNormalizingTransform()
          Get the transform that would normalize this view to (0,0).
 Style getStyle()
           
 Style getStyleRef()
           
 View getView()
           
 Polygon2D getViewBoundingPoints2D()
          Get the view bounding points.
 Polygon2D getViewBoundingPoints2DRef()
          Get a reference to the view bounding points.
 boolean hasClosedBoundingPoints()
          Check whether the view has closed bounding points or not.
 boolean isNormalized()
          See if the view's bounding points are already normalized or not.
 boolean isVisible()
           
 void normalizeBoundingPoints()
          Normalize the view's bounding points, such that its top-left bounds are at (0,0), keeping the transform correct.
 void render(SatinGraphics g)
           
 GraphicalObject setAttachedGraphicalObject(GraphicalObjectImpl gob)
          Set the GraphicalObject this ViewHandler is attached to.
 boolean setHasClosedBoundingPoints(boolean flag)
          Set whether the view has closed bounding points or not.
 AffineTransform setNormalizingTransform(AffineTransform newTx)
          Set the transform that would normalize this view to (0,0).
 Style setStyle(Style newStyle)
           
 void setView(View v)
           
 void setViewBoundingPoints2D(Polygon2D newPoly)
          Set the shape of the view (local coordinates).
 void setViewBoundingPoints2D(Shape s)
          Set the shape of this view (local coordinates).
 void setViewBoundingPoints2DRef(Polygon2D newPoly)
          Set a reference to the shape of the view (local coordinates).
 void setVisible(boolean flag)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ViewHandler

public ViewHandler(GraphicalObjectImpl gob)
Set the GraphicalObject that this view is attached to.

ViewHandler

public ViewHandler(ViewHandler viewHandler)
Copy constructor.
Parameters:
viewHandler - is the ViewHandler to copy.
Method Detail

setAttachedGraphicalObject

public GraphicalObject setAttachedGraphicalObject(GraphicalObjectImpl gob)
Set the GraphicalObject this ViewHandler is attached to.

setView

public void setView(View v)

getView

public View getView()

setVisible

public void setVisible(boolean flag)

isVisible

public boolean isVisible()

setStyle

public Style setStyle(Style newStyle)

getStyle

public Style getStyle()

getStyleRef

public Style getStyleRef()

isNormalized

public boolean isNormalized()
See if the view's bounding points are already normalized or not.
Returns:
true if normalized already, false if not.

normalizeBoundingPoints

public void normalizeBoundingPoints()
Normalize the view's bounding points, such that its top-left bounds are at (0,0), keeping the transform correct.

getNormalizingTransform

public AffineTransform getNormalizingTransform()
Get the transform that would normalize this view to (0,0).

applyNormalizingTransform

public AffineTransform applyNormalizingTransform(AffineTransform newTx)
Apply a new transform to the normalizing transform, the one that specifies how to normalize the coordinates to (0,0).

setNormalizingTransform

public AffineTransform setNormalizingTransform(AffineTransform newTx)
Set the transform that would normalize this view to (0,0).

clearNormalizingTransform

public void clearNormalizingTransform()
Set the normalizing transform to the identity if it is not already.

setViewBoundingPoints2D

public void setViewBoundingPoints2D(Shape s)
Set the shape of this view (local coordinates).
Parameters:
s - is the shape to set to.

setViewBoundingPoints2D

public void setViewBoundingPoints2D(Polygon2D newPoly)
Set the shape of the view (local coordinates).
Parameters:
newPoly - will be copied.

setViewBoundingPoints2DRef

public void setViewBoundingPoints2DRef(Polygon2D newPoly)
Set a reference to the shape of the view (local coordinates).
Parameters:
newPoly - is the polygon to set the reference to.

getViewBoundingPoints2D

public Polygon2D getViewBoundingPoints2D()
Get the view bounding points.

getViewBoundingPoints2DRef

public Polygon2D getViewBoundingPoints2DRef()
Get a reference to the view bounding points.

setHasClosedBoundingPoints

public boolean setHasClosedBoundingPoints(boolean flag)
Set whether the view has closed bounding points or not.

hasClosedBoundingPoints

public boolean hasClosedBoundingPoints()
Check whether the view has closed bounding points or not.

render

public void render(SatinGraphics g)

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
Overrides:
clone in class Object

Copyright Information