/** * */ public Rectangle getImageBounds(mxGraphics2DCanvas canvas, mxCellState state) { return state.getRectangle(); }
/** * */ public Rectangle getImageBounds(mxGraphics2DCanvas canvas, mxCellState state) { return state.getRectangle(); }
/** * */ public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state) { Rectangle temp = state.getRectangle(); return new Ellipse2D.Float(temp.x, temp.y, temp.width, temp.height); }
private final Rectangle getImageBounds( final mxCellState state ) { final Rectangle cellR = state.getRectangle(); final int arc = getArcSize( cellR.width, cellR.height ) / 2; final int minSize = Math.min( cellR.width - arc * 2, cellR.height - 4 ); final Rectangle imageBounds = new Rectangle( cellR.x + arc, cellR.y + 2, minSize, minSize ); return imageBounds; } }
/** * */ public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state) { Rectangle temp = state.getRectangle(); return new Ellipse2D.Float(temp.x, temp.y, temp.width, temp.height); }
private final Rectangle getImageBounds( final mxCellState state ) { final Rectangle cellR = state.getRectangle(); final int arc = getArcSize( cellR.width, cellR.height ) / 2; final int minSize = Math.min( cellR.width - arc * 2, cellR.height - 4 ); final Rectangle imageBounds = new Rectangle( cellR.x + arc, cellR.y + 2, minSize, minSize ); return imageBounds; } }
/** * Returns the rectangle that should be used as the perimeter of the cell. * * @return Returns the rectangle that defines the perimeter. */ public mxRectangle getPerimeterBounds(double border) { mxRectangle bounds = new mxRectangle(getRectangle()); if (border != 0) { bounds.grow(border); } return bounds; }
/** * Returns the rectangle that should be used as the perimeter of the cell. * * @return Returns the rectangle that defines the perimeter. */ public mxRectangle getPerimeterBounds(double border) { mxRectangle bounds = new mxRectangle(getRectangle()); if (border != 0) { bounds.grow(border); } return bounds; }
/** * */ public void paint(Graphics g) { if (currentState != null && first != null) { Rectangle rect = currentState.getRectangle(); double deg = currentAngle * mxConstants.DEG_PER_RAD; if (deg != 0) { ((Graphics2D) g).rotate(Math.toRadians(deg), currentState.getCenterX(), currentState.getCenterY()); } mxUtils.setAntiAlias((Graphics2D) g, true, false); g.drawRect(rect.x, rect.y, rect.width, rect.height); } }
/** * */ public void paint(Graphics g) { if (currentState != null && first != null) { Rectangle rect = currentState.getRectangle(); double deg = currentAngle * mxConstants.DEG_PER_RAD; if (deg != 0) { ((Graphics2D) g).rotate(Math.toRadians(deg), currentState.getCenterX(), currentState.getCenterY()); } mxUtils.setAntiAlias((Graphics2D) g, true, false); g.drawRect(rect.x, rect.y, rect.width, rect.height); } }
/** * */ public void paint(Graphics g) { Rectangle bounds = getState().getRectangle(); if (g.hitClip(bounds.x, bounds.y, bounds.width, bounds.height)) { Graphics2D g2 = (Graphics2D) g; Stroke stroke = g2.getStroke(); g2.setStroke(getSelectionStroke()); g.setColor(getSelectionColor()); g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); g2.setStroke(stroke); } super.paint(g); }
/** * */ public void paint(Graphics g) { Rectangle bounds = getState().getRectangle(); if (g.hitClip(bounds.x, bounds.y, bounds.width, bounds.height)) { Graphics2D g2 = (Graphics2D) g; Stroke stroke = g2.getStroke(); g2.setStroke(getSelectionStroke()); g.setColor(getSelectionColor()); g.drawRect(bounds.x, bounds.y, bounds.width, bounds.height); g2.setStroke(stroke); } super.paint(g); }
/** * */ public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state) { Rectangle temp = state.getRectangle(); int x = temp.x; int y = temp.y; int w = temp.width; int h = temp.height; float width = w * 2 / 6; GeneralPath path = new GeneralPath(); path.moveTo(x, y + h); path.curveTo(x, y + 3 * h / 5, x, y + 2 * h / 5, x + w / 2, y + 2 * h / 5); path.curveTo(x + w / 2 - width, y + 2 * h / 5, x + w / 2 - width, y, x + w / 2, y); path.curveTo(x + w / 2 + width, y, x + w / 2 + width, y + 2 * h / 5, x + w / 2, y + 2 * h / 5); path.curveTo(x + w, y + 2 * h / 5, x + w, y + 3 * h / 5, x + w, y + h); path.closePath(); return path; }
/** * */ public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state) { Rectangle temp = state.getRectangle(); int x = temp.x; int y = temp.y; int w = temp.width; int h = temp.height; float width = w * 2 / 6; GeneralPath path = new GeneralPath(); path.moveTo(x, y + h); path.curveTo(x, y + 3 * h / 5, x, y + 2 * h / 5, x + w / 2, y + 2 * h / 5); path.curveTo(x + w / 2 - width, y + 2 * h / 5, x + w / 2 - width, y, x + w / 2, y); path.curveTo(x + w / 2 + width, y, x + w / 2 + width, y + 2 * h / 5, x + w / 2, y + 2 * h / 5); path.curveTo(x + w, y + 2 * h / 5, x + w, y + 3 * h / 5, x + w, y + h); path.closePath(); return path; }
/** * */ public void paintShape(mxGraphics2DCanvas canvas, mxCellState state) { super.paintShape(canvas, state); int inset = (int) Math.round((mxUtils.getFloat(state.getStyle(), mxConstants.STYLE_STROKEWIDTH, 1) + 3) * canvas.getScale()); Rectangle rect = state.getRectangle(); int x = rect.x + inset; int y = rect.y + inset; int w = rect.width - 2 * inset; int h = rect.height - 2 * inset; canvas.getGraphics().drawOval(x, y, w, h); }
/** * */ public void paintShape(mxGraphics2DCanvas canvas, mxCellState state) { super.paintShape(canvas, state); int inset = (int) Math.round((mxUtils.getFloat(state.getStyle(), mxConstants.STYLE_STROKEWIDTH, 1) + 3) * canvas.getScale()); Rectangle rect = state.getRectangle(); int x = rect.x + inset; int y = rect.y + inset; int w = rect.width - 2 * inset; int h = rect.height - 2 * inset; canvas.getGraphics().drawOval(x, y, w, h); }
/** * */ public void paintShape(mxGraphics2DCanvas canvas, mxCellState state) { super.paintShape(canvas, state); int inset = (int) Math.round((mxUtils.getFloat(state.getStyle(), mxConstants.STYLE_STROKEWIDTH, 1) + 3) * canvas.getScale()); Rectangle rect = state.getRectangle(); int x = rect.x + inset; int y = rect.y + inset; int w = rect.width - 2 * inset; int h = rect.height - 2 * inset; canvas.getGraphics().drawRect(x, y, w, h); }
/** * */ public void paintShape(mxGraphics2DCanvas canvas, mxCellState state) { super.paintShape(canvas, state); int inset = (int) Math.round((mxUtils.getFloat(state.getStyle(), mxConstants.STYLE_STROKEWIDTH, 1) + 3) * canvas.getScale()); Rectangle rect = state.getRectangle(); int x = rect.x + inset; int y = rect.y + inset; int w = rect.width - 2 * inset; int h = rect.height - 2 * inset; canvas.getGraphics().drawRect(x, y, w, h); }
/** * */ public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state) { Rectangle temp = state.getRectangle(); int x = temp.x; int y = temp.y; int w = temp.width; int h = temp.height; int halfWidth = w / 2; int halfHeight = h / 2; Polygon rhombus = new Polygon(); rhombus.addPoint(x + halfWidth, y); rhombus.addPoint(x + w, y + halfHeight); rhombus.addPoint(x + halfWidth, y + h); rhombus.addPoint(x, y + halfHeight); return rhombus; }
/** * */ public Shape createShape(mxGraphics2DCanvas canvas, mxCellState state) { Rectangle temp = state.getRectangle(); int x = temp.x; int y = temp.y; int w = temp.width; int h = temp.height; int halfWidth = w / 2; int halfHeight = h / 2; Polygon rhombus = new Polygon(); rhombus.addPoint(x + halfWidth, y); rhombus.addPoint(x + w, y + halfHeight); rhombus.addPoint(x + halfWidth, y + h); rhombus.addPoint(x, y + halfHeight); return rhombus; }