public abstract class RendererBase extends Object
Constructor and Description |
---|
RendererBase(GraphicsBase<?> graphics,
String name)
Constructs a new renderer.
|
Modifier and Type | Method and Description |
---|---|
javafx.beans.property.DoubleProperty |
alphaProperty() |
protected void |
disableRedrawAfterPropertyChange()
Disables automatic redrawing of the graphics area when one of the
observed properties changes.
|
javafx.beans.property.BooleanProperty |
enabledProperty() |
protected void |
enableRedrawAfterPropertyChange()
Enabled automatic redrawing of the graphics area when one of the
observed properties changes.
|
double |
getAlpha() |
GraphicsBase<?> |
getGraphics() |
protected double |
getLocation(Instant time,
javafx.scene.canvas.Canvas canvas)
Calculates the x coordinate for the given time.
|
String |
getName() |
protected Instant |
getTimeAt(double location)
Calculates the time at the given x coordinate.
|
boolean |
isEnabled() |
boolean |
isSnapToPixel() |
protected void |
redrawObservable(javafx.beans.Observable observable)
Registers the given observable as something that requires
a redraw of the graphics area.
|
void |
setAlpha(double alpha) |
void |
setEnabled(boolean enabled) |
void |
setSnapToPixel(boolean snap) |
double |
snapPositionX(double value)
If this renderer's snapToPixel property is true, returns a value rounded
to the nearest pixel in the horizontal direction, else returns the
same value.
|
double |
snapPositionY(double value)
If this renderer's snapToPixel property is true, returns a value rounded
to the nearest pixel in the vertical direction, else returns the
same value.
|
double |
snapSizeX(double value)
If this renderer's snapToPixel property is true, returns a value ceiled
to the nearest pixel in the horizontal direction, else returns the
same value.
|
double |
snapSizeY(double value)
If this renderer's snapToPixel property is true, returns a value ceiled
to the nearest pixel in the vertical direction, else returns the
same value.
|
double |
snapSpaceX(double value)
If this renderer's snapToPixel property is true, returns a value rounded
to the nearest pixel in the horizontal direction, else returns the
same value.
|
double |
snapSpaceY(double value)
If this renderer's snapToPixel property is true, returns a value rounded
to the nearest pixel in the vertical direction, else returns the
same value.
|
javafx.beans.property.BooleanProperty |
snapToPixelProperty() |
public RendererBase(GraphicsBase<?> graphics, String name)
graphics
- the graphics control where the renderer will be usedname
- the name of the renderer (useful for tooling)public double snapSpaceX(double value)
value
- the space value to be snappedpublic double snapSpaceY(double value)
value
- the space value to be snappedpublic double snapSizeX(double value)
value
- the size value to be snappedpublic double snapSizeY(double value)
value
- the size value to be snappedpublic double snapPositionX(double value)
value
- the position value to be snappedpublic double snapPositionY(double value)
value
- the position value to be snappedprotected final void disableRedrawAfterPropertyChange()
protected final void enableRedrawAfterPropertyChange()
protected void redrawObservable(javafx.beans.Observable observable)
observable
- the observable to monitor for changespublic final String getName()
public final GraphicsBase<?> getGraphics()
protected final double getLocation(Instant time, javafx.scene.canvas.Canvas canvas)
AgendaLayout
.time
- the time for which to calculate the x coordinateTimelineModel.calculateLocationForTime(Instant)
protected final Instant getTimeAt(double location)
AgendaLayout
.location
- the location for which to return the timeTimelineModel.calculateTimeForLocation(double)
public final javafx.beans.property.BooleanProperty enabledProperty()
public final boolean isEnabled()
public final void setEnabled(boolean enabled)
public final javafx.beans.property.BooleanProperty snapToPixelProperty()
public final void setSnapToPixel(boolean snap)
public final boolean isSnapToPixel()
public final javafx.beans.property.DoubleProperty alphaProperty()
public final void setAlpha(double alpha)
public final double getAlpha()
Copyright © 2020 Dirk Lemmermann Software & Consulting. All rights reserved.