Class TickSkyAxisLabeller

  • All Implemented Interfaces:
    SkyAxisLabeller

    public abstract class TickSkyAxisLabeller
    extends java.lang.Object
    implements SkyAxisLabeller
    Partial SkyAxisLabeller implementation that labels axes with positioned numeric labels.
    Since:
    21 Feb 2013
    Author:
    Mark Taylor
    • Field Detail

      • X_ANCHOR

        public static Anchor X_ANCHOR
      • Y_ANCHOR

        public static Anchor Y_ANCHOR
    • Constructor Detail

      • TickSkyAxisLabeller

        public TickSkyAxisLabeller​(java.lang.String name,
                                   java.lang.String description)
        Constructor.
        Parameters:
        name - labeller name
        description - labeller description
    • Method Detail

      • getLabellerName

        public java.lang.String getLabellerName()
        Description copied from interface: SkyAxisLabeller
        Returns a name for this axis labelling mode.
        Specified by:
        getLabellerName in interface SkyAxisLabeller
        Returns:
        one-word name
      • calculateTicks

        protected abstract TickSkyAxisLabeller.SkyTick[] calculateTicks​(double[][][] lines,
                                                                        java.lang.String[] labels,
                                                                        java.awt.Rectangle plotBounds)
        Returns a list of ticks for labelling lines produced by a GridLiner.
        Parameters:
        lines - gridliner line point array
        labels - gridliner line label array
        plotBounds - extent of plot region in graphics coordinates
        See Also:
        GridLiner
      • removeOverlaps

        protected TickSkyAxisLabeller.SkyTick[] removeOverlaps​(TickSkyAxisLabeller.SkyTick[] ticks,
                                                               Captioner captioner)
        Takes a list of ticks and removes some elements if they are so crowded together the labels overlap.
        Parameters:
        ticks - input tick list
        captioner - text renderer
        Returns:
        output tick list, with some items removed if necessary
      • createExternalTick

        public static TickSkyAxisLabeller.SkyTick createExternalTick​(java.lang.String label,
                                                                     double[][] line,
                                                                     java.awt.Rectangle bounds)
        Constructs a single tick that sits outside the plot bounding box for a given grid line.
        Parameters:
        label - tick text
        line - grid line coordinates - array of (x,y) arrays
        bounds - plot region bounds
      • createInternalTick

        public static TickSkyAxisLabeller.SkyTick createInternalTick​(java.lang.String label,
                                                                     double[][] line)
        Constructs a single tick that sits inside the plot bounding box for a given grid line.
        Parameters:
        label - tick text
        line - grid line coordinates - array of (x,y) arrays