Klasse GridHelper

java.lang.Object
impl.com.flexganttfx.skin.graphics.GridHelper

public final class GridHelper extends Object
Utility methods for snapping times to the current or virtual grid. The graphics skins and row canvas behaviors use this helper when positioning or resizing activities.
  • Methodendetails

    • grid

      public static Instant grid(GraphicsBase<?> graphics, Instant time)
      Returns the nearest grid-aligned instant for the given time.
      Parameter:
      graphics - the graphics control
      time - the time
      Gibt zurück:
      the grid-aligned instant
    • grid

      public static Instant grid(GraphicsBase<?> graphics, Instant time, boolean roundUp)
      Returns the grid-aligned instant for the given time.
      Parameter:
      graphics - the graphics control
      time - the time
      roundUp - whether the result should be rounded up
      Gibt zurück:
      the grid-aligned instant
    • grid

      public static LocalTime grid(GraphicsBase<?> graphics, LocalTime time, boolean roundUp)
      Returns the grid-aligned local time for the given time.
      Parameter:
      graphics - the graphics control
      time - the time
      roundUp - whether the result should be rounded up
      Gibt zurück:
      the grid-aligned local time