@SuppressWarnings("unchecked") public void setAttributes(Map<AttributeKey, Object> map) { for (Map.Entry<AttributeKey, Object> entry : map.entrySet()) { set(entry.getKey(), entry.getValue()); } } @Override
@Override public <T> void set(AttributeKey<T> key, T newValue) { if (key == TRANSFORM) { invalidate(); } super.set(key, newValue); } @Override public Collection<Action> getActions(Point2D.Double p) {
@Override public <T> void set(AttributeKey<T> key, T newValue) { if (key == TRANSFORM) { invalidate(); } super.set(key, newValue); } @Override public Collection<Action> getActions(Point2D.Double p) {
/** * Sets an attribute of the figure. * AttributeKey name and semantics are defined by the class implementing * the figure interface. */ @Override public <T> void set(AttributeKey<T> key, T newValue) { super.set(key, newValue); for (final BezierFigure figure : figures) { figure.set(key, newValue); } }
/** * Sets an attribute of the figure. * AttributeKey name and semantics are defined by the class implementing * the figure interface. */ @Override public <T> void set(AttributeKey<T> key, T newValue) { super.set(key, newValue); for (final BezierFigure figure : figures) { figure.set(key, newValue); } }
@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(); }
@SuppressWarnings("unchecked") protected void readAttributes(DOMInput in) throws IOException { if (in.getElementCount("a") > 0) { in.openElement("a"); for (int i=in.getElementCount() - 1; i >= 0; i-- ) { in.openElement(i); String name = in.getTagName(); Object value = in.readObject(); AttributeKey key = getAttributeKey(name); if (key != null && key.isAssignable(value)) { if (forbiddenAttributes == null || ! forbiddenAttributes.contains(key)) { set(key, value); } } in.closeElement(); } in.closeElement(); } }
ButtonFactory.addToolTo(tb, editor, ct = new CreationTool(new LineFigure()), "edit.createArrow", labels); af = (AbstractAttributedFigure) ct.getPrototype(); af.set(END_DECORATION, new ArrowTip(0.35, 12, 11.3)); ButtonFactory.addToolTo(tb, editor, new ConnectionTool(new LineConnectionFigure()), "edit.createLineConnection", labels); ButtonFactory.addToolTo(tb, editor, cnt = new ConnectionTool(new LineConnectionFigure()), "edit.createElbowConnection", labels);
ButtonFactory.addToolTo(tb, editor, ct = new CreationTool(new LineFigure()), "edit.createArrow", labels); af = (AbstractAttributedFigure) ct.getPrototype(); af.set(END_DECORATION, new ArrowTip(0.35, 12, 11.3)); ButtonFactory.addToolTo(tb, editor, new ConnectionTool(new LineConnectionFigure()), "edit.createLineConnection", labels); ButtonFactory.addToolTo(tb, editor, cnt = new ConnectionTool(new LineConnectionFigure()), "edit.createElbowConnection", labels);