示例#1
0
 /**
  * Return the transform context of the figure. This default implementation assumes that the figure
  * does not implement a transform context, so just calls the same method on its parent. If it has
  * no parent, return null.
  */
 public TransformContext getTransformContext() {
   if (_parent == null) {
     return null;
   } else {
     return _parent.getTransformContext();
   }
 }
示例#2
0
 /**
  * Schedule a repaint of the figure. This should be called after performing modifications on the
  * figure, so that the figure is scheduled for redrawing. This default implementation creates a
  * damage region that is the same size as this figure's bounding box, and forwards that to the
  * parent. Subclasses only need to override this method if they need to damage a region that is
  * different from the bounding box.
  */
 public void repaint() {
   if (_parent != null) {
     repaint(DamageRegion.createDamageRegion(_parent.getTransformContext(), getBounds()));
   }
 }