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

bibliothek.gui.dock.facile.station.split.ConflictResolver Maven / Gradle / Ivy

Go to download

DockingFrames is an open source Java Swing docking framework, licenced under LGPL 2.1. This is the same distribution as the original distribution (http://www.docking-frames.org/), only reinstalled in maven

There is a newer version: 1.1.2p20b.fix-1
Show 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) 2008 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.facile.station.split;

/**
 * A {@link ConflictResolver} determines how to merge {@link ResizeRequest}s
 * and later how to resolve situations where two requests have to be handled
 * at the same time.
 * @author Benjamin Sigg
 */
public interface ConflictResolver {
    
    /**
     * Combines the two request left and right into
     * a new request.
     * @param left the request from the left, can be null
     * @param right the request from the right, can be null
     * @param node the node for which the requests have to be merged
     * @return a new request that somehow represents left and right
     * or null to cancel the requests
     */
    public ResizeRequest requestHorizontal( ResizeRequest left, ResizeRequest right, ResizeNode node );
    
    /**
     * Combines the two requests top and bottom into
     * a new request.
     * @param top the request from the top, can be null
     * @param bottom the request from the bottom, can be null
     * @param node the node for which the requests have to be merged
     * @return a new request that somehow represents top and bottom
     * or null to cancel the requests
     */
    public ResizeRequest requestVertical( ResizeRequest top, ResizeRequest bottom, ResizeNode node );
    
    /**
     * Called whenever a node has to grant two resize requests at the same time.
     * @param node the node at which a conflict occurred
     * @param left the request from the left child
     * @param deltaLeft how much the left child would move the divider
     * @param right the request from the right child
     * @param deltaRight how much the right child would move the divider
     * @return how much the divider should be moved
     */
    public double resolveHorizontal( ResizeNode node, ResizeRequest left, double deltaLeft, ResizeRequest right, double deltaRight );
    
    /**
     * Called whenever a node has to grant two resize requests at the same time.
     * @param node the node at which a conflict occurred
     * @param top the request from the top child
     * @param deltaTop how much the top child would move the divider
     * @param bottom the request from the bottom child
     * @param deltaBottom how much the bottom child would move the divider
     * @return how much the divider should be moved
     */
    public double resolveVertical( ResizeNode node, ResizeRequest top, double deltaTop, ResizeRequest bottom, double deltaBottom );
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy