Class MarkForm
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.MarkForm
-
- All Implemented Interfaces:
ModePlotter.Form,ShapeForm
public abstract class MarkForm extends java.lang.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
Fields Modifier and Type Field Description static intMIN_LEGEND_SIZEMinimum size of marker in legend, even if plot size is smaller.static MarkFormPAIRMarkForm instance for two points per tuple.static MarkFormQUADMarkForm instance for four points per tuple.static MarkFormSINGLEMarkForm instance for a single point per tuple.
-
Constructor Summary
Constructors Modifier Constructor Description protectedMarkForm(int npos, java.lang.String name, javax.swing.Icon icon)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static javax.swing.IconcreateLegendIcon(MarkShape shape, int size)Returns a legend icon suitable for a single marker.static MarkFormcreateMarkForm(int npos)Factory method to create an instance of this class.static GlyphcreateMarkGlyph(MarkShape shape, int size, boolean isMultipix)Creates a Glyph representing a marker.static OutlinercreateMarkOutliner(MarkShape shape, int size)Returns an outliner for use with single points.static OutlinercreateMultiMarkOutliner(MarkShape shape, int size, int npos)Returns an outliner for use with multiple points.booleanequals(java.lang.Object o)Coord[]getExtraCoords()Returns data coordinates additional to the basic position which are required to plot a point.java.lang.StringgetFormDescription()Returns a description of this mode as an XML string.javax.swing.IcongetFormIcon()Returns an icon to identify this form in the GUI.java.lang.StringgetFormName()Returns the user-directed name for this form.intgetPositionCount()Returns the number of data positions per tuple used by this form.inthashCode()-
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
-
MIN_LEGEND_SIZE
public static final int MIN_LEGEND_SIZE
Minimum size of marker in legend, even if plot size is smaller.- See Also:
- Constant Field Values
-
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.
-
QUAD
public static final MarkForm QUAD
MarkForm instance for four points per tuple.
-
-
Method Detail
-
getPositionCount
public int getPositionCount()
Description copied from interface:ShapeFormReturns the number of data positions per tuple used by this form.- Specified by:
getPositionCountin interfaceShapeForm- Returns:
- number of sets of positional coordinates
-
getFormName
public java.lang.String getFormName()
Description copied from interface:ModePlotter.FormReturns the user-directed name for this form.- Specified by:
getFormNamein interfaceModePlotter.Form- Returns:
- form name
-
getFormIcon
public javax.swing.Icon getFormIcon()
Description copied from interface:ModePlotter.FormReturns an icon to identify this form in the GUI.- Specified by:
getFormIconin interfaceModePlotter.Form- Returns:
- form icon
-
getFormDescription
public java.lang.String getFormDescription()
Description copied from interface:ShapeFormReturns a description of this mode as an XML string. The return value should be one or more <p> elements.- Specified by:
getFormDescriptionin interfaceShapeForm- Returns:
- XML description of form
-
getExtraCoords
public Coord[] getExtraCoords()
Description copied from interface:ShapeFormReturns data coordinates additional to the basic position which are required to plot a point.- Specified by:
getExtraCoordsin interfaceShapeForm- Returns:
- additional plot coordinates
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.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 shapesize- 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 shapesize- marker sizenpos- 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 shapesize- marker sizeisMultipix- if true, optimise for an instance that may have createPixer called multiple times- Returns:
- marker glyph
-
createLegendIcon
public static javax.swing.Icon createLegendIcon(MarkShape shape, int size)
Returns a legend icon suitable for a single marker.- Parameters:
shape- marker shapesize- marker size- Returns:
- legend icon
-
-