All Downloads are FREE. Search and download functionalities are using the official Maven repository.

bibliothek.gui.dock.util.UIBridge Maven / Gradle / Ivy

The newest version!
/*
 * Bibliothek - DockingFrames
 * Library built on Java/Swing, allows the user to "drag and drop"
 * panels containing any Swing-Component the developer likes to add.
 * 
 * Copyright (C) 2007 Benjamin Sigg
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 * 
 * Benjamin Sigg
 * [email protected]
 * CH - Switzerland
 */
package bibliothek.gui.dock.util;

import bibliothek.util.Path;


/**
 * An {@link UIBridge} is a filter between the {@link UIProperties} and
 * several {@link UIValue}s. Each change of an {@link UIValue} by the
 * UIProperties goes through an UIBridge. The bridge
 * can modify each request of the UIProperties and change
 * the resource that is transmitted to the UIValue. It is up to
 * the bridge how, why and when a resource is changed. Each bridge handles
 * only one kind (identified by a {@link Path}) of UIValue.
 * @author Benjamin Sigg
 * @param  the type of resources that are transmitted to the {@link UIValue}s.
 * @param  the kind of {@link UIValue}s this provider can manage
 */
public interface UIBridge> {
    /**
     * Adds a new {@link UIValue} that gets its resource from this bridge.
     * @param id the id of the resource the new value needs
     * @param uiValue a value that can be modified by this bride
     */
    public void add( String id, U uiValue );
    
    /**
     * Removes a value from this bridge.
     * @param id the id of the resource the value needed
     * @param uiValue the value that is no longer in use
     */
    public void remove( String id, U uiValue );
    
    /**
     * Called by the {@link UIProperties} when one resource or {@link UIValue}
     * has been exchanged. Normally an {@link UIBridge} can just
     * call {@link UIValue#set(Object)} with the argument value.
* This method may also be called with an {@link UIValue} that was not {@link #add(String, UIValue) added} * to this {@link UIBridge}. * @param id the identifier of the resource * @param value the new resource, can be null * @param uiValue the value that is affected by the change */ public void set( String id, V value, U uiValue ); }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy