public class PlotScene<P,A> extends Object
Constructor and Description |
---|
PlotScene(Ganger<P,A> ganger,
SurfaceFactory<P,A> surfFact,
ZoneContent<P,A>[] zoneContents,
Trimming[] trimmings,
ShadeAxisKit[] shadeKits,
PaperTypeSelector ptSel,
Compositor compositor,
PlotCaching caching)
Constructs a PlotScene containing multiple plot surfaces.
|
PlotScene(SurfaceFactory<P,A> surfFact,
ZoneContent<P,A> content,
Trimming trimming,
ShadeAxisKit shadeKit,
PaperTypeSelector ptSel,
Compositor compositor,
Padding padding,
PlotCaching caching)
Constructs a PlotScene containing a single plot surface.
|
Modifier and Type | Method and Description |
---|---|
static Map<AuxScale,Span> |
calculateNonShadeSpans(PlotLayer[] layers,
Surface surface,
Object[] plans,
DataStore dataStore)
Gathers requested ranging information from data,
excluding the AuxScale.COLOR item (the aux shading axis).
|
static Span |
calculateShadeSpan(List<Bi<Surface,PlotLayer>> surfLayers,
ShadeAxisKit shadeKit,
Object[] plans,
DataStore dataStore)
Gathers ranging information for the aux shading axis from data.
|
void |
clearPlot()
Clears the current cached plot image, if any, so that regeneration
of the image from the data is forced when the next paint operation
is performed; otherwise it may be copied from a cached image.
|
static <P,A> PlotScene<P,A> |
createGangScene(Ganger<P,A> ganger,
SurfaceFactory<P,A> surfFact,
PlotLayer[][] layerArrays,
P[] profiles,
ConfigMap[] aspectConfigs,
Trimming[] trimmings,
ShadeAxisKit[] shadeKits,
PaperTypeSelector ptSel,
Compositor compositor,
DataStore dataStore,
PlotCaching caching)
Utility method to construct a ganged PlotDisplay, with aspect
obtained from a supplied config map.
|
IndicatedRow[] |
findClosestRows(Surface surface,
PlotLayer[] layers,
Point point,
DataStore dataStore)
Assembles and returns a list of row indexes that are plotted close to
a given graphics position.
|
A[] |
getAspects()
Returns the most recently set aspects.
|
Gang |
getGang()
Returns the current plot gang.
|
Ganger<P,A> |
getGanger()
Returns the Ganger used by this scene.
|
PlotLayer[] |
getLayers(int iz)
Returns the plot layers contained in a given zone.
|
Surface[] |
getSurfaces()
Returns the current plot surfaces.
|
int |
getZoneIndex(Point pos)
Returns the index of the zone in whose data bounds a given point lies.
|
void |
paintScene(Graphics g,
Rectangle extBounds,
DataStore dataStore)
Paints the contents of this plot to a graphics context.
|
void |
prepareScene(Rectangle extBounds,
DataStore dataStore)
Ensures that the plot surfaces are ready to plot this scene.
|
boolean |
setAspects(A[] aspects)
Sets the aspects of the plot zones.
|
public PlotScene(Ganger<P,A> ganger, SurfaceFactory<P,A> surfFact, ZoneContent<P,A>[] zoneContents, Trimming[] trimmings, ShadeAxisKit[] shadeKits, PaperTypeSelector ptSel, Compositor compositor, PlotCaching caching)
The zoneContents array must have a number of entries that
matches the zone count of the ganger.
The trimmings and shadeKits are supplied as arrays, and in each case
may be either a 1- or nzone-element array depending on the Ganger's
Ganger.isTrimmingGlobal()
/Ganger.isShadingGlobal()
flags.
ganger
- defines plot surface groupingsurfFact
- surface factoryzoneContents
- plot content with initial aspect by zone
(nz-element array)trimmings
- plot decoration specification by zone
(nz- or 1-element array, elements may be null)shadeKits
- shader axis kits by zone
(nz- or 1-element array, elements may be null)ptSel
- paper type selectorcompositor
- compositor for pixel compositioncaching
- plot caching policypublic PlotScene(SurfaceFactory<P,A> surfFact, ZoneContent<P,A> content, Trimming trimming, ShadeAxisKit shadeKit, PaperTypeSelector ptSel, Compositor compositor, Padding padding, PlotCaching caching)
surfFact
- surface factorycontent
- plot content with initial aspecttrimming
- specification of additional decorationshadeKit
- shader axis specifier, or null if not requiredptSel
- paper type selectorcompositor
- compositor for pixel compositionpadding
- user requirements for external spacecaching
- plot caching policypublic Gang getGang()
public PlotLayer[] getLayers(int iz)
iz
- zone indexpublic void clearPlot()
@Slow public void prepareScene(Rectangle extBounds, DataStore dataStore)
paintScene(java.awt.Graphics, java.awt.Rectangle, uk.ac.starlink.ttools.plot2.data.DataStore)
, but may be
invoked directly if only the preparation and not the plotting itself
is required.extBounds
- external bounds of the plot, including any
space required for axis labels, legend, padding etcdataStore
- data storage object@Slow public void paintScene(Graphics g, Rectangle extBounds, DataStore dataStore)
g
- graphics contextextBounds
- external bounds of the plot, including any
space required for axis labels, legend, padding etcdataStore
- data storage objectpublic boolean setAspects(A[] aspects)
aspects
- per-zone array of required aspectspublic A[] getAspects()
public Surface[] getSurfaces()
public int getZoneIndex(Point pos)
pos
- graphics position@Slow public IndicatedRow[] findClosestRows(Surface surface, PlotLayer[] layers, Point point, DataStore dataStore)
surface
- plot surface on which layers are plottedlayers
- layers plottedpoint
- graphics position to which the selection event refersdataStore
- data storage object@Slow public static <P,A> PlotScene<P,A> createGangScene(Ganger<P,A> ganger, SurfaceFactory<P,A> surfFact, PlotLayer[][] layerArrays, P[] profiles, ConfigMap[] aspectConfigs, Trimming[] trimmings, ShadeAxisKit[] shadeKits, PaperTypeSelector ptSel, Compositor compositor, DataStore dataStore, PlotCaching caching)
The layerArrays, profiles and aspectConfigs arrays must have the
same length as the ganger zone count.
The trimmings and shadeKits are supplied as arrays, and in each case
may be either a 1- or nzone-element array depending on the Ganger's
Ganger.isTrimmingGlobal()
/Ganger.isShadingGlobal()
flags.
ganger
- defines plot groupingsurfFact
- surface factorylayerArrays
- per-zone layer arrays (nz-element array)profiles
- per-zone profiles (nz-element array);
should be result of ganger.adjustProfilesaspectConfigs
- per-zone config map providing entries
for surf.getAspectKeys (nz-element arrays)trimmings
- plot decoration specification by zone
(nz- or 1-element array,elements may be null)shadeKits
- shader axis specifiers by zone
(nz- or 1-element array, elements may be null)ptSel
- paper type selectorcompositor
- compositor for pixel compositiondataStore
- data storage objectcaching
- plot caching policy
on every repaint@Slow public static Map<AuxScale,Span> calculateNonShadeSpans(PlotLayer[] layers, Surface surface, Object[] plans, DataStore dataStore)
layers
- plot layerssurface
- surface on which layers will be plottedplans
- array of calculated plan objects, or nulldataStore
- data storage objectcalculateShadeSpan(java.util.List<uk.ac.starlink.util.Bi<uk.ac.starlink.ttools.plot2.Surface, uk.ac.starlink.ttools.plot2.PlotLayer>>, uk.ac.starlink.ttools.plot2.ShadeAxisKit, java.lang.Object[], uk.ac.starlink.ttools.plot2.data.DataStore)
,
AuxScale.COLOR
@Slow public static Span calculateShadeSpan(List<Bi<Surface,PlotLayer>> surfLayers, ShadeAxisKit shadeKit, Object[] plans, DataStore dataStore)
surfLayers
- list of paired (surface,layer) items corresponding
to the plot that will be performedshadeKit
- specifies shader axis, or nullplans
- array of calculated plan objects, or nulldataStore
- data storage objectAuxScale.COLOR
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.