Package java.awt.geom

Examples of java.awt.geom.RoundRectangle2D$Float


        updateSize();
        Graphics2D g2d = (Graphics2D) g;
        g2d.setFont(font);

        RoundRectangle2D r = new RoundRectangle2D.Double(getX(), getY(),
                getWidth(), getHeight(), 1, 1);
        //Rectangle2D r = new Rectangle2D.Double(getX(), getY(), getWidth(),
        // getHeight());
        Line2D l = new Line2D.Double(getX(), 25 + getY(), getWidth() + getX(),
                getY() + 25);
View Full Code Here


    public void paint(Graphics g)
    {
        Graphics2D g2d = (Graphics2D) g;
        g2d.setFont(font);
        updateSize();
        RoundRectangle2D r = new RoundRectangle2D.Double(getX(), getY(),
                getWidth(), getHeight(), 1, 1);
        Line2D l = new Line2D.Double(getX(), 25 + getY(), getWidth() + getX(),
                25 + getY());
        g2d.setColor(Color.white);
        g2d.fill(r);
View Full Code Here

     *                    at the four corners.
     * @see        java.awt.Graphics#fillRoundRect
     */
    public void drawRoundRect(int x, int y, int width, int height,
                              int arcWidth, int arcHeight){
        RoundRectangle2D rect = new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight);
        draw(rect);
    }
View Full Code Here

     *                     of the arc at the four corners.
     * @see         java.awt.Graphics#drawRoundRect
     */
    public void fillRoundRect(int x, int y, int width, int height,
                              int arcWidth, int arcHeight){
        RoundRectangle2D rect = new RoundRectangle2D.Float(x, y, width, height, arcWidth, arcHeight);
        fill(rect);
    }
View Full Code Here

                break;
        }


        RoundRectangle2D rect = new RoundRectangle2D.Float(x, y, width * 2, height * 2, width, height);

        Color bgColor = Color.decode(bg);

        Color fgColor = Color.decode(fg);
        Rectangle r = new Rectangle(width, height);
View Full Code Here

          new Color(Math.min(251 + b, 255), Math.min(251 + b, 255), Math.min(252 + b, 255)), 0, h + o,
          new Color(Math.min(215 + b, 255), Math.min(218 + b, 255), Math.min(224 + b, 255)), true);
      g.setPaint(gp);
    }

    final RoundRectangle2D roundRectangle2D = new RoundRectangle2D.Double(0, 0, w - 1, h - 1, 6, 6);

    //if (!selected || rollover)
    {
      g.fill(roundRectangle2D);
    }
View Full Code Here

   * @throws IOException if an I/O error occured.
   */
  public void writeObject (final Object o, final ObjectOutputStream out)
          throws IOException
  {
    final RoundRectangle2D rectangle = (RoundRectangle2D) o;
    out.writeDouble(rectangle.getX());
    out.writeDouble(rectangle.getY());
    out.writeDouble(rectangle.getWidth());
    out.writeDouble(rectangle.getHeight());
    out.writeDouble(rectangle.getArcWidth());
    out.writeDouble(rectangle.getArcHeight());
  }
View Full Code Here

   *
   * @return The object.
   */
  public Object createObject()
  {
    final RoundRectangle2D rect = new RoundRectangle2D.Float();
    final float w = getFloatParameter("width");
    final float h = getFloatParameter("height");
    final float x = getFloatParameter("x");
    final float y = getFloatParameter("y");
    final float aw = getFloatParameter("arcWidth");
    final float ah = getFloatParameter("arcHeight");
    rect.setRoundRect(x, y, w, h, aw, ah);

    return rect;
  }
View Full Code Here

    if (!(o instanceof RoundRectangle2D))
    {
      throw new ObjectFactoryException("The given object is no java.awt.geom.Rectangle2D.");
    }

    final RoundRectangle2D rect = (RoundRectangle2D) o;
    final float x = (float) rect.getX();
    final float y = (float) rect.getY();
    final float w = (float) rect.getWidth();
    final float h = (float) rect.getHeight();
    final float aw = (float) rect.getArcWidth();
    final float ah = (float) rect.getArcHeight();

    setParameter("x", new Float(x));
    setParameter("y", new Float(y));
    setParameter("width", new Float(w));
    setParameter("height", new Float(h));
View Full Code Here

      return;
    }

    if (shape instanceof RoundRectangle2D)
    {
      final RoundRectangle2D rr = (RoundRectangle2D) shape;
      if (retval == null)
      {
        retval = new CellBackground();
      }

      if (draw)
      {
        // the beast has a border ..
        final BorderEdge edge = ProcessUtility.produceBorderEdge(styleSheet);
        if (edge != null)
        {
          if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
          {
            retval.setTop(edge);
          }
          if ((backgroundHint & BACKGROUND_LEFT) == BACKGROUND_LEFT)
          {
            retval.setLeft(edge);
          }
          if ((backgroundHint & BACKGROUND_BOTTOM) == BACKGROUND_BOTTOM)
          {
            retval.setBottom(edge);
          }
          if ((backgroundHint & BACKGROUND_RIGHT) == BACKGROUND_RIGHT)
          {
            retval.setRight(edge);
          }
        }
      }
      if (fill && ((backgroundHint & BACKGROUND_AREA) == BACKGROUND_AREA))
      {
        final Color color = (Color) styleSheet.getStyleProperty(ElementStyleKeys.FILL_COLOR);
        if (color != null)
        {
          retval.addBackground(color);
        }
        else
        {
          retval.addBackground((Color) styleSheet.getStyleProperty(ElementStyleKeys.PAINT));
        }
      }

      final long arcHeight = StrictGeomUtility.toInternalValue(rr.getArcHeight());
      final long arcWidth = StrictGeomUtility.toInternalValue(rr.getArcWidth());
      if (arcHeight > 0 && arcWidth > 0)
      {
        final BorderCorner bc = new BorderCorner(arcWidth, arcHeight);
        if ((backgroundHint & BACKGROUND_TOP) == BACKGROUND_TOP)
        {
View Full Code Here

TOP

Related Classes of java.awt.geom.RoundRectangle2D$Float

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.