Class SingleAdapterZoneController<P,A>

java.lang.Object
uk.ac.starlink.topcat.plot2.SingleAdapterZoneController<P,A>
All Implemented Interfaces:
Configger, ZoneController<P,A>

public class SingleAdapterZoneController<P,A> extends Object implements ZoneController<P,A>
ZoneController implementation for use with one-zone plots. This is a wrapper around the legacy AxisController class.
Since:
18 Aug 2023
Author:
Mark Taylor
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears aspect constraints explicitly set by the user.
    Returns the plot aspect to use for setting up the plot surface.
    protected AxisController<P,A>
     
    uk.ac.starlink.ttools.plot2.config.ConfigMap
    Returns a configuration map.
    uk.ac.starlink.ttools.plot2.Navigator<A>
    Returns the navigator specified by this control.
    uk.ac.starlink.ttools.plot.Range[]
    Returns the current fixed data coordinate ranges.
    void
    setAspect(A aspect)
    Sets the plot aspect which defines the view on the data.
    void
    setLatestSurface(uk.ac.starlink.ttools.plot2.Surface surface)
    Accepts information about the latest plotting surface to be plotted by the panel associated with this controller.
    void
    setRanges(uk.ac.starlink.ttools.plot.Range[] ranges)
    Sets fixed data position coordinate ranges.
    void
    submitReports(Map<LayerId,uk.ac.starlink.ttools.plot2.ReportMap> reports)
    Accepts report information generated by plotting layers.
    void
    updateState(P profile, uk.ac.starlink.ttools.plot2.PlotLayer[] layers, boolean axisLock)
    Configures this controller for a given set of plot layers.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SingleAdapterZoneController

      public SingleAdapterZoneController(AxisController<P,A> axisController)
      Constructor.
      Parameters:
      axisController - object to which behaviour is delegated
  • Method Details

    • getAxisController

      protected AxisController<P,A> getAxisController()
    • setRanges

      public void setRanges(uk.ac.starlink.ttools.plot.Range[] ranges)
      Description copied from interface: ZoneController
      Sets fixed data position coordinate ranges. If these are not set then they may need to be calculated by examining the data to work out the plot aspect. Setting them to null ensures a re-range if required next time.
      Specified by:
      setRanges in interface ZoneController<P,A>
      Parameters:
      ranges - fixed data position coordinate ranges, or null to clear
    • getRanges

      public uk.ac.starlink.ttools.plot.Range[] getRanges()
      Description copied from interface: ZoneController
      Returns the current fixed data coordinate ranges. If not known, null is returned.
      Specified by:
      getRanges in interface ZoneController<P,A>
      Returns:
      fixed data position coordinate ranges, or null if not known
    • setAspect

      public void setAspect(A aspect)
      Description copied from interface: ZoneController
      Sets the plot aspect which defines the view on the data. If not set, it may have to be worked out from config and range inputs.
      Specified by:
      setAspect in interface ZoneController<P,A>
      Parameters:
      aspect - fixed aspect, or null to clear
    • getAspect

      public A getAspect()
      Description copied from interface: ZoneController
      Returns the plot aspect to use for setting up the plot surface. If not known, null is returned.
      Specified by:
      getAspect in interface ZoneController<P,A>
      Returns:
      fixed aspect, or null if none set
    • clearAspect

      public void clearAspect()
      Description copied from interface: ZoneController
      Clears aspect constraints explicitly set by the user.
      Specified by:
      clearAspect in interface ZoneController<P,A>
    • updateState

      public void updateState(P profile, uk.ac.starlink.ttools.plot2.PlotLayer[] layers, boolean axisLock)
      Description copied from interface: ZoneController
      Configures this controller for a given set of plot layers. This may trigger a resetting of the aspect and ranges, generally if the new plot is sufficiently different from most recent one.

      This isn't perfect, since it only allows to clear the range or not. Sometimes you might want finer control, e.g. to clear the range in one dimension and retain it in others. It may be possible to fit that into the updateState API, but it would require more work.

      Specified by:
      updateState in interface ZoneController<P,A>
      Parameters:
      profile - surface profile
      layers - layers which will be plotted
      axisLock - whether re-ranging is inhibited; normally, if true axes will not be reset by this method, but the implementation can override that if it needs to
    • submitReports

      public void submitReports(Map<LayerId,uk.ac.starlink.ttools.plot2.ReportMap> reports)
      Description copied from interface: ZoneController
      Accepts report information generated by plotting layers. Null map values are permitted, with the same meaning as an empty map.

      The default implementation does nothing, but subclasses may override it to enquire about plot results.

      Specified by:
      submitReports in interface ZoneController<P,A>
      Parameters:
      reports - per-layer plot reports for layers generated by the most recent plot
    • setLatestSurface

      public void setLatestSurface(uk.ac.starlink.ttools.plot2.Surface surface)
      Description copied from interface: ZoneController
      Accepts information about the latest plotting surface to be plotted by the panel associated with this controller. This method is intended for passing information back to this controller, which does not otherwise have access to the asynchronously constructed Surface object it has configured, it is not an instruction to adjust the current state.

      The default implementation does nothing, but subclasses may override it to acquire information about plot state.

      Specified by:
      setLatestSurface in interface ZoneController<P,A>
      Parameters:
      surface - latest plotting surface.
    • getNavigator

      public uk.ac.starlink.ttools.plot2.Navigator<A> getNavigator()
      Description copied from interface: ZoneController
      Returns the navigator specified by this control.
      Specified by:
      getNavigator in interface ZoneController<P,A>
      Returns:
      current navigator
    • getConfig

      public uk.ac.starlink.ttools.plot2.config.ConfigMap getConfig()
      Description copied from interface: Configger
      Returns a configuration map. Calling this method will typically gather information from a GUI to return.
      Specified by:
      getConfig in interface Configger
      Returns:
      config map