edu.stanford.hci.r3.paper.regions
Class CompoundRegion

java.lang.Object
  extended by edu.stanford.hci.r3.paper.Region
      extended by edu.stanford.hci.r3.paper.regions.CompoundRegion

public class CompoundRegion
extends Region

Put more than one region together.

This software is distributed under the BSD License.


Field Summary
 
Fields inherited from class edu.stanford.hci.r3.paper.Region
referenceUnits, scaleX, scaleY
 
Constructor Summary
CompoundRegion(java.lang.String name, Units xOrigin, Units yOrigin)
           
 
Method Summary
 void addChild(Region childRegion, Coordinates relativeCoord)
          A compound region is made up of a bunch of regions and their coordinates relative to the origin of the compound region.
 Coordinates getChildOffset(Region child)
           
 java.util.Set<Region> getChildren()
           
 RegionRenderer getRenderer()
          Subclasses should override this, to customize rendering.
 java.lang.String toString()
          Please override for more interesting output.
 
Methods inherited from class edu.stanford.hci.r3.paper.Region
addEventHandler, getEventHandlers, getFillColor, getHeight, getIsActiveString, getName, getOpacity, getOriginX, getOriginY, getParentSheet, getScaleX, getScaleY, getShape, getStrokeColor, getUnits, getUnscaledBounds2D, getUnscaledBoundsHeight, getUnscaledBoundsWidth, getUnscaledShapeCopy, getWidth, isActive, isVisible, resetScale, scaleRegion, scaleRegionUniformly, setActive, setFillColor, setName, setOpacity, setParentSheet, setScale, setShape, setStrokeColor, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CompoundRegion

public CompoundRegion(java.lang.String name,
                      Units xOrigin,
                      Units yOrigin)
Method Detail

addChild

public void addChild(Region childRegion,
                     Coordinates relativeCoord)
A compound region is made up of a bunch of regions and their coordinates relative to the origin of the compound region. TODO: Should renderers of this class respect the master scaling factor???

Parameters:
childRegion - a child region
relativeCoord -

getChildOffset

public Coordinates getChildOffset(Region child)
Parameters:
child -
Returns:

getChildren

public java.util.Set<Region> getChildren()
Returns:

getRenderer

public RegionRenderer getRenderer()
Description copied from class: Region
Subclasses should override this, to customize rendering. Otherwise, you'll just get gray boxes, which is what RegionRenderer does.

Overrides:
getRenderer in class Region
Returns:
the renderer for this region
See Also:
Region.getRenderer()

toString

public java.lang.String toString()
Description copied from class: Region
Please override for more interesting output. This will print the name of the class along with all the segments of the shape.

Overrides:
toString in class Region
Returns:
the String representation of this Region
See Also:
Region.toString()

Copyright 2006 Stanford University