當前位置: 首頁>>代碼示例>>Java>>正文


Java Rectangle2D.add方法代碼示例

本文整理匯總了Java中java.awt.geom.Rectangle2D.add方法的典型用法代碼示例。如果您正苦於以下問題:Java Rectangle2D.add方法的具體用法?Java Rectangle2D.add怎麽用?Java Rectangle2D.add使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在java.awt.geom.Rectangle2D的用法示例。


在下文中一共展示了Rectangle2D.add方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getGroupBounds

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
private Rectangle2D getGroupBounds() {
   int nShapes = contents.size();
   Rectangle2D bounds = new Rectangle2D.Double(0, 0, 0, 0);
   for (int i = 0; i < nShapes; i++) {
      if (i == 0) {
         bounds.setRect(contents.get(i).getBounds());
      } else {
         bounds.add(contents.get(i).getBounds());
      }
   }
   return bounds;
}
 
開發者ID:eric-roberts,項目名稱:JavaPPTX,代碼行數:13,代碼來源:PPGroup.java

示例2: adjustBounds

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
@Override
public void adjustBounds(Rectangle2D bb) {
   // Fix this eventually to compute the true bounds
   bb.add(x1, y1);
   bb.add(x2, y2);
   bb.add(x3, y3);
}
 
開發者ID:eric-roberts,項目名稱:JavaPPTX,代碼行數:8,代碼來源:PPPath.java

示例3: randomCoordinate

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
/**
 * Returns a random number bounded by <tt>toJCellMap.size()</tt>. Used to
 * generate a random position for any added j-vertex without layout
 * information.
 */
@SuppressWarnings("unchecked")
protected int randomCoordinate() {
    Rectangle2D bounds = new Rectangle();
    for (Object cell : getJGraph().getSelectionCells()) {
        if (cell instanceof JVertex) {
            bounds.add(((JVertex<G>) cell).getVisuals()
                .getNodePos());
        }
    }
    return 25 + randomGenerator
        .nextInt((this.nodeJCellMap.size() + this.edgeJCellMap.size()) * 5 + 1);
}
 
開發者ID:meteoorkip,項目名稱:JavaGraph,代碼行數:18,代碼來源:JModel.java

示例4: getVisualBounds

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
/**
 * Return the union of the visual bounds of all the components.
 * This incorporates the path.  It does not include logical
 * bounds (used by carets).
 */
public Rectangle2D getVisualBounds() {
    Rectangle2D result = null;

    for (int i = 0, n = 0; i < fComponents.length; i++, n += 2) {
        TextLineComponent tlc = fComponents[getComponentLogicalIndex(i)];
        Rectangle2D r = tlc.getVisualBounds();

        Point2D.Float pt = new Point2D.Float(locs[n], locs[n+1]);
        if (lp == null) {
            r.setRect(r.getMinX() + pt.x, r.getMinY() + pt.y,
                      r.getWidth(), r.getHeight());
        } else {
            lp.pathToPoint(pt, false, pt);

            AffineTransform at = tlc.getBaselineTransform();
            if (at != null) {
                AffineTransform tx = AffineTransform.getTranslateInstance
                    (pt.x - at.getTranslateX(), pt.y - at.getTranslateY());
                tx.concatenate(at);
                r = tx.createTransformedShape(r).getBounds2D();
            } else {
                r.setRect(r.getMinX() + pt.x, r.getMinY() + pt.y,
                          r.getWidth(), r.getHeight());
            }
        }

        if (result == null) {
            result = r;
        } else {
            result.add(r);
        }
    }

    if (result == null) {
        result = new Rectangle2D.Float(Float.MAX_VALUE, Float.MAX_VALUE, Float.MIN_VALUE, Float.MIN_VALUE);
    }

    return result;
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:45,代碼來源:TextLine.java

示例5: enlarge

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
public void enlarge(Rectangle2D r) {
    r.add(x0, y0);
    double eqn[] = {xcoeff1, 2 * xcoeff2, 3 * xcoeff3};
    int numroots = QuadCurve2D.solveQuadratic(eqn, eqn);
    for (int i = 0; i < numroots; i++) {
        double t = eqn[i];
        if (t > 0 && t < 1) {
            r.add(XforT(t), YforT(t));
        }
    }
    r.add(x1, y1);
}
 
開發者ID:AdoptOpenJDK,項目名稱:openjdk-jdk10,代碼行數:13,代碼來源:Order3.java

示例6: enlarge

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
public void enlarge(Rectangle2D r) {
    r.add(x0, y0);
    double t = -xcoeff1 / (2 * xcoeff2);
    if (t > 0 && t < 1) {
        r.add(XforT(t), YforT(t));
    }
    r.add(x1, y1);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:9,代碼來源:Order2.java

示例7: enlarge

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
public void enlarge(Rectangle2D r) {
    r.add(x, y);
}
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:4,代碼來源:Order0.java

示例8: getVisualBounds

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
public Rectangle2D getVisualBounds(Label label) {

            Rectangle2D visBounds = label.handleGetVisualBounds();

            if (swapColors || bgPaint != null || strikethrough
                        || stdUnderline != null || imUnderline != null) {

                float minX = 0;
                Rectangle2D lb = label.getLogicalBounds();

                float minY = 0, maxY = 0;

                if (swapColors || bgPaint != null) {

                    minY = (float)lb.getY();
                    maxY = minY + (float)lb.getHeight();
                }

                maxY = Math.max(maxY, getUnderlineMaxY(label.getCoreMetrics()));

                Rectangle2D ab = new Rectangle2D.Float(minX, minY, (float)lb.getWidth(), maxY-minY);
                visBounds.add(ab);
            }

            return visBounds;
        }
 
開發者ID:SunburstApps,項目名稱:OpenJSharp,代碼行數:27,代碼來源:Decoration.java

示例9: enlarge

import java.awt.geom.Rectangle2D; //導入方法依賴的package包/類
public void enlarge(Rectangle2D r) {
    r.add(x0, y0);
    r.add(x1, y1);
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:5,代碼來源:Order1.java


注:本文中的java.awt.geom.Rectangle2D.add方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。