Class TickFactory

java.lang.Object
org.eclipse.nebula.visualization.xygraph.linearscale.TickFactory

public class TickFactory
extends java.lang.Object
Tick factory produces the different axis ticks. When specifying a format and given the screen size parameters and range it will return a list of Ticks
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    static class  TickFactory.TickFormatting
    tick formatting modes
  • Constructor Summary

    Constructors 
    Constructor Description
    TickFactory​(IScaleProvider scale)  
    TickFactory​(TickFactory.TickFormatting format, IScaleProvider scale)  
  • Method Summary

    Modifier and Type Method Description
    java.util.List<Tick> generateIndexBasedTicks​(double min, double max, int maxTicks)
    Generate a list of ticks that span range given by min and max.
    java.util.List<Tick> generateLogTicks​(double min, double max, int maxTicks, boolean allowMinMaxOver, boolean tight)  
    java.util.List<Tick> generateTicks​(double min, double max, int maxTicks, boolean allowMinMaxOver, boolean tight)
    Generate a list of ticks that span range given by min and max.
    protected static java.math.BigDecimal nicenum​(java.math.BigDecimal x, boolean round)  
    protected static double roundDown​(java.math.BigDecimal numerator, java.math.BigDecimal denominator)
    Round numerator down to multiples of denominators
    protected static double roundUp​(java.math.BigDecimal numerator, java.math.BigDecimal denominator)
    Round numerator up to multiples of denominators

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • roundDown

      protected static double roundDown​(java.math.BigDecimal numerator, java.math.BigDecimal denominator)
      Round numerator down to multiples of denominators
      Parameters:
      numerator -
      denominator -
      Returns:
      rounded down value
    • roundUp

      protected static double roundUp​(java.math.BigDecimal numerator, java.math.BigDecimal denominator)
      Round numerator up to multiples of denominators
      Parameters:
      numerator -
      denominator -
      Returns:
      rounded up value
    • nicenum

      protected static java.math.BigDecimal nicenum​(java.math.BigDecimal x, boolean round)
      Parameters:
      x -
      round - if true, then round else take ceiling
      Returns:
      a nice number
    • generateTicks

      public java.util.List<Tick> generateTicks​(double min, double max, int maxTicks, boolean allowMinMaxOver, boolean tight)
      Generate a list of ticks that span range given by min and max. The maximum number of ticks is exceed by one in the case where the range straddles zero.
      Parameters:
      min -
      max -
      maxTicks -
      allowMinMaxOver - allow min/maximum overwrite
      tight - if true then remove ticks outside range
      Returns:
      a list of the ticks for the axis
    • generateIndexBasedTicks

      public java.util.List<Tick> generateIndexBasedTicks​(double min, double max, int maxTicks)
      Generate a list of ticks that span range given by min and max.
      Parameters:
      min -
      max -
      maxTicks -
      Returns:
      a list of the ticks for the axis
    • generateLogTicks

      public java.util.List<Tick> generateLogTicks​(double min, double max, int maxTicks, boolean allowMinMaxOver, boolean tight)
      Parameters:
      min - (must be >0)
      max - (must be >0)
      maxTicks -
      allowMinMaxOver - allow min/maximum overwrite
      tight - if true then remove ticks outside range
      Returns:
      a list of the ticks for the axis