/** * Gets the factory that creates bridges for <code>kind</code>. * @param kind some identifier for a type * @return the factory whose kind best matches <code>kind</code> or <code>null</code> */ public ColorBridgeFactory getBridgeFactory( Path kind ) { while( kind != null ){ ColorBridgeFactory factory = bridges.get( kind ); if( factory != null ) return factory; kind = kind.getParent(); } return null; } }
/** * Searches a bridge that can be used for <code>path</code>. * @param path the kind of bridge that is searched. First a bridge for * <code>path</code> will be searched, then for the parent of <code>path</code>, * and so on... * @return the bridge or <code>null</code> */ protected B getBridgeFor( Path path ){ while( path != null ){ UIPriorityValue<B> bridge = bridges.get( path ); if( bridge == null ){ bridge = createBridge( path ); if( !isRemoveable( path, bridge )){ bridges.put( path, bridge ); } } if( bridge != null ){ B result = bridge.getValue(); if( result != null ) return result; } path = path.getParent(); } return null; }
/** * Searches a bridge that can be used for <code>path</code>. * @param path the kind of bridge that is searched. First a bridge for * <code>path</code> will be searched, then for the parent of <code>path</code>, * and so on... * @return the bridge or <code>null</code> */ protected B getBridgeFor( Path path ){ while( path != null ){ UIPriorityValue<B> bridge = bridges.get( path ); if( bridge == null ){ bridge = createBridge( path ); if( !isRemoveable( path, bridge )){ bridges.put( path, bridge ); } } if( bridge != null ){ B result = bridge.getValue(); if( result != null ) return result; } path = path.getParent(); } return null; }