public abstract class AbstractZoneController<P,A> extends Object implements ZoneController<P,A>
Modifier | Constructor and Description |
---|---|
protected |
AbstractZoneController(uk.ac.starlink.ttools.plot2.SurfaceFactory<P,A> surfFact)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
clearRange(P oldProfile,
P newProfile,
uk.ac.starlink.ttools.plot2.PlotLayer[] oldLayers,
uk.ac.starlink.ttools.plot2.PlotLayer[] newLayers,
boolean lock)
Indicates whether a new configuration should result in clearing
the current ranges and plot aspect.
|
protected abstract boolean |
forceClearRange(P oldProfile,
P newProfile)
Determines whether the change between two profiles forces an
unconditional re-range of the plotting surface.
|
A |
getAspect()
Returns the plot aspect to use for setting up the plot surface.
|
uk.ac.starlink.ttools.plot2.Navigator<A> |
getNavigator()
Returns the navigator specified by this control.
|
uk.ac.starlink.ttools.plot.Range[] |
getRanges()
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clearAspect
public void setRanges(uk.ac.starlink.ttools.plot.Range[] ranges)
setRanges
in interface ZoneController<P,A>
ranges
- fixed data position coordinate ranges, or null to clearpublic uk.ac.starlink.ttools.plot.Range[] getRanges()
getRanges
in interface ZoneController<P,A>
public void setAspect(A aspect)
setAspect
in interface ZoneController<P,A>
aspect
- fixed aspect, or null to clearpublic A getAspect()
getAspect
in interface ZoneController<P,A>
public void updateState(P profile, uk.ac.starlink.ttools.plot2.PlotLayer[] layers, boolean axisLock)
clearRange
.
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.
updateState
in interface ZoneController<P,A>
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 topublic void submitReports(Map<LayerId,uk.ac.starlink.ttools.plot2.ReportMap> reports)
The default implementation does nothing, but subclasses may override it to enquire about plot results.
submitReports
in interface ZoneController<P,A>
reports
- per-layer plot reports for layers generated
by the most recent plotpublic void setLatestSurface(uk.ac.starlink.ttools.plot2.Surface surface)
The default implementation does nothing, but subclasses may override it to acquire information about plot state.
setLatestSurface
in interface ZoneController<P,A>
surface
- latest plotting surface.public uk.ac.starlink.ttools.plot2.Navigator<A> getNavigator()
getNavigator
in interface ZoneController<P,A>
protected boolean clearRange(P oldProfile, P newProfile, uk.ac.starlink.ttools.plot2.PlotLayer[] oldLayers, uk.ac.starlink.ttools.plot2.PlotLayer[] newLayers, boolean lock)
oldProfile
- profile for last plotnewProfile
- profile for next plotoldLayers
- layer set for last plotnewLayers
- layer set for next plotlock
- whether re-ranging is inhibited;
normally, if lock
is true this
method should return false, but the implementation
can overrule this and return true even when locked
if it needs toprotected abstract boolean forceClearRange(P oldProfile, P newProfile)
oldProfile
- profile before changenewProfile
- profile after changeCopyright © 2003-2025 CCLRC: Council for the Central Laboratory of the Research Councils. All Rights Reserved.