Examples of RoundRectangle2D


Examples of com.google.code.appengine.awt.geom.RoundRectangle2D

   
    /**
     * @see Graphics#drawRoundRect(int, int, int, int, int, int)
     */
    public void drawRoundRect(int x, int y, int width, int height, int arcWidth, int arcHeight) {
        RoundRectangle2D rect = new RoundRectangle2D.Double(x,y,width,height,arcWidth, arcHeight);
        draw(rect);
    }
View Full Code Here

Examples of java.awt.geom.RoundRectangle2D

   *
   * @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

Examples of java.awt.geom.RoundRectangle2D

    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

Examples of java.awt.geom.RoundRectangle2D

                            final int width,
                            final int height,
                            final int arcWidth,
                            final int arcHeight)
  {
    final RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight);
    draw(rect);
  }
View Full Code Here

Examples of java.awt.geom.RoundRectangle2D

                            final int width,
                            final int height,
                            final int arcWidth,
                            final int arcHeight)
  {
    final RoundRectangle2D rect = new RoundRectangle2D.Double(x, y, width, height, arcWidth, arcHeight);
    fill(rect);
  }
View Full Code Here

Examples of java.awt.geom.RoundRectangle2D

      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

Examples of java.awt.geom.RoundRectangle2D

    }

//    if ()
    float arcw = 20;
    float arch = 20;
    RoundRectangle2D rectangle = new RoundRectangle2D.Float(x, y, w, h, arcw, arch);
   
    g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);   
    g2d.fill(rectangle);
   
    g2d.setColor(getShadowColor());
    if (orientation == SwingConstants.HORIZONTAL) {
      rectangle.setFrame(x, y, w-1, h-1);
    }
    else {
      rectangle.setFrame(x, y, w-1, h-1);
    }
    g2d.draw(rectangle);
  }
View Full Code Here

Examples of java.awt.geom.RoundRectangle2D

    /* (non-Javadoc)
     * @see org.jpox.store.mapping.JavaTypeMapping#setObject(org.jpox.ObjectManager, java.lang.Object, int[], java.lang.Object)
     */
    public void setObject(ObjectManager om, Object preparedStatement, int[] exprIndex, Object value)
    {
      RoundRectangle2D roundRectangle = (RoundRectangle2D)value;
        if (roundRectangle == null)
        {
        for (int i = 0; i < exprIndex.length; i++)
        {
          getDataStoreMapping(i).setObject(preparedStatement, exprIndex[i], null);         
      }
        }
        else
        {
            getDataStoreMapping(0).setDouble(preparedStatement,exprIndex[0],roundRectangle.getX());
            getDataStoreMapping(1).setDouble(preparedStatement,exprIndex[1],roundRectangle.getY());
            getDataStoreMapping(2).setDouble(preparedStatement,exprIndex[2],roundRectangle.getWidth());
            getDataStoreMapping(3).setDouble(preparedStatement,exprIndex[3],roundRectangle.getHeight());
            getDataStoreMapping(4).setDouble(preparedStatement,exprIndex[4],roundRectangle.getArcWidth());
            getDataStoreMapping(5).setDouble(preparedStatement,exprIndex[5],roundRectangle.getArcHeight());
        }
    }
View Full Code Here

Examples of java.awt.geom.RoundRectangle2D

    /* (non-Javadoc)
     * @see org.datanucleus.store.mapping.JavaTypeMapping#setObject(org.datanucleus.ObjectManager, java.lang.Object, int[], java.lang.Object)
     */
    public void setObject(ExecutionContext ec, Object preparedStatement, int[] exprIndex, Object value)
    {
      RoundRectangle2D roundRectangle = (RoundRectangle2D)value;
        if (roundRectangle == null)
        {
        for (int i = 0; i < exprIndex.length; i++)
        {
          getDatastoreMapping(i).setObject(preparedStatement, exprIndex[i], null);         
      }
        }
        else
        {
            getDatastoreMapping(0).setDouble(preparedStatement,exprIndex[0],roundRectangle.getX());
            getDatastoreMapping(1).setDouble(preparedStatement,exprIndex[1],roundRectangle.getY());
            getDatastoreMapping(2).setDouble(preparedStatement,exprIndex[2],roundRectangle.getWidth());
            getDatastoreMapping(3).setDouble(preparedStatement,exprIndex[3],roundRectangle.getHeight());
            getDatastoreMapping(4).setDouble(preparedStatement,exprIndex[4],roundRectangle.getArcWidth());
            getDatastoreMapping(5).setDouble(preparedStatement,exprIndex[5],roundRectangle.getArcHeight());
        }
    }
View Full Code Here

Examples of java.awt.geom.RoundRectangle2D

            y + textBounds.getY(),
            textBounds.getWidth(),
            textBounds.getHeight()
        );
        // Expand the text rectangle to make a background round rectangle
        RoundRectangle2D background = new RoundRectangle2D.Double(
            textBounds.getX() - ArcRadius / 2,
            textBounds.getY() - ArcRadius / 2,
            textBounds.getWidth() + ArcRadius,
            textBounds.getHeight() + ArcRadius,
            ArcRadius, ArcRadius
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.