Class LeafIcon

All Implemented Interfaces:
Icon

public class LeafIcon extends AbstractAnahataIcon
A programmatically drawn icon representing a leaf in various stages of its lifecycle.

This icon is used to visualize the "metabolism" of context parts, specifically indicating whether a part is active, withered (effectively pruned), or dead (permanently deleted).

Author:
anahata
  • Field Details

    • state

      private final LeafIcon.LeafState state
      The active metabolic lifecycle state of this leaf.
  • Constructor Details

    • LeafIcon

      public LeafIcon(int size, LeafIcon.LeafState state)
      Constructs a new LeafIcon with the specified size and state.
      Parameters:
      size - The size in pixels.
      state - The current lifecycle stage.
  • Method Details

    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)

      Renders the leaf with biological fidelity, adjusting color and opacity based on the metabolic state.