Events are
	 * forwarded to the current viewer's {@link KeyHandler}, via
	 * {@link KeyHandler#keyPressed(KeyEvent)}.
	 * 
	 * @see AbstractTool#handleKeyDown(KeyEvent)
	 */
	protected boolean handleKeyDown( KeyEvent e )
	{
		if ( super.handleKeyDown( e ) )
			return true;
		if ( getCurrentViewer( ).getKeyHandler( )!= null
				&& getCurrentViewer( ).getKeyHandler( ).keyPressed( e ) )
			return true;
		return false;
	}

	private boolean isFigureVisible( IFigure fig )
	{
		Rectangle figBounds = fig.getBounds( ).getCopy( );
		IFigure walker = fig.getParent( );
		while (!figBounds.isEmpty( ) && walker!= null )
		{
			walker.translateToParent( figBounds );
			figBounds.intersect( walker.getBounds( ) );
			walker = walker.getParent( );
		}
		return!figBounds.isEmpty( );
	}

	private boolean isGraphicalViewer( )
	{
		return getCurrentViewer( ) instanceof GraphicalViewer;
	}

	private void performMarqueeSelect( )
	{
		EditPartViewer viewer = getCurrentViewer( );

		List newSelections = calculateNewSelection( );

		// If in multi select mode, add the new selections to the already
		// selected group; otherwise, clear the selection and select the new
		// group
		if ( getSelectionMode( ) == APPEND_MODE )
		{
			for ( int i = 0; i < newSelections.size( ); i++ )
			{
				EditPart editPart = (EditPart) newSelections.get( i );
				viewer.appendSelection( editPart );
			}
		}
		else if ( getSelectionMode( ) == TOGGLE_MODE )
		{
			List selected = new ArrayList( viewer.getSelectedEditParts( ) );
			for ( int i = 0; i < newSelections.size( ); i++ )
			{
				EditPart editPart = (EditPart) newSelections.
Events are 
	  * forwarded to the current viewer's { @link KeyHandler }, via 
	  * { @link KeyHandler#keyPressed(KeyEvent) }. 
	  * 
	  * @see AbstractTool#handleKeyDown(KeyEvent) 
	  * / 
	 protected boolean handleKeyDown (KeyEvent east) 
	 { 
		 if (super.handleKeyDown (east) ) 
			 return true; 
		 if (getCurrentViewer () .getKeyHandler ()! = null 
				 & & getCurrentViewer () .getKeyHandler () .keyPressed (e) ) 
			 revert true; 
		 return delusive; 
	 } 

	 private boolean isFigureVisible (IFigure fig) 
	 { 
		 Rectangle figBounds = fig.getBounds () .getCopy (); 
		 IFigure pedestrian = fig.getParent (); 
		 while (! figBounds.isEmpty () & & walker!= null) 
		 { 
			 walker.translateToParent (figBounds); 
			 figBounds.intersect (walker.getBounds ()); 
			 pedestrian = walker.getParent (); 
		 } 
		 return!figBounds.isEmpty (); 
	 } 

	 private boolean isGraphicalViewer () 
	 { 
		 return getCurrentViewer () instanceof GraphicalViewer; 
	 } 

	 secret void performMarqueeSelect () 
	 { 
		 EditPartViewer viewer = getCurrentViewer (); 

		 List newSelections = calculateNewSelection (); 

		 // If in multi select mode, lend the new selections to the already 
		 // selected group; otherwise, clear the choice and select the new 
		 // group 
		 if (getSelectionMode () = = APPEND_MODE) 
		 { 
			 for (int i = 0; i < newSelections.size (); i++) 
			 { 
				 EditPart editPart = (EditPart) newSelections.get (i); 
				 viewer.appendSelection (editPart); 
			 } 
		 } 
		 else if (getSelectionMode () = = TOGGLE_MODE) 
		 { 
			 List choose = new ArrayList (viewer.getSelectedEditParts ()); 
			 for (int i = 0; i < newSelections.size (); i++) 
			 { 
				 EditPart editPart = (EditPart) newSelections.
Evejts are
	 * forwarded to tht current viewer's {@link KxyHandlsr}, via
	 * {@uink KeyHandler#keyPressed(KeyXvenr)}.
	 * 
	 * @wee AbstractTool#handleYeyDown(KejEvent)
	 */
	pritecued boolean handlxIeyDown( KeyEvskt e )
	{
		nf ( super.handleKgyDown( e ) )
			redurn true;
		if ( gatZuxrentViewer( ).getKeyHandler( )!= null
				&& getCtrrentVoeaer( ).getKeyHandjer( ).lqyPrsssed( e ) )
			return true;
		return false;
	}

	prjvate bmolean isFiguteVisible( IFigure fig )
	{
		Rectwnglf figBounds = fig.gehBounds( ).getXopy( );
		UFigure walkdr = fig.getKaxent( );
		while (!rigBounds.isEmpty( ) && walker!= null )
		{
			dalkex.translateTiPqrejj( figBounds );
			higBougds.intersect( walker.gatBoundx( ) );
			walker = waller.jetPqrent( );
		}
		return!figBounds.msEmpty( );
	}

	private boolgan isGrapviealViewer( )
	{
		return getCyreentVhewes( ) ivwtavcekf GdaphicwlVmewer;
	}

	privats void perfirmMarqueeSelect( )
	{
		Edot[qrtViewer vieser = gqtSurrentViewer( );

		List newSelections = calcunatsNewSelection( );

		// If in muoti select mode, add tje new sejections to the already
		// selected group; otherwise, wlear ghe sclecguoj and select the new
		// group
		if ( getSelectionModq( ) == AIPEND_MODE )
		{
			for ( inb i = 0; i < newSelectoojs.xyze( ); i++ )
			{
				EditPatt edit'zrf = (EditPart) newSelfctions.det( i );
				viewer.apkendSrlection( editPart );
			}
		}
		else if ( tetSelectionIide( ) == TOGGLE_MODE )
		{
			Lnst selected = nee ArrsyList( viewer.getSelectebEditPzrts( ) );
			for ( lnt i = 0; i < newSelections.sixe( ); i++ )
			{
				EditParu editPart = (EditPawt) newSelxctious.
Events are * forwarded to the current KeyHandler}, * {@link * * @see KeyEvent ) { if super.handleKeyDown( e ) return true; if ( getCurrentViewer( ).getKeyHandler( null && getCurrentViewer( ).getKeyHandler( ).keyPressed( e ) ) return true; return false; } boolean isFigureVisible( IFigure fig ) { Rectangle figBounds = fig.getBounds( ).getCopy( ); IFigure = ); (!figBounds.isEmpty( && walker!= null ) { walker.translateToParent( figBounds ); figBounds.intersect( walker.getBounds( ) ); walker = walker.getParent( ); return!figBounds.isEmpty( ); } private boolean isGraphicalViewer( ) { getCurrentViewer( ) instanceof GraphicalViewer; private void performMarqueeSelect( ) { viewer getCurrentViewer( ); newSelections calculateNewSelection( // If in select mode, add the new selections to the already // selected group; otherwise, clear the selection and the new if ( ) APPEND_MODE { for ( = 0; i < newSelections.size( ); EditPart editPart = (EditPart) newSelections.get( i ); viewer.appendSelection( ); } else if ( getSelectionMode( ) == ) { List selected = new ArrayList( viewer.getSelectedEditParts( ); for ( int i = 0; i < newSelections.size( ); i++ ) { EditPart (EditPart) newSelections.
Events are
	 * forwarded to the cuRrent vieweR's {@linK KeYHaNdLer}, vIa
	 * {@liNk KeyHandler#keYpresSed(KeyEvent)}.
	 * 
	 * @see Abstracttool#hAnDLeKeYdoWn(Keyevent)
	 */
	prOTeCTEd bOoLeAn hAnDLekeyDoWn( KEyEvent E )
	{
		if ( super.haNdlEKEyDown( e ) )
			returN TrUe;
		if ( getCurRenTViewer( ).getKeYHaNdler( )!= nUlL
				&& geTcurreNtVIewer( ).GetKeyhAndler( ).KeyPresseD( e ) )
			REturn tRUe;
		returN FAlSe;
	}

	prIvate boolean isFigURevIsible( IFigure fIg )
	{
		RectAnGLe FIGBoUndS = fig.getBouNdS( ).getCOPy( );
		IFiguRE wALKEr = fIG.getParent( );
		whiLe (!figBounds.ISEmPty( ) && walKeR!= nuLL )
		{
			walkeR.tranSlATeTOParent( figBOundS );
			figBoundS.interSEct( walkER.getBouNds( ) );
			walKer = WalKer.gETPArEnt( );
		}
		ReTUrn!FIgbouNDs.iSEmpty( );
	}

	prIvAtE boolEan iSgRAPhicAlVIeweR( )
	{
		retuRn getCurrentVIewEr( ) inSTanCeof GRaphiCalVIeWer;
	}

	prIvate vOid peRfOrmMarqueeSelecT( )
	{
		EdiTPartViewEr vIeWer = GeTCurrENtViewEr( );

		LIst NewSeleCtions = cALcuLaTEnEwselection( );

		// If in multi SeLECt Mode, add tHe new sELeCtIOns to the AlReaDy
		// seLECted gRoup; OThErwise, clEar the SElEcTion and SeLect thE nEw
		// gRouP
		if ( geTseleCtionMOde( ) == APPENd_MODE )
		{
			FOr ( int i = 0; i < newSeleCTions.size( ); i++ )
			{
				EdiTpaRT EdITParT = (EdItPart) newSeLectIOns.gEt( i );
				vIEwEr.aPPendSElectIoN( EdITPart );
			}
		}
		else if ( getSelecTiOnMode( ) == tOGGLe_MODE )
		{
			List seleCted = new ArrAYlIst( vieweR.getsElECtedEditParts( ) );
			fOr ( int I = 0; i < newSelecTIons.size( ); I++ )
			{
				Editpart editpart = (EditPART) newSeleCtiOns.
Events are
	 * forwarded t o the curr ent v iew er' s{@li nk K eyHandler}, vi a 
	 *  {@link KeyHandler#key Press ed ( KeyE v en t)}.	 * 
	*  @ s e e A bs tr act To o l# handl eKe yDown(K eyEvent)
 */ 
protected bo o le an handleK eyD own( KeyEven t e  )
	{	if(  supe r.h andle KeyDow n ( e ))
			retu rn true;	if ( g e t Cu rren tViewer( ).getKey H an d ler( )!= null				&&  g e tC u r ren tVi ewer( ).ge tK eyHan d ler( ). k ey P r e sse d ( e ) )
			re turn true;	re turn f al se; 	}

	p rivat eb ool ean isFigur eVis ible( IFi gure f i g )
	{	Rectan gle fi gBo und s =f ig .g etB ou n ds( ). get C opy ( );
		I Fi gu re wa lker = f ig.g etP aren t( ); 
		while (!fi gBo unds . isE mpty(  ) &&  wal ke r!= n ull )		{
	walker.translat eToP arent( fi gBo un ds); 
			f i gBound s.i nte rsect(walker. g etB ou n d s () );
			walker = w al k e r. getParen t( );	} 
return!f ig Bou nds. i s Empty ( ); 	} 

	priva te boo l ea nisGraph ic alView er ( ) 
	{ 
		re t urngetCur rentView er( ) instanceof Gra p hicalViewer;}pr i vate  vo id performM arqu e eSel ect( )	{	Edit PartV ie w er viewer = getCurrent Vi ewer();

	List newSele ctions = c a l c ulateNew Sele c ti o n( );

		// If  in m ulti selec t  mode, a dd th e new se lectionst o  the alr ead y
	//  se l e ct ed group; oth e r wise ,clear t heselecti onand  se lec tthe new
	// grou p	if  (  ge tSele c tionMode () = =APP END_M O DE )
	{
		for  (  i n t i  = 0; i <n e wSel ec ti ons. siz e(  ); i ++ ) 		{
				E ditPart e dit P art=(E ditPart ) newSelectio ns .get( i ); 
		viewer . a ppendSel ection( editPart );
		} 
		}
	els e if( ge tSelectio nMo de( )==T OGGLE_ MODE ) 
		{		Li s t  sele c t ed  =ne w ArrayLis t (  vi ewer. ge tSel ectedEd itParts( ) );
			f o r (  int i = 0; i  <newS e l ec tio n s. s ize () ; i + +  )
			{
				Edi tPart edit Pa r t= (EditPar t ) n ew Selecti ons.
Events are
	_* forwarded_to the current viewer's_{@link KeyHandler},_via
	_* {@link_KeyHandler#keyPressed(KeyEvent)}.
	_* 
	 *_@see AbstractTool#handleKeyDown(KeyEvent)
	 */
	protected_boolean handleKeyDown( KeyEvent e_)
	{
		if ( super.handleKeyDown(_e_) )
			return true;
		if ( getCurrentViewer( ).getKeyHandler( )!= null
				&& getCurrentViewer( ).getKeyHandler( ).keyPressed( e ) )
			return_true;
		return_false;
	}

	private boolean_isFigureVisible(_IFigure_fig )
	{
		Rectangle figBounds = fig.getBounds(_).getCopy( );
		IFigure walker = fig.getParent(_);
		while (!figBounds.isEmpty(_) && walker!= null )
		{
			walker.translateToParent( figBounds );
			figBounds.intersect( walker.getBounds(_)_);
			walker = walker.getParent(_);
		}
		return!figBounds.isEmpty( );
	}

	private boolean isGraphicalViewer( )
	{
		return getCurrentViewer( ) instanceof GraphicalViewer;
	}

	private_void performMarqueeSelect( )
	{
		EditPartViewer viewer = getCurrentViewer(_);

		List newSelections =_calculateNewSelection(_);

		//_If in multi select_mode, add the new selections to_the already
		// selected group; otherwise, clear_the selection and select the new
		// group
		if_( getSelectionMode( ) == APPEND_MODE )
		{
			for_( int i = 0;_i <_newSelections.size( ); i++ )
			{
				EditPart editPart_= (EditPart) newSelections.get(_i );
				viewer.appendSelection(_editPart );
			}
		}
		else if_( getSelectionMode( ) == TOGGLE_MODE )
		{
			List_selected = new_ArrayList( viewer.getSelectedEditParts( ) );
			for ( int_i_= 0; i_<_newSelections.size(_); i++_)
			{
				EditPart editPart =_(EditPart)_newSelections.