int idx = 0;  for ( Iterator itr = se.eAllContents( ); itr.hasNext( ); ) { Object obj = itr.next( );  if ( obj instanceof ColorDefinition && !( ( (ColorDefinition) obj ).eContainer( ) instanceof LineAttributes ) ) { performHighlight( (ColorDefinition) obj, highlighted );  changed = true; } else if ( obj instanceof LineAttributes ) { LineAttributes la = (LineAttributes) obj;  if ( highlighted ) { int[] ls = new int[5]; ls[0] = la.getThickness( ); ls[1] = la.getColor( ).getRed( ); ls[2] = la.getColor( ).getGreen( ); ls[3] = la.getColor( ).getBlue( ); ls[4] = la.getColor( ).getTransparency( );  lineContext.add( ls );  la.setThickness( 3 ); la.getColor( ).set( 255, 255, 255, 127 );  changed = true; } else { if ( idx < lineContext.size( ) ) { Object context = lineContext.get( idx );  if ( context instanceof int[] && ( (int[]) context ).length > 4 ) { int[] ls = (int[]) context;  la.setThickness( ls[0] ); la.getColor( ).setRed( ls[1] ); la.getColor( ).setGreen( ls[2] ); la.getColor( ).setBlue( ls[3] ); la.getColor( ).setTransparency( ls[4] );  changed = true; } } }  idx++; } }  if ( highlighted && lineContext.size( ) > 0 ) { iun.putContext( se, lineContext ); }  return changed;
	private void performHighlight( ColorDefinition cd, boolean highlighted )	{		if ( cd != null )		{			if ( highlighted )			{				cd.setRed( ( cd.getRed( ) + 255 ) / 2 );				cd.setGreen( ( cd.getGreen( ) + 255 ) / 2 );				cd.setBlue( ( cd.getBlue( ) + 255 ) / 2 );			}			else			{				cd.setRed( Math.max( 0, cd.getRed( ) * 2 - 255 ) );				cd.setGreen( Math.max( 0, cd.getGreen( ) * 2 - 255 ) );				cd.setBlue( Math.max( 0, cd.getBlue( ) * 2 - 255 ) );			}		}	}