Package uk.ac.starlink.topcat.plot2
Class SingleAdapterZoneController<P,A>
java.lang.Object
uk.ac.starlink.topcat.plot2.SingleAdapterZoneController<P,A>
- All Implemented Interfaces:
Configger
,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
ConstructorsConstructorDescriptionSingleAdapterZoneController
(AxisController<P, A> axisController) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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
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.
-
Constructor Details
-
SingleAdapterZoneController
Constructor.- Parameters:
axisController
- object to which behaviour is delegated
-
-
Method Details
-
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 interfaceZoneController<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 interfaceZoneController<P,
A> - Returns:
- fixed data position coordinate ranges, or null if not known
-
setAspect
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 interfaceZoneController<P,
A> - Parameters:
aspect
- fixed aspect, or null to clear
-
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 interfaceZoneController<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 interfaceZoneController<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 interfaceZoneController<P,
A> - Parameters:
profile
- surface profilelayers
- layers which will be plottedaxisLock
- 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
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 interfaceZoneController<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 interfaceZoneController<P,
A> - Parameters:
surface
- latest plotting surface.
-
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.
-