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 TypeMethodDescriptionvoidClears 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.ConfigMapReturns 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.voidSets the plot aspect which defines the view on the data.voidsetLatestSurface(uk.ac.starlink.ttools.plot2.Surface surface) Accepts information about the latest plotting surface to be plotted by the panel associated with this controller.voidsetRanges(uk.ac.starlink.ttools.plot.Range[] ranges) Sets fixed data position coordinate ranges.voidsubmitReports(Map<LayerId, uk.ac.starlink.ttools.plot2.ReportMap> reports) Accepts report information generated by plotting layers.voidupdateState(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:ZoneControllerSets 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:
setRangesin 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:ZoneControllerReturns the current fixed data coordinate ranges. If not known, null is returned.- Specified by:
getRangesin interfaceZoneController<P,A> - Returns:
- fixed data position coordinate ranges, or null if not known
-
setAspect
Description copied from interface:ZoneControllerSets 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:
setAspectin interfaceZoneController<P,A> - Parameters:
aspect- fixed aspect, or null to clear
-
getAspect
Description copied from interface:ZoneControllerReturns the plot aspect to use for setting up the plot surface. If not known, null is returned.- Specified by:
getAspectin interfaceZoneController<P,A> - Returns:
- fixed aspect, or null if none set
-
clearAspect
public void clearAspect()Description copied from interface:ZoneControllerClears aspect constraints explicitly set by the user.- Specified by:
clearAspectin interfaceZoneController<P,A>
-
updateState
public void updateState(P profile, uk.ac.starlink.ttools.plot2.PlotLayer[] layers, boolean axisLock) Description copied from interface:ZoneControllerConfigures 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:
updateStatein 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:ZoneControllerAccepts 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:
submitReportsin 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:ZoneControllerAccepts 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:
setLatestSurfacein interfaceZoneController<P,A> - Parameters:
surface- latest plotting surface.
-
getConfig
-