Tabnine Logo
TickUnitSource.getLargerTickUnit
Code IndexAdd Tabnine to your IDE (free)

How to use
getLargerTickUnit
method
in
org.jfree.chart.axis.TickUnitSource

Best Java code snippets using org.jfree.chart.axis.TickUnitSource.getLargerTickUnit (Showing top 13 results out of 315)

origin: tflobbe/solrmeter

  @Override
  public TickUnit getLargerTickUnit(TickUnit unit) {
    TickUnit newUnit = decorated.getLargerTickUnit(unit);
    if(newUnit.compareTo(lowerUnit)<0) {
      return lowerUnit;
    } else {
      return newUnit;
    }
  }
};
origin: jfree/jfreechart

} else {
  prevCandidate = candidate;
  candidate = tickUnits.getLargerTickUnit(prevCandidate);
  if (candidate.equals(prevCandidate)) {
    found = true;  // there are no more candidates
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: jfree/jfreechart

} else {
  prevCandidate = candidate;
  candidate = tickUnits.getLargerTickUnit(prevCandidate);
  if (candidate.equals(prevCandidate)) {
    found = true;  // there are no more candidates
origin: org.codehaus.jtstand/jtstand-chart

tickLabelWidth = estimateMaximumTickLabelWidth(g2, unit2);
if (tickLabelWidth > unit2Width) {
  unit2 = (DateTickUnit) tickUnits.getLargerTickUnit(unit2);
origin: jfree/jfreechart

finalUnit = (DateTickUnit) tickUnits.getLargerTickUnit(candidate2);
origin: org.codehaus.jtstand/jtstand-chart

finalUnit = (DateTickUnit) tickUnits.getLargerTickUnit(candidate2);
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: org.codehaus.jtstand/jtstand-chart

unit2 = (NumberTickUnit) tickUnits.getLargerTickUnit(unit2);
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

unit2 = (NumberTickUnit) tickUnits.getLargerTickUnit(unit2);
origin: jfree/jfreechart

unit2 = (NumberTickUnit) tickUnits.getLargerTickUnit(unit2);
origin: jfree/jfreechart

unit2 = (NumberTickUnit) tickUnitSource.getLargerTickUnit(unit2);
org.jfree.chart.axisTickUnitSourcegetLargerTickUnit

Javadoc

Returns the smallest tick unit available in the source that is larger than unit or, if there is no larger unit, returns unit.

Popular methods of TickUnitSource

  • getCeilingTickUnit
    Returns the tick unit in the collection that is greater than or equal to (in size) the specified uni

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • startActivity (Activity)
  • setContentView (Activity)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • CodeWhisperer alternatives
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