Klasse ActivityRenderer<A extends Activity>

Bekannte direkte Unterklassen:
ActivityBarRenderer, CalendarActivityRenderer, ChartActivityRenderer

public class ActivityRenderer<A extends Activity> extends Renderer
Base renderer for drawing activities as filled and stroked shapes. It manages state-specific styling, safe graphics context handling, and returns the bounds of the rendered activity.
  • Eigenschaftsdetails

  • Konstruktordetails

    • ActivityRenderer

      public ActivityRenderer(GraphicsBase<?> graphics, String name)
      Constructs an activity renderer and registers its stroke and corner styling properties for redraws.
      Parameter:
      graphics - the graphics control that uses this renderer
      name - the renderer name
  • Methodendetails

    • draw

      public final ActivityBounds draw(ActivityRef<A> activityRef, Position position, GraphicsContext gc, double x, double y, double w, double h, boolean selected, boolean hover, boolean highlighted, boolean pressed)
      Draws the given activity and returns the resulting bounds.
      Parameter:
      activityRef - the activity reference to render
      position - the activity position
      gc - the graphics context
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      selected - whether the activity is selected
      hover - whether the activity is hovered
      highlighted - whether the activity is highlighted
      pressed - whether the activity is pressed
      Gibt zurück:
      the bounds of the rendered activity
    • 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)
      Draws the activity contents and returns the resulting bounds.
      Parameter:
      activityRef - the activity reference to render
      position - the activity position
      gc - the graphics context
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      selected - whether the activity is selected
      hover - whether the activity is hovered
      highlighted - whether the activity is highlighted
      pressed - whether the activity is pressed
      Gibt zurück:
      the bounds of the rendered 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)
      Draws the activity background.
      Parameter:
      activityRef - the activity reference to render
      position - the activity position
      gc - the graphics context
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      selected - whether the activity is selected
      hover - whether the activity is hovered
      highlighted - whether the activity is highlighted
      pressed - whether the activity is pressed
    • 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)
      Draws the activity border.
      Parameter:
      activityRef - the activity reference to render
      position - the activity position
      gc - the graphics context
      x - the x coordinate
      y - the y coordinate
      w - the width
      h - the height
      selected - whether the activity is selected
      hover - whether the activity is hovered
      highlighted - whether the activity is highlighted
      pressed - whether the activity is pressed
    • getStroke

      protected Paint getStroke(boolean selected, boolean hover, boolean highlighted, boolean pressed)
      Returns the stroke paint for the given activity state.
      Parameter:
      selected - whether the activity is selected
      hover - whether the activity is hovered
      highlighted - whether the activity is highlighted
      pressed - whether the activity is pressed
      Gibt zurück:
      the stroke paint to use
    • cornersRoundedProperty

      public final BooleanProperty cornersRoundedProperty()
      The cornersRounded property. Controls whether activity corners are rendered rounded.
      Gibt zurück:
      the cornersRounded property
      Siehe auch:
    • cornerRadiusProperty

      public final DoubleProperty cornerRadiusProperty()
      The cornerRadius property. Controls the radius used for rounded activity corners.
      Gibt zurück:
      the cornerRadius property
      Siehe auch:
    • lineWidthProperty

      public final DoubleProperty lineWidthProperty()
      The lineWidth property. Controls the stroke width used to draw activity borders.
      Gibt zurück:
      the lineWidth property
      Siehe auch:
    • strokeProperty

      public final ObjectProperty<Paint> strokeProperty()
      The stroke property. Defines the default stroke paint used for activities.
      Gibt zurück:
      the stroke property
      Siehe auch:
    • strokePressedProperty

      public final ObjectProperty<Paint> strokePressedProperty()
      The strokePressed property. Defines the stroke paint used while an activity is pressed.
      Gibt zurück:
      the strokePressed property
      Siehe auch:
    • strokeHoverProperty

      public final ObjectProperty<Paint> strokeHoverProperty()
      The strokeHover property. Defines the stroke paint used while an activity is hovered.
      Gibt zurück:
      the strokeHover property
      Siehe auch:
    • strokeSelectedProperty

      public final ObjectProperty<Paint> strokeSelectedProperty()
      The strokeSelected property. Defines the stroke paint used while an activity is selected.
      Gibt zurück:
      the strokeSelected property
      Siehe auch:
    • strokeHighlightProperty

      public final ObjectProperty<Paint> strokeHighlightProperty()
      The strokeHighlight property. Defines the stroke paint used while an activity is highlighted.
      Gibt zurück:
      the strokeHighlight property
      Siehe auch:
    • getStroke

      public final Paint getStroke()
      Ruft den Wert der stroke-Eigenschaft ab.
      Eigenschaftsbeschreibung:
      The stroke property. Defines the default stroke paint used for activities.
      Gibt zurück:
      Wert der Eigenschaft stroke
      Siehe auch:
    • setStroke

      public final void setStroke(Paint paint)
      Legt den Wert der stroke-Eigenschaft fest.
      Eigenschaftsbeschreibung:
      The stroke property. Defines the default stroke paint used for activities.
      Parameter:
      paint - Wert für die Eigenschaft stroke
      Siehe auch:
    • getStrokePressed

      public final Paint getStrokePressed()
      Ruft den Wert der strokePressed-Eigenschaft ab.
      Eigenschaftsbeschreibung:
      The strokePressed property. Defines the stroke paint used while an activity is pressed.
      Gibt zurück:
      Wert der Eigenschaft strokePressed
      Siehe auch:
    • setStrokePressed

      public final void setStrokePressed(Paint paint)
      Legt den Wert der strokePressed-Eigenschaft fest.
      Eigenschaftsbeschreibung:
      The strokePressed property. Defines the stroke paint used while an activity is pressed.
      Parameter:
      paint - Wert für die Eigenschaft strokePressed
      Siehe auch:
    • getStrokeHighlight

      public final Paint getStrokeHighlight()
      Ruft den Wert der strokeHighlight-Eigenschaft ab.
      Eigenschaftsbeschreibung:
      The strokeHighlight property. Defines the stroke paint used while an activity is highlighted.
      Gibt zurück:
      Wert der Eigenschaft strokeHighlight
      Siehe auch:
    • setStrokeHighlight

      public final void setStrokeHighlight(Paint paint)
      Legt den Wert der strokeHighlight-Eigenschaft fest.
      Eigenschaftsbeschreibung:
      The strokeHighlight property. Defines the stroke paint used while an activity is highlighted.
      Parameter:
      paint - Wert für die Eigenschaft strokeHighlight
      Siehe auch:
    • getStrokeSelected

      public final Paint getStrokeSelected()
      Ruft den Wert der strokeSelected-Eigenschaft ab.
      Eigenschaftsbeschreibung:
      The strokeSelected property. Defines the stroke paint used while an activity is selected.
      Gibt zurück:
      Wert der Eigenschaft strokeSelected
      Siehe auch:
    • setStrokeSelected

      public final void setStrokeSelected(Paint paint)
      Legt den Wert der strokeSelected-Eigenschaft fest.
      Eigenschaftsbeschreibung:
      The strokeSelected property. Defines the stroke paint used while an activity is selected.
      Parameter:
      paint - Wert für die Eigenschaft strokeSelected
      Siehe auch:
    • getStrokeHover

      public final Paint getStrokeHover()
      Ruft den Wert der strokeHover-Eigenschaft ab.
      Eigenschaftsbeschreibung:
      The strokeHover property. Defines the stroke paint used while an activity is hovered.
      Gibt zurück:
      Wert der Eigenschaft strokeHover
      Siehe auch:
    • setStrokeHover

      public final void setStrokeHover(Paint paint)
      Legt den Wert der strokeHover-Eigenschaft fest.
      Eigenschaftsbeschreibung:
      The strokeHover property. Defines the stroke paint used while an activity is hovered.
      Parameter:
      paint - Wert für die Eigenschaft strokeHover
      Siehe auch:
    • setCornerRadius

      public final void setCornerRadius(double radius)
      Legt den Wert der cornerRadius-Eigenschaft fest.
      Eigenschaftsbeschreibung:
      The cornerRadius property. Controls the radius used for rounded activity corners.
      Parameter:
      radius - Wert für die Eigenschaft cornerRadius
      Siehe auch:
    • getCornerRadius

      public final double getCornerRadius()
      Ruft den Wert der cornerRadius-Eigenschaft ab.
      Eigenschaftsbeschreibung:
      The cornerRadius property. Controls the radius used for rounded activity corners.
      Gibt zurück:
      Wert der Eigenschaft cornerRadius
      Siehe auch:
    • setCornersRounded

      public final void setCornersRounded(boolean rounded)
      Legt den Wert der cornersRounded-Eigenschaft fest.
      Eigenschaftsbeschreibung:
      The cornersRounded property. Controls whether activity corners are rendered rounded.
      Parameter:
      rounded - Wert für die Eigenschaft cornersRounded
      Siehe auch:
    • isCornersRounded

      public final boolean isCornersRounded()
      Ruft den Wert der cornersRounded-Eigenschaft ab.
      Eigenschaftsbeschreibung:
      The cornersRounded property. Controls whether activity corners are rendered rounded.
      Gibt zurück:
      Wert der Eigenschaft cornersRounded
      Siehe auch:
    • setLineWidth

      public final void setLineWidth(double lineWidth)
      Legt den Wert der lineWidth-Eigenschaft fest.
      Eigenschaftsbeschreibung:
      The lineWidth property. Controls the stroke width used to draw activity borders.
      Parameter:
      lineWidth - Wert für die Eigenschaft lineWidth
      Siehe auch:
    • getLineWidth

      public final double getLineWidth()
      Ruft den Wert der lineWidth-Eigenschaft ab.
      Eigenschaftsbeschreibung:
      The lineWidth property. Controls the stroke width used to draw activity borders.
      Gibt zurück:
      Wert der Eigenschaft lineWidth
      Siehe auch: