Examples of BasicRectangle


Examples of diva.canvas.toolbox.BasicRectangle

            FigureTest.FigureFactory {
        // FindBugs suggests making this class static so as to decrease
        // the size of instances and avoid dangling references.

        public Figure createFigure() {
            return new BasicRectangle(10, 10, 20, 20, Color.blue);
        }
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

     */
    public void createTerminals() {
        FigureLayer layer = graphicsPane.getForegroundLayer();

        // Draw a rectangle to position them
        BasicRectangle square = new BasicRectangle(160, 80, 80, 80);
        square.setStrokePaint(Color.gray);
        layer.add(square);

        // Create a BoundsGeometry to help get sites
        BoundsGeometry _geometry = new BoundsGeometry(square, square
                .getBounds());

        // Create a set of terminals, one by one
        // NORTH
        StraightTerminal north = new StraightTerminal(_geometry.getN());
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

     * other useful predefined figure classes, is contained in the
     * package <b>diva.canvas.toolbox</b>.
     */
    public void createBasicRectangle() {
        FigureLayer layer = graphicsPane.getForegroundLayer();
        Figure rectangle = new BasicRectangle(50, 50, 80, 80, Color.blue);
        layer.add(rectangle);
    }
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

            if (isEllipse) {
                f = new BasicEllipse(0, 0, _size, _size);
                f.setFillPaint(Color.blue);
            } else {
                f = new BasicRectangle(0, 0, _size, _size);
                f.setFillPaint(Color.pink);
            }

            String label = actor.getName();
            LabelWrapper w = new LabelWrapper(f, label);
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

        // Wrap in a CompositeFigure with echos of the bounding box.
        // Note that the bounds here are actually bigger than the
        // bounding box, which may be OK in this case.
        Rectangle2D bounds = result.getBounds();
        CompositeFigure composite = new CompositeFigure();
        BasicRectangle rectangle = new BasicRectangle(bounds.getX() + 10.0,
                bounds.getY() + 10.0, bounds.getWidth(), bounds.getHeight(),
                Color.white);
        composite.add(rectangle);

        BasicRectangle rectangle2 = new BasicRectangle(bounds.getX() + 5.0,
                bounds.getY() + 5.0, bounds.getWidth(), bounds.getHeight(),
                Color.white);
        composite.add(rectangle2);

        BasicRectangle rectangle3 = new BasicRectangle(bounds.getX(), bounds
                .getY(), bounds.getWidth(), bounds.getHeight(), Color.white);
        composite.add(rectangle3);
        composite.add(result);
        return composite;
    }
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

        // getBackgroundLayer() only returns a CanvasLayer.
        FigureLayer layer = (FigureLayer) getJGraph().getGraphPane()
                .getBackgroundLayer();
        layer.setVisible(true);

        BasicRectangle reference = new BasicRectangle(-30.0, -20.0, 60.0, 40.0,
                0.1f);
        reference.setStrokePaint(Color.BLUE);
        layer.add(reference);
    }
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

            int numberOfCharacters = ((IntToken) displayWidth.getToken())
                    .intValue();

            // NOTE: Padding of 20.
            int width = (int) ((stringBounds.getWidth() * numberOfCharacters) + 20);
            return new BasicRectangle(0, 0, width, 30, Color.white, 1);
        } catch (IllegalActionException ex) {
            // Should not be thrown.
            throw new InternalErrorException(ex);
        }
    }
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

         "</property></group>" );
         MoMLChangeRequest request = new MoMLChangeRequest(
         this, this, moml.toString());
         requestChange(request);
         */
        return new BasicRectangle(-30, -20, 60, 40, Color.white, 1);
    }
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

                if (object instanceof NamedObj && cf != null && !_transformed
                        && _results != null
                        && _results.get(_currentPosition).containsValue(object)) {
                    Rectangle2D bounds = cf.getBackgroundFigure().getBounds();
                    float padding = _HIGHLIGHT_PADDING;
                    BasicFigure bf = new BasicRectangle(bounds.getX() - padding,
                            bounds.getY() - padding,
                            bounds.getWidth() + padding * 2.0,
                            bounds.getHeight() + padding * 2.0,
                            _HIGHLIGHT_THICKNESS);
                    bf.setStrokePaint(_HIGHLIGHT_COLOR);

                    int index = cf.getFigureCount();
                    if (index < 0) {
                        index = 0;
                    }
View Full Code Here

Examples of diva.canvas.toolbox.BasicRectangle

            // snap to grid still works.
            width = Math.floor(stringBounds.getWidth()) + 20;
            height = Math.floor(stringBounds.getHeight()) + 10;
        }

        return new BasicRectangle(0, 0, width, height, boxColor.asColor(), 1);
    }
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.