la = (Label) EcoreUtil.copy( mr.getLabel( ) );
la = LabelImpl.copyInstance( mr.getLabel( ) );
	private final void renderMarkerRanges( OneAxis[] oaxa,			Bounds boPlotClientArea ) throws ChartException	{		Axis ax;		EList el;		int iRangeCount, iAxisCount = oaxa.length;		MarkerRange mr;		RectangleRenderEvent rre;		DataElement deStart, deEnd;		AutoScale asc;		double dMin = 0, dMax = 0;		int iOrientation, iCompare = IConstants.EQUAL;		final Bounds bo = BoundsImpl.create( 0, 0, 0, 0 );		final IDeviceRenderer idr = getDevice( );		final ScriptHandler sh = getRunTimeContext( ).getScriptHandler( );		final boolean bTransposed = ( (ChartWithAxes) getModel( ) ).isTransposed( );		final PlotWithAxes pwa = (PlotWithAxes) getComputations( );		final StringBuffer sb = new StringBuffer( );		Bounds boText = BoundsImpl.create( 0, 0, 0, 0 );		Anchor anc = null;		Label la = null;		TextRenderEvent tre;		Orientation or;		double dOriginalAngle = 0;		for ( int i = 0; i < iAxisCount; i++ )		{			ax = oaxa[i].getModelAxis( );			iOrientation = ax.getOrientation( ).getValue( );			if ( bTransposed ) // TOGGLE ORIENTATION			{				iOrientation = ( iOrientation == Orientation.HORIZONTAL ) ? Orientation.VERTICAL						: Orientation.HORIZONTAL;			}			asc = oaxa[i].getScale( );			el = ax.getMarkerRanges( );			iRangeCount = el.size( );			for ( int j = 0; j < iRangeCount; j++ )			{				mr = (MarkerRange) el.get( j );				ScriptHandler.callFunction( sh,						ScriptHandler.BEFORE_DRAW_MARKER_RANGE,						ax,						mr,						getRunTimeContext( ).getScriptContext( ) );				getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.BEFORE_DRAW_MARKER_RANGE,						mr );				deStart = mr.getStartValue( );				deEnd = mr.getEndValue( );				try				{					iCompare = compare( deStart, deEnd );				}				catch ( ChartException dfex )				{					throw new ChartException( ChartEnginePlugin.ID,							ChartException.RENDERING,							dfex );				}				// IF OUT OF ORDER, SWAP				if ( iCompare == IConstants.MORE )				{					final DataElement deTemp = deStart;					deStart = deEnd;					deEnd = deTemp;				}				if ( isDimension3D( ) )				{					// TODO render 3D marker range					return;				}				// COMPUTE THE START BOUND				try				{					dMin = ( deStart == null ) ? ( ( iOrientation == Orientation.HORIZONTAL ) ? boPlotClientArea.getLeft( )							: boPlotClientArea.getTop( )									+ boPlotClientArea.getHeight( ) )							: PlotWith2DAxes.getLocation( asc, deStart );				}				catch ( Exception ex )				{					logger.log( ILogger.WARNING,							Messages.getString( "exception.cannot.locate.start.marker.range", //$NON-NLS-1$									new Object[]{											deStart, mr									},									getRunTimeContext( ).getLocale( ) ) );					continue; // TRY NEXT MARKER RANGE				}				// COMPUTE THE END BOUND				try				{					dMax = ( deEnd == null ) ? ( ( iOrientation == Orientation.HORIZONTAL ) ? boPlotClientArea.getLeft( )							+ boPlotClientArea.getWidth( )							: boPlotClientArea.getTop( ) )							: PlotWith2DAxes.getLocation( asc, deEnd );				}				catch ( Exception ex )				{					logger.log( ILogger.WARNING,							Messages.getString( "exception.cannot.locate.end.marker.range", //$NON-NLS-1$									new Object[]{											deEnd, mr									},									getRunTimeContext( ).getLocale( ) ) );					continue; // TRY NEXT MARKER RANGE				}				rre = (RectangleRenderEvent) ( (EventObjectCache) idr ).getEventObject( StructureSource.createMarkerRange( mr ),						RectangleRenderEvent.class );				if ( iOrientation == Orientation.HORIZONTAL )				{					// RESTRICT RIGHT EDGE					if ( dMax > boPlotClientArea.getLeft( )							+ boPlotClientArea.getWidth( ) )					{						dMax = boPlotClientArea.getLeft( )								+ boPlotClientArea.getWidth( );					}					// RESTRICT LEFT EDGE					if ( dMin < boPlotClientArea.getLeft( ) )					{						dMax = boPlotClientArea.getLeft( );					}					bo.set( dMin,							boPlotClientArea.getTop( ),							dMax - dMin,							boPlotClientArea.getHeight( ) );				}				else				{					// RESTRICT TOP EDGE					if ( dMax < boPlotClientArea.getTop( ) )					{						dMax = boPlotClientArea.getTop( );					}					// RESTRICT BOTTOM EDGE					if ( dMin > boPlotClientArea.getTop( )							+ boPlotClientArea.getHeight( ) )					{						dMin = boPlotClientArea.getTop( )								+ boPlotClientArea.getHeight( );					}					bo.set( boPlotClientArea.getLeft( ),							dMax,							boPlotClientArea.getWidth( ),							dMin - dMax );				}				if ( pwa.getDimension( ) == IConstants.TWO_5_D )				{					if ( iOrientation == Orientation.HORIZONTAL )					{						bo.translate( pwa.getSeriesThickness( ), 0 );					}					else					{						bo.translate( 0, -pwa.getSeriesThickness( ) );					}				}				// DRAW THE MARKER RANGE (RECTANGULAR AREA)				rre.setBounds( bo );				rre.setOutline( mr.getOutline( ) );				rre.setBackground( mr.getFill( ) );				idr.fillRectangle( rre );				idr.drawRectangle( rre );				la = (Label) EcoreUtil.copy( mr.getLabel( ) );				if ( la.isVisible( ) )				{					if ( la.getCaption( ).getValue( ) != null							&& !IConstants.UNDEFINED_STRING.equals( la.getCaption( )									.getValue( ) )							&& la.getCaption( ).getValue( ).length( ) > 0 )					{						la.getCaption( ).setValue( oaxa[i].getRunTimeContext( )								.externalizedMessage( la.getCaption( )										.getValue( ) ) );					}					else					{						try						{							sb.delete( 0, sb.length( ) );							sb.append( Messages.getString( "prefix.marker.range.caption", //$NON-NLS-1$ 									getRunTimeContext( ).getLocale( ) ) );							sb.append( ValueFormatter.format( deStart,									mr.getFormatSpecifier( ),									oaxa[i].getRunTimeContext( ).getLocale( ),									null ) );							sb.append( Messages.getString( "separator.marker.range.caption", //$NON-NLS-1$ 									getRunTimeContext( ).getLocale( ) ) );							sb.append( ValueFormatter.format( deEnd,									mr.getFormatSpecifier( ),									oaxa[i].getRunTimeContext( ).getLocale( ),									null ) );							sb.append( Messages.getString( "suffix.marker.range.caption", //$NON-NLS-1$ 									getRunTimeContext( ).getLocale( ) ) );							la.getCaption( ).setValue( sb.toString( ) );						}						catch ( ChartException dfex )						{							throw new ChartException( ChartEnginePlugin.ID,									ChartException.RENDERING,									dfex );						}					}					// DETERMINE THE LABEL ANCHOR (TRANSPOSE IF NEEDED)					anc = switchAnchor( mr.getLabelAnchor( ) );					if ( bTransposed )					{						or = ax.getOrientation( ) == Orientation.HORIZONTAL_LITERAL ? Orientation.VERTICAL_LITERAL								: Orientation.HORIZONTAL_LITERAL;						dOriginalAngle = la.getCaption( )								.getFont( )								.getRotation( );						try						{							la.getCaption( )									.getFont( )									.setRotation( pwa.getTransposedAngle( dOriginalAngle ) );							anc = pwa.transposedAnchor( or, anc );						}						catch ( IllegalArgumentException uiex )						{							throw new ChartException( ChartEnginePlugin.ID,									ChartException.RENDERING,									uiex );						}					}					BoundingBox bb = null;					try					{						bb = Methods.computeBox( idr.getDisplayServer( ),								IConstants.LEFT,								la,								0,								0 );					}					catch ( IllegalArgumentException uiex )					{						throw new ChartException( ChartEnginePlugin.ID,								ChartException.RENDERING,								uiex );					}					boText.set( 0, 0, bb.getWidth( ), bb.getHeight( ) );					// NOW THAT WE COMPUTED THE BOUNDS, RENDER THE ACTUAL TEXT					tre = (TextRenderEvent) ( (EventObjectCache) idr ).getEventObject( StructureSource.createMarkerRange( mr ),							TextRenderEvent.class );					tre.setBlockBounds( bo );					tre.setBlockAlignment( anchorToAlignment( anc ) );					tre.setLabel( la );					tre.setAction( TextRenderEvent.RENDER_TEXT_IN_BLOCK );					idr.drawText( tre );				}				if ( isInteractivityEnabled( ) )				{					Trigger tg;					EList elTriggers = mr.getTriggers( );					if ( !elTriggers.isEmpty( ) )					{						final InteractionEvent iev = (InteractionEvent) ( (EventObjectCache) idr ).getEventObject( StructureSource.createMarkerRange( mr ),								InteractionEvent.class );						for ( int t = 0; t < elTriggers.size( ); t++ )						{							tg = (Trigger) EcoreUtil.copy( (Trigger) elTriggers.get( t ) );							processTrigger( tg,									StructureSource.createMarkerRange( mr ) );							iev.addTrigger( tg );						}						iev.setHotSpot( rre );						idr.enableInteraction( iev );					}				}				ScriptHandler.callFunction( sh,						ScriptHandler.AFTER_DRAW_MARKER_RANGE,						ax,						mr,						getRunTimeContext( ).getScriptContext( ) );				getRunTimeContext( ).notifyStructureChange( IStructureDefinitionListener.AFTER_DRAW_MARKER_RANGE,						mr );			}		}	}