/** * */ 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); }
@Override public void paintShape( final mxGraphics2DCanvas canvas, final mxCellState state ) { super.paintShape( canvas, state ); final String imgStr = mxUtils.getString( state.getStyle(), mxConstants.STYLE_IMAGE ); if ( imgStr != null ) { final Image img = canvas.loadImage( mxUtils.getString( state.getStyle(), mxConstants.STYLE_IMAGE ) ); if ( img != null ) { final Rectangle bounds = getImageBounds( state ); final int x = bounds.x; final int y = bounds.y; final int w = bounds.width; final int h = bounds.height; if ( h > 0 && w > 0 ) { final Image scaledImage = img.getScaledInstance( w, h, Image.SCALE_FAST ); canvas.getGraphics().drawImage( scaledImage, x, y, null ); } } } }
@Override public void paintShape( final mxGraphics2DCanvas canvas, final mxCellState state ) { super.paintShape( canvas, state ); final String imgStr = mxUtils.getString( state.getStyle(), mxConstants.STYLE_IMAGE ); if ( imgStr != null ) { final Image img = canvas.loadImage( mxUtils.getString( state.getStyle(), mxConstants.STYLE_IMAGE ) ); if ( img != null ) { final Rectangle bounds = getImageBounds( state ); final int x = bounds.x; final int y = bounds.y; final int w = bounds.width; final int h = bounds.height; if ( h > 0 && w > 0 ) { final Image scaledImage = img.getScaledInstance( w, h, Image.SCALE_FAST ); canvas.getGraphics().drawImage( scaledImage, x, y, null ); } } } }
/** * */ public void paintShape(mxGraphics2DCanvas canvas, mxCellState state) { super.paintShape(canvas, state); boolean flipH = mxUtils.isTrue(state.getStyle(), mxConstants.STYLE_IMAGE_FLIPH, false); boolean flipV = mxUtils.isTrue(state.getStyle(), mxConstants.STYLE_IMAGE_FLIPV, false); canvas.drawImage(getImageBounds(canvas, state), getImageForStyle(canvas, state), mxGraphics2DCanvas.PRESERVE_IMAGE_ASPECT, flipH, flipV); }
/** * */ public void paintShape(mxGraphics2DCanvas canvas, mxCellState state) { super.paintShape(canvas, state); boolean flipH = mxUtils.isTrue(state.getStyle(), mxConstants.STYLE_IMAGE_FLIPH, false); boolean flipV = mxUtils.isTrue(state.getStyle(), mxConstants.STYLE_IMAGE_FLIPV, false); canvas.drawImage(getImageBounds(canvas, state), getImageForStyle(canvas, state), mxGraphics2DCanvas.PRESERVE_IMAGE_ASPECT, flipH, flipV); }