|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbibliothek.gui.dock.station.stack.StackDockStationFactory
public class StackDockStationFactory
A DockFactory that can read and write instances of
StackDockStation. This factory will create new instances of
StackDockStation through the method createStation().
| Field Summary | |
|---|---|
static String |
ID
The ID which is returned by getID() |
| Constructor Summary | |
|---|---|
StackDockStationFactory()
|
|
| Method Summary | |
|---|---|
protected StackDockStation |
createStation()
Called when a new StackDockStation is required. |
void |
estimateLocations(StackDockStationLayout layout,
LocationEstimationMap children)
Tries to estimate the DockablePropertys of the children of the
station which is represented by layout.The children of this station are accessible through children.getChild( ... |
String |
getID()
Gets the unique name of this converter. |
StackDockStationLayout |
getLayout(StackDockStation station,
Map<Dockable,Integer> children)
Gets the layout of element. |
StackDockStationLayout |
getPerspectiveLayout(StackDockPerspective element,
Map<PerspectiveDockable,Integer> children)
Gets the layout information that is associated with element. |
StackDockStation |
layout(StackDockStationLayout layout,
Map<Integer,Dockable> children,
PlaceholderStrategy placeholders)
Creates a new DockElement and changes the layout of the new
element such that is matches layout. |
StackDockStation |
layout(StackDockStationLayout layout,
PlaceholderStrategy placeholders)
Creates a new DockElement and changes the layout of the new
element such that is matches layout. |
void |
layoutPerspective(StackDockPerspective perspective,
StackDockStationLayout layout,
Map<Integer,PerspectiveDockable> children)
Updates the contents of perspective such that it reflects the contents of layout. |
StackDockPerspective |
layoutPerspective(StackDockStationLayout layout,
Map<Integer,PerspectiveDockable> children)
Creates an element that can be used by a Perspective to create a layout
without creating any DockElements. |
StackDockStationLayout |
read(DataInputStream in,
PlaceholderStrategy placeholders)
Reads a layout from a stream. |
StackDockStationLayout |
read(XElement element,
PlaceholderStrategy placeholders)
Reads a layout from an xml-element. |
void |
setLayout(StackDockStation station,
StackDockStationLayout layout,
Map<Integer,Dockable> children,
PlaceholderStrategy placeholders)
Reads the contents of layout and changes the layout of
element accordingly. |
void |
setLayout(StackDockStation element,
StackDockStationLayout layout,
PlaceholderStrategy placeholders)
Reads the contents of layout and changes the layout of
element accordingly. |
void |
write(StackDockStationLayout layout,
DataOutputStream out)
Writes the contents of layout into out. |
void |
write(StackDockStationLayout layout,
XElement element)
Writes the contents of layout into element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ID
getID()
| Constructor Detail |
|---|
public StackDockStationFactory()
| Method Detail |
|---|
public String getID()
DockConverter
getID in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>
public StackDockStationLayout getLayout(StackDockStation station,
Map<Dockable,Integer> children)
DockConverterelement. This method should create
a new instance of the layout object, that new object should not be
tied to element in any way. A layout can be living for
a long period of time and might be used on another dockable
object.
getLayout in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>station - the element for which a new layout should be createdchildren - a map containing unique identifiers for the children
of the element. Children which are not in this map should not be
stored in the layout.children.size() (excl.). The
same identifiers will be used as indices by a LocationEstimationMap. See
also DockFactory.estimateLocations(Object, LocationEstimationMap).
public void estimateLocations(StackDockStationLayout layout,
LocationEstimationMap children)
DockFactoryDockablePropertys of the children of the
station which is represented by layout.children.getChild( ... ), this
factory may also access the leafs in the tree of Dockables through
children.getSubChild(...).DockableProperty,
it is the callers responsibility to handle chains of stations.
estimateLocations in interface DockFactory<StackDockStation,StackDockPerspective,StackDockStationLayout>layout - this stationchildren - the children of the station, this method should call
DockLayoutInfo.setLocation(DockableProperty) or LocationEstimationMap.setLocation(int, DockableProperty) and
LocationEstimationMap.setLocation(int, int, DockableProperty) for as many children as possible
public void setLayout(StackDockStation station,
StackDockStationLayout layout,
Map<Integer,Dockable> children,
PlaceholderStrategy placeholders)
DockConverterlayout and changes the layout of
element accordingly. This method should remove all
children from element and add new children.
setLayout in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>station - the element whose content and children will be rearranged.layout - the new layout of elementchildren - some children, note that the map may not contain all elements
which were present when the layout was created.placeholders - a strategy to detect invalid placeholders, can be null.
Factories loading only Dockables but no DockStations can safely ignore this argument.
public void setLayout(StackDockStation element,
StackDockStationLayout layout,
PlaceholderStrategy placeholders)
DockConverterlayout and changes the layout of
element accordingly. This method should not add or remove
children to or from element.
setLayout in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>element - the element whose properties will be changedlayout - the new set of propertiesplaceholders - a strategy to detect invalid placeholders, can be null.
Factories loading only Dockables but no DockStations can safely ignore this argument.
public StackDockPerspective layoutPerspective(StackDockStationLayout layout,
Map<Integer,PerspectiveDockable> children)
DockFactoryPerspective to create a layout
without creating any DockElements. This method may return null only
if the client is guaranteed not to use a Perspective.
layoutPerspective in interface DockFactory<StackDockStation,StackDockPerspective,StackDockStationLayout>layout - the new layoutchildren - some children, note that the map may not contain all elements
which were present when the layout was created. Is null if the children of this
station are going to be ignored.
null, the return value of PerspectiveElement.getFactoryID() should
be equal to DockConverter.getID()
public void layoutPerspective(StackDockPerspective perspective,
StackDockStationLayout layout,
Map<Integer,PerspectiveDockable> children)
DockFactoryperspective such that it reflects the contents of layout.
layoutPerspective in interface DockFactory<StackDockStation,StackDockPerspective,StackDockStationLayout>perspective - the perspective that is to be updatedlayout - the layout to applychildren - the new children of perspective, is null if the children of this
station are going to be ignored.
public StackDockStation layout(StackDockStationLayout layout,
Map<Integer,Dockable> children,
PlaceholderStrategy placeholders)
DockFactoryDockElement and changes the layout of the new
element such that is matches layout.
layout in interface DockFactory<StackDockStation,StackDockPerspective,StackDockStationLayout>layout - the new layoutchildren - some children, note that the map may not contain all elements
which were present when the layout was created.placeholders - a strategy to detect invalid placeholders, can be null.
Factories loading only Dockables but no DockStations can safely ignore this argument.
null if layout can't be used
public StackDockStation layout(StackDockStationLayout layout,
PlaceholderStrategy placeholders)
DockFactoryDockElement and changes the layout of the new
element such that is matches layout. This method should
not add any children to the element.
layout in interface DockFactory<StackDockStation,StackDockPerspective,StackDockStationLayout>layout - the new layoutplaceholders - a strategy to detect invalid placeholders, can be null.
Factories loading only Dockables but no DockStations can safely ignore this argument.
null if layout can't be used
public StackDockStationLayout getPerspectiveLayout(StackDockPerspective element,
Map<PerspectiveDockable,Integer> children)
DockConverterelement.
The layout information can be any Object. The only restriction
of the object is, that the associated DockFactory understands
how to read that object.
getPerspectiveLayout in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>element - the element whose layout information is asked.children - a map providing identifiers for the children of this element. The
identifiers are in the range from 0 (incl.) to children.size() (excl.),
the exact same identifiers would be given to DockConverter.getLayout(bibliothek.gui.dock.DockElement, Map).
Is null if the children of this station should be ignored.
null if this converter does not support perspectives
public void write(StackDockStationLayout layout,
DataOutputStream out)
throws IOException
DockConverterlayout into out.
write in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>layout - the layout to storeout - the stream to write into
IOException - if an I/O-error occurs
public StackDockStationLayout read(DataInputStream in,
PlaceholderStrategy placeholders)
throws IOException
DockConverter
read in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>in - the stream to read fromplaceholders - a strategy to detect invalid placeholders, can be null.
Factories loading only Dockables but no DockStations can safely ignore this argument.
null if the layout
should be discarded
IOException - if an I/O-error occurs
public void write(StackDockStationLayout layout,
XElement element)
DockConverterlayout into element.
write in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>layout - the layout to storeelement - an xml-element into which this method should write, the
attributes of element should not be changed.
public StackDockStationLayout read(XElement element,
PlaceholderStrategy placeholders)
DockConverter
read in interface DockConverter<StackDockStation,StackDockPerspective,StackDockStationLayout>element - the element to read, should not be changed by this
method.placeholders - a strategy to detect invalid placeholders, can be null.
Factories loading only Dockables but no DockStations can safely ignore this argument.
null if the layout
should be discardedprotected StackDockStation createStation()
StackDockStation is required.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||