Пример #1
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));
 }
Пример #2
0
  public Point2D componentToImage(Point2D p) {
    Point2D tp = null;

    try {
      tp = t.inverseTransform(p, null);
    } catch (NoninvertibleTransformException ex) {
      // can't happen.
    }

    return tp;
  }