Example usage for java.awt.geom Rectangle2D.Float add

List of usage examples for java.awt.geom Rectangle2D.Float add

Introduction

In this page you can find the example usage for java.awt.geom Rectangle2D.Float add.

Prototype

public void add(Rectangle2D r) 

Source Link

Document

Adds a Rectangle2D object to this Rectangle2D .

Usage

From source file:tufts.vue.LWComponent.java

/** @return the union of the bounds of the current component, all connected links, and all far endpoints
 * of those links.//from   www .  j ava2  s .  c  o  m
 */
public Rectangle2D.Float getFanBounds(Rectangle2D.Float rect) {
    if (rect == null)
        rect = getMapBounds();
    else
        rect.setRect(getMapBounds());

    for (LWLink link : getLinks()) {
        final LWComponent head = link.getHead();
        final LWComponent tail = link.getTail();

        rect.add(link.getPaintBounds());

        if (head != this) {
            if (head != null)
                rect.add(head.getPaintBounds());
        } else if (tail != this) {
            if (tail != null)
                rect.add(tail.getPaintBounds());
        }
    }
    return rect;
}

From source file:tufts.vue.LWComponent.java

/**
 * Return absolute map bounds for hit detection & clipping.  This will vary
 * depenending on current stroke width, if in a visible pathway,
 * etc.//from ww w .  j a  v  a  2 s .  c  o  m
 */
public Rectangle2D.Float getPaintBounds() {
    if (LWPathway.isShowingSlideIcons() && inDrawnPathway()) {
        Rectangle2D.Float b = addStrokeToBounds(getMapBounds(), LWPathway.PathBorderStrokeWidth);
        if (farthestVisibleSlideCorner != null) {
            //if (DEBUG.WORK) out("IN DRAWN PATHWAY w/CORNER");
            b.add(farthestVisibleSlideCorner);
        }
        return b;
    } else
        return addStrokeToBounds(getMapBounds(), 0);
}