Examples of Rectangle2D


Examples of java.awt.geom.Rectangle2D

      }
    }
    else if (content instanceof Shape)
    {
      final Shape s = (Shape) content;
      final Rectangle2D bounds2D = s.getBounds2D();
      contentWidth = StrictGeomUtility.toInternalValue(bounds2D.getWidth());
      contentHeight = StrictGeomUtility.toInternalValue(bounds2D.getHeight());
    }
  }
View Full Code Here

Examples of java.awt.geom.Rectangle2D

    {
      throw new NullPointerException("The given pageformat must not be null.");
    }
    width = Math.max(width, (float) (format.getImageableWidth() + x));
    height = Math.max(height, (float) (format.getImageableHeight() + y));
    final Rectangle2D bounds = new Rectangle2D.Double
        (x, y, format.getImageableWidth(), format.getImageableHeight());
    pageBoundsList.add(bounds);
    pageFormatList.add(format.clone());
  }
View Full Code Here

Examples of java.awt.geom.Rectangle2D

   * @param index the index of the page.
   * @return the position of the page (within the global page).
   */
  public Rectangle2D getPagePosition(final int index)
  {
    final Rectangle2D rec = (Rectangle2D) pageBoundsList.get(index);
    return rec.getBounds2D();
  }
View Full Code Here

Examples of java.awt.geom.Rectangle2D

  public Rectangle2D[] getPagePositions()
  {
    final Rectangle2D[] rects = new Rectangle2D[pageBoundsList.size()];
    for (int i = 0; i < pageBoundsList.size(); i++)
    {
      final Rectangle2D rec = (Rectangle2D) pageBoundsList.get(i);
      rects[i] = rec.getBounds2D();
    }
    return rects;
  }
View Full Code Here

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

Examples of java.awt.geom.Rectangle2D

    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

Examples of java.awt.geom.Rectangle2D

        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

Examples of java.awt.geom.Rectangle2D

        }

        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

Examples of java.awt.geom.Rectangle2D

      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

Examples of java.awt.geom.Rectangle2D

    {
      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
TOP
Copyright © 2018 www.massapi.com. 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.