Package org.jfree.chart.axis

Examples of org.jfree.chart.axis.NumberTickUnit


        xAxis.setAutoTickUnitSelection(true);

      } else {
        double tickSize = ((Number) fieldXTick.getValue())
            .doubleValue();
        ((NumberAxis) xAxis).setTickUnit(new NumberTickUnit(tickSize));
      }

    }

    if (checkYAutoRange.isSelected()) {

      yAxis.setAutoRange(true);

    } else {

      double lower = ((Number) fieldYMin.getValue()).doubleValue();
      double upper = ((Number) fieldYMax.getValue()).doubleValue();
      if (lower > upper) {
        displayMessage("Invalid " + yAxis.getLabel() + " range.");
        return false;
      }
      yAxis.setRange(lower, upper);
    }

    if (yAxis instanceof NumberAxis) {

      if (checkYAutoTick.isSelected()) {
        yAxis.setAutoTickUnitSelection(true);

      } else {
        double tickSize = ((Number) fieldYTick.getValue())
            .doubleValue();
        ((NumberAxis) yAxis).setTickUnit(new NumberTickUnit(tickSize));
      }

    }

    return true;
View Full Code Here


      this.labelsValue = null;
      this.labelsName = null;
      inAxis.setAutoRangeIncludesZero(false);
      inAxis.setLowerMargin(0);
      inAxis.setUpperMargin(0);
      axis.setTickUnit(new NumberTickUnit(computeAutoTickValue()));
   }
View Full Code Here

    * @param tick tick unit.
    *
    *
    */
   public void setLabels (double tick)  {
      axis.setTickUnit(new NumberTickUnit(tick));
      labelsFlag = false;
   }
View Full Code Here

   /**
    * Calculates and sets an automatic tick unit.
    *
    */
   public void setLabelsAuto()  {
      axis.setTickUnit(new NumberTickUnit(computeAutoTickValue()));
      labelsFlag = false;
   }
View Full Code Here

        this.dataset = dataset;
        if (this.dataset != null) {
            this.dataset.addChangeListener(this);
        }
        this.angleTickUnit = new NumberTickUnit(DEFAULT_ANGLE_TICK_UNIT_SIZE);

        this.axis = radiusAxis;
        if (this.axis != null) {
            this.axis.setPlot(this);
            this.axis.addChangeListener(this);
View Full Code Here

      double iRangeMax = Double.parseDouble(rangeMax);
      numberAxis.setRange(0.0, iRangeMax);
    }
    String tickUnit = params.get(BaseChartWeb.CHART_PARAM_SERIES_AXISMARGIN_TICKUNIT);
    if (isParamValueValid(tickUnit)) {
      numberAxis.setTickUnit(new NumberTickUnit(convertParamToDouble(tickUnit)));
    }
  }
View Full Code Here

        assertFalse(a1.equals(a2));
        a2.setAutoRangeStickyZero(false);
        assertTrue(a1.equals(a2));

        //private NumberTickUnit tickUnit;
        a1.setTickUnit(new NumberTickUnit(25.0));
        assertFalse(a1.equals(a2));
        a2.setTickUnit(new NumberTickUnit(25.0));
        assertTrue(a1.equals(a2));

        //private NumberFormat numberFormatOverride;
        a1.setNumberFormatOverride(new DecimalFormat("0.00"));
        assertFalse(a1.equals(a2));
View Full Code Here

    /**
     * Confirm that the equals method can distinguish all the required fields.
     */
    public void testEquals() {
        NumberTickUnit t1 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        NumberTickUnit t2 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        assertTrue(t1.equals(t2));
        assertTrue(t2.equals(t1));
       
        t1 = new NumberTickUnit(3.21, new DecimalFormat("0.00"));
        assertFalse(t1.equals(t2));
        t2 = new NumberTickUnit(3.21, new DecimalFormat("0.00"));
        assertTrue(t1.equals(t2));
       
        t1 = new NumberTickUnit(3.21, new DecimalFormat("0.000"));
        assertFalse(t1.equals(t2));
        t2 = new NumberTickUnit(3.21, new DecimalFormat("0.000"));
        assertTrue(t1.equals(t2));
    }
View Full Code Here

    /**
     * Two objects that are equal are required to return the same hashCode.
     */
    public void testHashCode() {
        NumberTickUnit t1 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        NumberTickUnit t2 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        int h1 = t1.hashCode();
        int h2 = t2.hashCode();
        assertEquals(h1, h2);
    }
View Full Code Here

    /**
     * This is an immutable class so it doesn't need to be cloneable.
     */
    public void testCloning() {
        NumberTickUnit t1 = new NumberTickUnit(1.23, new DecimalFormat("0.00"));
        assertFalse(t1 instanceof Cloneable);
    }
View Full Code Here

TOP

Related Classes of org.jfree.chart.axis.NumberTickUnit

Copyright © 2018 www.massapicom. 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.