Class PaperTypeSelector
java.lang.Object
uk.ac.starlink.ttools.plot2.paper.PaperTypeSelector
Provides interface and logic for determining what PaperType
(rendering machinery) to use to render a given selection of
plot layers to a given output medium.
A
PlotType
provides an instance of this class.- Since:
- 14 Feb 2013
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic PaperTypeSelector
Default selector for 2d output.static PaperTypeSelector
Default selector for 3d output. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PaperTypeSelector
createSingleSelector
(PaperType ptype) Returns a selector which always returns a fixed paper type.static LayerOpt[]
Returns an array of layer options corresponding to an array of layers.abstract PaperType
getPixelPaperType
(LayerOpt[] opts, Compositor compositor) Supplies a PaperType appropriate for rendering to a bitmap (pixellated) output medium.abstract PaperType
getVectorPaperType
(LayerOpt[] opts) Supplies a PaperType appropriate for rendering to a vector (non-pixellated) output medium.
-
Field Details
-
SELECTOR_2D
Default selector for 2d output. -
SELECTOR_3D
Default selector for 3d output.
-
-
Constructor Details
-
PaperTypeSelector
public PaperTypeSelector()
-
-
Method Details
-
getVectorPaperType
Supplies a PaperType appropriate for rendering to a vector (non-pixellated) output medium.- Parameters:
opts
- layer options- Returns:
- paper type
-
getPixelPaperType
Supplies a PaperType appropriate for rendering to a bitmap (pixellated) output medium.- Parameters:
opts
- layer optionscompositor
- compositor for combining colours (relevant only if some transparency is present)- Returns:
- paper type
-
createSingleSelector
Returns a selector which always returns a fixed paper type. This is only useful for debugging.- Parameters:
ptype
- fixed paper type- Returns:
- selector
-
getOpts
Returns an array of layer options corresponding to an array of layers.- Parameters:
layers
- layers- Returns:
- layer options, same length as layers array
-