Package diva.canvas.toolbox

Examples of diva.canvas.toolbox.LabelWrapper


        e.setStateType(type);

        // Set the label
        Object p = "node"; //n.getProperty("label");
        String label = (p == null) ? "Unnamed" : (String) p;
        LabelWrapper w = new LabelWrapper(e, label);
        return w;
    }
View Full Code Here


            final ExecEvent.ExecEventType state = event.getState();
            NamedObj actor = event.getSource();

            // Get the corresponding graph node and its figure
            Object node = _nodeMap.get(actor);
            LabelWrapper wrapper = (LabelWrapper) _graphPane
                    .getGraphController().getFigure(node);
            final BasicFigure figure = (BasicFigure) wrapper.getChild();

            // Color the graph
            try {
                SwingUtilities.invokeAndWait(new Runnable() {
                    public void run() {
View Full Code Here

                f = new BasicRectangle(0, 0, _size, _size);
                f.setFillPaint(Color.pink);
            }

            String label = actor.getName();
            LabelWrapper w = new LabelWrapper(f, label);
            w.setAnchor(SwingConstants.SOUTH);
            w.getLabel().setAnchor(SwingConstants.NORTH);
            return w;
        }
View Full Code Here

            final ExecEvent.ExecEventType state = event.getState();
            NamedObj actor = event.getSource();

            // Get the corresponding graph node and its figure
            Object node = _nodeMap.get(actor);
            LabelWrapper wrapper = (LabelWrapper) _graphPane
                    .getGraphController().getFigure(node);
            final BasicFigure figure = (BasicFigure) wrapper.getChild();

            // Color the graph
            try {
                // Used to use invokeAndWait() here, but this leads to deadlock!
                SwingUtilities.invokeLater(new Runnable() {
View Full Code Here

                f = new BasicRectangle(0, 0, _size, _size);
                f.setFillPaint(Color.blue);
            }

            String label = actor.getName();
            LabelWrapper w = new LabelWrapper(f, label);
            w.setAnchor(SwingConstants.SOUTH);
            w.getLabel().setAnchor(SwingConstants.NORTH);
            return w;
        }
View Full Code Here

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

        Figure a = new BasicEllipse(420, 100, 100, 50);
        LabelWrapper wrapperA = new LabelWrapper(a, "Foo!\nBar!\nBaz!");
        layer.add(wrapperA);
        wrapperA.setInteractor(defaultInteractor);

        Figure b = new BasicRectangle(460, 200, 50, 40, Color.green);
        LabelWrapper wrapperB = new LabelWrapper(b, "Bar!");
        wrapperB.setAnchor(SwingConstants.SOUTH_WEST);
        wrapperB.getLabel().setAnchor(SwingConstants.NORTH_WEST);
        layer.add(wrapperB);
        wrapperB.setInteractor(defaultInteractor);
    }
View Full Code Here

TOP

Related Classes of diva.canvas.toolbox.LabelWrapper

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.