Package java.awt.geom

Examples of java.awt.geom.RectangularShape


   */
  public static Shape translateShape(final Shape s, final double x, final double y)
  {
    if (s instanceof RectangularShape)
    {
      final RectangularShape rect = (RectangularShape) s;
      final RectangularShape retval = (RectangularShape) rect.clone();
      retval.setFrame(retval.getX() + x, retval.getY() + y, retval.getWidth(), retval.getHeight());
      return retval;
    }
    if (s instanceof Line2D)
    {
      final Line2D line = (Line2D) s;
      final Line2D retval = (Line2D) line.clone();
      retval.setLine(retval.getX1() + x, retval.getY1() + y,
          retval.getX2() + x, retval.getY2() + y);
      return retval;
    }

    final AffineTransform af = AffineTransform.getTranslateInstance(x, y);
    return af.createTransformedShape(s);
View Full Code Here


        Point2D paint = new Point2D.Float(0f, 0f);
        boolean numericalcolumns = m.isColumnNumeric();
 
        float modelVal = 0f;
       
        RectangularShape shape;
       
        for(int set = 0; set < datasetcount; set++) {
            for(int value = 0; value < m.getDataSetLength(set);  value++) {
                modelVal = m.getValueAt(set, value).floatValue();
               
                // Catch modelVal == Not A Number
                if(modelVal != modelVal)
                    continue;
               
                if(numericalcolumns)
                    val = new Point2D.Float(((Number)m.getColumnValueAt(set, value)).floatValue(),
                                            modelVal);
                else
                    val = new Point2D.Float((float)value,
                                            modelVal);
                   
               
                yaxis1.transform(val, paint);
                if(paint == null)
                    continue;
               
                g.setColor(rcm.getColor(set));
               
                shape = rcm.getShape(set);
                shape.setFrame(paint.getX() - shapeSize/2, paint.getY() - shapeSize/2, shapeSize, shapeSize);
               
        g.fill(shape);
            }
        }
   }   
View Full Code Here

     * @return the Shape stored for the given row.
     */   
    public RectangularShape getShape(int row) {
     
      // get the custom color
        RectangularShape c = (RectangularShape)customShapes.get(new Integer(row));
       
        // if no custom color
        if(c == null)
        {         
          // calculate the matching predefined shape by a modulo operation
View Full Code Here

   */
  public static Shape resizeRect(final RectangularShape rectangularShape,
                                 final double width,
                                 final double height)
  {
    final RectangularShape retval = (RectangularShape) rectangularShape.clone();
    retval.setFrame(retval.getX(), retval.getY(), width, height);
    return retval;
  }
View Full Code Here

   */
  public static Shape translateShape(final Shape s, final double x, final double y)
  {
    if (s instanceof RectangularShape)
    {
      final RectangularShape rect = (RectangularShape) s;
      final RectangularShape retval = (RectangularShape) rect.clone();
      retval.setFrame(retval.getX() + x, retval.getY() + y, retval.getWidth(), retval.getHeight());
      return retval;
    }
    if (s instanceof Line2D)
    {
      final Line2D line = (Line2D) s;
      final Line2D retval = (Line2D) line.clone();
      retval.setLine(retval.getX1() + x, retval.getY1() + y,
          retval.getX2() + x, retval.getY2() + y);
      return retval;
    }

    final AffineTransform af = AffineTransform.getTranslateInstance(x, y);
    return af.createTransformedShape(s);
View Full Code Here

        pntOutlineT    = new GradientPaint( 0, 0, colrDark, 0, hh, colrClearD );
        pntOutlineB    = new GradientPaint( 0, hh, colrClearL, 0, height - 2, colrLight );
        pntInline    = new GradientPaint( 0, 0, colrDark2, 0, hh, colrClearD );
      }
     
      final RectangularShape  r  = new RoundRectangle2D.Float( 0.5f, 0, width - 1, height, diameter, diameter );
      final RectangularShape  r2  = new RoundRectangle2D.Float( 0.5f, 0, width - 2, height - 1, diameter, diameter );
      final Area        a  = new Area( r );
      a.subtract( new Area( new Rectangle2D.Float( insets.left, insets.top,
        width - insets.left - insets.right, height - insets.top - insets.bottom )));

      shpOutline    = strkOutline.createStrokedShape( r2 );
View Full Code Here

            if (c.getAlpha() == 0) {
                return;
            }
        }

        RectangularShape shadow = createShadow(bar, renderer.getShadowXOffset(),
                renderer.getShadowYOffset(), base, pegShadow);
        g2.setPaint(renderer.getShadowPaint());
        g2.fill(shadow);

    }
View Full Code Here

            if (c.getAlpha() == 0) {
                return;
            }
        }

        RectangularShape shadow = createShadow(bar, renderer.getShadowXOffset(),
                renderer.getShadowYOffset(), base, pegShadow);
        g2.setPaint(renderer.getShadowPaint());
        g2.fill(shadow);

    }
View Full Code Here

            if (c.getAlpha() == 0) {
                return;
            }
        }

        RectangularShape shadow = createShadow(bar, renderer.getShadowXOffset(),
                renderer.getShadowYOffset(), base, pegShadow);
        g2.setPaint(Color.gray);
        g2.fill(shadow);

    }
View Full Code Here

            if (c.getAlpha() == 0) {
                return;
            }
        }

        RectangularShape shadow = createShadow(bar, renderer.getShadowXOffset(),
                renderer.getShadowYOffset(), base, pegShadow);
        g2.setPaint(Color.gray);
        g2.fill(shadow);

    }
View Full Code Here

TOP

Related Classes of java.awt.geom.RectangularShape

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.