Klasse VirtualGrid<T extends TemporalUnit>

java.lang.Object
com.flexganttfx.model.dateline.VirtualGrid<T>
Typparameter:
T - the type of the temporal unit (e.g. ChronoUnit)
Bekannte direkte Unterklassen:
ChronoUnitGrid, SimpleUnitGrid

public abstract class VirtualGrid<T extends TemporalUnit> extends Object
A utility class for supporting an invisible grid for editing operations on activities. When a grid is set the start and end times of activities will "snap" to locations defined by the grid.
Seit:
1.0
  • Konstruktorübersicht

    Konstruktoren
    Konstruktor
    Beschreibung
    VirtualGrid(String name, String shortName, T unit, int amount)
    Constructs a new grid.
    VirtualGrid(String name, T unit, int amount)
    Constructs a new grid.
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    abstract Instant
    adjustTime(Instant instant, ZoneId zoneId, boolean roundUp, DayOfWeek firstDayOfWeek)
    Adjusts the given instant so that the returned instant will snap to the position defined by the grid settings.
    abstract LocalTime
    adjustTime(LocalTime time, boolean roundUp)
    Adjusts the given local time so that the returned time will snap to the position defined by the grid settings.
    final int
    The number of units used for the grid.
    final String
    Returns the grid name that can be used for grid selection controls.
    final String
    Returns the grid short name that can be used for grid selection controls.
    final T
    The temporal unit used for the grid.
     

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Konstruktordetails

    • VirtualGrid

      public VirtualGrid(String name, String shortName, T unit, int amount)
      Constructs a new grid.
      Parameter:
      name - a name that can be shown in the user interface (e.g. "15 Minutes")
      shortName - a short name that can be shown in the user interface (e.g. "15 Min.")
      unit - the temporal unit of the grid (e.g. MINUTES)
      amount - the amount of the temporal unit (e.g. "15")
      Seit:
      1.1
    • VirtualGrid

      public VirtualGrid(String name, T unit, int amount)
      Constructs a new grid.
      Parameter:
      name - a name that can be shown in the user interface (e.g. "15 Minutes"), will also be used as the short name
      unit - the temporal unit of the grid (e.g. MINUTES)
      amount - the amount of the temporal unit (e.g. "15")
      Seit:
      1.0
  • Methodendetails

    • getName

      public final String getName()
      Returns the grid name that can be used for grid selection controls.
      Gibt zurück:
      the name of the grid settings
      Seit:
      1.0
    • getShortName

      public final String getShortName()
      Returns the grid short name that can be used for grid selection controls.
      Gibt zurück:
      the short name of the grid settings
      Seit:
      1.1
    • getUnit

      public final T getUnit()
      The temporal unit used for the grid.
      Gibt zurück:
      the temporal unit of the grid
      Seit:
      1.0
    • getAmount

      public final int getAmount()
      The number of units used for the grid.
      Gibt zurück:
      the number of units
      Seit:
      1.0
    • adjustTime

      public abstract Instant adjustTime(Instant instant, ZoneId zoneId, boolean roundUp, DayOfWeek firstDayOfWeek)
      Adjusts the given instant so that the returned instant will snap to the position defined by the grid settings.
      Parameter:
      instant - the time to adjust to a grid location
      zoneId - the time zone for which the adjustment is performed (can be different from row to row)
      roundUp - a flag signaling whether we want the adjusted time to snap to an earlier or later time (start time or end time)
      firstDayOfWeek - the weekday that is considered to be the first day of the week (mostly Monday or Sunday)
      Gibt zurück:
      the grid adjusted time
      Seit:
      1.0
    • adjustTime

      public abstract LocalTime adjustTime(LocalTime time, boolean roundUp)
      Adjusts the given local time so that the returned time will snap to the position defined by the grid settings.
      Parameter:
      time - the time to adjust to a grid location
      roundUp - a flag signaling whether we want the adjusted time to snap to an earlier or later time (start time or end time)
      Gibt zurück:
      the grid adjusted local time
      Seit:
      1.0
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object