uk.ac.starlink.ast.gui
Class AstFigureProps

java.lang.Object
  extended by uk.ac.starlink.diva.FigureProps
      extended by uk.ac.starlink.ast.gui.AstFigureProps
All Implemented Interfaces:
XMLEncodeDecode

public class AstFigureProps
extends FigureProps

Subclass of FigureProps that can convert a Figure between coordinates systems using a Mapping when restoring from an XML serialization.

This class is intended to be used as a replacement for FigureProps is intended for use when restoring figures that are stored in some coordinate system that needs modifying to align with the system now in use.

Version:
$Id$
Author:
Peter W. Draper

Field Summary
 
Fields inherited from class uk.ac.starlink.diva.FigureProps
interpolatorFactory
 
Constructor Summary
AstFigureProps()
          Create an instance ready to be configured using the decode method.
AstFigureProps(FigureProps props)
          Create an instance which is a copy of an existing FigureProps.
 
Method Summary
 void decode(Element rootElement, Mapping oldMapping, Mapping newMapping)
          Decode using the given mappings to transforming stored coordinates to world coordinates, and world coordinates to current graphics coordinates.
 void transform(double[] x, double[] y, Mapping mapping)
          Transform arrays of coordinates using a mapping.
 void transform(Rectangle2D.Double r, Mapping mapping)
          Transform a Rectangle using a given mapping.
 
Methods inherited from class uk.ac.starlink.diva.FigureProps
copy, decode, decodeBase64DoubleArray, encode, encodeBase64DoubleArray, getComposite, getFill, getFont, getHeight, getInterpolator, getOutline, getTagName, getText, getThickness, getType, getWidth, getX1, getX2, getXArray, getY1, getY2, getYArray, readInterpolator, reset, setComposite, setFill, setFont, setFromString, setHeight, setInterpolator, setOutline, setText, setThickness, setType, setType, setWidth, setX1, setX2, setXArray, setY1, setY2, setYArray, toString, writeInterpolator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AstFigureProps

public AstFigureProps()
Create an instance ready to be configured using the decode method.


AstFigureProps

public AstFigureProps(FigureProps props)
Create an instance which is a copy of an existing FigureProps.

Method Detail

decode

public void decode(Element rootElement,
                   Mapping oldMapping,
                   Mapping newMapping)
Decode using the given mappings to transforming stored coordinates to world coordinates, and world coordinates to current graphics coordinates.

Usually the oldMapping will be the Plot in force when the figures were encoded and newMapping will be the current Plot.


transform

public void transform(Rectangle2D.Double r,
                      Mapping mapping)
Transform a Rectangle using a given mapping.


transform

public void transform(double[] x,
                      double[] y,
                      Mapping mapping)
Transform arrays of coordinates using a mapping.



Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.