/** * Delegates to the enclosed <code>GeneralPath</code>. */ public Rectangle getBounds() { return path.getBounds(); }
public Rectangle getBounds(){ Rectangle bounds = makeIntoPath().getBounds(); return bounds; }
/** * Puts diagram shapes in pseudo-3d order starting from back to front * */ public int compare(Object object1, Object object2) { if(!(object1 instanceof DiagramShape) || !(object2 instanceof DiagramShape)) throw new RuntimeException("This comparator can only compare DiagramShapeS"); DiagramShape shape1 = (DiagramShape) object1; DiagramShape shape2 = (DiagramShape) object2; double y1 = shape1.makeIntoPath().getBounds().getCenterY(); double y2 = shape2.makeIntoPath().getBounds().getCenterY(); if(y1 > y2) return -1; if(y1 < y2) return 1; return 0; }
private GeneralPath makeIOPath(Diagram diagram) { if(points.size() != 4) return null; Rectangle bounds = makeIntoPath().getBounds(); ShapePoint point1 = new ShapePoint((float)bounds.getMinX(), (float)bounds.getMinY()); ShapePoint point2 = new ShapePoint((float)bounds.getMaxX(), (float)bounds.getMinY()); ShapePoint point3 = new ShapePoint((float)bounds.getMaxX(), (float)bounds.getMaxY()); ShapePoint point4 = new ShapePoint((float)bounds.getMinX(), (float)bounds.getMaxY()); float offset = diagram.getCellWidth() / 2; GeneralPath path = new GeneralPath(); path.moveTo(point1.x + offset, point1.y); path.lineTo(point2.x + offset, point2.y); path.lineTo(point3.x - offset, point3.y); path.lineTo(point4.x - offset, point4.y); path.closePath(); return path; }
private GeneralPath makeDecisionPath(Diagram diagram) { if(points.size() != 4) return null; Rectangle bounds = makeIntoPath().getBounds(); ShapePoint pointMid = new ShapePoint((float)bounds.getCenterX(), (float)bounds.getCenterY()); ShapePoint left = new ShapePoint((float)bounds.getMinX(), (float)pointMid.getY()); ShapePoint right = new ShapePoint((float)bounds.getMaxX(), (float)pointMid.getY()); ShapePoint top = new ShapePoint((float)pointMid.getX(), (float)bounds.getMinY()); ShapePoint bottom = new ShapePoint((float)pointMid.getX(), (float)bounds.getMaxY()); GeneralPath path = new GeneralPath(); path.moveTo(left.x, left.y); path.lineTo(top.x, top.y); path.lineTo(right.x, right.y); path.lineTo(bottom.x, bottom.y); path.closePath(); return path; }
private GeneralPath makeTrapezoidPath(Diagram diagram, boolean inverted) { if(points.size() != 4) return null; Rectangle bounds = makeIntoPath().getBounds(); float offset = 0.7f * diagram.getCellWidth(); // fixed slope if (inverted) offset = -offset; ShapePoint ul = new ShapePoint((float)bounds.getMinX() + offset, (float)bounds.getMinY()); ShapePoint ur = new ShapePoint((float)bounds.getMaxX() - offset, (float)bounds.getMinY()); ShapePoint br = new ShapePoint((float)bounds.getMaxX() + offset, (float)bounds.getMaxY()); ShapePoint bl = new ShapePoint((float)bounds.getMinX() - offset, (float)bounds.getMaxY()); ShapePoint pointMid = new ShapePoint((float)bounds.getCenterX(), (float)bounds.getMaxY()); GeneralPath path = new GeneralPath(); path.moveTo(ul.x, ul.y); path.lineTo(ur.x, ur.y); path.lineTo(br.x, br.y); path.lineTo(bl.x, bl.y); path.closePath(); return path; }
private GeneralPath makeDocumentPath(Diagram diagram) { if(points.size() != 4) return null; Rectangle bounds = makeIntoPath().getBounds(); ShapePoint point1 = new ShapePoint((float)bounds.getMinX(), (float)bounds.getMinY()); ShapePoint point2 = new ShapePoint((float)bounds.getMaxX(), (float)bounds.getMinY()); ShapePoint point3 = new ShapePoint((float)bounds.getMaxX(), (float)bounds.getMaxY()); ShapePoint point4 = new ShapePoint((float)bounds.getMinX(), (float)bounds.getMaxY()); ShapePoint pointMid = new ShapePoint((float)bounds.getCenterX(), (float)bounds.getMaxY()); GeneralPath path = new GeneralPath(); path.moveTo(point1.x, point1.y); path.lineTo(point2.x, point2.y); path.lineTo(point3.x, point3.y); //int controlDX = diagram.getCellWidth(); //int controlDY = diagram.getCellHeight() / 2; int controlDX = bounds.width / 6; int controlDY = bounds.height / 8; path.quadTo(pointMid.x + controlDX, pointMid.y - controlDY, pointMid.x, pointMid.y); path.quadTo(pointMid.x - controlDX, pointMid.y + controlDY, point4.x, point4.y); path.closePath(); return path; }
private GeneralPath makeEllipsePath(Diagram diagram) { if(points.size() != 4) return null; Rectangle bounds = makeIntoPath().getBounds(); float xOff = (float) bounds.getWidth() * 0.5f * KAPPA; float yOff = (float) bounds.getHeight() * 0.5f * KAPPA; ShapePoint pointMid = new ShapePoint((float)bounds.getCenterX(), (float)bounds.getCenterY()); ShapePoint left = new ShapePoint((float)bounds.getMinX(), (float)pointMid.getY()); ShapePoint right = new ShapePoint((float)bounds.getMaxX(), (float)pointMid.getY()); ShapePoint top = new ShapePoint((float)pointMid.getX(), (float)bounds.getMinY()); ShapePoint bottom = new ShapePoint((float)pointMid.getX(), (float)bounds.getMaxY()); GeneralPath path = new GeneralPath(); path.moveTo(top.x, top.y); path.curveTo(top.x + xOff, top.y, right.x, right.y - yOff, right.x, right.y); path.curveTo(right.x, right.y + yOff, bottom.x + xOff, bottom.y, bottom.x, bottom.y); path.curveTo(bottom.x - xOff, bottom.y, left.x, left.y + yOff, left.x, left.y); path.curveTo(left.x, left.y - yOff, top.x - xOff, top.y, top.x, top.y); path.closePath(); return path; }
public Rectangle getBounds() { return polygonPath.getBounds(); }
private GeneralPath makeStoragePath(Diagram diagram) { if(points.size() != 4) return null; Rectangle bounds = makeIntoPath().getBounds(); ShapePoint point1 = new ShapePoint((float)bounds.getMinX(), (float)bounds.getMinY()); ShapePoint point2 = new ShapePoint((float)bounds.getMaxX(), (float)bounds.getMinY());
@Override public float getHeight(int code) throws IOException { String name = codeToName(code); if (getStandard14AFM() != null) { String afmName = getEncoding().getName(code); return getStandard14AFM().getCharacterHeight(afmName); // todo: isn't this the y-advance, not the height? } else { // todo: should be scaled by font matrix return (float) genericFont.getPath(name).getBounds().getHeight(); } }
/** * Delegates to the enclosed <code>GeneralPath</code>. */ public synchronized Rectangle getBounds() { return path.getBounds(); }
/** * Delegates to the enclosed <code>GeneralPath</code>. */ public synchronized Rectangle getBounds() { return path.getBounds(); }
/** {@inheritDoc} */ public Rectangle2D getBounds2D() { return generalPath.getBounds(); }
/** * Delegates to the enclosed <code>GeneralPath</code>. */ public Rectangle getBounds() { return path.getBounds(); }
/** * Delegates to the enclosed <code>GeneralPath</code>. */ public synchronized Rectangle getBounds() { return path.getBounds(); }
@Override public Rectangle getBounds() { return delegate.getBounds(); }
/** * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds() */ @Override protected Rectangle getBounds() { return this.getComponentShape().getBounds(); }
/** * @see org.apache.airavata.xbaya.ui.graph.NodeGUI#getBounds() */ @Override protected Rectangle getBounds() { return this.getComponentShape().getBounds(); }
private void scrollToCenterPath(final GeneralPath geoBoundaryPath, final JViewport viewport) { final GeneralPath pixelPath = ProductUtils.convertToPixelPath(geoBoundaryPath, wmPainter.getGeoCoding()); final Rectangle viewRect = viewport.getViewRect(); final Rectangle pathBounds = pixelPath.getBounds(); setCenter(viewRect, new Point((int) pathBounds.getCenterX(), (int) pathBounds.getCenterY())); final Dimension bounds = new Dimension(scaledImage.getWidth(null), scaledImage.getHeight(null)); ensureRectIsInBounds(viewRect, bounds); viewport.scrollRectToVisible(viewRect); }