Constructor and Description |
---|
Axis(int glo,
int ghi,
double dlo,
double dhi,
Scale scale,
boolean flip)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
double[] |
dataPan(double d0,
double d1)
Returns the data bounds that result from performing an axis pan
between two given data positions.
|
double |
dataToGraphics(double d)
Converts a data coordinate to the graphics position on this axis.
|
double[] |
dataZoom(double d0,
double factor)
Returns the data bounds that result from performing an axis zoom
about a given data position.
|
void |
drawLabels(Tick[] ticks,
String title,
Captioner captioner,
TickLook tickLook,
Orientation orient,
boolean invert,
Graphics g)
Draws an axis title and supplied tickmarks.
|
boolean |
equals(Object o) |
double[] |
getDataLimits()
Returns the axis data bounds.
|
int[] |
getGraphicsLimits()
Returns the axis graphics bounds.
|
Rectangle |
getLabelBounds(Tick[] ticks,
String title,
Captioner captioner,
Orientation orient,
boolean invert)
Determines the bounds for axis and tickmark annotations.
|
Scale |
getScale()
Returns the scale used by this axis.
|
double |
graphicsToData(double g)
Converts a graphics position on this axis to a data coordinate.
|
int |
hashCode() |
boolean |
isFlip()
Indicates whether this axis has the scaling reversed.
|
public Axis(int glo, int ghi, double dlo, double dhi, Scale scale, boolean flip)
glo
- minimum graphics coordinateghi
- maximum graphics coordinatedlo
- minimum data coordinatedhi
- maximum data coordinatescale
- scaling functionflip
- true if the data coordinates should run
in the opposite sense to the graphics coordinatespublic double dataToGraphics(double d)
d
- data coordinatepublic double graphicsToData(double g)
g
- graphics coordinatepublic double[] dataZoom(double d0, double factor)
d0
- data reference position for zoomfactor
- amount to zoompublic double[] dataPan(double d0, double d1)
d0
- source data positiond1
- destination data positionpublic int[] getGraphicsLimits()
glo
)
is always strictly less than the second (ghi
).public double[] getDataLimits()
dlo
)
is always strictly less than the second (dhi
).public Scale getScale()
public boolean isFlip()
public void drawLabels(Tick[] ticks, String title, Captioner captioner, TickLook tickLook, Orientation orient, boolean invert, Graphics g)
ticks
- tickmark arraytitle
- axis label text, may be nullcaptioner
- text positioning objecttickLook
- tick drawing styleorient
- axis orientation codeinvert
- whether to reverse sense of axisg
- graphics contextpublic Rectangle getLabelBounds(Tick[] ticks, String title, Captioner captioner, Orientation orient, boolean invert)
drawLabels(uk.ac.starlink.ttools.plot2.Tick[], java.lang.String, uk.ac.starlink.ttools.plot2.Captioner, uk.ac.starlink.ttools.plot2.TickLook, uk.ac.starlink.ttools.plot2.Orientation, boolean, java.awt.Graphics)
.ticks
- tickmark arraytitle
- axis label text, may be nullcaptioner
- text positioning objectorient
- axis orientation codeinvert
- whether to reverse sense of axisCopyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.