Tabnine Logo
TickUnit.getSize
Code IndexAdd Tabnine to your IDE (free)

How to use
getSize
method
in
org.jfree.chart.axis.TickUnit

Best Java code snippets using org.jfree.chart.axis.TickUnit.getSize (Showing top 20 results out of 315)

origin: org.codehaus.jtstand/jtstand-chart

/**
 * 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;
  }
}
origin: jfree/jfreechart

/**
 * 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;
  }
}
origin: jfree/jfreechart

@Override
public TickUnit getCeilingTickUnit(TickUnit unit) {
  return getCeilingTickUnit(unit.getSize());
}
origin: jfree/jfreechart

/**
 * Returns a tick unit that is larger than the supplied unit.
 *
 * @param unit  the unit ({@code null} not permitted).
 *
 * @return A tick unit that is larger than the supplied unit.
 */
@Override
public TickUnit getLargerTickUnit(TickUnit unit) {
  double x = unit.getSize();
  double log = Math.log(x) / LOG_10_VALUE;
  double higher = Math.ceil(log);
  return new NumberTickUnit(Math.pow(10, higher),
      new DecimalFormat("0.0E0"));
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns a tick unit that is larger than the supplied unit.
 *
 * @param unit  the unit (<code>null</code> not permitted).
 *
 * @return A tick unit that is larger than the supplied unit.
 */
public TickUnit getLargerTickUnit(TickUnit unit) {
  double x = unit.getSize();
  double log = Math.log(x) / LOG_10_VALUE;
  double higher = Math.ceil(log);
  return new NumberTickUnit(Math.pow(10, higher),
      new DecimalFormat("0.0E0"));
}
origin: jfree/jfreechart

/**
 * Standard constructor - constructs a panel for editing the properties of
 * the specified plot.
 *
 * @param plot  the plot, which should be changed.
 */
public DefaultPolarPlotEditor(PolarPlot plot) {
  super(plot);
  this.angleOffsetValue = plot.getAngleOffset();
  this.angleOffset.setText(Double.toString(this.angleOffsetValue));
  this.manualTickUnitValue = plot.getAngleTickUnit().getSize();
  this.manualTickUnit.setText(Double.toString(this.manualTickUnitValue));
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * 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;
}
origin: jfree/jfreechart

/**
 * 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;
}
origin: jfree/jfreechart

int count = (int) (length / unit.getSize());
if (count < 2 || count > 40) {
  unit = tickUnitSource.getCeilingTickUnit(length / 20);
double unit1Width = lengthToJava2D(unit1.getSize(), dataArea, edge);
double guess = (tickLabelWidth / unit1Width) * unit1.getSize();
NumberTickUnit unit2 = (NumberTickUnit) 
    tickUnitSource.getCeilingTickUnit(guess);
origin: jfree/jfreechart

/**
 * Selects an appropriate tick size for the axis.  The strategy is to
 * display as many ticks as possible (selected from a collection of
 * 'standard' tick units) without the labels overlapping.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area defined by the axes.
 * @param edge  the axis location.
 */
protected void selectHorizontalAutoTickUnit(Graphics2D g2,
    Rectangle2D dataArea, RectangleEdge edge) {
  double zero = valueToJava2D(0.0, dataArea, edge);
  double tickLabelWidth = estimateMaximumTickLabelWidth(g2,
      getTickUnit());
  // start with the current tick unit...
  TickUnitSource tickUnits = getStandardTickUnits();
  TickUnit unit1 = tickUnits.getCeilingTickUnit(getTickUnit());
  double x1 = valueToJava2D(unit1.getSize(), dataArea, edge);
  double unit1Width = Math.abs(x1 - zero);
  // then extrapolate...
  double guess = (tickLabelWidth / unit1Width) * unit1.getSize();
  DateTickUnit unit2 = (DateTickUnit) tickUnits.getCeilingTickUnit(guess);
  double x2 = valueToJava2D(unit2.getSize(), dataArea, edge);
  double unit2Width = Math.abs(x2 - zero);
  tickLabelWidth = estimateMaximumTickLabelWidth(g2, unit2);
  if (tickLabelWidth > unit2Width) {
    unit2 = (DateTickUnit) tickUnits.getLargerTickUnit(unit2);
  }
  setTickUnit(unit2, false, false);
}
origin: org.codehaus.jtstand/jtstand-chart

double x1 = valueToJava2D(shift + unit1.getSize(), dataArea, edge);
double unit1Width = Math.abs(x1 - zero);
double guess = (tickLabelWidth / unit1Width) * unit1.getSize();
DateTickUnit unit2 = (DateTickUnit) tickUnits.getCeilingTickUnit(guess);
double x2 = valueToJava2D(shift + unit2.getSize(), dataArea, edge);
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Selects an appropriate tick value for the axis.  The strategy is to
 * display as many ticks as possible (selected from an array of 'standard'
 * tick units) without the labels overlapping.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area in which the plot should be drawn.
 * @param edge  the axis location.
 */
protected void selectVerticalAutoTickUnit(Graphics2D g2,
                     Rectangle2D dataArea,
                     RectangleEdge edge) {
  double tickLabelHeight = estimateMaximumTickLabelHeight(g2);
  // start with the current tick unit...
  TickUnitSource tickUnits = getStandardTickUnits();
  TickUnit unit1 = tickUnits.getCeilingTickUnit(getTickUnit());
  double unitHeight = lengthToJava2D(unit1.getSize(), dataArea, edge);
  // then extrapolate...
  double guess = (tickLabelHeight / unitHeight) * unit1.getSize();
  NumberTickUnit unit2
    = (NumberTickUnit) tickUnits.getCeilingTickUnit(guess);
  double unit2Height = lengthToJava2D(unit2.getSize(), dataArea, edge);
  tickLabelHeight = estimateMaximumTickLabelHeight(g2);
  if (tickLabelHeight > unit2Height) {
    unit2 = (NumberTickUnit) tickUnits.getLargerTickUnit(unit2);
  }
  setTickUnit(unit2, false, false);
}
origin: jfree/jfreechart

double size = tu.getSize();
int count = calculateVisibleTickCount();
double lowestTickValue = calculateLowestVisibleTickValue();
origin: org.codehaus.jtstand/jtstand-chart

double unitHeight = exponentLengthToJava2D(unit1.getSize(), dataArea,
    edge);
double guess = (tickLabelHeight / unitHeight) * unit1.getSize();
origin: org.codehaus.jtstand/jtstand-chart

double size = tu.getSize();
int count = calculateVisibleTickCount();
double lowestTickValue = calculateLowestVisibleTickValue();
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Selects an appropriate tick value for the axis.  The strategy is to
 * display as many ticks as possible (selected from an array of 'standard'
 * tick units) without the labels overlapping.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area defined by the axes.
 * @param edge  the axis location.
 */
protected void selectHorizontalAutoTickUnit(Graphics2D g2,
                      Rectangle2D dataArea,
                      RectangleEdge edge) {
  double tickLabelWidth = estimateMaximumTickLabelWidth(g2,
      getTickUnit());
  // start with the current tick unit...
  TickUnitSource tickUnits = getStandardTickUnits();
  TickUnit unit1 = tickUnits.getCeilingTickUnit(getTickUnit());
  double unit1Width = lengthToJava2D(unit1.getSize(), dataArea, edge);
  // then extrapolate...
  double guess = (tickLabelWidth / unit1Width) * unit1.getSize();
  NumberTickUnit unit2 = (NumberTickUnit) tickUnits.getCeilingTickUnit(
      guess);
  double unit2Width = lengthToJava2D(unit2.getSize(), dataArea, edge);
  tickLabelWidth = estimateMaximumTickLabelWidth(g2, unit2);
  if (tickLabelWidth > unit2Width) {
    unit2 = (NumberTickUnit) tickUnits.getLargerTickUnit(unit2);
  }
  setTickUnit(unit2, false, false);
}
origin: org.codehaus.jtstand/jtstand-chart

double unit1Width = exponentLengthToJava2D(unit1.getSize(), dataArea,
    edge);
double guess = (tickLabelWidth / unit1Width) * unit1.getSize();
origin: jfree/jfreechart

double unitHeight = lengthToJava2D(unit1.getSize(), dataArea, edge);
double guess;
if (unitHeight > 0) { // then extrapolate...
  guess = (tickLabelHeight / unitHeight) * unit1.getSize();
} else { 
  guess = getRange().getLength() / 20.0;
origin: jfree/jfreechart

    candidate);
double candidateWidth = exponentLengthToJava2D(candidate.getSize(), 
    dataArea, edge);
if (tickLabelWidth < candidateWidth) {
origin: jfree/jfreechart

double tickLabelHeight = estimateMaximumTickLabelHeight(g2);
double candidateHeight = exponentLengthToJava2D(candidate.getSize(), 
    dataArea, edge);
if (tickLabelHeight < candidateHeight) {
org.jfree.chart.axisTickUnitgetSize

Javadoc

Returns the size of the tick unit.

Popular methods of TickUnit

  • equals
    Tests this unit for equality with another object.
  • getMinorTickCount
    Returns the minor tick count.
  • hashCode
    Returns a hash code for this instance.
  • valueToString
    Converts the supplied value to a string. Subclasses may implement special formatting by overriding t
  • compareTo
    Compares this tick unit to an arbitrary object.

Popular in Java

  • Making http post requests using okhttp
  • putExtra (Intent)
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Menu (java.awt)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top 12 Jupyter Notebook extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now