jview
Class SelectTransform

java.lang.Object
  extended by jview.AbstractFormattingTransform
      extended by jview.BasicTransform
          extended by jview.SelectTransform
All Implemented Interfaces:
CoordinateTransforming, DeltaFormattedTransforming, DeltaTransforming, FormattedTransforming, InvertableTransforming

public class SelectTransform
extends BasicTransform

A simple transform that let you define user-space coordinate indices that should be used in calculating the transform.


Field Summary
private  int x
          The index in the VectorG mapping to the x-coordinate.
static int XINDEX
          The default x index.
private  int y
          The index in the VectorG mapping to the y-coordinate.
static int YINDEX
          The default x index.
 
Constructor Summary
SelectTransform(Rectangle2D bounds)
          Constructs a new selectable transform with default inidces zero and one.
SelectTransform(Rectangle2D bounds, int xindex, int yindex)
          Constructs a new selectable transform with sepecified indices.
 
Method Summary
 Point2D toNormalizedSpace(VectorG xy)
          We re-arrange the argument and call the super method.
 VectorG toUserSpace(Point2D ab)
          We call the super method and return a vector of dimension equal to the maximum of x and y.
 
Methods inherited from class jview.BasicTransform
estimateX, estimateY, getDefiningRectangle, invertUserXY, setDateX, setDateY, setFlipX, setFlipY, setLogarithmicX, setLogarithmicY, toNormalizedDistance, toString, toUserDistance, useEstimatedFormats
 
Methods inherited from class jview.AbstractFormattingTransform
deltaFormatUserSpaceX, deltaFormatUserSpaceY, formatUserCoordinates, formatUserSpaceX, formatUserSpaceY, getFormatUserX, getFormatUserY, setDeltaFormatUserX, setDeltaFormatUserY, setFormatUserX, setFormatUserY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

XINDEX

public static final int XINDEX
The default x index.

See Also:
Constant Field Values

YINDEX

public static final int YINDEX
The default x index.

See Also:
Constant Field Values

x

private int x
The index in the VectorG mapping to the x-coordinate.


y

private int y
The index in the VectorG mapping to the y-coordinate.

Constructor Detail

SelectTransform

public SelectTransform(Rectangle2D bounds)
Constructs a new selectable transform with default inidces zero and one.


SelectTransform

public SelectTransform(Rectangle2D bounds,
                       int xindex,
                       int yindex)
Constructs a new selectable transform with sepecified indices.

Method Detail

toNormalizedSpace

public Point2D toNormalizedSpace(VectorG xy)
We re-arrange the argument and call the super method.

Specified by:
toNormalizedSpace in interface CoordinateTransforming
Overrides:
toNormalizedSpace in class BasicTransform
Parameters:
xy - A vector of user coordinates.
Returns:
A point in normalized screen coordinate, with 0≤x,y≤1

toUserSpace

public VectorG toUserSpace(Point2D ab)
We call the super method and return a vector of dimension equal to the maximum of x and y.

Specified by:
toUserSpace in interface CoordinateTransforming
Overrides:
toUserSpace in class BasicTransform
Parameters:
ab - A pixel in normalized coordinates.
Returns:
A vector in user space, never null