question: public void addElement ( PMElement e ) { if ( e instanceof PMLabel ) { labels . addArea ( e ) ; } else if ( e instanceof PMHotArea ) { hotAreas . addArea ( e ) ; areascount ++ ; } else if ( e instanceof PMAreasGroup ) { PMAreasGroup ag = ( PMAreasGroup ) e ; Enumeration < PMElement > iter = ag . elements ( ) ; while ( iter . hasMoreElements ( ) ) { addElement ( iter . nextElement ( ) ) ; } } else { otherAreas . addArea ( e ) ; } }
target:  Adds element to PicMap component. Please note, that all objects implementing PMLabel interface will be placed in the topmost layer. All objects implementing PMHotArea will be placed in the middle layer. All others are going to bottom layer. Within same layer objects are drawing by order they added to components.