public final Collection<String> getKeysCollection() { ArrayList<String> list = new ArrayList<String>(); fillKeysCollection(list); return list; }
/** * Gets the alpha value (transparency) for this group. * * @return double between 0 and 1 */ @Override public double getAlpha() { return getAttributes().getAlpha(); }
public final JsArray<JavaScriptObject> getArrayOfJSO(String name) { if (typeOf(name) == NativeInternalType.ARRAY) { return getArrayOfJSO0(name); } return null; }
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); } }
/** * Returns global alpha value. * * @return double */ public final double getGlobalAlpha() { double alpha = 1; Node<?> node = this; while (null != node) { Attributes attr = node.getAttributes(); if (attr.isDefined(Attribute.ALPHA)) { alpha = alpha * attr.getAlpha(); } node = node.getParent(); } return alpha; }
public final Point2DArray getControlPoints() { JsArray<JavaScriptObject> points = getArrayOfJSO(Attribute.CONTROL_POINTS.getProperty()); if (null != points) { return new Point2DArray(points); } return new Point2DArray(); }
public final Transform getTransform() { JavaScriptObject xrfm = getArray(Attribute.TRANSFORM.getProperty()); if (null != xrfm) { TransformJSO pjso = xrfm.cast(); return new Transform(pjso); } return null; }
/** * Gets the arrow type which specifies if the arrow has one or two arrow heads, * where they are located and whether the end without the arrow head is tapered or not. * * @return ArrowType */ public ArrowType getArrowType() { return getAttributes().getArrowType(); }
public double getAngleFactor() { return getAttributes().getAngleFactor(); }
/** * Gets the angle between the midline of the arrow (between start and end points) * and the outer diagonal. * * @return angle in degrees, e.g. 45.0 */ public double getArrowAngle() { return getAttributes().getArrowAngle(); }
/** * Constructor. Creates an instance of a group. */ protected Group(JSONObject node) { super(NodeType.GROUP, node); 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); } }
public final Point2DArray getPoints() { JsArray<JavaScriptObject> points = getArrayOfJSO(Attribute.POINTS.getProperty()); if (null != points) { return new Point2DArray(points); } return new Point2DArray(); }
public final DashArray getDashArray() { JsArrayMixed dash = getArray(Attribute.DASH_ARRAY.getProperty()); if (null != dash) { DashArrayJSO djso = dash.cast(); return new DashArray(djso); } return new DashArray(); }
/** * Gets the alpha value for this shape. * * @return double */ @Override public double getAlpha() { return getAttributes().getAlpha(); }