public void paint ( Graphics2D gfx ) { // if we're rendering footprints, paint that boolean footpaint = _fprintDebug . getValue ( ) ; if ( footpaint ) { gfx . setColor ( Color . black ) ; gfx . draw ( _footprint ) ; if ( _hideObjects . getValue ( ) ) { // We're in footprints but no objects mode, so let's also fill it in so we can // see things better/tell if we have overlapping ones Composite ocomp = gfx . getComposite ( ) ; gfx . setComposite ( ALPHA_WARN ) ; gfx . fill ( _footprint ) ; gfx . setComposite ( ocomp ) ; } } if ( _hideObjects . getValue ( ) ) { return ; } // if we have a warning, render an alpha'd red rectangle over our bounds if ( _warning ) { Composite ocomp = gfx . getComposite ( ) ; gfx . setComposite ( ALPHA_WARN ) ; gfx . fill ( bounds ) ; gfx . setComposite ( ocomp ) ; } // paint our tile tile . paint ( gfx , bounds . x , bounds . y ) ; // and possibly paint the object's spot if ( footpaint && _sspot != null ) { // translate the origin to center on the portal gfx . translate ( _sspot . x , _sspot . y ) ; // rotate to reflect the spot orientation double rot = ( Math . PI / 4.0f ) * tile . getSpotOrient ( ) ; gfx . rotate ( rot ) ; // draw the spot triangle gfx . setColor ( Color . green ) ; gfx . fill ( _spotTri ) ; // outline the triangle in black gfx . setColor ( Color . black ) ; gfx . draw ( _spotTri ) ; // restore the original transform gfx . rotate ( - rot ) ; gfx . translate ( - _sspot . x , - _sspot . y ) ; } }
Requests that this scene object render itself .