45464748495051525354555657
* updates all the cached values * * @param state */ private void updateCache(mxCellState state) { Polygon2D polygon = getParent().getBasicShape(); Rectangle2D boundsOnGraph = getParent().canvasBounds(state); offset = new Point2D.Double(boundsOnGraph.getX() - polygon.getBounds2D().getMinX(), boundsOnGraph.getY() - polygon.getBounds2D().getMinY()); scaledPolygon = getParent().getScaledShape(); }
296297298299300301302303
* * @param event */ public PolygonEventView(PolygonEventModel event) { super(event, true, false); basicShape = new Polygon2D(new double[] { -18, -5, 18, 18, -12 }, new double[] { -7, -18, -18, 16, 18 }, 5); }
314315316317318319320321322323324325
@Override public Rectangle2D getInitialBounds() { PolygonLocationModel model = (PolygonLocationModel) getModelElement() .getLocation(); Polygon2D poly = new Polygon2D(); for (GlobalPosition p : model.getPoints()) { poly.addPoint(p.projected()); } return poly.getBounds2D(); }