protected Shape(ShapeType type) { super(NodeType.SHAPE); m_type = type; setX(0).setY(0).setAlpha(1).setDraggable(false); }
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); } }