Interface ViewPlacementRule


  • public interface ViewPlacementRule
    • Method Detail

      • placeView

        Object placeView​(GroupArrangement planArr,
                         Set<String> existingViewIds,
                         ViewPlacer<?> placer)
        It is fine for implementations to down-cast the placer argument, as long as it is done with care. The placer will be an instance of a predictable subclass, based on the DockingGroup from which this rule is being invoked. For example, when invoked by a DockingGroupMultiframe, the rule will be given a ViewPlacerMultiframe.

        Implementations should make exactly one call to one of the placer methods, and return the result. For example:

         
         ViewPlacementRule rule = ( planArr, existingViewIds, placer ) ->
         {
             DockerArrangementTile tile = ...;
             int viewNum = ...;
             return placer.addToTile( tile, viewNum );
         };
         
         
        NOTE: This method could use generics to declare that the return type should match the type parameter of placer. However, Java does not allow lambda syntax when there are type parameters involved, so using generics would make this interface more cumbersome to work with.