Exemplo n.º 1
0
 /**
  * set the value of this <code>AttributeComponent</code>
  *
  * @param a the set of attributes possibly having an attribute this component can display
  * @return true, if the set of attributes had a matching attribute, false if not
  */
 public boolean setValue(final AttributeSet a) {
   final boolean success = true;
   ca = new CombinedAttribute(key, a, true);
   if (++setValueCalls < 2) {
     originalValue = ca.getAttribute();
   }
   SizeSelectorPanel ssp;
   for (int i = 0; i < components.size(); i++) {
     ssp = (SizeSelectorPanel) components.elementAt(i);
     ssp.setValue(ca.getAttribute(i));
   }
   return success;
 }
Exemplo n.º 2
0
 public AttributeSet getValue(final boolean includeUnchanged) {
   if (includeUnchanged) {
     final SimpleAttributeSet set = new SimpleAttributeSet();
     SizeSelectorPanel ssp;
     for (int i = 0; i < components.size(); i++) {
       ssp = (SizeSelectorPanel) components.elementAt(i);
       ca.setAttribute(i, ssp.getAttr());
     }
     final String newValue = ca.getAttribute();
     set.addAttribute(key, newValue);
     Util.styleSheet().addCSSAttribute(set, (CSS.Attribute) key, newValue);
     return set;
   } else {
     return getValue();
   }
 }
Exemplo n.º 3
0
 /**
  * get the value of this <code>AttributeComponent</code>
  *
  * @return the value selected from this component
  */
 public AttributeSet getValue() {
   final SimpleAttributeSet set = new SimpleAttributeSet();
   SizeSelectorPanel ssp;
   for (int i = 0; i < components.size(); i++) {
     ssp = (SizeSelectorPanel) components.elementAt(i);
     if (ssp.valueChanged()) {
       ca.setAttribute(i, ssp.getAttr());
     }
   }
   final String newValue = ca.getAttribute();
   if (!originalValue.equalsIgnoreCase(newValue)) {
     set.addAttribute(key, newValue);
     Util.styleSheet().addCSSAttribute(set, (CSS.Attribute) key, newValue);
   }
   return set;
 }
Exemplo n.º 4
0
 /**
  * set the value of this <code>AttributeComponent</code>
  *
  * @param color the <code>CombinedAttribute</code> to take the color from
  */
 public void setValue(
     final CombinedAttribute borderWidths, final CombinedAttribute borderColors) {
   String attr = borderColors.getAttribute(side);
   // System.out.println("BorderSettings setValue attr='" + attr + "'");
   if (attr != null) {
     bColor.setValue(attr);
   }
   attr = borderWidths.getAttribute(side);
   if (attr != null) {
     bWidth.setValue(attr);
   }
 }
Exemplo n.º 5
0
 public String getBorderWidth() {
   return bWidth.getAttr();
 }