Class PlotPosition


  • @Equality
    public class PlotPosition
    extends java.lang.Object
    Characterises explicit settings for how to position a plot component in graphics coordinates. This aggregates width and height, giving the external dimensions of the whole plot graphic, and a Padding object, giving the gaps between the dimension and the data region of the plot (this is where axis annotations etc are usually drawn).

    Any of these Integer dimensions may be null, indicating that no explicit settings are in force. Where there is no explicit setting, the plotting machinery is expected to come up with sensible defaults.

    Since:
    18 Dec 2014
    Author:
    Mark Taylor
    • Constructor Summary

      Constructors 
      Constructor Description
      PlotPosition()
      Constructs a PlotPosition with no explicit settings.
      PlotPosition​(java.lang.Integer width, java.lang.Integer height, uk.ac.starlink.ttools.plot2.Padding padding)
      Constructs a PlotPosition from a Dimension and Insets.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.Integer getHeight()
      Returns the external height for the plot, if specified.
      uk.ac.starlink.ttools.plot2.Padding getPadding()
      Returns settings for the border between the data region and exterior dimensions of a plot.
      java.lang.Integer getWidth()
      Returns the external width for the plot, if specified.
      int hashCode()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PlotPosition

        public PlotPosition()
        Constructs a PlotPosition with no explicit settings.
      • PlotPosition

        public PlotPosition​(java.lang.Integer width,
                            java.lang.Integer height,
                            uk.ac.starlink.ttools.plot2.Padding padding)
        Constructs a PlotPosition from a Dimension and Insets.
        Parameters:
        width - external plot width, may be null
        height - external plot height, may be null
        padding - border between external plot dimensions and data region, may be null or have null members
    • Method Detail

      • getWidth

        public java.lang.Integer getWidth()
        Returns the external width for the plot, if specified.
        Returns:
        required external plot width in pixels, or null
      • getHeight

        public java.lang.Integer getHeight()
        Returns the external height for the plot, if specified.
        Returns:
        required external plot height in pixels, or null
      • getPadding

        public uk.ac.starlink.ttools.plot2.Padding getPadding()
        Returns settings for the border between the data region and exterior dimensions of a plot. The return value is not null, but any of its members may be.
        Returns:
        settings for border between plot data region and exterior, not null
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object