Class MultiPointForm

  • All Implemented Interfaces:
    ModePlotter.Form, ShapeForm
    Direct Known Subclasses:
    SkyMultiPointForm

    public abstract class MultiPointForm
    extends java.lang.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 Detail

      • MultiPointForm

        public MultiPointForm​(java.lang.String name,
                              javax.swing.Icon icon,
                              java.lang.String description,
                              MultiPointCoordSet extraCoordSet,
                              MultiPointConfigKey rendererKey,
                              ConfigKey<?>[] otherKeys)
        Constructor.
        Parameters:
        name - shapeform name
        icon - shapeform icon
        description - XML description
        extraCoordSet - defines the extra positional coordinates used to plot multipoint shapes
        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
        otherKeys - additional config keys
    • Method Detail

      • getScaleFactor

        protected abstract double getScaleFactor​(ConfigMap config)
        Returns a fixed constant by which to scale all (autoscaled or not autoscaled) offset values before plotting.
        Parameters:
        config - config map
        Returns:
        constant scaling factor
      • isAutoscale

        protected abstract boolean isAutoscale​(ConfigMap config)
        Indicates whether autoscaling should be applied. If true, before plotting is carried out a scan of all the data values is performed to determine the range of values, and the supplied offsets are scaled accordingly, so that the largest ones are a reasonable size on the screen.
        Parameters:
        config - config map
        Returns:
        true for autoscaling false to use raw values
      • 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 java.lang.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 javax.swing.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 java.lang.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
      • 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​(java.lang.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
      • getDefaultScalingDescription

        public static java.lang.String getDefaultScalingDescription​(java.lang.String shapename)
        Returns XML text suitable for inclusion in a MultiPointForm description explaining how the scaling of marker sizes is controlled. This corresponds to the behaviour of the createDefaultForm method.
        Parameters:
        shapename - human-readable name of the shape being plotted by this form
        Returns:
        description text <p> element
      • createErrorForm

        public static MultiPointForm createErrorForm​(java.lang.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
      • createDefaultForm

        public static MultiPointForm createDefaultForm​(java.lang.String name,
                                                       javax.swing.Icon icon,
                                                       java.lang.String description,
                                                       MultiPointCoordSet extraCoordSet,
                                                       MultiPointConfigKey rendererKey,
                                                       boolean canScale)
        Returns a new MultiPointForm with scaling in one of two default configurations, depending on the value of the supplied canScale parameter. If true, then the StyleKeys SCALE and AUTOSCALE keys are used to configure scaling, and if false, no scaling is provided.
        Parameters:
        name - shapeform name
        icon - shapeform icon
        description - XML description
        extraCoordSet - defines the extra positional coordinates used to plot multipoint shapes
        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
        canScale - true for standard scaling configuration, false for no scaling