g2d.setPaint( new GradientPaint( new Point2D.Double( dX + 3, ( dY - dYHalfOffset ) + 3 ), (Color) _sxs.getColor( la.getShadowColor( ) ), new Point2D.Double( dX + 3 + dFW, ( dY - dYHalfOffset ) + 3 + dFH ), (Color) _sxs.getColor( la.getShadowColor( ) .translucent( ) ) ) ); g2d.fill( new Rectangle2D.Double( dX + 3, ( dY - dYHalfOffset ) + 3,
g2d.setPaint( new GradientPaint( new Point2D.Double( dX + shadowness, ( dY - dYHalfOffset ) + shadowness ), (Color) _sxs.getColor( la.getShadowColor( ) ), new Point2D.Double( dX + shadowness + dFW, ( dY - dYHalfOffset ) + shadowness + dFH ), (Color) _sxs.getColor( la.getShadowColor( ) .translucent( ) ) ) ); g2d.fill( new Rectangle2D.Double( dX + shadowness, ( dY - dYHalfOffset ) + shadowness,
	private final void showRightValue( IPrimitiveRenderer ipr, Location lo,			Label la, boolean bShadow )	{		Graphics2D g2d = (Graphics2D) ( (IDeviceRenderer) ipr ).getGraphicsContext( );		double dX = lo.getX( ), dY = lo.getY( );		FontDefinition fd = la.getCaption( ).getFont( );		double dAngleInDegrees = fd.getRotation( );		if ( bShadow ) // UPDATE TO FALSE IF SHADOW COLOR UNDEFINED BUT SHADOW		// REQUESTED FOR		{			bShadow = la.getShadowColor( ) != null;		}		Color clrText = (Color) _sxs.getColor( la.getCaption( ).getColor( ) );		Color clrBackground = null;		if ( la.getBackground( ) != null )		{			clrBackground = (Color) _sxs.getColor( (ColorDefinition) la.getBackground( ) );		}		// dX += 2;		dY += 1;		final ITextMetrics itm = new SwingTextMetrics( _sxs, la );		final double dFW = itm.getFullWidth( );		final double dH = itm.getHeight( );		final double dD = itm.getDescent( );		final double dFH = itm.getFullHeight( );		double dXOffset = 0, dW = 0;		final int iLC = itm.getLineCount( );		final Insets ins = la.getInsets( )				.scaledInstance( _sxs.getDpiResolution( ) / 72d );		TextLayout tl;		final HorizontalAlignment ha = la.getCaption( )				.getFont( )				.getAlignment( )				.getHorizontalAlignment( );		final boolean bRightAligned = ha.getValue( ) == HorizontalAlignment.RIGHT;		final boolean bCenterAligned = ha.getValue( ) == HorizontalAlignment.CENTER;		double dAngleInRadians = ( ( -dAngleInDegrees * Math.PI ) / 180.0 );		int iRotateX = (int) dX;		int iRotateY = (int) ( dY + dH / 2 );		dY += dH / 2;		// HORIZONTAL TEXT		if ( dAngleInDegrees == 0 )		{			double dYHalfOffset = ( dFH + dH ) / 2d;			if ( bShadow ) // RENDER THE SHADOW			{				g2d.setPaint( new GradientPaint( new Point2D.Double( dX + 3,						( dY - dYHalfOffset ) + 3 ),						(Color) _sxs.getColor( la.getShadowColor( ) ),						new Point2D.Double( dX + 3 + dFW, ( dY - dYHalfOffset )								+ 3								+ dFH ),						(Color) _sxs.getColor( la.getShadowColor( )								.translucent( ) ) ) );				g2d.fill( new Rectangle2D.Double( dX + 3,						( dY - dYHalfOffset ) + 3,						dFW,						dFH ) );			}			else			{				final Rectangle2D.Double r2d = new Rectangle2D.Double( dX, dY						- dYHalfOffset, dFW, dFH );				// RENDER THE BACKGROUND FILL				if ( clrBackground != null )				{					g2d.setColor( clrBackground );					g2d.fill( r2d );				}				// RENDER THE TEXT				g2d.setColor( clrText );				for ( int i = 0; i < iLC; i++ )				{					tl = ( (SwingTextMetrics) itm ).getLayout( i );					if ( bRightAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + dFW - dW - ins.getRight( );					}					else if ( bCenterAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + ( dFW - dW ) / 2;					}					tl.draw( g2d,							(float) ( dX + dXOffset + ins.getLeft( ) ),							(float) ( dY									- dYHalfOffset									+ ins.getTop( )									+ dH									* ( i + 1 ) - dD )					// (float)(((dY - dD) - ((iLC - i) * dH - (iLC + 1) * dH/2))					// + ins.getTop())					);				}				// RENDER THE OUTLINE/BORDER				renderOutline( ipr, la.getOutline( ), r2d );			}		}		// DRAW POSITIVE ANGLE (> 0)		else if ( dAngleInDegrees > 0 && dAngleInDegrees < 90 )		{			double dDeltaX = dH * Math.sin( dAngleInRadians );			double dDeltaY = dH * Math.cos( dAngleInRadians ) - dH / 2;			dX -= dDeltaX;			dY += dDeltaY;			g2d.rotate( dAngleInRadians, iRotateX - dDeltaX, iRotateY + dDeltaY );			if ( bShadow ) // RENDER THE SHADOW			{				g2d.setPaint( new GradientPaint( new Point2D.Double( dX + 3,						( dY - dH ) + 3 ),						(Color) _sxs.getColor( la.getShadowColor( ) ),						new Point2D.Double( dX + 3 + dFW, ( dY - dH ) + 3 + dFH ),						(Color) _sxs.getColor( la.getShadowColor( )								.translucent( ) ) ) );				g2d.fill( new Rectangle2D.Double( dX + 3,						( dY - dH ) + 3,						dFW,						dFH ) );			}			else			{				final Rectangle2D.Double r2d = new Rectangle2D.Double( dX,						( dY - dH ),						dFW,						dFH );				// RENDER THE BACKGROUND				if ( clrBackground != null )				{					g2d.setColor( clrBackground );					g2d.fill( r2d );				}				// RENDER THE TEXT				g2d.setColor( clrText );				for ( int i = 0; i < iLC; i++ )				{					tl = ( (SwingTextMetrics) itm ).getLayout( i );					if ( bRightAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + dFW - dW - ins.getRight( );					}					else if ( bCenterAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + ( dFW - dW ) / 2;					}					tl.draw( g2d,							(float) ( dX + dXOffset + ins.getLeft( ) ),							(float) ( ( dY - dD + dH * i ) + ins.getTop( ) ) );				}				// RENDER THE OUTLINE/BORDER				renderOutline( ipr, la.getOutline( ), r2d );			}			// UNDO THE 'ROTATED' STATE OF THE GRAPHICS CONTEXT			g2d.rotate( -dAngleInRadians, iRotateX - dDeltaX, iRotateY					+ dDeltaY );			// crossHairs(g2d, (int)dX, (int)dY);		}		// DRAW NEGATIVE ANGLE (< 0)		else if ( dAngleInDegrees < 0 && dAngleInDegrees > -90 )		{			double dDeltaY = -dH / 2;			dY += dDeltaY;			g2d.rotate( dAngleInRadians, iRotateX, iRotateY + dDeltaY );			if ( bShadow ) // RENDER THE SHADOW			{				g2d.setPaint( new GradientPaint( new Point2D.Double( dX + 3,						( dY - dFH ) + 3 ),						(Color) _sxs.getColor( la.getShadowColor( ) ),						new Point2D.Double( dX + 3 + dFW, ( dY - dFH )								+ 3								+ dFH ),						(Color) _sxs.getColor( la.getShadowColor( )								.translucent( ) ) ) );				g2d.fill( new Rectangle2D.Double( dX + 3,						( dY - dFH ) + 3,						dFW,						dFH ) );			}			else			{				final Rectangle2D.Double r2d = new Rectangle2D.Double( dX, dY						- dFH, dFW, dFH );				// RENDER THE BACKGROUND				if ( clrBackground != null )				{					g2d.setColor( clrBackground );					g2d.fill( r2d );				}				// RENDER THE TEXT				g2d.setColor( clrText );				for ( int i = 0; i < iLC; i++ )				{					tl = ( (SwingTextMetrics) itm ).getLayout( i );					if ( bRightAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + dFW - dW - ins.getRight( );					}					else if ( bCenterAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + ( dFW - dW ) / 2;					}					tl.draw( g2d,							(float) ( dX + dXOffset + ins.getLeft( ) ),							(float) ( ( dY - dD - dH * ( iLC - i - 1 ) ) - ins.getBottom( ) ) );				}				// RENDER THE OUTLINE/BORDER				renderOutline( ipr, la.getOutline( ), r2d );			}			// UNDO THE 'ROTATED' STATE OF THE GRAPHICS CONTEXT			g2d.rotate( -dAngleInRadians, iRotateX, iRotateY + dDeltaY );			// crossHairs(g2d, (int)dX, (int)dY);		}		// VERTICALLY UP		else if ( dAngleInDegrees == 90 )		{			double dDeltaX = dH;			double dDeltaY = ( dFW - dH ) / 2;			dX += dDeltaX;			dY += dDeltaY;			g2d.rotate( dAngleInRadians, dX, dY );			if ( bShadow ) // RENDER THE SHADOW			{				g2d.setPaint( new GradientPaint( new Point2D.Double( dX + 3,						( dY - dH ) + 3 ),						(Color) _sxs.getColor( la.getShadowColor( ) ),						new Point2D.Double( dX + 3 + dFW, ( dY - dH ) + 3 + dFH ),						(Color) _sxs.getColor( la.getShadowColor( )								.translucent( ) ) ) );				g2d.fill( new Rectangle2D.Double( dX + 3,						( dY - dH ) + 3,						dFW,						dFH ) );			}			else			{				final Rectangle2D.Double r2d = new Rectangle2D.Double( dX, dY						- dH, dFW, dFH );				// RENDER THE BACKGROUND				if ( clrBackground != null )				{					g2d.setColor( clrBackground );					g2d.fill( r2d );				}				// RENDER THE TEXT				g2d.setColor( clrText );				for ( int i = 0; i < iLC; i++ )				{					tl = ( (SwingTextMetrics) itm ).getLayout( i );					if ( bRightAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + dFW - dW - ins.getRight( );					}					else if ( bCenterAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + ( dFW - dW ) / 2;					}					tl.draw( g2d,							(float) ( dX + dXOffset + ins.getLeft( ) ),							(float) ( ( dY - dD + dH * i ) + ins.getTop( ) ) );				}				// RENDER THE OUTLINE/BORDER				renderOutline( ipr, la.getOutline( ), r2d );			}			// UNDO THE 'ROTATED' STATE OF THE GRAPHICS CONTEXT			g2d.rotate( -dAngleInRadians, dX, dY );			// crossHairs(g2d, (int)dX, (int)dY);		}		// VERTICALLY DOWN		else if ( dAngleInDegrees == -90 )		{			double dDeltaX = 0;			double dDeltaY = ( dFW + dH ) / 2;			dX += dDeltaX;			dY -= dDeltaY;			g2d.rotate( dAngleInRadians, dX, dY );			if ( bShadow ) // RENDER THE SHADOW			{				g2d.setPaint( new GradientPaint( new Point2D.Double( dX + 3,						( dY - dH ) + 3 ),						(Color) _sxs.getColor( la.getShadowColor( ) ),						new Point2D.Double( dX + 3 + dFW, ( dY - dH ) + 3 + dFH ),						(Color) _sxs.getColor( la.getShadowColor( )								.translucent( ) ) ) );				g2d.fill( new Rectangle2D.Double( dX + 3,						( dY - dH ) + 3,						dFW,						dFH ) );			}			else			{				final Rectangle2D.Double r2d = new Rectangle2D.Double( dX, dY						- dH, dFW, dFH );				// RENDER THE BACKGROUND				if ( clrBackground != null )				{					g2d.setColor( clrBackground );					g2d.fill( r2d );				}				// RENDER THE TEXT				g2d.setColor( clrText );				for ( int i = 0; i < iLC; i++ )				{					tl = ( (SwingTextMetrics) itm ).getLayout( i );					if ( bRightAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + dFW - dW - ins.getRight( );					}					else if ( bCenterAligned )					{						dW = tl.getBounds( ).getWidth( );						dXOffset = -ins.getLeft( ) + ( dFW - dW ) / 2;					}					tl.draw( g2d,							(float) ( dX + dXOffset + ins.getLeft( ) ),							(float) ( ( dY - dD + dH * i ) + ins.getTop( ) ) );				}				// RENDER THE OUTLINE/BORDER				renderOutline( ipr, la.getOutline( ), r2d );			}			// UNDO THE 'ROTATED' STATE OF THE GRAPHICS CONTEXT			g2d.rotate( -dAngleInRadians, dX, dY );			// crossHairs(g2d, (int)dX, (int)dY);		}		itm.dispose( );	}