Class ALspLabelStyleCollectorWrapper


public class ALspLabelStyleCollectorWrapper extends ALspLabelStyleCollector
A wrapper for a label style collector to allow easy creation of wrappers that will even remain compatible if additional abstract methods are added to ALspLabelStyleCollector.

By default, wrapping a style collector in this wrapper does not have any effect at all. Users of this class have to extend it to achieve the desired behavior.

As an example, this class can be used to filter out all TLspTextStyle instances before passing the styles on to the delegate. This allows you to implement a fill toggle action.

The following example shows a styler that uses a wrapper that sets another ALspStyleTargetProvider:

 public void locate( Collection<?> aObjects, ALspLabelStyleCollector aStyleCollector, TLspContext aContext ) {
   ALspLabelStyleCollectorWrapper myWrapper = new ALspLabelStyleCollectorWrapper( aStyleCollector ) {

     @Override
     public ALspLabelStyleCollector geometry( ALspStyleTargetProvider aStyleTargetProvider ) {
       fDelegate.geometry( fAnotherStyleTargetProvider );
     }

   };
   fDelegateStyler.locate( aObjects, myWrapper, aContext );
 }
 
Since:
2012.0