예제 #1
0
 /** Checks if a Point2D.Double is inside the figure. */
 public boolean contains(Point2D.Double p) {
   if (TRANSFORM.get(this) != null) {
     try {
       p = (Point2D.Double) TRANSFORM.get(this).inverseTransform(p, new Point2D.Double());
     } catch (NoninvertibleTransformException ex) {
       ex.printStackTrace();
     }
   }
   return getTextShape().getBounds2D().contains(p);
 }
예제 #2
0
 public void setFontSize(float size) {
   // FONT_SIZE.basicSet(this, new Double(size));
   Point2D.Double p = new Point2D.Double(0, size);
   AffineTransform tx = TRANSFORM.get(this);
   if (tx != null) {
     try {
       tx.inverseTransform(p, p);
       Point2D.Double p0 = new Point2D.Double(0, 0);
       tx.inverseTransform(p0, p0);
       p.y -= p0.y;
     } catch (NoninvertibleTransformException ex) {
       ex.printStackTrace();
     }
   }
   FONT_SIZE.set(this, Math.abs(p.y));
 }