bibliothek.gui.dock.common.CStationContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docking-frames-common Show documentation
Show all versions of docking-frames-common Show documentation
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
/*
* 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) 2011 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.common;
import java.awt.Component;
import bibliothek.gui.Dockable;
import bibliothek.gui.dock.common.mode.ExtendedMode;
/**
* A {@link CStationContainer} is a set of root {@link CStation}s that are somehow
* combined and ordered on some kind of {@link Component}. A container may or may not be mutable.
* @author Benjamin Sigg
*/
public interface CStationContainer {
/**
* Adds the observer listener
to this container. The listener is to be informed
* whenever a {@link CStation} is added or removed from this container.
* @param listener the new listener, not null
*/
public void addStationContainerListener( CStationContainerListener listener );
/**
* Removes the observer listener
from this container.
* @param listener the listener to remove
*/
public void removeStationContainerListener( CStationContainerListener listener );
/**
* Gets a unique identifier that is used by only this {@link CStationContainer}.
* @return the unique identifier, not null
*/
public String getUniqueId();
/**
* Gets a {@link Component} whose children are all the {@link CStation}s of this
* {@link CStationContainer}.
* @return the parent of all {@link CStation}s, not null
*/
public Component getComponent();
/**
* Gets the number of {@link CStation}s that are currently in this container.
* @return the number of stations, at least 0
*/
public int getStationCount();
/**
* Gets the index'th child of this container.
* @param index the index of the child, between 0 and {@link #getStationCount()}
* @return the child, not null
*/
public CStation> getStation( int index );
/**
* Gets the preferred default {@link CStation} of this container. Children with no location
* are usually made visible on such a default station.
* @return the default station or null
*/
public CStation> getDefaultStation();
/**
* Gets the preferred default {@link CStation} of this container for children in mode mode
.
* @param mode the mode for which a station is searched
* @return a child of this {@link CStationContainer} that can show {@link Dockable}s in mode mode
,
* can be null
*/
public CStation> getDefaultStation( ExtendedMode mode );
/**
* Assuming container
is a type of {@link CStationContainer} that is known to
* this
, and assuming station
is a child of container
: this
* method returns one of this
children that has the same relative location in respect to this
* as station
has to container
. For example if station
is the
* center area of a {@link CGridArea}, and this
is a {@link CGridArea} as well, then
* this method would return the center area of this
.
* @param container some kind of {@link CStationContainer}, may be a type that is known to this
* or not.
* @param station some child of container
* @return a child of this
, such that the location of the child in relation to this
is
* equivalent to the location of station
in relation to container
. A value of
* null
indicates that this method did not find a suitable child. If possible the result of this method
* and station
should be of the same type.
*/
public CStation> getMatchingStation( CStationContainer container, CStation> station );
}