src/main/java/com/mxgraph/shape/mxBasicShape.java
protected boolean configureGraphics(mxGraphics2DCanvas canvas,
			mxCellState state, boolean background)
	{
		Map<String, Object> style = state.getStyle();

		if (background)
		{
			// Paints the background of the shape
			Paint fillPaint = hasGradient(canvas, state) ? canvas
					.createFillPaint(getGradientBounds(canvas, state), style)
					: null;

			if (fillPaint != null)
			{
				canvas.getGraphics().setPaint(fillPaint);

				return true;
			}
			else
			{
				Color color = getFillColor(canvas, state);
				canvas.getGraphics().setColor(color);

				return color != null;
			}
		}
		else
		{
			canvas.getGraphics().setPaint(null);
			Color color = getStrokeColor(canvas, state);
			canvas.getGraphics().setColor(color);
			canvas.getGraphics().setStroke(canvas.createStroke(style));

			return color != null;
		}
	}
/**
	 * Configures the graphics object ready to paint.
	 * @param canvas the canvas to be painted to
	 * @param state the state of cell to be painted
	 * @param background whether or not this is the background stage of 
	 * 			the shape paint
	 * @return whether or not the shape is ready to be drawn
	 */
Configures the graphics object ready to paint.
@param canvas the canvas to be painted to
@param state the state of cell to be painted
@param background whether or not this is the background stage of
the shape paint
@return whether or not the shape is ready to be drawn
Configures the graphics object ready to paint . @param canvas the canvas to be painted to @param state the state of cell to be painted @param background whether or not this is the background stage of the shape paint @return whether or not the shape is ready to be drawn
protected boolean configureGraphics(mxGraphics2DCanvas canvas,
			mxCellState state, boolean background)
	{
		Map<String, Object> style = state.getStyle();
		if (background)
		{
			Paint fillPaint = hasGradient(canvas, state) ? canvas
					.createFillPaint(getGradientBounds(canvas, state), style)
					: null;
			if (fillPaint != null)
			{
				canvas.getGraphics().setPaint(fillPaint);
				return true;
			}
			else
			{
				Color color = getFillColor(canvas, state);
				canvas.getGraphics().setColor(color);
				return color != null;
			}
		}
		else
		{
			canvas.getGraphics().setPaint(null);
			Color color = getStrokeColor(canvas, state);
			canvas.getGraphics().setColor(color);
			canvas.getGraphics().setStroke(canvas.createStroke(style));
			return color != null;
		}
	}
protected boolean configureGraphics ( mxGraphics2DCanvas canvas , mxCellState state , boolean background ) { Map < String , Object > style = state . getStyle ( ) ; if ( background ) { Paint fillPaint = hasGradient ( canvas , state ) ? canvas . createFillPaint ( getGradientBounds ( canvas , state ) , style ) : null ; if ( fillPaint != null ) { canvas . getGraphics ( ) . setPaint ( fillPaint ) ; return true ; } else { Color color = getFillColor ( canvas , state ) ; canvas . getGraphics ( ) . setColor ( color ) ; return color != null ; } } else { canvas . getGraphics ( ) . setPaint ( null ) ; Color color = getStrokeColor ( canvas , state ) ; canvas . getGraphics ( ) . setColor ( color ) ; canvas . getGraphics ( ) . setStroke ( canvas . createStroke ( style ) ) ; return color != null ; } }
Configures the graphics object ready to paint.
Configures the graphics object ready to paint .
// Paints the background of the shape