当前位置: 首页>>代码示例>>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;未经允许,请勿转载。