Package java.awt.geom

Examples of java.awt.geom.Rectangle2D


    pageFormatList = new ArrayList();

    Object o = instance.readObject(in);
    while (o != null)
    {
      final Rectangle2D rect = (Rectangle2D) o;
      pageBoundsList.add(rect);
      o = instance.readObject(in);
    }

    o = instance.readObject(in);
View Full Code Here


    for (int vert = 0; vert < pageCountVertical; vert++)
    {
      float pageStartX = 0;
      for (int hor = 0; hor < pageCountHorizontal; hor++)
      {
        final Rectangle2D rect =
            new Rectangle2D.Float(pageStartX, pageStartY, width, height);
        pagePositions[vert * pageCountHorizontal + hor] = rect;
        pageStartX += width;
      }
      pageStartY += height;
View Full Code Here

        float ln1;
        float lt2;
        float ln2;
        FontRenderContext frc = new FontRenderContext(new AffineTransform(), true, true);
        gv = font.createGlyphVector(frc, str);
        Rectangle2D r = gv.getLogicalBounds();
        w = r.getWidth();
        angle = 0;
        int nseg = llpoints.length / 2 - 1;
        lt1 = llpoints[0];
        ln1 = llpoints[1];
        llp1.setLatLon(lt1, ln1, true);
View Full Code Here

        }

        public void mouseReleased(MouseEvent event) {
            if (getAction() != null ? getAction().isEnabled() : isEnabled()) {
                // do a hit test to make sure the mouse is being released inside the button
                Rectangle2D buttonRect = BorderlessImageButton.this.getBounds();
                if (buttonRect.contains(event.getPoint())) {
                    BorderlessImageButton.this.setBackground(BorderlessUtility.ON_MOUSE_OVER_BACKGROUND);
                }
            }
        }
View Full Code Here

      final String text = String.valueOf(i);

      final float width;
      if (useFontMetricsGetStringBounds)
      {
        final Rectangle2D bounds = fm.getStringBounds(text, g2);
        // getStringBounds() can return incorrect height for some Unicode
        // characters...see bug parade 6183356, let's replace it with
        // something correct
        width = (float) bounds.getWidth();
      }
      else
      {
        width = fm.stringWidth(text);
      }
View Full Code Here

    {
      return;
    }
    final double x0 = valueToJava2D(rangeLowerBound.doubleValue(), area);
    final double x1 = valueToJava2D(rangeUpperBound.doubleValue(), area);
    final Rectangle2D rangeArea = new Rectangle2D.Double(x0, area.getY(),
        (x1 - x0), area.getHeight());
    g2.setPaint(getRangePaint());
    g2.fill(rangeArea);
  }
View Full Code Here

      throw new IllegalArgumentException("The given FontSize is <= 0");
    }

    if (maxLineHeightUsed)
    {
      final Rectangle2D rect = font.getMaxCharBounds(DefaultSizeCalculator.getFrcDetector().createFontRenderContext());
      this.lineHeight = (float) rect.getHeight();
    }
    else
    {
      this.lineHeight = font.getSize2D();
    }
View Full Code Here

    {
      chars = new char[Math.max(chars.length + 100, text.length())];
    }

    text.getChars(lineStartPos, endPos, chars, 0);
    final Rectangle2D textBounds2 = font.getStringBounds(chars, 0, endPos - lineStartPos, frc);
    return (float) textBounds2.getWidth();
  }
View Full Code Here

      reportDrawable.setStyleSheet(getStyleSheet());
    }

    final Graphics2D derived = (Graphics2D) g2.create();
    derived.scale(scaleX, scaleY);
    final Rectangle2D scaledArea = (Rectangle2D) area.clone();
    scaledArea.setRect(scaledArea.getX() * scaleX, scaledArea.getY() * scaleY,
        scaledArea.getWidth() * scaleX, scaledArea.getHeight() * scaleY);
    super.draw(derived, scaledArea);
    derived.dispose();
  }
View Full Code Here

    }

    if (drawable instanceof ReportDrawable)
    {
      final ReportDrawable reportDrawable = (ReportDrawable) drawable;
      final Rectangle2D scaledArea = (Rectangle2D) bounds.clone();
      scaledArea.setRect(scaledArea.getX() * scaleX, scaledArea.getY() * scaleY,
          scaledArea.getWidth() * scaleX, scaledArea.getHeight() * scaleY);
      reportDrawable.getImageMap(scaledArea);
    }
    return null;
  }
View Full Code Here

TOP

Related Classes of java.awt.geom.Rectangle2D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.