bibliothek.gui.dock.layout.DockableProperty Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of docking-frames-core Show documentation
Show all versions of docking-frames-core Show documentation
A window docking framework for Swing
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.layout;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import bibliothek.gui.DockStation;
import bibliothek.gui.Dockable;
import bibliothek.util.xml.XElement;
/**
* Describes the location of a {@link Dockable} on a {@link DockStation}.
* The properties can be nested, that describes the fact that a DockStation
* can also be a Dockable
.
* A DockableProperty
should not have any reference to its Dockable
or its
* DockStation
.
* @author Benjamin Sigg
*/
public interface DockableProperty {
/**
* Gets the property which should be used for the child of this
* dockable DockStation.
* @return the property for the child, or null
* @see #setSuccessor(DockableProperty)
*/
public DockableProperty getSuccessor();
/**
* Sets the property which will be used if this property was used and
* there is not yet a leaf in the tree of DockStations and Dockables reached.
* For example: there is a DockStation root
, a
* dockable DockStation node
which is a child of root
* and a Dockable leaf
which is a child of node
.
* A DockableProperty called one
would describe the relationship
* between root
and node
. Another DockableProperty
* called two
would describe the relationship between
* node
and leaf
. In this case, the successor
* of one
would be two
.
* @param properties the location of a child
*/
public void setSuccessor( DockableProperty properties );
/**
* Gets a copy of this property, the {@link #getSuccessor() successor} must be
* copied as well.
* @return an independent copy of this
*/
public DockableProperty copy();
/**
* Gets the unique name of the {@link DockablePropertyFactory} which
* can create this type of DockableProperty.
* @return the id
* @see DockablePropertyFactory
*/
public String getFactoryID();
/**
* Tells whether this
describes the same position
* as property
, not checking the {@link #getSuccessor() successor}.
* @param property the property to check
* @return true
if this
is the same as property
*/
public boolean equalsNoSuccessor( DockableProperty property );
/**
* Stores the contents of this DockableProperty in a stream. The
* {@link #getSuccessor() successor} (if there is one) must
* not be saved.
* @param out the stream to write in
* @throws IOException if anything unexpected happens
*/
public void store( DataOutputStream out ) throws IOException;
/**
* Stores the contents of this property as xml element.
* @param element the element into which to write, the attributes of
* this element should not be changed
*/
public void store( XElement element );
/**
* Reads the contents of this DockableProperty from a stream. The
* property can assume that a property with the same type has written
* into the stream.
* @param in the stream to read
* @throws IOException if anything unexpected happens
*/
public void load( DataInputStream in ) throws IOException;
/**
* Reads the contents of this {@link DockableProperty} from an
* xml element.
* @param element the element that was written earlier by this property
*/
public void load( XElement element );
}