Class StyleKeys
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.config.StyleKeys
-
public class StyleKeys extends java.lang.Object
Contains many common config keys and associated utility methods.- Since:
- 25 Feb 2013
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description static ConfigKey<Anchor>
ANCHOR
Config key for text anchor positioning.static ConfigKey<java.lang.Boolean>
ANTIALIAS
Config key for line antialiasing.static ConfigKey<java.lang.Boolean>
AUTOSCALE
Config key for autoscale flag for markers in data space.static ConfigKey<java.lang.Boolean>
AUTOSCALE_PIX
Config key for autoscale flag for markers in pixel space.static ConfigKey<java.lang.Double>
AUX_CROWD
Config key for aux axis tick crowding.static ConfigKey<java.awt.Color>
AUX_NULLCOLOR
Config key for aux null colour.static ConfigKey<java.lang.Double>
AUX_OPAQUE
Config key for the opacity limit of auxiliary shaded plots.static RampKeySet
AUX_RAMP
Config key set for global Aux axis colour ramp.static ConfigKey<java.awt.Color>
AXLABEL_COLOR
Config key for axis label colour.static ConfigKey<BarStyle.Form>
BAR_FORM
Config key for histogram bar style.static CaptionerKeySet
CAPTIONER
Config key set for axis and general captioner.static ConfigKey<java.awt.Color>
COLOR
Config key for style colour.static ConfigKey<java.lang.Boolean>
CUMULATIVE
Config key for cumulative histogram flag.static ConfigKey<float[]>
DASH
Config key for line dash style.static RampKeySet
DENSITY_RAMP
Config key set for density point shading.static MultiPointConfigKey
ELLIPSE_SHAPE
Config key for ellipse marker style.static MultiPointConfigKey
ERROR_SHAPE_1D
Config key for 1d (vertical) error marker style.static MultiPointConfigKey
ERROR_SHAPE_2D
Config key for 2d error marker style.static MultiPointConfigKey
ERROR_SHAPE_3D
Config key for 3d error marker style.static ConfigKey<FillMode>
FILL
Config key for KDE fill mode.static ConfigKey<java.lang.Boolean>
GRID_ANTIALIAS
Config key for axis grid antialiasing.static ConfigKey<java.awt.Color>
GRID_COLOR
Config key for axis grid colour.static ConfigKey<java.lang.String>
LABEL
Config key for a layer label string.static ConfigKey<LevelMode>
LEVEL_MODE
Config key for scaling level mode.static ConfigKey<MarkShape>
MARK_SHAPE
Config key for marker shape.static ConfigKey<java.lang.Boolean>
MINOR_TICKS
Config key for minor tick drawing key.static ConfigKey<Normalisation>
NORMALISE
Config key for histogram normalisation mode on generic axis.static ConfigKey<java.lang.Double>
SCALE
Config key for scaling of markers in data space.static ConfigKey<java.lang.Double>
SCALE_PIX
Config key for scaling of markers in pixel space.static ConfigKey<java.lang.Double>
SHADE_HIGH
Config key for aux shader upper limit.static ConfigKey<java.lang.Double>
SHADE_LOW
Config key for aux shader lower limit.static ConfigKey<Subrange>
SHADE_SUBRANGE
Config key for aux shader subrange.static ConfigKey<java.lang.Boolean>
SHOW_LABEL
Config key for legend inclusion flag.static ConfigKey<java.lang.Integer>
SIZE
Config key for marker size.static ConfigKey<java.lang.Double>
TRANSPARENCY
Config key for "normal" transparency - it's just 1-alpha.static ConfigKey<java.lang.Double>
TRANSPARENT_LEVEL
Config key for transparency level of adaptive transparent plots.static MultiPointConfigKey
VECTOR_SHAPE
Config key for vector marker style.static ConfigKey<XYShape>
XYSHAPE
Config key for XY shape.static ConfigKey<java.lang.Double>
ZOOM_FACTOR
Config key for zoom factor.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ClippedShader[]
createAuxShaders()
Returns a list of shaders suitable for aux axis shading.static ConfigKey<java.lang.String>
createAxisLabelKey(java.lang.String axName)
Returns an axis labelling config key.static ConfigKey<java.lang.Double>
createCrowdKey(ConfigMeta meta)
Returns an axis tick mark crowding config key.static ConfigKey<MarkShape>
createMarkShapeKey(ConfigMeta meta, MarkShape dflt)
Returns a config key for choosing marker shape.static ConfigKey<java.lang.Integer>
createMarkSizeKey(ConfigMeta meta, int dflt)
Returns a config key for choosing marker size in pixels.static ConfigKey<java.awt.Color>
createNullColorKey(java.lang.String axname, java.lang.String axName)
Returns a key for acquiring a colour used in place of a shading ramp colour in case that the input data is null.static ConfigKey<java.lang.Double>
createOpaqueKey(int dfltValue)
Returns a key for acquiring an opacity value; the value is the number of pixels that have to be overplotted on a given position to completely obscure the background.static java.awt.Stroke
createStroke(ConfigMap config, int cap, int join)
Obtains a line drawing stroke based on a config map.static ConfigKey<java.lang.Integer>
createThicknessKey(int dfltThick)
Returns a config key for line thickness with a given default value.static java.awt.Color
getAlphaColor(ConfigMap config, ConfigKey<java.awt.Color> colorKey, ConfigKey<java.lang.Double> transparencyKey)
Returns a colour specified by a basic colour key and a transparency key.static ConfigKey<?>[]
getStrokeKeys()
Returns a list of config keys for configuring a line-drawing stroke.
-
-
-
Field Detail
-
SIZE
public static final ConfigKey<java.lang.Integer> SIZE
Config key for marker size.
-
COLOR
public static final ConfigKey<java.awt.Color> COLOR
Config key for style colour.
-
AUX_OPAQUE
public static final ConfigKey<java.lang.Double> AUX_OPAQUE
Config key for the opacity limit of auxiliary shaded plots.
-
TRANSPARENT_LEVEL
public static final ConfigKey<java.lang.Double> TRANSPARENT_LEVEL
Config key for transparency level of adaptive transparent plots.
-
TRANSPARENCY
public static final ConfigKey<java.lang.Double> TRANSPARENCY
Config key for "normal" transparency - it's just 1-alpha.
-
DASH
public static final ConfigKey<float[]> DASH
Config key for line dash style.
-
GRID_COLOR
public static final ConfigKey<java.awt.Color> GRID_COLOR
Config key for axis grid colour.
-
AXLABEL_COLOR
public static final ConfigKey<java.awt.Color> AXLABEL_COLOR
Config key for axis label colour.
-
BAR_FORM
public static final ConfigKey<BarStyle.Form> BAR_FORM
Config key for histogram bar style.
-
CUMULATIVE
public static final ConfigKey<java.lang.Boolean> CUMULATIVE
Config key for cumulative histogram flag.
-
NORMALISE
public static final ConfigKey<Normalisation> NORMALISE
Config key for histogram normalisation mode on generic axis.
-
ANTIALIAS
public static final ConfigKey<java.lang.Boolean> ANTIALIAS
Config key for line antialiasing.
-
GRID_ANTIALIAS
public static final ConfigKey<java.lang.Boolean> GRID_ANTIALIAS
Config key for axis grid antialiasing.
-
VECTOR_SHAPE
public static final MultiPointConfigKey VECTOR_SHAPE
Config key for vector marker style.
-
ELLIPSE_SHAPE
public static final MultiPointConfigKey ELLIPSE_SHAPE
Config key for ellipse marker style.
-
ERROR_SHAPE_1D
public static final MultiPointConfigKey ERROR_SHAPE_1D
Config key for 1d (vertical) error marker style.
-
ERROR_SHAPE_2D
public static final MultiPointConfigKey ERROR_SHAPE_2D
Config key for 2d error marker style.
-
ERROR_SHAPE_3D
public static final MultiPointConfigKey ERROR_SHAPE_3D
Config key for 3d error marker style.
-
AUX_CROWD
public static final ConfigKey<java.lang.Double> AUX_CROWD
Config key for aux axis tick crowding.
-
SHADE_LOW
public static final ConfigKey<java.lang.Double> SHADE_LOW
Config key for aux shader lower limit.
-
SHADE_HIGH
public static final ConfigKey<java.lang.Double> SHADE_HIGH
Config key for aux shader upper limit.
-
SHADE_SUBRANGE
public static final ConfigKey<Subrange> SHADE_SUBRANGE
Config key for aux shader subrange.
-
AUX_NULLCOLOR
public static final ConfigKey<java.awt.Color> AUX_NULLCOLOR
Config key for aux null colour.
-
SCALE
public static final ConfigKey<java.lang.Double> SCALE
Config key for scaling of markers in data space.
-
SCALE_PIX
public static final ConfigKey<java.lang.Double> SCALE_PIX
Config key for scaling of markers in pixel space.
-
AUTOSCALE
public static final ConfigKey<java.lang.Boolean> AUTOSCALE
Config key for autoscale flag for markers in data space.
-
AUTOSCALE_PIX
public static final ConfigKey<java.lang.Boolean> AUTOSCALE_PIX
Config key for autoscale flag for markers in pixel space.
-
LABEL
public static final ConfigKey<java.lang.String> LABEL
Config key for a layer label string.
-
SHOW_LABEL
public static final ConfigKey<java.lang.Boolean> SHOW_LABEL
Config key for legend inclusion flag.
-
MINOR_TICKS
public static final ConfigKey<java.lang.Boolean> MINOR_TICKS
Config key for minor tick drawing key.
-
ZOOM_FACTOR
public static final ConfigKey<java.lang.Double> ZOOM_FACTOR
Config key for zoom factor.
-
CAPTIONER
public static final CaptionerKeySet CAPTIONER
Config key set for axis and general captioner.
-
AUX_RAMP
public static final RampKeySet AUX_RAMP
Config key set for global Aux axis colour ramp.
-
DENSITY_RAMP
public static final RampKeySet DENSITY_RAMP
Config key set for density point shading.
-
-
Method Detail
-
getStrokeKeys
public static ConfigKey<?>[] getStrokeKeys()
Returns a list of config keys for configuring a line-drawing stroke. Pass a map with values for these to thecreateStroke
method.- Returns:
- stroke key list
- See Also:
createStroke(uk.ac.starlink.ttools.plot2.config.ConfigMap, int, int)
-
createStroke
public static java.awt.Stroke createStroke(ConfigMap config, int cap, int join)
Obtains a line drawing stroke based on a config map. The keys used are those returned bygetStrokeKeys
. The line join and cap policy must be provided.- Parameters:
config
- config mapcap
- one ofBasicStroke
's CAP_* constantsjoin
- one ofBasicStroke
's JOIN_* constants- Returns:
- stroke
-
createMarkShapeKey
public static ConfigKey<MarkShape> createMarkShapeKey(ConfigMeta meta, MarkShape dflt)
Returns a config key for choosing marker shape.- Parameters:
meta
- metadatadflt
- default shape value- Returns:
- new key
-
createMarkSizeKey
public static ConfigKey<java.lang.Integer> createMarkSizeKey(ConfigMeta meta, int dflt)
Returns a config key for choosing marker size in pixels.- Parameters:
meta
- metadatadflt
- default size value- Returns:
- new key
-
createCrowdKey
public static ConfigKey<java.lang.Double> createCrowdKey(ConfigMeta meta)
Returns an axis tick mark crowding config key.- Parameters:
meta
- metadata- Returns:
- new key
-
createAxisLabelKey
public static ConfigKey<java.lang.String> createAxisLabelKey(java.lang.String axName)
Returns an axis labelling config key.- Parameters:
axName
- axis name- Returns:
- new key
-
createNullColorKey
public static ConfigKey<java.awt.Color> createNullColorKey(java.lang.String axname, java.lang.String axName)
Returns a key for acquiring a colour used in place of a shading ramp colour in case that the input data is null.- Parameters:
axname
- short form of axis name, used in text parameter namesaxName
- long form of axis name, used in descriptions- Returns:
- new key
-
createOpaqueKey
public static ConfigKey<java.lang.Double> createOpaqueKey(int dfltValue)
Returns a key for acquiring an opacity value; the value is the number of pixels that have to be overplotted on a given position to completely obscure the background.- Parameters:
dfltValue
- default opacity; the lowest sensible value is 1 (no transparency)- Returns:
- new key
-
createThicknessKey
public static ConfigKey<java.lang.Integer> createThicknessKey(int dfltThick)
Returns a config key for line thickness with a given default value.- Parameters:
dfltThick
- default value for line width in pixels- Returns:
- new config key
-
getAlphaColor
public static java.awt.Color getAlphaColor(ConfigMap config, ConfigKey<java.awt.Color> colorKey, ConfigKey<java.lang.Double> transparencyKey)
Returns a colour specified by a basic colour key and a transparency key.- Parameters:
config
- config mapcolorKey
- key for colour, for instanceCOLOR
transparencyKey
- key for 1-alpha, for instanceTRANSPARENCY
-
createAuxShaders
public static ClippedShader[] createAuxShaders()
Returns a list of shaders suitable for aux axis shading.- Returns:
- shaders
-
-