protected Shape(ShapeType type) { super(NodeType.SHAPE); m_type = type; setX(0).setY(0).setAlpha(1).setDraggable(false); }
/** * Sets the X and Y attributes to P.x and P.y * * @param p Point2D * @return this Shape */ @Override public T setLocation(Point2D p) { setX(p.getX()); setY(p.getY()); return cast(); }
public Shape(ShapeType type, JSONObject node) { super(NodeType.SHAPE, node); m_type = type; final Attributes attr = getAttributes(); if (NativeInternalType.NUMBER != attr.typeOf(Attribute.X)) { setX(0); } if (NativeInternalType.NUMBER != attr.typeOf(Attribute.Y)) { setY(0); } if (NativeInternalType.NUMBER != attr.typeOf(Attribute.ALPHA)) { setAlpha(1); } else { attr.setAlpha(attr.getAlpha()); // normalizes alpha if out of range } if (NativeInternalType.BOOLEAN != attr.typeOf(Attribute.DRAGGABLE)) { setDraggable(false); } }