Examples of NumberTick


Examples of org.jfree.chart.axis.NumberTick

         double start = Math.pow(10, Math.floor(Math.log10(range.getLowerBound())));
         double end = Math.pow(10, Math.floor(Math.log10(range.getUpperBound())));
         double current = start;
         while (current <= end) {
            if (range.contains(current)) {
               ticks.add(new NumberTick(TickType.MAJOR, current, tickLabel(current), textAnchor, textAnchor, TICK_LABEL_ANGLE));
            }
            for (int i = 2; i < 10; ++i) {
               if (range.contains(current * i)) {
                  ticks.add(new NumberTick(TickType.MINOR, current * i, tickLabel(current * i), textAnchor, TextAnchor.TOP_LEFT, TICK_LABEL_ANGLE));
               }
            }
            current *= 10;
         }
         return ticks;
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

         double maxUsedPosition = 0;
         for (Map.Entry<Double, String> value : iterationValues.tailMap(getRange().getLowerBound()).headMap(getRange().getUpperBound()).entrySet()) {
            double xPosition = valueToJava2D(value.getKey(), dataArea, edge);
            if (xPosition > maxUsedPosition) {
               result.add(new NumberTick(TickType.MAJOR, value.getKey(), value.getValue(), TextAnchor.TOP_CENTER, TextAnchor.CENTER, 0.0));
               Rectangle2D bounds = TextUtils.getTextBounds(value.getValue(), g2.getFontMetrics());
               maxUsedPosition = xPosition + bounds.getWidth() * 1.1;
            }
         }
         return result;
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

     */
    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;
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

        double maxRadius = plot.getMaxRadius();

        Point center = plot.translateValueThetaRadiusToJava2D(0.0, 0.0, dataArea);
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            NumberTick tick = (NumberTick) iterator.next();
            Point p = plot.translateValueThetaRadiusToJava2D(
                tick.getNumber().doubleValue(), maxRadius, dataArea
            );
            g2.setPaint(plot.getAngleGridlinePaint());
            g2.drawLine(center.x, center.y, p.x, p.y);
            if (plot.isAngleLabelsVisible()) {
                int x = p.x;
                int y = p.y;
                g2.setPaint(plot.getAngleLabelPaint());
                TextUtilities.drawAlignedString(
                    tick.getText(), g2, x, y, TextAnchor.CENTER
                );
            }
        }
     }
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

        Point center = plot.translateValueThetaRadiusToJava2D(0.0, 0.0, dataArea);
       
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            NumberTick tick = (NumberTick) iterator.next();
            Point p = plot.translateValueThetaRadiusToJava2D(
                90.0, tick.getNumber().doubleValue(), dataArea
            );
            int r = p.x - center.x;
            int upperLeftX = center.x - r;
            int upperLeftY = center.y - r;
            int d = 2 * r;
 
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

            this.dataset.addChangeListener(this);
        }
     
        this.angleTicks = new java.util.ArrayList();
        this.angleTicks.add(
            new NumberTick(new Double(0.0), "0", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)
        );
        this.angleTicks.add(
            new NumberTick(new Double(45.0), "45", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)
        );
        this.angleTicks.add(
            new NumberTick(new Double(90.0), "90", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)
        );
        this.angleTicks.add(
            new NumberTick(new Double(135.0), "135", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)
        );
        this.angleTicks.add(
            new NumberTick(new Double(180.0), "180", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)
        );
        this.angleTicks.add(
            new NumberTick(new Double(225.0), "225", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)
        );
        this.angleTicks.add(
            new NumberTick(new Double(270.0), "270", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)
        );
        this.angleTicks.add(
            new NumberTick(new Double(315.0), "315", TextAnchor.CENTER, TextAnchor.CENTER, 0.0)
        );
       
        this.radiusAxis = radiusAxis;
        if (this.radiusAxis != null) {
            this.radiusAxis.setPlot(this);
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

        Point center = plot.translateValueThetaRadiusToJava2D(axisMin, axisMin,
                dataArea);
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            NumberTick tick = (NumberTick) iterator.next();
            Point p = plot.translateValueThetaRadiusToJava2D(
                    tick.getNumber().doubleValue(), maxRadius, dataArea);
            g2.setPaint(plot.getAngleGridlinePaint());
            g2.drawLine(center.x, center.y, p.x, p.y);
            if (plot.isAngleLabelsVisible()) {
                int x = p.x;
                int y = p.y;
                g2.setPaint(plot.getAngleLabelPaint());
                TextUtilities.drawAlignedString(tick.getText(), g2, x, y,
                        TextAnchor.CENTER);
            }
        }
     }
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

        Point center = plot.translateValueThetaRadiusToJava2D(axisMin, axisMin,
                dataArea);
       
        Iterator iterator = ticks.iterator();
        while (iterator.hasNext()) {
            NumberTick tick = (NumberTick) iterator.next();
            Point p = plot.translateValueThetaRadiusToJava2D(90.0,
                    tick.getNumber().doubleValue(), dataArea);
            int r = p.x - center.x;
            int upperLeftX = center.x - r;
            int upperLeftY = center.y - r;
            int d = 2 * r;
            Ellipse2D ring = new Ellipse2D.Double(upperLeftX, upperLeftY, d, d);
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

        if (this.dataset != null) {
            this.dataset.addChangeListener(this);
        }
     
        this.angleTicks = new java.util.ArrayList();
        this.angleTicks.add(new NumberTick(new Double(0.0), "0",
                TextAnchor.CENTER, TextAnchor.CENTER, 0.0));
        this.angleTicks.add(new NumberTick(new Double(45.0), "45",
                TextAnchor.CENTER, TextAnchor.CENTER, 0.0));
        this.angleTicks.add(new NumberTick(new Double(90.0), "90",
                TextAnchor.CENTER, TextAnchor.CENTER, 0.0));
        this.angleTicks.add(new NumberTick(new Double(135.0), "135",
                TextAnchor.CENTER, TextAnchor.CENTER, 0.0));
        this.angleTicks.add(new NumberTick(new Double(180.0), "180",
                TextAnchor.CENTER, TextAnchor.CENTER, 0.0));
        this.angleTicks.add(new NumberTick(new Double(225.0), "225",
                TextAnchor.CENTER, TextAnchor.CENTER, 0.0));
        this.angleTicks.add(new NumberTick(new Double(270.0), "270",
                TextAnchor.CENTER, TextAnchor.CENTER, 0.0));
        this.angleTicks.add(new NumberTick(new Double(315.0), "315",
                TextAnchor.CENTER, TextAnchor.CENTER, 0.0));
       
        this.axis = radiusAxis;
        if (this.axis != null) {
            this.axis.setPlot(this);
View Full Code Here

Examples of org.jfree.chart.axis.NumberTick

        List<ValueTick> ticks = new ArrayList<ValueTick>();
        for (double currentTickVal = 0.0; currentTickVal < 360.0;
                currentTickVal += this.angleTickUnit.getSize()) {

            TextAnchor ta = calculateTextAnchor(currentTickVal);
            NumberTick tick = new NumberTick(currentTickVal,
                this.angleTickUnit.valueToString(currentTickVal),
                ta, TextAnchor.CENTER, 0.0);
            ticks.add(tick);
        }
        return ticks;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.