Class Rule

java.lang.Object
org.graphstream.ui.graphicGraph.stylesheet.Rule

public class Rule
extends Object
Style application rule.

A rule is made of a selector and values. The selector identifies the element(s) this rule applies to, and the values are styles to apply to the matched elements.

  • Field Details

  • Constructor Details

    • Rule

      public Rule​(Selector selector)
      New rule with a matcher.
      Parameters:
      selector - The rule selector.
    • Rule

      public Rule​(Selector selector, Rule parent)
  • Method Details

    • getStyle

      public Style getStyle()
      This rule style.
      Returns:
      The rule style.
    • getGroups

      public HashSet<String> getGroups()
      The group this rule participate in, maybe null if the rule does not participate in any group.
      Returns:
      The group set or null.
    • matchId

      public boolean matchId​(String identifier)
      True if this rule selector match the given identifier.
      Parameters:
      identifier - The identifier to test for the match.
      Returns:
      True if matching.
    • setStyle

      public void setStyle​(Style style)
      Change the style.
      Parameters:
      style - A style specification.
    • addGroup

      public void addGroup​(String groupId)
      Specify that this rule participates in the given style group.
      Parameters:
      groupId - The group unique identifier.
    • removeGroup

      public void removeGroup​(String groupId)
      Remove this rule from the style group.
      Parameters:
      groupId - The group unique identifier.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString​(int level)