コード例 #1
0
 public boolean isSpecified(RenderingRuleProperty property) {
   if (property.isFloat()) {
     return fvalues[property.getId()] != 0 || values[property.getId()] != -1;
   } else {
     int val = values[property.getId()];
     if (property.isColor()) {
       return val != 0;
     } else {
       return val != -1;
     }
   }
 }
コード例 #2
0
 public float getFloatPropertyValue(RenderingRuleProperty property, float defVal) {
   float f = fvalues[property.getId()];
   if (f == 0) {
     return defVal;
   }
   return f;
 }
コード例 #3
0
 public String getStringPropertyValue(RenderingRuleProperty property) {
   int val = values[property.getId()];
   if (val < 0) {
     return null;
   }
   return storage.getStringValue(val);
 }
コード例 #4
0
 public void clearValue(RenderingRuleProperty p) {
   if (p.isIntParse()) {
     values[p.getId()] = savedValues[p.getId()];
   } else {
     fvalues[p.getId()] = savedFvalues[p.getId()];
     values[p.getId()] = savedValues[p.getId()];
   }
 }
コード例 #5
0
  private boolean visitRule(RenderingRule rule, boolean loadOutput) {
    RenderingRuleProperty[] properties = rule.getProperties();
    for (int i = 0; i < properties.length; i++) {
      RenderingRuleProperty rp = properties[i];
      if (rp.isInputProperty()) {
        boolean match;
        if (rp.isFloat()) {
          match = rp.accept(rule.getFloatProp(i), fvalues[rp.getId()], this);
        } else {
          match = rp.accept(rule.getIntProp(i), values[rp.getId()], this);
        }
        if (!match) {
          return false;
        }
      } else if (rp == storage.PROPS.R_DISABLE) {
        // quick disable return even without load output
        values[rp.getId()] = rule.getIntProp(i);
      }
    }
    if (!loadOutput) {
      return true;
    }
    // accept it
    for (int i = 0; i < properties.length; i++) {
      RenderingRuleProperty rp = properties[i];
      if (rp.isOutputProperty()) {
        searchResult = true;
        if (rp.isFloat()) {
          fvalues[rp.getId()] = rule.getFloatProp(i);
          values[rp.getId()] = rule.getIntProp(i);
        } else {
          values[rp.getId()] = rule.getIntProp(i);
        }
      }
    }

    for (RenderingRule rr : rule.getIfElseChildren()) {
      boolean match = visitRule(rr, loadOutput);
      if (match) {
        break;
      }
    }

    for (RenderingRule rr : rule.getIfChildren()) {
      visitRule(rr, loadOutput);
    }
    return true;
  }
コード例 #6
0
 public void setBooleanFilter(RenderingRuleProperty p, boolean filter) {
   assert p.isInputProperty();
   values[p.getId()] =
       filter ? RenderingRuleProperty.TRUE_VALUE : RenderingRuleProperty.FALSE_VALUE;
 }
コード例 #7
0
 public void setIntFilter(RenderingRuleProperty p, int filter) {
   assert p.isInputProperty();
   values[p.getId()] = filter;
 }
コード例 #8
0
 public void setStringFilter(RenderingRuleProperty p, String filter) {
   assert p.isInputProperty();
   values[p.getId()] = storage.getDictionaryValue(filter);
 }
コード例 #9
0
 public int getIntPropertyValue(RenderingRuleProperty property, int defValue) {
   int val = values[property.getId()];
   return val == -1 ? defValue : val;
 }
コード例 #10
0
 public int getIntPropertyValue(RenderingRuleProperty property) {
   return values[property.getId()];
 }
コード例 #11
0
 public String getColorStringPropertyValue(RenderingRuleProperty property) {
   return RenderingRuleProperty.colorToString(values[property.getId()]);
 }
コード例 #12
0
 public float getFloatPropertyValue(RenderingRuleProperty property) {
   return fvalues[property.getId()];
 }