/** * React to a changes in the attributes by changing the icon. * * @param attribute The attribute that changed. * @exception IllegalActionException If the change is not acceptable to this container (should not * be thrown). */ @Override public void attributeChanged(Attribute attribute) throws IllegalActionException { if (attribute == x || attribute == y || attribute == arrowLength || attribute == arrowWidth || attribute == lineColor) { double xValue = ((DoubleToken) x.getToken()).doubleValue(); double yValue = ((DoubleToken) y.getToken()).doubleValue(); double arrowLengthValue = ((DoubleToken) arrowLength.getToken()).doubleValue(); double arrowWidthValue = ((DoubleToken) arrowWidth.getToken()).doubleValue(); _icon.setShape(_createArrow(xValue, yValue, arrowLengthValue, arrowWidthValue)); _icon.setLineColor(lineColor.asColor()); _icon.setFillColor(lineColor.asColor()); } else { super.attributeChanged(attribute); } }
/** Override the default setStyle. Legal styles <em>do not</em> include MARK or MARK_LINE. */ public void setStyle(int st) { if (st == MARK || st == MARK_LINE) return; super.setStyle(st); }