private void addHorizontalTicks(RectangleEdge edge, List ticks, double lowerBoundVal, String tickLabel, double tickVal) { if (tickVal >= lowerBoundVal - SMALL_LOG_VALUE) { //tick value not below lowest data value TextAnchor anchor; TextAnchor rotationAnchor; double angle = 0.0; if (isVerticalTickLabels()) { anchor = TextAnchor.CENTER_RIGHT; rotationAnchor = TextAnchor.CENTER_RIGHT; if (edge == RectangleEdge.TOP) { angle = Math.PI / 2.0; } else { angle = -Math.PI / 2.0; } } else { if (edge == RectangleEdge.TOP) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; } else { anchor = TextAnchor.TOP_CENTER; rotationAnchor = TextAnchor.TOP_CENTER; } } ticks.add(new NumberTick(new Double(tickVal), tickLabel, anchor, rotationAnchor, angle)); } }
/** * 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; }
private void addHorizontalTicks(RectangleEdge edge, List ticks, double lowerBoundVal, String tickLabel, double tickVal) { if (tickVal >= lowerBoundVal - SMALL_LOG_VALUE) { //tick value not below lowest data value TextAnchor anchor; TextAnchor rotationAnchor; double angle = 0.0; if (isVerticalTickLabels()) { anchor = TextAnchor.CENTER_RIGHT; rotationAnchor = TextAnchor.CENTER_RIGHT; if (edge == RectangleEdge.TOP) { angle = Math.PI / 2.0; } else { angle = -Math.PI / 2.0; } } else { if (edge == RectangleEdge.TOP) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; } else { anchor = TextAnchor.TOP_CENTER; rotationAnchor = TextAnchor.TOP_CENTER; } } ticks.add(new NumberTick(new Double(tickVal), tickLabel, anchor, rotationAnchor, angle)); } }
private void addVerticalTicks(RectangleEdge edge, List ticks, double lowerBoundVal, String tickLabel, double tickVal) { if (tickVal >= lowerBoundVal - SMALL_LOG_VALUE) { //tick value not below lowest data value TextAnchor anchor; TextAnchor rotationAnchor; double angle = 0.0; if (isVerticalTickLabels()) { if (edge == RectangleEdge.LEFT) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; angle = -Math.PI / 2.0; } else { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; angle = Math.PI / 2.0; } } else { if (edge == RectangleEdge.LEFT) { anchor = TextAnchor.CENTER_RIGHT; rotationAnchor = TextAnchor.CENTER_RIGHT; } else { anchor = TextAnchor.CENTER_LEFT; rotationAnchor = TextAnchor.CENTER_LEFT; } } //create tick object and add to list: ticks.add(new NumberTick(new Double(tickVal), tickLabel, anchor, rotationAnchor, angle)); } } }
private void addVerticalTicks(RectangleEdge edge, List ticks, double lowerBoundVal, String tickLabel, double tickVal) { if (tickVal >= lowerBoundVal - SMALL_LOG_VALUE) { //tick value not below lowest data value TextAnchor anchor; TextAnchor rotationAnchor; double angle = 0.0; if (isVerticalTickLabels()) { if (edge == RectangleEdge.LEFT) { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; angle = -Math.PI / 2.0; } else { anchor = TextAnchor.BOTTOM_CENTER; rotationAnchor = TextAnchor.BOTTOM_CENTER; angle = Math.PI / 2.0; } } else { if (edge == RectangleEdge.LEFT) { anchor = TextAnchor.CENTER_RIGHT; rotationAnchor = TextAnchor.CENTER_RIGHT; } else { anchor = TextAnchor.CENTER_LEFT; rotationAnchor = TextAnchor.CENTER_LEFT; } } //create tick object and add to list: ticks.add(new NumberTick(new Double(tickVal), tickLabel, anchor, rotationAnchor, angle)); } } }
/** * 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; }
@Override public List<NumberTick> refreshTicks(Graphics2D g2, AxisState state, Rectangle2D dataArea, RectangleEdge edge) { // List<NumberTick> allTicks = super.refreshTicks(g2, state, dataArea, edge); List<NumberTick> myTicks = new ArrayList<NumberTick>(); for (int i = 0; i < numberOfBins; i++) { myTicks.add(new NumberTick(TickType.MAJOR, i * session.chartData.getSAXWindowSize(), String.valueOf(i * session.chartData.getSAXWindowSize()), TextAnchor.CENTER, TextAnchor.CENTER, 0.0d)); // textAnchor, rotationAnchor, angle)); } // for (Object tick : allTicks) { // NumberTick numberTick = (NumberTick) tick; // // if (TickType.MAJOR.equals(numberTick.getTickType()) // && (numberTick.getValue() % this.session.chartData.getSAXWindowSize() != 0)) { // // myTicks.add(new NumberTick(TickType.MINOR, numberTick.getValue(), "", numberTick // // .getTextAnchor(), numberTick.getRotationAnchor(), numberTick.getAngle())); // continue; // } // myTicks.add(tick); // } return myTicks; } };
ticks.add(new NumberTick(tick, toString(t, sci), anchor, rotationAnchor, angle)); if (t < upperBound) { for (int j = 2; j < 10; j++) { label = toString(s, sci); ticks.add(new NumberTick(new Double(s), label, anchor, rotationAnchor, angle)); if (isLastTickAdded) { break; ticks.add(new NumberTick(t, toString(t, sci), anchor, rotationAnchor, angle));
vv = 1.0 - vv; normalisedTicks.add(new NumberTick(new Double(vv), tick.getText(), tick.getTextAnchor(), tick.getRotationAnchor(), tick.getAngle())); tickValue = (i * (1.0 / (Math.max(labelCount - 1, 1)))); Tick tick = new NumberTick(new Double(tickValue), tickLabel, anchor, rotationAnchor, 0.0);
Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); ticks.add(tick);
Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); ticks.add(tick);
Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); ticks.add(tick);
Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); ticks.add(tick);
double v = calculateValue(current); if (range.contains(v)) { ticks.add(new NumberTick(TickType.MAJOR, v, createTickLabel(v), textAnchor, TextAnchor.CENTER, 0.0)); double minorV = v + i * ((next - v) / minorTickCount); if (range.contains(minorV)) { ticks.add(new NumberTick(TickType.MINOR, minorV, "", textAnchor, TextAnchor.CENTER, 0.0));
double v = calculateValue(current); if (range.contains(v)) { ticks.add(new NumberTick(TickType.MAJOR, v, createTickLabel(v), textAnchor, TextAnchor.CENTER, 0.0)); double minorV = v + i * ((next - v) / minorTickCount); if (range.contains(minorV)) { ticks.add(new NumberTick(TickType.MINOR, minorV, "", textAnchor, TextAnchor.CENTER, 0.0));
- size * minorTick / minorTickSpaces; if (getRange().contains(minorTickValue)) { result.add(new NumberTick(TickType.MINOR, minorTickValue, "", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0)); Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); result.add(tick); result.add(new NumberTick(TickType.MINOR, minorTickValue, "", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0));
- size * minorTick / minorTickSpaces; if (getRange().contains(minorTickValue)) { result.add(new NumberTick(TickType.MINOR, minorTickValue, "", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0)); Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); result.add(tick); result.add(new NumberTick(TickType.MINOR, minorTickValue, "", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0));
- size * minorTick / minorTickSpaces; if (getRange().contains(minorTickValue)) { result.add(new NumberTick(TickType.MINOR, minorTickValue, "", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0)); Tick tick = new NumberTick(new Double(currentTickValue), tickLabel, anchor, rotationAnchor, angle); result.add(tick); result.add(new NumberTick(TickType.MINOR, minorTickValue, "", TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0));
long lastOnAxis = getLast().getLastMillisecond() + 1; while (t0 <= lastOnAxis) { ticks.add(new NumberTick(Double.valueOf(t0), "", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)); x0 = valueToJava2D(t0, dataArea, edge);
long lastOnAxis = getLast().getLastMillisecond() + 1; while (t0 <= lastOnAxis) { ticks.add(new NumberTick(new Double(t0), "", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)); x0 = valueToJava2D(t0, dataArea, edge);