/** * Tests this formatter for equality with an arbitrary object. * * @param obj the object ({@code null} permitted). * * @return A boolean. */ @Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof NumberTickUnit)) { return false; } if (!super.equals(obj)) { return false; } NumberTickUnit that = (NumberTickUnit) obj; if (!this.formatter.equals(that.formatter)) { return false; } return true; }
/** * Compares this tick unit to an arbitrary object. * * @param object the object to compare against. * * @return <code>1</code> if the size of the other object is less than this, * <code>0</code> if both have the same size and <code>-1</code> this * size is less than the others. */ public int compareTo(Object object) { if (object instanceof TickUnit) { TickUnit other = (TickUnit) object; if (this.size > other.getSize()) { return 1; } else if (this.size < other.getSize()) { return -1; } else { return 0; } } else { return -1; } }
/** * Returns a hash code for this instance. * * @return A hash code. */ @Override public int hashCode() { int result = super.hashCode(); result = 29 * result + (this.formatter != null ? this.formatter.hashCode() : 0); return result; }
/** * Generates a list of tick values for the angular tick marks. * * @return A list of {@link NumberTick} instances. * * @since 1.0.10 */ protected List refreshAngleTicks() { List ticks = new ArrayList(); for (double currentTickVal = 0.0; currentTickVal < 360.0; currentTickVal += this.angleTickUnit.getSize()) { NumberTick tick = new NumberTick(new Double(currentTickVal), this.angleTickUnit.valueToString(currentTickVal), TextAnchor.CENTER, TextAnchor.CENTER, 0.0); ticks.add(tick); } return ticks; }
double size = tu.getSize(); int count = calculateVisibleTickCount(); double lowestTickValue = calculateLowestVisibleTickValue(); int minorTickSpaces = getMinorTickCount(); if (minorTickSpaces <= 0) { minorTickSpaces = tu.getMinorTickCount();
candidate); double candidateWidth = exponentLengthToJava2D(candidate.getSize(), dataArea, edge); if (tickLabelWidth < candidateWidth) { prevCandidate = candidate; candidate = tickUnits.getLargerTickUnit(prevCandidate); if (candidate.equals(prevCandidate)) { found = true; // there are no more candidates
lowerStr = unit.valueToString(lower); upperStr = unit.valueToString(upper);
@Override public TickUnit getLargerTickUnit(TickUnit unit) { TickUnit newUnit = decorated.getLargerTickUnit(unit); if(newUnit.compareTo(lowerUnit)<0) { return lowerUnit; } else { return newUnit; } } };
double size = tu.getSize(); int count = calculateVisibleTickCount(); double lowestTickValue = calculateLowestVisibleTickValue(); int minorTickSpaces = getMinorTickCount(); if (minorTickSpaces <= 0) { minorTickSpaces = tu.getMinorTickCount();
/** * Generates a list of tick values for the angular tick marks. * * @return A list of {@link NumberTick} instances. * * @since 1.0.10 */ protected List refreshAngleTicks() { List ticks = new ArrayList(); for (double currentTickVal = 0.0; currentTickVal < 360.0; currentTickVal += this.angleTickUnit.getSize()) { TextAnchor ta = calculateTextAnchor(currentTickVal); NumberTick tick = new NumberTick(new Double(currentTickVal), this.angleTickUnit.valueToString(currentTickVal), ta, TextAnchor.CENTER, 0.0); ticks.add(tick); } return ticks; }
double tickLabelHeight = estimateMaximumTickLabelHeight(g2); double candidateHeight = exponentLengthToJava2D(candidate.getSize(), dataArea, edge); if (tickLabelHeight < candidateHeight) { prevCandidate = candidate; candidate = tickUnits.getLargerTickUnit(prevCandidate); if (candidate.equals(prevCandidate)) { found = true; // there are no more candidates
lowerStr = unit.valueToString(lower); upperStr = unit.valueToString(upper);
@Override public TickUnit getCeilingTickUnit(double size) { TickUnit newUnit = decorated.getCeilingTickUnit(size); if(newUnit.compareTo(lowerUnit)<0) { return lowerUnit; } else { return newUnit; } }
double size = tu.getSize(); int count = calculateVisibleTickCount(); double lowestTickValue = calculateLowestVisibleTickValue(); int minorTickSpaces = getMinorTickCount(); if (minorTickSpaces <= 0) { minorTickSpaces = tu.getMinorTickCount();
/** * Compares this tick unit to an arbitrary object. * * @param object the object to compare against. * * @return {@code 1} if the size of the other object is less than this, * {@code 0} if both have the same size and {@code -1} this * size is less than the others. */ @Override public int compareTo(Object object) { if (object instanceof TickUnit) { TickUnit other = (TickUnit) object; if (this.size > other.getSize()) { return 1; } else if (this.size < other.getSize()) { return -1; } else { return 0; } } else { return -1; } }
/** * Tests this formatter for equality with an arbitrary object. * * @param obj the object (<code>null</code> permitted). * * @return A boolean. */ public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof NumberTickUnit)) { return false; } if (!super.equals(obj)) { return false; } NumberTickUnit that = (NumberTickUnit) obj; if (!this.formatter.equals(that.formatter)) { return false; } return true; }
lowerStr = unit.valueToString(lower); upperStr = unit.valueToString(upper);
/** * Returns a hash code for this instance. * * @return A hash code. */ public int hashCode() { int result = super.hashCode(); result = 29 * result + (this.formatter != null ? this.formatter.hashCode() : 0); return result; }
@Override public TickUnit getCeilingTickUnit(TickUnit unit) { TickUnit newUnit = decorated.getCeilingTickUnit(unit); if(newUnit.compareTo(lowerUnit)<0) { return lowerUnit; } else { return newUnit; } }
double size = tu.getSize(); int count = calculateVisibleTickCount(); double lowestTickValue = calculateLowestVisibleTickValue(); int minorTickSpaces = getMinorTickCount(); if (minorTickSpaces <= 0) { minorTickSpaces = tu.getMinorTickCount();