Module com.flexganttfx.view
Class ActivityBarRenderer<A extends Activity>
- java.lang.Object
-
- com.flexganttfx.view.graphics.renderer.Renderer
-
- com.flexganttfx.view.graphics.renderer.ActivityRenderer<A>
-
- com.flexganttfx.view.graphics.renderer.ActivityBarRenderer<A>
-
- Direct Known Subclasses:
CompletableActivityRenderer
public class ActivityBarRenderer<A extends Activity> extends ActivityRenderer<A>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ActivityBarRenderer.TextPosition
-
Constructor Summary
Constructors Constructor Description ActivityBarRenderer(GraphicsBase<?> graphics, String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BooleanProperty
autoFixTextProperty()
DoubleProperty
barHeightProperty()
protected ActivityBounds
drawActivity(ActivityRef<A> activityRef, Position position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
protected void
drawBackground(ActivityRef<A> activityRef, Position position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
protected void
drawBorder(ActivityRef<A> activityRef, Position position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
protected void
drawText(ActivityRef<A> activityRef, String text, ActivityBarRenderer.TextPosition position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
ObjectProperty<Font>
fontProperty()
double
getBarHeight()
Font
getFont()
Paint
getTextFill()
protected Paint
getTextFill(boolean selected, boolean hover, boolean highlighted, boolean pressed)
Paint
getTextFillHighlight()
Paint
getTextFillHover()
Paint
getTextFillPressed()
Paint
getTextFillSelected()
double
getTextGap()
BooleanProperty
glossyProperty()
boolean
isAutoFixText()
boolean
isGlossy()
protected boolean
isTextVisible(String text, ActivityBarRenderer.TextPosition position, double availableWidth)
Determines if the given text for the given position will be drawn or not depending on the available width.void
setAutoFixText(boolean auto)
void
setBarHeight(double height)
void
setFont(Font font)
void
setGlossy(boolean glossy)
void
setTextFill(Paint fill)
void
setTextFillHighlight(Paint fill)
void
setTextFillHover(Paint fill)
void
setTextFillPressed(Paint fill)
void
setTextFillSelected(Paint fill)
void
setTextGap(double gap)
ObjectProperty<Paint>
textFillHighlightProperty()
ObjectProperty<Paint>
textFillHoverProperty()
ObjectProperty<Paint>
textFillPressedProperty()
ObjectProperty<Paint>
textFillProperty()
ObjectProperty<Paint>
textFillSelectedProperty()
DoubleProperty
textGapProperty()
-
Methods inherited from class com.flexganttfx.view.graphics.renderer.ActivityRenderer
cornerRadiusProperty, cornersRoundedProperty, draw, getCornerRadius, getLineWidth, getStroke, getStroke, getStrokeHighlight, getStrokeHover, getStrokePressed, getStrokeSelected, isCornersRounded, lineWidthProperty, setCornerRadius, setCornersRounded, setLineWidth, setStroke, setStrokeHighlight, setStrokeHover, setStrokePressed, setStrokeSelected, strokeHighlightProperty, strokeHoverProperty, strokePressedProperty, strokeProperty, strokeSelectedProperty
-
Methods inherited from class com.flexganttfx.view.graphics.renderer.Renderer
alphaProperty, disableRedrawAfterPropertyChange, enabledProperty, enableRedrawAfterPropertyChange, fillHighlightProperty, fillHoverProperty, fillPressedProperty, fillProperty, fillSelectedProperty, getAlpha, getFill, getFill, getFillHighlight, getFillHover, getFillPressed, getFillSelected, getGraphics, getLocation, getName, getPadding, getTimeAt, isEnabled, isSnapToPixel, paddingProperty, redrawObservable, setAlpha, setEnabled, setFill, setFillHighlight, setFillHover, setFillPressed, setFillSelected, setPadding, setSnapToPixel, snapPosition, snapSize, snapSpace, snapToPixelProperty
-
-
-
-
Constructor Detail
-
ActivityBarRenderer
public ActivityBarRenderer(GraphicsBase<?> graphics, String name)
-
-
Method Detail
-
drawActivity
protected ActivityBounds drawActivity(ActivityRef<A> activityRef, Position position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
- Overrides:
drawActivity
in classActivityRenderer<A extends Activity>
-
drawBackground
protected void drawBackground(ActivityRef<A> activityRef, Position position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
- Overrides:
drawBackground
in classActivityRenderer<A extends Activity>
-
drawBorder
protected void drawBorder(ActivityRef<A> activityRef, Position position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
- Overrides:
drawBorder
in classActivityRenderer<A extends Activity>
-
drawText
protected void drawText(ActivityRef<A> activityRef, String text, ActivityBarRenderer.TextPosition position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
-
isTextVisible
protected boolean isTextVisible(String text, ActivityBarRenderer.TextPosition position, double availableWidth)
Determines if the given text for the given position will be drawn or not depending on the available width. The default strategy is to not allow the text to show if the available width is less than 10 pixels, the text is null, or the text length multiplied by three is larger than the available width.- Parameters:
text
- the text to drawposition
- the text positionavailableWidth
- the availble width of the entire activity- Returns:
- true if the text can be drawn
- Since:
- 1.5
-
getTextFill
protected Paint getTextFill(boolean selected, boolean hover, boolean highlighted, boolean pressed)
-
barHeightProperty
public final DoubleProperty barHeightProperty()
-
getBarHeight
public final double getBarHeight()
-
setBarHeight
public final void setBarHeight(double height)
-
textGapProperty
public final DoubleProperty textGapProperty()
-
setTextGap
public final void setTextGap(double gap)
-
getTextGap
public final double getTextGap()
-
textFillProperty
public final ObjectProperty<Paint> textFillProperty()
-
setTextFill
public final void setTextFill(Paint fill)
-
getTextFill
public final Paint getTextFill()
-
textFillHoverProperty
public final ObjectProperty<Paint> textFillHoverProperty()
-
setTextFillHover
public final void setTextFillHover(Paint fill)
-
getTextFillHover
public final Paint getTextFillHover()
-
textFillHighlightProperty
public final ObjectProperty<Paint> textFillHighlightProperty()
-
setTextFillHighlight
public final void setTextFillHighlight(Paint fill)
-
getTextFillHighlight
public final Paint getTextFillHighlight()
-
textFillPressedProperty
public final ObjectProperty<Paint> textFillPressedProperty()
-
setTextFillPressed
public final void setTextFillPressed(Paint fill)
-
getTextFillPressed
public final Paint getTextFillPressed()
-
textFillSelectedProperty
public final ObjectProperty<Paint> textFillSelectedProperty()
-
setTextFillSelected
public final void setTextFillSelected(Paint fill)
-
getTextFillSelected
public final Paint getTextFillSelected()
-
fontProperty
public final ObjectProperty<Font> fontProperty()
-
setFont
public final void setFont(Font font)
-
getFont
public final Font getFont()
-
glossyProperty
public final BooleanProperty glossyProperty()
-
setGlossy
public final void setGlossy(boolean glossy)
-
isGlossy
public final boolean isGlossy()
-
autoFixTextProperty
public final BooleanProperty autoFixTextProperty()
-
setAutoFixText
public final void setAutoFixText(boolean auto)
-
isAutoFixText
public final boolean isAutoFixText()
-
-