org.graphstream.ui.graphicGraph.stylesheet
Class Rule

java.lang.Object
  extended by 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 Summary
 HashSet<String> groups
          Optionally, the rule can store all the style groups it participates in.
 Selector selector
          The match.
 Style style
          The style.
 
Constructor Summary
Rule(Selector selector)
          New rule with a matcher.
Rule(Selector selector, Rule parent)
           
 
Method Summary
 void addGroup(String groupId)
          Specify that this rule participates in the given style group.
 HashSet<String> getGroups()
          The group this rule participate in, maybe null if the rule does not participate in any group.
 Style getStyle()
          This rule style.
 boolean matchId(String identifier)
          True if this rule selector match the given identifier.
 void removeGroup(String groupId)
          Remove this rule from the style group.
 void setStyle(Style style)
          Change the style.
 String toString()
           
 String toString(int level)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

selector

public Selector selector
The match.


style

public Style style
The style.


groups

public HashSet<String> groups
Optionally, the rule can store all the style groups it participates in.

Constructor Detail

Rule

public Rule(Selector selector)
New rule with a matcher.

Parameters:
selector - The rule selector.

Rule

public Rule(Selector selector,
            Rule parent)
Method Detail

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)


Copyright © 2011. All Rights Reserved.