edu.stanford.hci.r3.pattern.coordinates.conversion
Class FlexiblePatternCoordinateConverter

java.lang.Object
  extended by edu.stanford.hci.r3.pattern.coordinates.conversion.FlexiblePatternCoordinateConverter
All Implemented Interfaces:
PatternCoordinateConverter

public class FlexiblePatternCoordinateConverter
extends java.lang.Object
implements PatternCoordinateConverter

This coordinate converter will automatically move to wherever the anchor point is set, and will take on the width and height of its associated region. The anchor will be set to the first sample that comes in, if it is not otherwise set. Thus, this pattern coordinate converter can be easily changed at runtime. Be careful if you have more than one of these in your paper application, as the first one encountered may consume the event before the other one sees if (if the two regions somehow become "overlapped"). Also, if you never set your anchor point, this region may opportunistically steal pen input from another region on your sheet, if it is encountered first by the EventEngine.

This software is distributed under the BSD License.


Constructor Summary
FlexiblePatternCoordinateConverter(Region floatingRegion)
           
 
Method Summary
 boolean contains(StreamedPatternCoordinates coord)
           
 double getArea()
           
 java.lang.String getRegionName()
           
 PercentageCoordinates getRelativeLocation(StreamedPatternCoordinates coord)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FlexiblePatternCoordinateConverter

public FlexiblePatternCoordinateConverter(Region floatingRegion)
Parameters:
floatingRegion -
Method Detail

contains

public boolean contains(StreamedPatternCoordinates coord)
Specified by:
contains in interface PatternCoordinateConverter
See Also:
PatternCoordinateConverter.contains(edu.stanford.hci.r3.units.coordinates.StreamedPatternCoordinates)

getArea

public double getArea()
Specified by:
getArea in interface PatternCoordinateConverter
Returns:
the area, in pattern dots squared, of this patch.

getRegionName

public java.lang.String getRegionName()
Specified by:
getRegionName in interface PatternCoordinateConverter

getRelativeLocation

public PercentageCoordinates getRelativeLocation(StreamedPatternCoordinates coord)
Specified by:
getRelativeLocation in interface PatternCoordinateConverter

Copyright 2006 Stanford University