Module com.flexganttfx.view
Class ActivityBarRenderer<A extends Activity>
java.lang.Object
com.flexganttfx.view.graphics.renderer.RendererBase
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>
-
Property Summary
Properties inherited from class com.flexganttfx.view.graphics.renderer.ActivityRenderer
cornerRadius, cornersRounded, lineWidth, strokeHighlight, strokeHover, strokePressed, stroke, strokeSelected
Properties inherited from class com.flexganttfx.view.graphics.renderer.Renderer
fillHighlight, fillHover, fillPressed, fill, fillSelected, padding
Properties inherited from class com.flexganttfx.view.graphics.renderer.RendererBase
alpha, enabled, snapToPixel
-
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
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()
Gets the value of the property barHeight.Font
getFont()
Gets the value of the property font.Paint
getTextFill()
Gets the value of the property textFill.protected Paint
getTextFill(boolean selected, boolean hover, boolean highlighted, boolean pressed)
Paint
getTextFillHighlight()
Gets the value of the property textFillHighlight.Paint
getTextFillHover()
Gets the value of the property textFillHover.Paint
getTextFillPressed()
Gets the value of the property textFillPressed.Paint
getTextFillSelected()
Gets the value of the property textFillSelected.double
getTextGap()
Gets the value of the property textGap.BooleanProperty
glossyProperty()
boolean
isAutoFixText()
Gets the value of the property autoFixText.boolean
isGlossy()
Gets the value of the property glossy.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)
Sets the value of the property autoFixText.void
setBarHeight(double height)
Sets the value of the property barHeight.void
setFont(Font font)
Sets the value of the property font.void
setGlossy(boolean glossy)
Sets the value of the property glossy.void
setTextFill(Paint fill)
Sets the value of the property textFill.void
setTextFillHighlight(Paint fill)
Sets the value of the property textFillHighlight.void
setTextFillHover(Paint fill)
Sets the value of the property textFillHover.void
setTextFillPressed(Paint fill)
Sets the value of the property textFillPressed.void
setTextFillSelected(Paint fill)
Sets the value of the property textFillSelected.void
setTextGap(double gap)
Sets the value of the property textGap.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
fillHighlightProperty, fillHoverProperty, fillPressedProperty, fillProperty, fillSelectedProperty, getFill, getFill, getFillHighlight, getFillHover, getFillPressed, getFillSelected, getPadding, paddingProperty, setFill, setFillHighlight, setFillHover, setFillPressed, setFillSelected, setPadding
Methods inherited from class com.flexganttfx.view.graphics.renderer.RendererBase
alphaProperty, disableRedrawAfterPropertyChange, enabledProperty, enableRedrawAfterPropertyChange, getAlpha, getGraphics, getLocation, getName, getTimeAt, isEnabled, isSnapToPixel, redrawObservable, setAlpha, setEnabled, setSnapToPixel, snapPositionX, snapPositionY, snapSizeX, snapSizeY, snapSpaceX, snapSpaceY, snapToPixelProperty
-
Property Details
-
barHeight
- See Also:
getBarHeight()
,setBarHeight(double)
-
textGap
- See Also:
getTextGap()
,setTextGap(double)
-
textFill
- See Also:
getTextFill()
,setTextFill(Paint)
-
textFillHover
- See Also:
getTextFillHover()
,setTextFillHover(Paint)
-
textFillHighlight
-
textFillPressed
- See Also:
getTextFillPressed()
,setTextFillPressed(Paint)
-
textFillSelected
- See Also:
getTextFillSelected()
,setTextFillSelected(Paint)
-
font
- See Also:
getFont()
,setFont(Font)
-
glossy
- See Also:
isGlossy()
,setGlossy(boolean)
-
autoFixText
- See Also:
isAutoFixText()
,setAutoFixText(boolean)
-
-
Constructor Details
-
ActivityBarRenderer
-
-
Method Details
-
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
-
barHeightProperty
- See Also:
getBarHeight()
,setBarHeight(double)
-
getBarHeight
public final double getBarHeight()Gets the value of the property barHeight.- Property description:
-
setBarHeight
public final void setBarHeight(double height)Sets the value of the property barHeight.- Property description:
-
textGapProperty
- See Also:
getTextGap()
,setTextGap(double)
-
setTextGap
public final void setTextGap(double gap)Sets the value of the property textGap.- Property description:
-
getTextGap
public final double getTextGap()Gets the value of the property textGap.- Property description:
-
textFillProperty
- See Also:
getTextFill()
,setTextFill(Paint)
-
setTextFill
Sets the value of the property textFill.- Property description:
-
getTextFill
Gets the value of the property textFill.- Property description:
-
textFillHoverProperty
- See Also:
getTextFillHover()
,setTextFillHover(Paint)
-
setTextFillHover
Sets the value of the property textFillHover.- Property description:
-
getTextFillHover
Gets the value of the property textFillHover.- Property description:
-
textFillHighlightProperty
-
setTextFillHighlight
Sets the value of the property textFillHighlight.- Property description:
-
getTextFillHighlight
Gets the value of the property textFillHighlight.- Property description:
-
textFillPressedProperty
- See Also:
getTextFillPressed()
,setTextFillPressed(Paint)
-
setTextFillPressed
Sets the value of the property textFillPressed.- Property description:
-
getTextFillPressed
Gets the value of the property textFillPressed.- Property description:
-
textFillSelectedProperty
- See Also:
getTextFillSelected()
,setTextFillSelected(Paint)
-
setTextFillSelected
Sets the value of the property textFillSelected.- Property description:
-
getTextFillSelected
Gets the value of the property textFillSelected.- Property description:
-
fontProperty
- See Also:
getFont()
,setFont(Font)
-
setFont
Sets the value of the property font.- Property description:
-
getFont
Gets the value of the property font.- Property description:
-
glossyProperty
- See Also:
isGlossy()
,setGlossy(boolean)
-
setGlossy
public final void setGlossy(boolean glossy)Sets the value of the property glossy.- Property description:
-
isGlossy
public final boolean isGlossy()Gets the value of the property glossy.- Property description:
-
autoFixTextProperty
- See Also:
isAutoFixText()
,setAutoFixText(boolean)
-
setAutoFixText
public final void setAutoFixText(boolean auto)Sets the value of the property autoFixText.- Property description:
-
isAutoFixText
public final boolean isAutoFixText()Gets the value of the property autoFixText.- Property description:
-