com.partnersoft.maps.rover
Class RoverMachineRegister

java.lang.Object
  extended by com.partnersoft.maps.rover.RoverMachineRegister

public class RoverMachineRegister
extends java.lang.Object

A buffer object used to contain the raw coded data and geometry values for a RoverEntity.

Perhaps this is an abuse of the concept, but "Register" is used intentionally to allude to the idea of numeric registers in CPUs. It's a (relatively) fast and (relatively) low-level place to store mutable rover entity data, that may be acted on directly (e.g. when rendering) or used to construct actual immutable RoverEntity objects.

It is designed for speed and open access and not security. Share instances at your own risk.

Copyright 2008 Partner Software, Inc.

Version:
$Id$
Author:
Paul Reavis

Field Summary
 byte alignment
          Only valid for text, the alignment code.
 int dataId
          The current numeric RoverData ID.
 int graphicTypeId
          The current numeric RoverGraphicType ID.
 int imageId
          Only valid for images, the ID of the image.
 byte offsetX
          Only valid for points and text, the X offset in pixels.
 byte offsetY
          Only valid for points and text, the Y offset in pixels.
 int pixelsHigh
          Only valid for images, the width of the image in pixels.
 int pixelsWide
          Only valid for images, the width of the image in pixels.
 DynamicDoubleArray points
          A dynamic array of points represented as doubles in x1, y1, x2, y2, etc.
 byte rotation
          Only valid for points and text, the rotation, encoded in theta units of 1/256 of a circle.
 double scale
          Only valid for images, the scale (width/height of pixel in map units) of the image.
 int shapeTypeCode
          The current shape type code.
 RoverStore store
          The current RoverStore.
 java.lang.String text
          Only valid for text, the actual text of the label.
 double x
          X for image, point, and text entities.
 double y
          Y for image, point, and text entities.
 
Constructor Summary
RoverMachineRegister()
           
 
Method Summary
 ImageSource loadImage()
           
 boolean simplifyPoints()
          Same as simplifyPoints(1.0).
 boolean simplifyPoints(double epsilon)
          Reduces the granularity of the points array in place using the given epsilon.
 java.lang.String toString()
           
 void transformPoints(java.awt.geom.AffineTransform transform)
          Transforms the points array in place using the given AffineTransform.
 void transformXy(java.awt.geom.AffineTransform transform)
          Transforms the x and y values using the given AffineTransform.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

store

public RoverStore store
The current RoverStore.


dataId

public int dataId
The current numeric RoverData ID.


graphicTypeId

public int graphicTypeId
The current numeric RoverGraphicType ID.


shapeTypeCode

public int shapeTypeCode
The current shape type code.


x

public double x
X for image, point, and text entities.


y

public double y
Y for image, point, and text entities.


points

public DynamicDoubleArray points
A dynamic array of points represented as doubles in x1, y1, x2, y2, etc. order with the points defining whichever shape or shapes is current.


offsetX

public byte offsetX
Only valid for points and text, the X offset in pixels.


offsetY

public byte offsetY
Only valid for points and text, the Y offset in pixels.


rotation

public byte rotation
Only valid for points and text, the rotation, encoded in theta units of 1/256 of a circle.


alignment

public byte alignment
Only valid for text, the alignment code.


text

public java.lang.String text
Only valid for text, the actual text of the label.


imageId

public int imageId
Only valid for images, the ID of the image.


scale

public double scale
Only valid for images, the scale (width/height of pixel in map units) of the image.


pixelsWide

public int pixelsWide
Only valid for images, the width of the image in pixels.


pixelsHigh

public int pixelsHigh
Only valid for images, the width of the image in pixels.

Constructor Detail

RoverMachineRegister

public RoverMachineRegister()
Method Detail

transformPoints

public void transformPoints(java.awt.geom.AffineTransform transform)
Transforms the points array in place using the given AffineTransform. WARNING: modifies the points array contents.


transformXy

public void transformXy(java.awt.geom.AffineTransform transform)
Transforms the x and y values using the given AffineTransform. WARNING: modifies the x and y variables.


simplifyPoints

public boolean simplifyPoints()
Same as simplifyPoints(1.0).

Returns:
true if results after simplification are still valid.

simplifyPoints

public boolean simplifyPoints(double epsilon)
Reduces the granularity of the points array in place using the given epsilon. This is a fast, rather than accurate, operation whereby a segment passes if either deltaX or deltaY is greater than the given epsilon. Returns true if the results contain at least one segment. WARNING: modifies the points array contents.


loadImage

public ImageSource loadImage()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object