示例#1
0
 /**
  * Give notification from the model that a change occured for an element this view is responsible
  * for rendering.
  *
  * <p>
  */
 public void changedUpdate(DrawingEvent.EventType eventType) {
   // if geometry changed from ellipse to circle or vice-versa, we need to *force*
   // update of interior paint attribute ; otherwise, if attribute changed,
   // no need to worry, for this is done automatically by superclass :
   if (eventType != DrawingEvent.EventType.ATTRIBUTE_CHANGE) syncAttributes();
   super.changedUpdate(eventType); // super calls syncAttribute if ATTRIBUTE_CHANGE, it's ok.
 }
示例#2
0
 /**
  * Inherits from superclass, except for elliptic arcs, which are never filled, as well as rotated
  * ellipses. Conversely, circles, circular arcs and non-rotated ellipses are always filled.
  */
 protected void syncAttributes() {
   super.syncAttributes(); // that's ok for ellipses and circular arcs
   outlineStroke =
       new BasicStroke(element.getAttribute(LINE_WIDTH).floatValue()); // dont' dash or dot
   PicEllipse ellipse = (PicEllipse) element;
   // filled : isCircular() || (isPlain() && non-rotated)
   if (!ellipse.isCircular()
       && (ellipse.getRotationAngle() != 0
           || !ellipse.isPlain())) { // elliptic arcs or rotated ellipses
     interiorPaint = null; // forbides filling
   }
   // never paint arrows :
   // arrowStart = arrowEnd = null; // now rendered by formatter
 }