/** * 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; }
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(); } }
/** * 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; }
/** * 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); } }
public String getBorderWidth() { return bWidth.getAttr(); }