Package java.awt.geom

Examples of java.awt.geom.RectangularShape


        if(isFillVertical()) {
            height = height - insets.top - insets.bottom;
        }


        RectangularShape shape = new Rectangle2D.Double(x, y, width, height);
        if(rounded) {
            shape = new RoundRectangle2D.Double(x, y, width, height, roundWidth, roundHeight);
        }
        return shape;
    }
View Full Code Here


          annotationManager.add(layer, annotation);
        }
      } else if(e.getModifiers() == modifiers) {
          if(down != null) {
            Point2D out = e.getPoint();
            RectangularShape arect = (RectangularShape)rectangularShape.clone();
            arect.setFrameFromDiagonal(down,out);
            Shape s = vv.getRenderContext().getMultiLayerTransformer().inverseTransform(arect);
            Annotation<Shape> annotation =
              new Annotation<Shape>(s, layer, annotationColor, fill, out);
            annotationManager.add(layer, annotation);
          }
View Full Code Here

       
        float flatness = 0;
        MutableTransformer transformer = rc.getMultiLayerTransformer().getTransformer(Layer.VIEW);
        if(transformer instanceof LensTransformer) {
            LensTransformer ht = (LensTransformer)transformer;
            RectangularShape lensShape = ht.getLensShape();
            if(lensShape.contains(x1,y1) || lensShape.contains(x2,y2)) {
                flatness = .05f;
            }
        }

        boolean isLoop = v1.equals(v2);
View Full Code Here

        
         ArrayList<RectangularShape> componentShapes = new ArrayList<RectangularShape>();
        
         for (Vertex vertex: layout.getFirst().keySet())
         {
           RectangularShape shape =  layout.getFirst().get(vertex);
           vertexComponentMap.get(vertex).setBounds( shape.getBounds());
           maxX = Math.max(maxX, shape.getBounds().x + shape.getBounds().width);
           maxY = Math.max(maxY, shape.getBounds().y + shape.getBounds().height);
          
           for (RectangularShape s: componentShapes)
           {
             if ( shape.intersects(s.getBounds2D()))
               componentIntersecting = true;
           }
           componentShapes.add(shape);
         }
        
         if (! skipEdgeLabels)
         {
           for (Entry<Edge,Pair<RectangularShape,PolyLine>> edgeEntry: layout.getSecond().entrySet())
           {
             RectangularShape shape =  edgeEntry.getValue().getFirst();
              edgeLabelComponentMap.get(edgeEntry.getKey()).setBounds(shape.getBounds());
 
              maxX = Math.max(maxX, shape.getBounds().x + shape.getBounds().width);
              maxY = Math.max(maxY, shape.getBounds().y + shape.getBounds().height);
             
              for (RectangularShape s: componentShapes)
              {
                if ( shape.intersects(s.getBounds2D()))
                  componentIntersecting = true;
              }
              componentShapes.add(shape);
           }
         }
View Full Code Here

      List<PolyLine> polyLines = new ArrayList<PolyLine>();

      // Edges
      for (Edge edge : graph.getEdges())
      {
         RectangularShape source = vertexMap.get(graph.getSource(edge));
         RectangularShape destination = vertexMap.get(graph.getDest(edge));

         PolyLine line = new PolyLine(new Line2D.Double(source.getCenterX(),
               source.getCenterY(), destination.getCenterX(), destination
                     .getCenterY()));
         edgeMap.put(edge, new Pair<RectangularShape, PolyLine>(null, line));
         polyLines.add(line);
      }
View Full Code Here

                    int translateX = dragPos.x - pressedAt.x;
                    int translateY = dragPos.y - pressedAt.y;
                    if (ghost instanceof Polygon) {
                        ((Polygon)ghost).translate(translateX, translateY);
                    } else if (ghost instanceof RectangularShape) {
                        RectangularShape rectGhost = (RectangularShape)ghost;
                        Rectangle bounds = rectGhost.getBounds();
                        rectGhost.setFrame(bounds.x + translateX, bounds.y + translateY,
                                bounds.getWidth(), bounds.getHeight());
                    }
                   
                    g2d.setStroke(new BasicStroke((float) 2.0));   
                    g2d.draw(ghost);
View Full Code Here

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

        RectangularShape shadow = createShadow(bar, renderer.getShadowXOffset(),
                renderer.getShadowYOffset(), base, pegShadow);
        if (renderer instanceof XYBarRendererAdapter) {
            g2.setPaint(((XYBarRendererAdapter)renderer).getShadowPaint());
        }
        g2.fill(shadow);
View Full Code Here

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

        RectangularShape shadow = createShadow(bar, renderer.getShadowXOffset(),
                renderer.getShadowYOffset(), base, pegShadow);
        if (renderer instanceof XYBarRendererAdapter) {
            g2.setPaint(((XYBarRendererAdapter) 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

    String getShapeDesc(Shape shape) {
        String shapeDesc = null;

        if (shape instanceof RectangularShape) {
            RectangularShape rshape = (RectangularShape)shape;
            shapeDesc =
                doubleToStr(rshape.getX()) + "," +
                doubleToStr(rshape.getY()) + "," +
                doubleToStr(rshape.getWidth()) + "," +
                doubleToStr(rshape.getHeight());

            if (shape instanceof Ellipse2D) {
                shapeDesc = "ellipse(" + shapeDesc + ")";
            } else
            if (shape instanceof Rectangle2D) {
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.