Examples of LabelFigure


Examples of diva.canvas.toolbox.LabelFigure

                    // This exception should not occur.
                }

                if (!labelStr.equals("")) {
                    // FIXME: get label position modifier, if any.
                    LabelFigure label = new LabelFigure(labelStr, _labelFont);
                    label.setFillPaint(Color.black);
                    c.setLabelFigure(label);
                }
            }

            return c;
View Full Code Here

Examples of diva.canvas.toolbox.LabelFigure

        square.setStrokePaint(Color.gray);
        layer.add(square);

        // Create the labels
        for (int i = 0; i < anchors.length; i++) {
            LabelFigure labelFigure = new LabelFigure(labels[i], fonts[i],
                    styles[i], 20);

            // Set the anchor
            labelFigure.setAnchor(anchors[i]);

            // Move the anchor to the right location
            Point2D pt = CanvasUtilities.getLocation(square.getBounds(),
                    CanvasUtilities.reverseDirection(anchors[i]));
            labelFigure.translateTo(pt);

            // Add to the layer
            layer.add(labelFigure);
            labelFigure.setInteractor(defaultInteractor);

            // Draw a small circle there so we can see it
            Figure mark = new BasicEllipse(pt.getX() - 2, pt.getY() - 2, 4, 4,
                    Color.red);
            layer.add(mark);
View Full Code Here

Examples of diva.canvas.toolbox.LabelFigure

    /** Tell the connector to reposition its label if it has one.
     * The label is currently only positioned at the center of the arc.
     */
    public void repositionLabel() {
        LabelFigure label = getLabelFigure();

        if (label != null) {
            Point2D pt = getArcMidpoint();
            label.translateTo(pt);

            // FIXME: Need a way to override the positioning.
            label.autoAnchor(_arc);
        }
    }
View Full Code Here

Examples of diva.canvas.toolbox.LabelFigure

        super(fig, label);

        _listenerManager = new CanvasFigureListenerManager(this);

        setAnchor(anchor);
        LabelFigure labelFig = getLabel();
        labelFig.setFillPaint(color);
        labelFig.setFont(font);
        labelFig.setAnchor(SwingConstants.WEST);

        if (interactor != null) {
            setInteractor(interactor);
        }
    }
View Full Code Here

Examples of diva.canvas.toolbox.LabelFigure

        // box around diagonal label
        mbandDiagRect = new BasicFigure(new Rectangle2D.Double(), Color.yellow);
        mband.add(mbandDiagRect);

        // The width label
        mbandWidthText = new LabelFigure(" "); // note: diva-0.3 bug with empty string
        mbandWidthText.setFillPaint(Color.blue);
//        Font font = new Font("Dialog", Font.BOLD, 12);
        Font font = new Font(Font.SANS_SERIF, Font.BOLD, 13);
        mbandWidthText.setFont(font);
        mband.add(mbandWidthText);

        // The height label
        mbandHeightText = new LabelFigure(" ");
        mbandHeightText.setFillPaint(Color.blue);
        mbandHeightText.setFont(font);
        mband.add(mbandHeightText);

        // The diagonal label
        mbandDiagText = new LabelFigure(" ");
        mbandDiagText.setFillPaint(Color.blue);
        mbandDiagText.setFont(font);
        mband.add(mbandDiagText);

        GraphicsPane gpane = (GraphicsPane) imageDisplay.getCanvasPane();
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.