public <T> void removeAttribute(AttributeKey<T> key) { if (hasAttribute(key)) { T oldValue = key.get(this); attributes.remove(key); fireAttributeChanged(key, oldValue, key.getDefaultValue()); } }
/** Gets an attribute from the figure. */ public <T> T getAttribute(AttributeKey<T> key) { return hasAttribute(key) ? key.get(attributes) : key.getDefaultValue(); }