Class MarkForm
java.lang.Object
uk.ac.starlink.ttools.plot2.layer.MarkForm
- All Implemented Interfaces:
ModePlotter.Form
,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
FieldsModifier and TypeFieldDescriptionstatic final int
Minimum size of marker in legend, even if plot size is smaller.static final MarkForm
MarkForm instance for two points per tuple.static final MarkForm
MarkForm instance for four points per tuple.static final MarkForm
MarkForm instance for a single point per tuple. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadjustGeom
(DataGeom geom, DataSpec dataSpec, ShapeStyle style) Provides a DataGeom to be used by the layer this form makes, given a DataGeom that characterises the plotting environment.static Icon
createLegendIcon
(MarkerShape 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
(MarkerShape shape, int size, boolean isMultipix) Creates a Glyph representing a marker.static Outliner
createMarkOutliner
(MarkerShape shape, int size) Returns an outliner for use with single points.static MarkerStyle
createMarkStyle
(MarkerShape shape, int size) Creates a MarkStyle with a given size.static Outliner
createMultiMarkOutliner
(MarkerShape shape, int size, int npos) Returns an outliner for use with multiple points.boolean
int
Returns the number of basic data positions per tuple used by this form.Coord[]
Returns data coordinates additional to the basic position which are required to plot a point.int
Returns the number of extra coordinates that can be interpreted as positions.Returns a description of this mode as an XML string.Returns an icon to identify this form in the GUI.Returns the user-directed name for 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 Details
-
MIN_LEGEND_SIZE
public static final int MIN_LEGEND_SIZEMinimum size of marker in legend, even if plot size is smaller.- See Also:
-
SINGLE
MarkForm instance for a single point per tuple. -
PAIR
MarkForm instance for two points per tuple. -
QUAD
MarkForm instance for four points per tuple.
-
-
Constructor Details
-
MarkForm
Constructor.- Parameters:
npos
- number of points to mark per tuplename
- form nameicon
- form icon
-
-
Method Details
-
getBasicPositionCount
public int getBasicPositionCount()Description copied from interface:ShapeForm
Returns the number of basic data positions per tuple used by this form.- Specified by:
getBasicPositionCount
in interfaceShapeForm
- Returns:
- number of basic sets of positional coordinates
-
getFormName
Description copied from interface:ModePlotter.Form
Returns the user-directed name for this form.- Specified by:
getFormName
in interfaceModePlotter.Form
- Returns:
- form name
-
getFormIcon
Description copied from interface:ModePlotter.Form
Returns an icon to identify this form in the GUI.- Specified by:
getFormIcon
in interfaceModePlotter.Form
- Returns:
- form icon
-
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 interfaceShapeForm
- Returns:
- XML description of form
-
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 interfaceShapeForm
- Returns:
- additional plot coordinates
-
getExtraPositionCount
public int getExtraPositionCount()Description copied from interface:ShapeForm
Returns the number of extra coordinates that can be interpreted as positions.- Specified by:
getExtraPositionCount
in interfaceShapeForm
- Returns:
- number of positional extra coordinates
-
adjustGeom
Description copied from interface:ShapeForm
Provides a DataGeom to be used by the layer this form makes, given a DataGeom that characterises the plotting environment. The output should be similar to the input, for instance implementing the same plotType-specific DataGeom subtype.In most cases the supplied DataGeom instance can be returned unchanged, but instances with special requirements may want to adjust how the data is interpreted.
- Specified by:
adjustGeom
in interfaceShapeForm
- Parameters:
geom
- context geomdataSpec
- data specification with which the geom will be usedstyle
- style with which the geom will be used- Returns:
- geom to use for data interpretation, the same or similar to the input
-
hashCode
public int hashCode() -
equals
-
createMarkForm
Factory method to create an instance of this class.- Parameters:
npos
- number of positions per tuple- Returns:
- form instance
-
createMarkOutliner
Returns an outliner for use with single points.- Parameters:
shape
- marker shapesize
- marker size- Returns:
- single-point outliner
-
createMultiMarkOutliner
Returns an outliner for use with multiple points.- Parameters:
shape
- marker shapesize
- marker sizenpos
- number of positions per tuple- Returns:
- multi-point outliner
-
createMarkStyle
Creates a MarkStyle with a given size.- Parameters:
shape
- marker shapesize
- marker size in pixels- Returns:
- marker style
-
createMarkGlyph
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
Returns a legend icon suitable for a single marker.- Parameters:
shape
- marker shapesize
- marker size- Returns:
- legend icon
-