|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jfree.chart.axis.Axis
org.jfree.chart.axis.ValueAxis
org.jfree.chart.axis.LogAxis
org.opensha.commons.gui.plot.jfreechart.JFreeLogarithmicAxis
public class JFreeLogarithmicAxis
A numerical axis that uses a logarithmic scale.
| Field Summary | |
|---|---|
protected boolean |
expTickLabelsFlag
Flag set true for "1e#"-style tick labels. |
static double |
LOG10_VALUE
Useful constant for log(10). |
protected boolean |
log10TickLabelsInPowerFlag
Flag set true for representing the tick labels as the super script of 10 |
protected boolean |
minorAxisTickLabelFlag
Flag set true to show the tick labels for minor axis |
protected NumberFormat |
numberFormatterObj
Number formatter for generating numeric strings. |
static double |
SMALL_LOG_VALUE
Smallest arbitrarily-close-to-zero value allowed. |
protected boolean |
strictValuesFlag
Flag set true make axis throw exception if any values are <= 0 and 'allowNegativesFlag' is false. |
| Fields inherited from class org.jfree.chart.axis.ValueAxis |
|---|
DEFAULT_AUTO_RANGE, DEFAULT_AUTO_RANGE_MINIMUM_SIZE, DEFAULT_AUTO_TICK_UNIT_SELECTION, DEFAULT_INVERTED, DEFAULT_LOWER_BOUND, DEFAULT_LOWER_MARGIN, DEFAULT_RANGE, DEFAULT_UPPER_BOUND, DEFAULT_UPPER_MARGIN, MAXIMUM_TICK_COUNT |
| Fields inherited from class org.jfree.chart.axis.Axis |
|---|
DEFAULT_AXIS_LABEL_FONT, DEFAULT_AXIS_LABEL_INSETS, DEFAULT_AXIS_LABEL_PAINT, DEFAULT_AXIS_LINE_PAINT, DEFAULT_AXIS_LINE_STROKE, DEFAULT_AXIS_VISIBLE, DEFAULT_TICK_LABEL_FONT, DEFAULT_TICK_LABEL_INSETS, DEFAULT_TICK_LABEL_PAINT, DEFAULT_TICK_LABELS_VISIBLE, DEFAULT_TICK_MARK_INSIDE_LENGTH, DEFAULT_TICK_MARK_OUTSIDE_LENGTH, DEFAULT_TICK_MARK_PAINT, DEFAULT_TICK_MARK_STROKE, DEFAULT_TICK_MARKS_VISIBLE |
| Constructor Summary | |
|---|---|
JFreeLogarithmicAxis(String label)
|
|
| Method Summary | |
|---|---|
void |
autoAdjustRange()
Rescales the axis to ensure that all data is visible. |
protected double |
computeLogCeil(double upper)
Returns the smallest (closest to negative infinity) double value that is not less than the argument, is equal to a mathematical integer and satisfying the condition that log base 10 of the value is an integer (i.e., the value returned will be a power of 10: 1, 10, 100, 1000, etc.). |
protected double |
computeLogFloor(double lower)
Returns the largest (closest to positive infinity) double value that is not greater than the argument, is equal to a mathematical integer and satisfying the condition that log base 10 of the value is an integer (i.e., the value returned will be a power of 10: 1, 10, 100, 1000, etc.). |
protected org.jfree.chart.axis.AxisState |
drawTickMarksAndLabels(Graphics2D g2,
double cursor,
Rectangle2D plotArea,
Rectangle2D dataArea,
org.jfree.ui.RectangleEdge edge)
Draws the axis line, tick marks and tick mark labels. |
boolean |
getExpTickLabelsFlag()
Returns the 'expTickLabelsFlag' flag. |
boolean |
getLog10TickLabelsInPowerFlag()
Returns the 'log10TickLabelsInPowerFlag' flag. |
boolean |
getMinorAxisTickLabelFlag()
|
boolean |
getStrictValuesFlag()
Returns the 'strictValuesFlag' flag; if true then this axis will throw a runtime exception if any of its values are less than or equal to zero; if false then the axis will adjust for values less than or equal to zero as needed. |
protected String |
makeTickLabel(double val)
Converts the given value to a tick label string. |
protected String |
makeTickLabel(double val,
boolean forceFmtFlag)
Converts the given value to a tick label string. |
List |
refreshTicksHorizontal(Graphics2D g2,
Rectangle2D dataArea,
org.jfree.ui.RectangleEdge edge)
Calculates the positions of the tick labels for the axis, storing the results in the tick label list (ready for drawing). |
List |
refreshTicksVertical(Graphics2D g2,
Rectangle2D dataArea,
org.jfree.ui.RectangleEdge edge)
Calculates the positions of the tick labels for the axis, storing the results in the tick label list (ready for drawing). |
void |
setExpTickLabelsFlag()
Sets the 'expTickLabelsFlag' flag to true for for "1e#"-style tick labels, false for representing the power of 10 in superScript. |
void |
setLog10TickLabelsInPowerFlag()
Sets the 'log10TickLabelsInPowerFlag' flag to true for representing the power of 10 in superScript , false for "1e#"-style tick labels. |
void |
setMinorAxisTickLabelFlag(boolean flag)
Sets the minorAxisTickLabelFlag to true for showing the tick labels for minor axis, else sets it false. |
void |
setStrictValuesFlag(boolean flgVal)
Sets the 'strictValuesFlag' flag; if true; then this axis will throw a runtime exception if any of its values are less than or equal to zero; if false then the axis will adjust for values less than or equal to zero as needed. |
protected void |
setupNumberFmtObj()
Sets up the number formatter object according to the 'expTickLabelsFlag' flag. |
void |
setVerticalAnchorShift(float verticalAnchorShift)
This allows you to shift the tick labels vertically to fix some overlap issues (specifically with X axis). |
protected double |
switchedLog10(double val)
Returns the log10 value, depending on if values between 0 and 1 are being plotted. |
| Methods inherited from class org.jfree.chart.axis.LogAxis |
|---|
calculateLog, calculateValue, configure, createLogTickUnits, createTickLabel, draw, equals, estimateMaximumTickLabelHeight, estimateMaximumTickLabelWidth, exponentLengthToJava2D, getBase, getNumberFormatOverride, getSmallestValue, getTickUnit, hashCode, java2DToValue, pan, refreshTicks, selectAutoTickUnit, selectHorizontalAutoTickUnit, selectVerticalAutoTickUnit, setBase, setNumberFormatOverride, setSmallestValue, setTickUnit, setTickUnit, valueToJava2D, zoomRange |
| Methods inherited from class org.jfree.chart.axis.ValueAxis |
|---|
calculateAnchorPoint, centerRange, clone, drawAxisLine, findMaximumTickLabelHeight, findMaximumTickLabelWidth, getAutoRangeMinimumSize, getAutoTickIndex, getDefaultAutoRange, getDownArrow, getFixedAutoRange, getLeftArrow, getLowerBound, getLowerMargin, getMinorTickCount, getRange, getRightArrow, getStandardTickUnits, getUpArrow, getUpperBound, getUpperMargin, isAutoRange, isAutoTickUnitSelection, isInverted, isNegativeArrowVisible, isPositiveArrowVisible, isVerticalTickLabels, lengthToJava2D, reserveSpace, resizeRange, resizeRange, resizeRange2, setAutoRange, setAutoRange, setAutoRangeMinimumSize, setAutoRangeMinimumSize, setAutoTickIndex, setAutoTickUnitSelection, setAutoTickUnitSelection, setDefaultAutoRange, setDownArrow, setFixedAutoRange, setInverted, setLeftArrow, setLowerBound, setLowerMargin, setMinorTickCount, setNegativeArrowVisible, setPositiveArrowVisible, setRange, setRange, setRange, setRangeAboutValue, setRangeWithMargins, setRangeWithMargins, setRangeWithMargins, setRightArrow, setStandardTickUnits, setUpArrow, setUpperBound, setUpperMargin, setVerticalTickLabels |
| Methods inherited from class org.jfree.chart.axis.Axis |
|---|
addChangeListener, createAndAddEntity, drawLabel, fireChangeEvent, getAxisLinePaint, getAxisLineStroke, getFixedDimension, getLabel, getLabelAngle, getLabelEnclosure, getLabelFont, getLabelInsets, getLabelPaint, getMinorTickMarkInsideLength, getMinorTickMarkOutsideLength, getPlot, getTickLabelFont, getTickLabelInsets, getTickLabelPaint, getTickMarkInsideLength, getTickMarkOutsideLength, getTickMarkPaint, getTickMarkStroke, hasListener, isAxisLineVisible, isMinorTickMarksVisible, isTickLabelsVisible, isTickMarksVisible, isVisible, notifyListeners, removeChangeListener, setAxisLinePaint, setAxisLineStroke, setAxisLineVisible, setFixedDimension, setLabel, setLabelAngle, setLabelFont, setLabelInsets, setLabelInsets, setLabelPaint, setMinorTickMarkInsideLength, setMinorTickMarkOutsideLength, setMinorTickMarksVisible, setPlot, setTickLabelFont, setTickLabelInsets, setTickLabelPaint, setTickLabelsVisible, setTickMarkInsideLength, setTickMarkOutsideLength, setTickMarkPaint, setTickMarkStroke, setTickMarksVisible, setVisible |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double LOG10_VALUE
public static final double SMALL_LOG_VALUE
protected boolean strictValuesFlag
protected final NumberFormat numberFormatterObj
protected boolean expTickLabelsFlag
protected boolean log10TickLabelsInPowerFlag
protected boolean minorAxisTickLabelFlag
| Constructor Detail |
|---|
public JFreeLogarithmicAxis(String label)
| Method Detail |
|---|
public void setStrictValuesFlag(boolean flgVal)
flgVal - true for strict enforcement.public boolean getStrictValuesFlag()
public void setExpTickLabelsFlag()
protected void setupNumberFmtObj()
public boolean getExpTickLabelsFlag()
public void setLog10TickLabelsInPowerFlag()
public boolean getLog10TickLabelsInPowerFlag()
public void setMinorAxisTickLabelFlag(boolean flag)
flag - : sets the minorAxisTickLabel flag to true or falsepublic boolean getMinorAxisTickLabelFlag()
public List refreshTicksHorizontal(Graphics2D g2,
Rectangle2D dataArea,
org.jfree.ui.RectangleEdge edge)
refreshTicksHorizontal in class org.jfree.chart.axis.LogAxisg2 - the graphics device.dataArea - the area in which the plot should be drawn.edge - the location of the axis.protected double switchedLog10(double val)
val - the value.
public List refreshTicksVertical(Graphics2D g2,
Rectangle2D dataArea,
org.jfree.ui.RectangleEdge edge)
refreshTicksVertical in class org.jfree.chart.axis.LogAxisg2 - the graphics device.dataArea - the area in which the plot should be drawn.edge - the axis location.public void setVerticalAnchorShift(float verticalAnchorShift)
verticalAnchorShift -
protected org.jfree.chart.axis.AxisState drawTickMarksAndLabels(Graphics2D g2,
double cursor,
Rectangle2D plotArea,
Rectangle2D dataArea,
org.jfree.ui.RectangleEdge edge)
drawTickMarksAndLabels in class org.jfree.chart.axis.ValueAxisg2 - the graphics device.cursor - the cursor.plotArea - the plot area.dataArea - the data area.edge - the edge that the axis is aligned with.
protected String makeTickLabel(double val,
boolean forceFmtFlag)
val - the value to convert.forceFmtFlag - true to force the number-formatter object
to be used.
protected String makeTickLabel(double val)
val - the value to convert.
protected double computeLogFloor(double lower)
lower - a double value below which a floor will be calcualted.
protected double computeLogCeil(double upper)
upper - a double value above which a ceiling will be calcualted.
public void autoAdjustRange()
autoAdjustRange in class org.jfree.chart.axis.LogAxis
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||