public abstract class StackGanger<P,A> extends Object implements Ganger<P,A>
Modifier and Type | Field and Description |
---|---|
static ConfigKey<Integer> |
ZONEGAP_KEY
Config key for vertical gap between zones.
|
Modifier | Constructor and Description |
---|---|
protected |
StackGanger(String[] zoneNames,
boolean isUp,
Padding padding,
int zoneGap)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
A[] |
adjustAspects(A[] aspects,
int index)
Adjusts plot surface aspects as required to ensure that plot data
regions in a ganged set of zones are consistent.
|
P[] |
adjustProfiles(P[] profiles)
Adjusts plot surface profiles as required for plots appearing
in multiple plots within a gang.
|
Gang |
createApproxGang(Rectangle extBounds)
Constructs an approximate gang instance given only minimal information.
|
Gang |
createGang(Rectangle[] zonePlotBounds)
Creates a gang given the graphics coordinates of the individual zones.
|
Gang |
createGang(Rectangle gangExtBox,
SurfaceFactory<P,A> surfFact,
ZoneContent<P,A>[] contents,
Trimming[] trimmings,
ShadeAxis[] shadeAxes,
boolean withScroll)
Creates a gang given the external bounds for the whole plotting area
and other required information that characterises each zone.
|
abstract A |
fixXLimits(A aspect,
double xmin,
double xmax)
Modifies an aspect object to give it fixed data limits on the
horizontal axis.
|
abstract double[] |
getXLimits(A aspect)
Returns the data limits of the horizontal axis defined by a given aspect.
|
int |
getZoneCount()
Returns the number of zones in gangs produced by this ganger.
|
String[] |
getZoneNames()
Returns a list of identifiers, one for each zone in gangs
produced by this ganger.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isShadingGlobal, isTrimmingGlobal
protected StackGanger(String[] zoneNames, boolean isUp, Padding padding, int zoneGap)
zoneNames
- one string identifier for each required zoneisUp
- true if zones are ordered upwards on the graphics plane,
false if they go downpadding
- defines user preferences, if any, for space
reserved outside the whole gangzoneGap
- vertical gap between zones in gangpublic abstract double[] getXLimits(A aspect)
aspect
- surface aspectpublic abstract A fixXLimits(A aspect, double xmin, double xmax)
aspect
- input surface aspectxmin
- required lower limit on horizontal axisxmax
- required upper limit on horizontal axispublic int getZoneCount()
Ganger
getZoneCount
in interface Ganger<P,A>
public String[] getZoneNames()
public Gang createGang(Rectangle[] zonePlotBounds)
Ganger
The supplied rectangle arguments give the bounds of the data area for each zone. This does not include any space for axis labels and other annotations, which are assumed to be available as required.
createGang
in interface Ganger<P,A>
zonePlotBounds
- array of data bounds, one for each zonepublic Gang createGang(Rectangle gangExtBox, SurfaceFactory<P,A> surfFact, ZoneContent<P,A>[] contents, Trimming[] trimmings, ShadeAxis[] shadeAxes, boolean withScroll)
Ganger
The form of the trimmings
and shadeAxes
arrays are as determined by the Ganger.isTrimmingGlobal()
and
Ganger.isShadingGlobal()
methods; the length of each respective array
must be one for the global case, and the same as the length of the
zoneContents
array in the per-zone case.
createGang
in interface Ganger<P,A>
gangExtBox
- total area enclosing all zones and associated
axis labels, annotations etcsurfFact
- surface factorycontents
- plot content for each zone (nz-element array)trimmings
- additional decorations
(1- or nz-element array, elements may be null)shadeAxes
- shading axes
(1- or nz-element array, elements may be null)withScroll
- true if the positioning should work well
even after some user scrollingpublic Gang createApproxGang(Rectangle extBounds)
Ganger
createApproxGang
in interface Ganger<P,A>
extBounds
- total area enclosing all zones and associated
axis labels, annotations etcpublic A[] adjustAspects(A[] aspects, int index)
Ganger
If a reference index greater than or equal to zero is supplied, this denotes the "master" zone, to which the other aspects should be adjusted. Otherwise, the aspects should be adjusted more democratically, treating all their requirements equally. With a reference index the other aspects might be adjusted to equal the master one, and without they might all be adjusted to cover the union of the ranges defined. If the reference index is >= the number of zones, behaviour is undefined.
adjustAspects
in interface Ganger<P,A>
aspects
- unadjusted aspectsindex
- index of reference aspect in array, or -1 for no referencepublic P[] adjustProfiles(P[] profiles)
Ganger
adjustProfiles
in interface Ganger<P,A>
profiles
- unadjusted profilesCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.