Package org.geoforge.guillc.jfree.chart.axis

Source Code of org.geoforge.guillc.jfree.chart.axis.GfrAxsLinDstDepth

/*
*  Copyright (C) 2011-2014 GeoForge Project
*
*  This program is free software: you can redistribute it and/or modify
*  it under the terms of the GNU Lesser General Public License as published by
*  the Free Software Foundation, either version 3 of the License, or
*  (at your option) any later version.
*
*  This program is distributed in the hope that it will be useful,
*  but WITHOUT ANY WARRANTY; without even the implied warranty of
*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*  GNU Lesser General Public License for more details.
*
*  You should have received a copy of the GNU Lesser General Public License
*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

package org.geoforge.guillc.jfree.chart.axis;

import java.text.DecimalFormat;
import org.geoforge.jfreechart.axis.GfrAxsLinDstAbs;
import org.jfree.chart.axis.NumberTickUnit;
import org.jfree.chart.axis.TickUnitSource;
import org.jfree.chart.axis.TickUnits;
import org.jfree.data.Range;

/**
*
* @author bantchao
*/
public class GfrAxsLinDstDepth extends GfrAxsLinDstAbs
{
   // ---

   static protected TickUnitSource _s_createTickUnits(double dblSizeTickUnit)
   {
     
      TickUnits units = new TickUnits();
      DecimalFormat df7 = new DecimalFormat("0.0");
      DecimalFormat df8 = new DecimalFormat("#,##0");


      // we can add the units in any order, the TickUnits collection will
      // sort them...
      units.add(new NumberTickUnit(dblSizeTickUnit, df7, 2));
      units.add(new NumberTickUnit(1, df8, 2));
      units.add(new NumberTickUnit(10, df8, 2));
      units.add(new NumberTickUnit(100, df8, 2));
      units.add(new NumberTickUnit(1000, df8, 2));

      return units;
   }

   // ---
   public GfrAxsLinDstDepth(boolean blnIsMeter)
   {
      super(
              blnIsMeter,
              "Depth");

      super.setInverted(true);
   }

   public GfrAxsLinDstDepth(
           boolean blnIsMeter,
           double dblRangeMin,
           double dblRangeMax)
   {
      this(blnIsMeter);

      //--
      super.setAutoRange(true);
      super.setUpperMargin(0);
      super.setLowerMargin(0);

      super.setDefaultAutoRange(new Range(dblRangeMin, dblRangeMax));
   }

}
TOP

Related Classes of org.geoforge.guillc.jfree.chart.axis.GfrAxsLinDstDepth

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.