Пример #1
0
  /**
   * Check each group that may have changed, for example to rebuild the Z index and the shadow set.
   *
   * @param oldRule The old rule that changed.
   * @param newRule The new rule that participated in the change.
   */
  protected void checkZIndexAndShadow(Rule oldRule, Rule newRule) {
    if (oldRule != null) {
      if (oldRule.selector.getId() != null || oldRule.selector.getClazz() != null) {
        // We may accelerate things a bit when a class or id style is
        // modified,
        // since only the groups listed in the style are concerned (we
        // are at the
        // bottom of the inheritance tree).
        if (oldRule.getGroups() != null)
          for (String s : oldRule.getGroups()) {
            StyleGroup group = groups.get(s);
            zIndex.groupChanged(group);
            shadow.groupChanged(group);
          }
      } else {
        // For kind styles "NODE", "EDGE", "GRAPH", "SPRITE", we must
        // reset
        // the whole Z and shadows for the kind, since several styles
        // may
        // have changed.

        Selector.Type type = oldRule.selector.type;

        for (StyleGroup group : groups.values()) {
          if (group.getType() == type) {
            zIndex.groupChanged(group);
            shadow.groupChanged(group);
          }
        }
      }
    }
  }
Пример #2
0
 public final Rule rule() throws ParseException {
   Selector select;
   Style style;
   Rule rule;
   select = select();
   rule = new Rule(select);
   style = new Style();
   rule.setStyle(style);
   jj_consume_token(LBRACE);
   styles(style);
   jj_consume_token(RBRACE);
   {
     if (true) return rule;
   }
   throw new Error("Missing return statement in function");
 }