/** * * @param x * @param y * @return Returns the inde of the handle at the given location. */ public int getIndexAt(int x, int y) { int index = super.getIndexAt(x, y); // Makes the complete label a trigger for the label handle if (index < 0 && handles != null && handlesVisible && isLabelMovable() && state.getLabelBounds().getRectangle().contains(x, y)) { index = handles.length - 1; } return index; }
/** * * @param x * @param y * @return Returns the inde of the handle at the given location. */ public int getIndexAt(int x, int y) { int index = super.getIndexAt(x, y); // Makes the complete label a trigger for the label handle if (index < 0 && handles != null && handlesVisible && isLabelMovable() && state.getLabelBounds().getRectangle().contains(x, y)) { index = handles.length - 1; } return index; }
/** * * @return Returns the bounds of the preview. */ protected Rectangle getPreviewBounds() { Rectangle bounds = null; if (isLabel(index)) { bounds = state.getLabelBounds().getRectangle(); } else { bounds = new Rectangle(p[0]); for (int i = 0; i < p.length; i++) { bounds.add(p[i]); } bounds.height += 1; bounds.width += 1; } return bounds; }
/** * * @return Returns the bounds of the preview. */ protected Rectangle getPreviewBounds() { Rectangle bounds = null; if (isLabel(index)) { bounds = state.getLabelBounds().getRectangle(); } else { bounds = new Rectangle(p[0]); for (int i = 0; i < p.length; i++) { bounds.add(p[i]); } bounds.height += 1; bounds.width += 1; } return bounds; }
mxRectangle bounds = state.getLabelBounds(); h[h.length - 1] = new Rectangle((int) (bounds.getX() + bounds.getWidth() / 2 - s), (int) (bounds.getY()
mxRectangle bounds = state.getLabelBounds(); h[h.length - 1] = new Rectangle((int) (bounds.getX() + bounds.getWidth() / 2 - s), (int) (bounds.getY()
public Object drawLabel(String label, mxCellState state, boolean html) { mxRectangle bounds = state.getLabelBounds(); if (drawLabels && bounds != null) { int x = (int) bounds.getX() + translate.x; int y = (int) bounds.getY() + translate.y; int w = (int) bounds.getWidth(); int h = (int) bounds.getHeight(); Map<String, Object> style = state.getStyle(); return drawText(label, x, y, w, h, style); } return null; }
public Object drawLabel(String label, mxCellState state, boolean html) { mxRectangle bounds = state.getLabelBounds(); if (drawLabels && bounds != null) { int x = (int) bounds.getX() + translate.x; int y = (int) bounds.getY() + translate.y; int w = (int) bounds.getWidth(); int h = (int) bounds.getHeight(); Map<String, Object> style = state.getStyle(); return drawText(label, x, y, w, h, style); } return null; }
if (edge != null && edge.getLabelBounds() != null)
if (edge != null && edge.getLabelBounds() != null)
public Object drawLabel(String label, mxCellState state, boolean html) { mxRectangle bounds = state.getLabelBounds(); if (drawLabels && bounds != null) { int x = (int) bounds.getX() + translate.x; int y = (int) bounds.getY() + translate.y; int w = (int) bounds.getWidth(); int h = (int) bounds.getHeight(); Map<String, Object> style = state.getStyle(); return drawText(label, x, y, w, h, style); } return null; }
public Object drawLabel(String text, mxCellState state, boolean html) { Map<String, Object> style = state.getStyle(); mxITextShape shape = getTextShape(style, html); if (g != null && shape != null && drawLabels && text != null && text.length() > 0) { // Creates a temporary graphics instance for drawing this shape float opacity = mxUtils.getFloat(style, mxConstants.STYLE_TEXT_OPACITY, 100); Graphics2D previousGraphics = g; g = createTemporaryGraphics(style, opacity, null); // Draws the label background and border Color bg = mxUtils.getColor(style, mxConstants.STYLE_LABEL_BACKGROUNDCOLOR); Color border = mxUtils.getColor(style, mxConstants.STYLE_LABEL_BORDERCOLOR); paintRectangle(state.getLabelBounds().getRectangle(), bg, border); // Paints the label and restores the graphics object shape.paintShape(this, text, state, style); g.dispose(); g = previousGraphics; } return shape; }
public Object drawLabel(String text, mxCellState state, boolean html) { Map<String, Object> style = state.getStyle(); mxITextShape shape = getTextShape(style, html); if (g != null && shape != null && drawLabels && text != null && text.length() > 0) { // Creates a temporary graphics instance for drawing this shape float opacity = mxUtils.getFloat(style, mxConstants.STYLE_TEXT_OPACITY, 100); Graphics2D previousGraphics = g; g = createTemporaryGraphics(style, opacity, null); // Draws the label background and border Color bg = mxUtils.getColor(style, mxConstants.STYLE_LABEL_BACKGROUNDCOLOR); Color border = mxUtils.getColor(style, mxConstants.STYLE_LABEL_BORDERCOLOR); paintRectangle(state.getLabelBounds().getRectangle(), bg, border); // Paints the label and restores the graphics object shape.paintShape(this, text, state, style); g.dispose(); g = previousGraphics; } return shape; }
public Object drawLabel(String label, mxCellState state, boolean html) { mxRectangle bounds = state.getLabelBounds(); if (drawLabels && bounds != null) { int x = (int) (bounds.getX() + translate.getY()); int y = (int) (bounds.getY() + translate.getY()); int w = (int) bounds.getWidth(); int h = (int) bounds.getHeight(); Map<String, Object> style = state.getStyle(); return drawText(label, x, y, w, h, style); } return null; }
public Object drawLabel(String label, mxCellState state, boolean html) { mxRectangle bounds = state.getLabelBounds(); if (drawLabels && bounds != null) { int x = (int) (bounds.getX() + translate.getX()); int y = (int) (bounds.getY() + translate.getY()); int w = (int) bounds.getWidth(); int h = (int) bounds.getHeight(); Map<String, Object> style = state.getStyle(); return drawText(label, x, y, w, h, style); } return null; }
public Object drawLabel(String label, mxCellState state, boolean html) { mxRectangle bounds = state.getLabelBounds(); if (drawLabels && bounds != null) { int x = (int) (bounds.getX() + translate.getX()); int y = (int) (bounds.getY() + translate.getY()); int w = (int) bounds.getWidth(); int h = (int) bounds.getHeight(); Map<String, Object> style = state.getStyle(); return drawText(label, x, y, w, h, style); } return null; }
if (state.getLabelBounds() != null) tmp.add(state.getLabelBounds());
if (state.getLabelBounds() != null) tmp.add(state.getLabelBounds());
/** * */ public void restoreState(mxCellState state, mxCellState from) { state.setLabelBounds(from.getLabelBounds()); state.setAbsolutePoints(from.getAbsolutePoints()); state.setOrigin(from.getOrigin()); state.setAbsoluteOffset(from.getAbsoluteOffset()); state.setBoundingBox(from.getBoundingBox()); state.setTerminalDistance(from.getTerminalDistance()); state.setSegments(from.getSegments()); state.setLength(from.getLength()); state.setX(from.getX()); state.setY(from.getY()); state.setWidth(from.getWidth()); state.setHeight(from.getHeight()); }
/** * */ public void restoreState(mxCellState state, mxCellState from) { state.setLabelBounds(from.getLabelBounds()); state.setAbsolutePoints(from.getAbsolutePoints()); state.setOrigin(from.getOrigin()); state.setAbsoluteOffset(from.getAbsoluteOffset()); state.setBoundingBox(from.getBoundingBox()); state.setTerminalDistance(from.getTerminalDistance()); state.setSegments(from.getSegments()); state.setLength(from.getLength()); state.setX(from.getX()); state.setY(from.getY()); state.setWidth(from.getWidth()); state.setHeight(from.getHeight()); }