Class HandleArrayForm

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

public class HandleArrayForm extends Object implements ShapeForm
Form for drawing markers to identify X/Y array data. These markers can be used as point locations for plotted lines, which otherwise do not have a localised position so that they can't otherwise be used for activation actions etc.
Since:
18 Aug 2022
Author:
Mark Taylor
  • Field Details

    • PLACEMENT_KEY

      public static final ConfigKey<XYArrayPlacement> PLACEMENT_KEY
      Config key for handle placement.
    • FRACTION_KEY

      public static final ConfigKey<Double> FRACTION_KEY
      Config key for placement fractional position.
    • SHAPE_KEY

      public static final ConfigKey<MarkerShape> SHAPE_KEY
      Config key for handle shape.
    • SIZE_KEY

      public static final ConfigKey<Integer> SIZE_KEY
      Config key for handle size.
  • 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 interface ShapeForm
      Returns:
      number of basic sets of positional coordinates
    • 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
    • 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 interface ShapeForm
      Returns:
      number of positional extra 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
    • adjustGeom

      public DataGeom adjustGeom(DataGeom geom, DataSpec dataSpec, ShapeStyle style)
      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 interface ShapeForm
      Parameters:
      geom - context geom
      dataSpec - data specification with which the geom will be used
      style - style with which the geom will be used
      Returns:
      geom to use for data interpretation, the same or similar to the input
    • 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
    • getInstance

      public static HandleArrayForm getInstance()
      Returns the sole instance of this singleton class.
      Returns:
      instance