public AbstractAttributedFigure clone() {
   AbstractAttributedFigure that = (AbstractAttributedFigure) super.clone();
   that.attributes = new HashMap<AttributeKey, Object>(this.attributes);
   if (this.forbiddenAttributes != null) {
     that.forbiddenAttributes = new HashSet<AttributeKey>(this.forbiddenAttributes);
   }
   return that;
 }
Exemplo n.º 2
0
 @Override
 public <T> void set(AttributeKey<T> key, T newValue) {
   if (key == TRANSFORM) {
     invalidate();
   }
   super.set(key, newValue);
 }
Exemplo n.º 3
0
 @Override
 public <T> void set(AttributeKey<T> key, T newValue) {
   if (key == PATH_CLOSED) {
     path.setClosed((Boolean) newValue);
   } else if (key == WINDING_RULE) {
     path.setWindingRule(
         newValue == AttributeKeys.WindingRule.EVEN_ODD
             ? Path2D.Double.WIND_EVEN_ODD
             : Path2D.Double.WIND_NON_ZERO);
   }
   super.set(key, newValue);
   invalidate();
 }
Exemplo n.º 4
0
 @Override
 public void invalidate() {
   super.invalidate();
   path.invalidatePath();
   cappedPath = null;
 }
Exemplo n.º 5
0
 @Override
 protected void validate() {
   super.validate();
   path.invalidatePath();
   cappedPath = null;
 }