|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.topcat.plot2.AxisController<P,A>
public abstract class AxisController<P,A>
Object which configures details of a plot's axes, including surface aspect and ranges. As well as methods which are used by the plot classes to interrogate and configure the plot programmatically, this supplies one or more controls to be placed in the GUI allowing user control of these things.
Constructor Summary | |
---|---|
protected |
AxisController(uk.ac.starlink.ttools.plot2.SurfaceFactory<P,A> surfFact)
Constructor. |
Method Summary | |
---|---|
void |
addActionListener(ActionListener listener)
Adds a listener notified when any of the controls changes. |
protected void |
addAspectConfigTab(String label,
uk.ac.starlink.ttools.plot2.config.Specifier<uk.ac.starlink.ttools.plot2.config.ConfigMap> aspectSpecifier)
Adds a tab to the main control for specifying the aspect. |
void |
addControl(ConfigControl control)
Adds a control to the list of controls managed by this object. |
protected void |
addNavigatorTab()
Adds a tab to the main control for selecting navigator options. |
boolean |
assertHasKeys(uk.ac.starlink.ttools.plot2.config.ConfigKey[] requiredKeys)
Utility method to assert that all of a given set of keys are actually being obtained by this controller. |
void |
clearAspect()
Clears any settings in tabs added by the addAspectConfigTab method. |
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. |
abstract void |
configureForLayers(LayerControl[] layerControls)
This abstract method provides a hook for implementations to adjust their GUI state based on the layer controls which will be supplying layers for them to plot. |
protected uk.ac.starlink.topcat.plot2.AxisController.DataId |
createDataId(uk.ac.starlink.ttools.plot2.PlotLayer layer)
Returns an object that characterises a plot layer for ranging purposes. |
protected abstract boolean |
forceClearRange(P oldProfile,
P newProfile)
Determines whether the change between two profiles forces an unconditional re-range of the plotting surface. |
ActionListener |
getActionForwarder()
Returns an object which will forward actions to listeners registered with this panel. |
A |
getAspect()
Returns the plot aspect to use for setting up the plot surface. |
uk.ac.starlink.ttools.plot2.config.ConfigMap |
getConfig()
Returns the configuration defined by all this object's controls. |
Control[] |
getControls()
Returns all the controls for user configuration of this controller. |
ConfigControl |
getMainControl()
Returns the control that provides the main part of the GUI configurability. |
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. |
uk.ac.starlink.ttools.plot2.SurfaceFactory<P,A> |
getSurfaceFactory()
Returns this control's surface factory. |
void |
removeActionListener(ActionListener listener)
Removes a listener previously added by addActionListener. |
void |
setAspect(A aspect)
Sets the plot aspect which defines the view on the data. |
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 Detail |
---|
protected AxisController(uk.ac.starlink.ttools.plot2.SurfaceFactory<P,A> surfFact)
surfFact
- plot surface factoryMethod Detail |
---|
public uk.ac.starlink.ttools.plot2.SurfaceFactory<P,A> getSurfaceFactory()
public ConfigControl getMainControl()
public Control[] getControls()
public void addControl(ConfigControl control)
control
- control to addpublic uk.ac.starlink.ttools.plot2.config.ConfigMap getConfig()
getConfig
in interface Configger
public void addActionListener(ActionListener listener)
listener
- listener to addpublic void removeActionListener(ActionListener listener)
listener
- listener to removepublic ActionListener getActionForwarder()
public void setRanges(uk.ac.starlink.ttools.plot.Range[] ranges)
ranges
- fixed data position coordinate ranges, or null to clearpublic uk.ac.starlink.ttools.plot.Range[] getRanges()
public void setAspect(A aspect)
aspect
- fixed aspect, or null to clearpublic A getAspect()
public abstract void configureForLayers(LayerControl[] layerControls)
layerControls
- layer controls expected to provide layers
to be plotted on these axesprotected void addNavigatorTab()
public uk.ac.starlink.ttools.plot2.Navigator<A> getNavigator()
protected void addAspectConfigTab(String label, uk.ac.starlink.ttools.plot2.config.Specifier<uk.ac.starlink.ttools.plot2.config.ConfigMap> aspectSpecifier)
label
- tab labelaspectSpecifier
- config specifier for aspect keyspublic void clearAspect()
addAspectConfigTab
method.
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.
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 boolean assertHasKeys(uk.ac.starlink.ttools.plot2.config.ConfigKey[] requiredKeys)
requiredKeys
- list of keys this control should obtain
getConfig
method contains entries
for all the required keys
AssertionError
- if the result would be false and assertions
are enabledpublic 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.
reports
- per-layer plot reports for layers generated
by the most recent plotprotected 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 to
protected abstract boolean forceClearRange(P oldProfile, P newProfile)
oldProfile
- profile before changenewProfile
- profile after change
@Equality protected uk.ac.starlink.topcat.plot2.AxisController.DataId createDataId(uk.ac.starlink.ttools.plot2.PlotLayer layer)
Equality
)
results from this method should be treated as having the same ranges.
layer
- plot layer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |