DraggableShape
public class TimeAxis extends java.lang.Object implements DraggableShape
Modifier and Type | Field | Description |
---|---|---|
static int |
YEAR_IN_PIXELS |
The value of a year in pixels.
|
Constructor | Description |
---|---|
TimeAxis(int startYear,
int endYear) |
Contructor to build a time axis and register it to the border pane, such that it is rendered.
|
Modifier and Type | Method | Description |
---|---|---|
void |
dragX(double xDiff) |
If this method is called, the shape will be dragged xDiff pixels in x direction.
|
void |
dragY(double yDiff) |
If this method is called, the shape will be dragged yDiff pixels in y direction.
|
double |
getPixelForDate(java.util.Date date) |
Returns the x coordinate in pixels for a given date.
|
void |
setHeightProperty(javafx.beans.property.ReadOnlyDoubleProperty heightProperty) |
Sets the height property such that the y coordinate is always adjusted to the height properties value.
|
public static final int YEAR_IN_PIXELS
public TimeAxis(int startYear, int endYear)
startYear
- the start year of the time axis.endYear
- the end year of the time axis.public void dragX(double xDiff)
DraggableShape
dragX
in interface DraggableShape
xDiff
- the difference of the drag in x direction.public void dragY(double yDiff)
DraggableShape
dragY
in interface DraggableShape
yDiff
- the difference of the drag in y direction.public void setHeightProperty(javafx.beans.property.ReadOnlyDoubleProperty heightProperty)
heightProperty
- public double getPixelForDate(java.util.Date date)
date
- the date that should be converted.