uk.ac.starlink.ttools.plot2.layer
Class MarkForm

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.layer.MarkForm
All Implemented Interfaces:
ModePlotter.Form, ShapeForm

public abstract class MarkForm
extends Object
implements ShapeForm

ShapeForm implementation that just draws a fixed-size marker for each position. One or more positions per tuple may be marked.

Since:
18 Feb 2013
Author:
Mark Taylor

Field Summary
static MarkForm PAIR
          MarkForm instance for two points per tuple.
static MarkForm SINGLE
          MarkForm instance for a single point per tuple.
 
Constructor Summary
protected MarkForm(int npos, String name, Icon icon)
          Constructor.
 
Method Summary
static Icon createLegendIcon(MarkShape shape, int size)
          Returns a legend icon suitable for a single marker.
static MarkForm createMarkForm(int npos)
          Factory method to create an instance of this class.
static Glyph createMarkGlyph(MarkShape shape, int size, boolean isMultipix)
          Creates a Glyph representing a marker.
static Outliner createMarkOutliner(MarkShape shape, int size)
          Returns an outliner for use with single points.
static Outliner createMultiMarkOutliner(MarkShape shape, int size, int npos)
          Returns an outliner for use with multiple points.
 boolean equals(Object o)
           
 Coord[] getExtraCoords()
          Returns data coordinates additional to the basic position which are required to plot a point.
 String getFormDescription()
          Returns a description of this mode as an XML string.
 Icon getFormIcon()
          Returns an icon to identify this form in the GUI.
 String getFormName()
          Returns the user-directed name for this form.
 int getPositionCount()
          Returns the number of data positions per tuple used by this form.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface uk.ac.starlink.ttools.plot2.layer.ShapeForm
createOutliner, getConfigKeys
 

Field Detail

SINGLE

public static final MarkForm SINGLE
MarkForm instance for a single point per tuple.


PAIR

public static final MarkForm PAIR
MarkForm instance for two points per tuple.

Constructor Detail

MarkForm

protected MarkForm(int npos,
                   String name,
                   Icon icon)
Constructor.

Parameters:
npos - number of points to mark per tuple
name - form name
icon - form icon
Method Detail

getPositionCount

public int getPositionCount()
Description copied from interface: ShapeForm
Returns the number of data positions per tuple used by this form.

Specified by:
getPositionCount in interface ShapeForm
Returns:
number of sets of positional coordinates

getFormName

public String getFormName()
Description copied from interface: ModePlotter.Form
Returns the user-directed name for this form.

Specified by:
getFormName in interface ModePlotter.Form
Returns:
form name

getFormIcon

public Icon getFormIcon()
Description copied from interface: ModePlotter.Form
Returns an icon to identify this form in the GUI.

Specified by:
getFormIcon in interface ModePlotter.Form
Returns:
form icon

getFormDescription

public String getFormDescription()
Description copied from interface: ShapeForm
Returns a description of this mode as an XML string. The return value should be one or more <p> elements.

Specified by:
getFormDescription in interface ShapeForm
Returns:
XML description of form

getExtraCoords

public Coord[] getExtraCoords()
Description copied from interface: ShapeForm
Returns data coordinates additional to the basic position which are required to plot a point.

Specified by:
getExtraCoords in interface ShapeForm
Returns:
additional plot coordinates

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object o)
Overrides:
equals in class Object

createMarkForm

public static MarkForm createMarkForm(int npos)
Factory method to create an instance of this class.

Parameters:
npos - number of positions per tuple
Returns:
form instance

createMarkOutliner

public static Outliner createMarkOutliner(MarkShape shape,
                                          int size)
Returns an outliner for use with single points.

Parameters:
shape - marker shape
size - marker size
Returns:
single-point outliner

createMultiMarkOutliner

public static Outliner createMultiMarkOutliner(MarkShape shape,
                                               int size,
                                               int npos)
Returns an outliner for use with multiple points.

Parameters:
shape - marker shape
size - marker size
npos - number of positions per tuple
Returns:
multi-point outliner

createMarkGlyph

public static Glyph createMarkGlyph(MarkShape shape,
                                    int size,
                                    boolean isMultipix)
Creates a Glyph representing a marker.

Parameters:
shape - marker shape
size - marker size
isMultipix - if true, optimise for an instance that may have createPixer called multiple times
Returns:
marker glyph

createLegendIcon

public static Icon createLegendIcon(MarkShape shape,
                                    int size)
Returns a legend icon suitable for a single marker.

Parameters:
shape - marker shape
size - marker size
Returns:
legend icon


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