@Override protected String getColorString(Node<?> node) { return node.getAttributes().getFillColor(); }
@Override protected String getColorString(Node<?> node) { return node.getAttributes().getStrokeColor(); }
@Override protected void setColorString(Node<?> node, String color) { node.getAttributes().setStrokeColor(color); } }
@Override protected void setColorString(Node<?> node, String color) { node.getAttributes().setFillColor(color); } }
public Transform getTransform() { return getAttributes().getTransform(); }
public T setTransform(Transform transform) { getAttributes().setTransform(transform); return cast(); }
@Override public boolean apply(Node<?> node, double percent) { node.getAttributes().putDouble(m_attribute.getProperty(), (m_origin + ((m_target - m_origin) * percent))); return true; } }
@Override public boolean apply(Node<?> node, double percent) { node.getAttributes().putDouble(m_attribute.getProperty(), (m_origin + ((m_target - m_origin) * percent))); return true; } }
@Override public boolean apply(Node<?> node, double percent) { double value = (m_origin + ((m_target - m_origin) * percent)); if (value < m_minval) { value = m_minval; } if (value > m_maxval) { value = m_maxval; } node.getAttributes().putDouble(m_attribute.getProperty(), value); return true; } }
@Override public boolean init(Node<?> node) { if ((node != null) && (m_attribute != null) && (node.getAttributeSheet().contains(m_attribute))) { m_origin = node.getAttributes().getDouble(m_attribute.getProperty()); return true; } return false; }
@Override public boolean apply(Node<?> node, double percent) { double value = (m_origin + ((m_target - m_origin) * percent)); if (value < m_minval) { value = m_minval; } if (value > m_maxval) { value = m_maxval; } node.getAttributes().putDouble(m_attribute.getProperty(), value); return true; } }
@Override public boolean init(Node<?> node) { if ((node != null) && (m_attribute != null) && (node.getAttributeSheet().contains(m_attribute))) { m_origin = node.getAttributes().getPoint2D(m_attribute.getProperty()); if (null == m_origin) { m_origin = new Point2D(1, 1); } return true; } return false; }
@Override public boolean init(Node<?> node) { if ((node != null) && (m_attribute != null) && (node.getAttributeSheet().contains(m_attribute))) { m_origin = node.getAttributes().getPoint2D(m_attribute.getProperty()); if (null == m_origin) { m_origin = new Point2D(0, 0); } return true; } return false; }
@Override public boolean apply(Node<?> node, double percent) { Point2D posn = m_calc.calculate(percent); if (posn != null) { node.getAttributes().putDouble(Attribute.X.getProperty(), posn.getX()); node.getAttributes().putDouble(Attribute.Y.getProperty(), posn.getY()); return true; } return false; } }
@Override public boolean init(Node<?> node) { if ((node != null) && (m_attribute != null) && (node.getAttributeSheet().contains(m_attribute))) { m_origin = node.getAttributes().getDouble(m_attribute.getProperty()); if (m_origin < m_minval) { m_origin = m_minval; } if (m_origin > m_maxval) { m_origin = m_maxval; } if (m_target < m_minval) { m_target = m_minval; } if (m_target > m_maxval) { m_target = m_maxval; } return true; } return 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; }
@Override public boolean apply(Node<?> node, double percent) { double x = m_origin.getX() + ((m_target.getX() - m_origin.getX()) * percent); double y = m_origin.getY() + ((m_target.getY() - m_origin.getY()) * percent); node.getAttributes().putPoint2D(m_attribute.getProperty(), new Point2D(x, y)); return true; } }
@Override public boolean apply(Node<?> node, double percent) { double x = m_origin.getX() + ((m_target.getX() - m_origin.getX()) * percent); double y = m_origin.getY() + ((m_target.getY() - m_origin.getY()) * percent); node.getAttributes().putPoint2D(m_attribute.getProperty(), new Point2D(x, y)); return true; } }
@Override public void startDrag(DragContext dragContext) { Attributes attr = dragContext.getNode().asNode().getAttributes(); m_constraint = attr.getDragConstraint(); m_bounds = attr.getDragBounds(); if (m_bounds != null) { double x = attr.getX(); double y = attr.getY(); if (m_bounds.isX1()) m_dx1 = m_bounds.getX1() - x; if (m_bounds.isX2()) m_dx2 = m_bounds.getX2() - x; if (m_bounds.isY1()) m_dy1 = m_bounds.getY1() - y; if (m_bounds.isY2()) m_dy2 = m_bounds.getY2() - y; } }
Attributes attr = getAttributes();