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

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

public class MultiPointForm
extends Object
implements ShapeForm

ShapeForm implementation that draws shapes based on a single main position, and a number of additional positions supplied as extra coordinates. The extra coordinates required (defining one or more non-central data positions) are defined by a supplied MultiPointCoordSet and those coordinates are then plotted by a corresponding ErrorRenderer. ErrorRenderer may be a slightly misleading name in this context, but you can think of any of these multi-point shapes as a generalisation of error bars.

Since:
18 Feb 2013
Author:
Mark Taylor

Constructor Summary
MultiPointForm(String name, Icon icon, String description, MultiPointCoordSet extraCoordSet, boolean canScale, MultiPointConfigKey rendererKey)
          Constructor.
 
Method Summary
static MultiPointForm createEllipseForm(String name, MultiPointCoordSet extraCoordSet, boolean canScale)
          Returns a MultiPointForm instance for drawing ellipses around the central position.
static MultiPointForm createErrorForm(String name, MultiPointCoordSet extraCoordSet, MultiPointConfigKey rendererKey)
          Returns a MultiPointForm for drawing error bars.
 Outliner createOutliner(ConfigMap config)
          Returns an object which will do the work of drawing shapes when supplied with the appropriate style information and data.
static MultiPointForm createVectorForm(String name, MultiPointCoordSet extraCoordSet, boolean canScale)
          Returns a MultiPointForm instance for drawing arrows from the central position to another position.
 ConfigKey[] getConfigKeys()
          Returns style configuration keys specific to this form.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiPointForm

public MultiPointForm(String name,
                      Icon icon,
                      String description,
                      MultiPointCoordSet extraCoordSet,
                      boolean canScale,
                      MultiPointConfigKey rendererKey)
Constructor.

Parameters:
name - shapeform name
icon - shapeform icon
description - XML description
extraCoordSet - defines the extra positional coordinates used to plot multipoint shapes
canScale - true if a configuration option to scale the shapes should be supplied
rendererKey - config key for the renderer; provides option to vary the shape, but any renderer specified by it must be expecting data corresponding to the extraCoordSet parameter
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

getConfigKeys

public ConfigKey[] getConfigKeys()
Description copied from interface: ShapeForm
Returns style configuration keys specific to this form. These keys will be used in the config map supplied to ShapeForm.createOutliner(uk.ac.starlink.ttools.plot2.config.ConfigMap).

Specified by:
getConfigKeys in interface ShapeForm
Returns:
config keys

createOutliner

public Outliner createOutliner(ConfigMap config)
Description copied from interface: ShapeForm
Returns an object which will do the work of drawing shapes when supplied with the appropriate style information and data. The significant keys in the supplied config map are those given by ShapeForm.getConfigKeys().

Specified by:
createOutliner in interface ShapeForm
Parameters:
config - configuration map from which values for this form's config keys will be extracted
Returns:
new outliner object

createVectorForm

public static MultiPointForm createVectorForm(String name,
                                              MultiPointCoordSet extraCoordSet,
                                              boolean canScale)
Returns a MultiPointForm instance for drawing arrows from the central position to another position.

Parameters:
name - form name
extraCoordSet - nDataDim-element coord set that defines one extra data position, the (unscaled) endpoint of the vector
canScale - whether to offer vector size scaling
Returns:
new vector form instance

createEllipseForm

public static MultiPointForm createEllipseForm(String name,
                                               MultiPointCoordSet extraCoordSet,
                                               boolean canScale)
Returns a MultiPointForm instance for drawing ellipses around the central position.

Parameters:
name - form name
extraCoordSet - 3-element coord set containing major/minor radius (order not significant) and position angle in degrees
canScale - whether to offer vector size scaling
Returns:
new vector form instance

createErrorForm

public static MultiPointForm createErrorForm(String name,
                                             MultiPointCoordSet extraCoordSet,
                                             MultiPointConfigKey rendererKey)
Returns a MultiPointForm for drawing error bars.

Parameters:
name - form name
extraCoordSet - coord set specifying error bar position endpoints
rendererKey - config key for specifying error renderers
Returns:
new error form instance


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