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
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
KonstruktorenKonstruktorBeschreibungVirtualGrid(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 TypMethodeBeschreibungabstract InstantadjustTime(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 LocalTimeadjustTime(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 intThe number of units used for the grid.final StringgetName()Returns the grid name that can be used for grid selection controls.final StringReturns the grid short name that can be used for grid selection controls.final TgetUnit()The temporal unit used for the grid.toString()
-
Konstruktordetails
-
VirtualGrid
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
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 nameunit- the temporal unit of the grid (e.g. MINUTES)amount- the amount of the temporal unit (e.g. "15")- Seit:
- 1.0
-
-
Methodendetails
-
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
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
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 locationzoneId- 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
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 locationroundUp- 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
-