public interface SurfaceFactory<P,A>
Modifier and Type | Method and Description |
---|---|
A |
createAspect(P profile,
ConfigMap aspectConfig,
Range[] ranges)
Creates an aspect from configuration information.
|
Navigator<A> |
createNavigator(ConfigMap navigatorConfig)
Creates a navigator from configuration information.
|
P |
createProfile(ConfigMap config)
Creates a profile that can be used when creating a plot surface.
|
Surface |
createSurface(Rectangle plotBounds,
P profile,
A aspect)
Returns a new plot surface.
|
ConfigMap |
getAspectConfig(Surface surface)
Returns a ConfigMap that corresponds to the configuration of
the given surface, which must have been created by this factory.
|
ConfigKey<?>[] |
getAspectKeys()
Returns the configuration keys that may be used to configure aspect
for this surface factory.
|
ConfigKey<?>[] |
getNavigatorKeys()
Returns the configuration keys that may be used to configure
a navigator for use with this surface factory.
|
PlotMetric |
getPlotMetric()
Returns an object that can assess distances between graphic
positions on the plot surface.
|
ConfigKey<?>[] |
getProfileKeys()
Returns the configuration keys used to configure profile for this
surface factory.
|
Range[] |
readRanges(P profile,
PlotLayer[] layers,
DataStore dataStore)
Provides the ranges that may be passed to
createAspect . |
boolean |
useRanges(P profile,
ConfigMap aspectConfig)
Indicates whether ranges should be provided to generate an aspect.
|
Surface createSurface(Rectangle plotBounds, P profile, A aspect)
plotBounds
- rectangle to containing actual plot data
(not insets)profile
- configuration object defining plot styleaspect
- configuration object defining plot viewpointConfigKey<?>[] getProfileKeys()
createProfile
method.P createProfile(ConfigMap config)
getProfileKeys
.
The return value can be used as input to
createSurface
and other methods in this class.config
- map of profile configuration itemsConfigKey<?>[] getAspectKeys()
useRanges
and
createAspect
methods.boolean useRanges(P profile, ConfigMap aspectConfig)
readRanges
to createAspect
alongside the arguments of this method.
If false, any such ranges will be ignored.profile
- surface configuration profileaspectConfig
- configuration map that may contain keys from
getAspectKeys
@Slow Range[] readRanges(P profile, PlotLayer[] layers, DataStore dataStore)
createAspect
.
There is only any point calling this if useRanges
returns true.profile
- surface configuration profilelayers
- plot layers to be plotteddataStore
- contains actual dataA createAspect(P profile, ConfigMap aspectConfig, Range[] ranges)
useRanges
returns true.
It is legal to give the ranges argument as null in any case.
In all cases, the returned value must be non-null and usable by
createSurface
.profile
- surface configuration profileaspectConfig
- configuration map that may contain keys from
getAspectKeys
ranges
- range data filled in from layers, or nullConfigMap getAspectConfig(Surface surface)
createAspect
method with
the right profile should come up with approximately the same
surface, preferably without reference to any supplied ranges.
The returned config items should be optimised for presentation to the user, so that for instance decimal values are reported to a reasonable level of precision. Because of this, and perhaps for other reasons related to implementation, a surface resulting from feeding the returned config back to this factory may not be identical to the supplied surface, so round-tripping is not guaranteed to be exact.
surface
- plot surface; if it was not created by this factory,
behaviour is undefinedConfigKey<?>[] getNavigatorKeys()
createNavigator(uk.ac.starlink.ttools.plot2.config.ConfigMap)
method.Navigator<A> createNavigator(ConfigMap navigatorConfig)
navigatorConfig
- configuration map that may contain keys from
getNavigatorKeys
PlotMetric getPlotMetric()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.