public class TimeSurfaceFactory extends Object implements SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>
| Modifier and Type | Class and Description |
|---|---|
static class |
TimeSurfaceFactory.Profile
Profile class which defines fixed configuration items for a TimeSurface.
|
| Modifier and Type | Field and Description |
|---|---|
static ConfigKey<Boolean> |
GRID_KEY
Config key to determine if grid lines are drawn.
|
static ConfigKey<OrientationPolicy> |
ORIENTATIONS_KEY
Config key to control axis label orientation.
|
static ConfigKey<TimeJELFunction> |
T2FUNC_KEY
Config key for secondary time axis function.
|
static ConfigKey<String> |
T2LABEL_KEY
Config key for secondary time axis text label.
|
static ConfigKey<Double> |
TCROWD_KEY
Config key to control tick mark crowding on time axis.
|
static ConfigKey<TimeFormat> |
TFORMAT_KEY
Config key to control time value formatting.
|
static ConfigKey<String> |
TLABEL_KEY
Config key for time axis text label.
|
static ConfigKey<Double> |
TMAX_KEY
Config key for time axis upper bound, before subranging.
|
static ConfigKey<Double> |
TMIN_KEY
Config key for time axis lower bound, before subranging.
|
static ConfigKey<Subrange> |
TSUBRANGE_KEY
Config key for time axis subrange.
|
static ConfigKey<JELFunction> |
Y2FUNC_KEY
Config key for secondary Y axis function.
|
static ConfigKey<String> |
Y2LABEL_KEY
Config key for secondary Y axis text label.
|
static ConfigKey<Double> |
YCROWD_KEY
Config key to control tick mark crowding on Y axis.
|
static ConfigKey<Boolean> |
YFLIP_KEY
Config key for Y axis flip flag.
|
static ConfigKey<String> |
YLABEL_KEY
Config key for Y axis text label.
|
static ConfigKey<Boolean> |
YLOG_KEY
Config key for deprecated Y axis log scale flag.
|
static ConfigKey<Double> |
YMAX_KEY
Config key for Y axis upper bound, before subranging.
|
static ConfigKey<Double> |
YMIN_KEY
Config key for Y axis lower bound, before subranging.
|
static ConfigKey<Scale> |
YSCALE_KEY
Config key for Y axis scale flag.
|
static ConfigKey<Subrange> |
YSUBRANGE_KEY
Config key for Y axis subrange.
|
| Constructor and Description |
|---|
TimeSurfaceFactory() |
| Modifier and Type | Method and Description |
|---|---|
TimeAspect |
createAspect(TimeSurfaceFactory.Profile profile,
ConfigMap config,
Range[] ranges)
Creates an aspect from configuration information.
|
Navigator<TimeAspect> |
createNavigator(ConfigMap navConfig)
Creates a navigator from configuration information.
|
TimeSurfaceFactory.Profile |
createProfile(ConfigMap config)
Creates a profile that can be used when creating a plot surface.
|
Surface |
createSurface(Rectangle plotBounds,
TimeSurfaceFactory.Profile profile,
TimeAspect aspect)
Returns a new plot surface.
|
ConfigMap |
getAspectConfig(Surface surf)
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(TimeSurfaceFactory.Profile profile,
PlotLayer[] layers,
DataStore dataStore)
Provides the ranges that may be passed to
createAspect. |
boolean |
useRanges(TimeSurfaceFactory.Profile profile,
ConfigMap config)
Indicates whether ranges should be provided to generate an aspect.
|
public static final ConfigKey<Double> TMIN_KEY
public static final ConfigKey<Double> TMAX_KEY
public static final ConfigKey<Subrange> TSUBRANGE_KEY
public static final ConfigKey<Double> YMIN_KEY
public static final ConfigKey<Double> YMAX_KEY
public static final ConfigKey<Boolean> YLOG_KEY
public static final ConfigKey<TimeJELFunction> T2FUNC_KEY
public static final ConfigKey<JELFunction> Y2FUNC_KEY
public static final ConfigKey<String> T2LABEL_KEY
public static final ConfigKey<String> Y2LABEL_KEY
public static final ConfigKey<Boolean> GRID_KEY
public static final ConfigKey<Double> TCROWD_KEY
public static final ConfigKey<Double> YCROWD_KEY
public static final ConfigKey<OrientationPolicy> ORIENTATIONS_KEY
public static final ConfigKey<TimeFormat> TFORMAT_KEY
public Surface createSurface(Rectangle plotBounds, TimeSurfaceFactory.Profile profile, TimeAspect aspect)
SurfaceFactorycreateSurface in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>plotBounds - rectangle to containing actual plot data
(not insets)profile - configuration object defining plot styleaspect - configuration object defining plot viewpointpublic ConfigKey<?>[] getProfileKeys()
SurfaceFactorycreateProfile method.getProfileKeys in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>public TimeSurfaceFactory.Profile createProfile(ConfigMap config)
SurfaceFactorygetProfileKeys.
The return value can be used as input to
createSurface and other methods in this class.createProfile in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>config - map of profile configuration itemspublic ConfigKey<?>[] getAspectKeys()
SurfaceFactoryuseRanges and
createAspect methods.getAspectKeys in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>public boolean useRanges(TimeSurfaceFactory.Profile profile, ConfigMap config)
SurfaceFactoryreadRanges to createAspect
alongside the arguments of this method.
If false, any such ranges will be ignored.useRanges in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>profile - surface configuration profileconfig - configuration map that may contain keys from
getAspectKeyspublic TimeAspect createAspect(TimeSurfaceFactory.Profile profile, ConfigMap config, Range[] ranges)
SurfaceFactoryuseRanges
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.createAspect in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>profile - surface configuration profileconfig - configuration map that may contain keys from
getAspectKeysranges - range data filled in from layers, or nullpublic ConfigMap getAspectConfig(Surface surf)
SurfaceFactorycreateAspect 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.
getAspectConfig in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>surf - plot surface; if it was not created by this factory,
behaviour is undefinedpublic Range[] readRanges(TimeSurfaceFactory.Profile profile, PlotLayer[] layers, DataStore dataStore)
SurfaceFactorycreateAspect.
There is only any point calling this if useRanges
returns true.readRanges in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>profile - surface configuration profilelayers - plot layers to be plotteddataStore - contains actual datapublic ConfigKey<?>[] getNavigatorKeys()
SurfaceFactorySurfaceFactory.createNavigator(uk.ac.starlink.ttools.plot2.config.ConfigMap) method.getNavigatorKeys in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>public Navigator<TimeAspect> createNavigator(ConfigMap navConfig)
SurfaceFactorycreateNavigator in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>navConfig - configuration map that may contain keys from
getNavigatorKeyspublic PlotMetric getPlotMetric()
SurfaceFactorygetPlotMetric in interface SurfaceFactory<TimeSurfaceFactory.Profile,TimeAspect>Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.