Class LayerVisibilityModel

java.lang.Object
com.arbergashi.charts.ui.legend.LayerVisibilityModel

public final class LayerVisibilityModel extends Object
Holds per-series visibility state.

This model is intentionally lightweight and thread-safe. Swing users typically interact with it on the EDT, but renderers and overlays may consult it during paint. Series ids usually come from BaseRenderer#getId().

Since:
2025-06-01
Version:
1.0.0
Author:
Arber Gashi
  • Constructor Details

    • LayerVisibilityModel

      public LayerVisibilityModel()
  • Method Details

    • isVisible

      public boolean isVisible(String seriesId)
      Returns whether the series is considered visible (default: true).
    • setVisible

      public void setVisible(String seriesId, boolean visible)
      Sets the series visibility.
    • toggle

      public boolean toggle(String seriesId)
      Toggles visibility and returns the new state.
    • clear

      public void clear()
      Clears all overrides (all series visible by default).
    • setSolo

      public void setSolo(String seriesId)
      Sets the series as solo (others remain visible but can be dimmed).
    • clearSolo

      public void clearSolo()
      Clears solo mode.
    • isSoloActive

      public boolean isSoloActive()
      Returns true when solo mode is active.
    • isDimmed

      public boolean isDimmed(String seriesId)
      Returns true when the series should be dimmed due to solo mode.