|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface defines a component that pools objects of type
Layout and
use them to perform layout on the given graph elements.
It encapsulates the layout classes (objects of type
NodeLayout) and allows accessing these through
layout context.
A layout context is a unique identifier that associates
with an object of type Layout and
its particular setting.
To handle layouter together with a specified setting of them
as a unit simplifies the modeling clustered graphs.
The LayoutService provides a set of essential methods to:
| Method Summary | |
boolean |
addLayoutContext(java.lang.String basicEngine,
java.lang.String layoutContext)
Creates a new layout-context and add it into the pool of the layout-contexts. |
void |
addProgressListener(ProgressListener progresslistener)
Adds a progress-listener. |
AttributeSet |
duplicateLayoutContext(java.lang.String templateLayoutContext,
java.lang.String newLayoutContext)
Creates a copy from the layout-context specified by templateLayoutContext and adds it into the pool of . |
boolean |
error()
Returns true if an error has occurred; otherwise false.
|
AttributeSet |
getAttribute()
This method gets the attribute-set of LayoutService.
|
java.lang.Object |
getAttribute(java.lang.String key)
This method may be used to obtain a specified attribute of the LayoutService.
|
java.lang.String |
getBaseLayoutEngine(java.lang.String layoutContext)
This method returns the base layouter of an specified layout-contexts. |
AttributeSet |
getConfiguration(java.lang.String[] listOfLayoutContexts)
This method returns an attribute-set which contains attributes of all layout contexts specified by listOfLayoutContexts.
|
AttributeSet |
getEdgeDefaultLayoutAttributes(java.lang.String layoutContext)
This method returns the default edge attributes of specified layout-context. |
java.lang.String[] |
getEdgeLayoutContextList()
This method returns the list of all defined edge layout-contexts. |
java.lang.String[] |
getEdgeLayoutEngineList()
This method returns the list of registered edge layouter. |
java.lang.String |
getErrorMessage()
Returns the error-message if an error has occurred. |
java.lang.Object |
getLayoutAttribute(java.lang.String layoutContext,
java.lang.String key)
Obtains the value of the attribute specified by key and the layout-context. |
AttributeSet |
getLayoutAttributeSet(java.lang.String layoutContext)
Returns the attribute-set of the specified layout-context. |
java.lang.String[] |
getLayoutContextList()
This method returns the list of all defined node and edge layout-contexts. |
java.lang.String[] |
getLayoutContextList(java.lang.String basicLayoutEngine)
This method returns array of layout-contexts that are associated with the specified basicLayoutEngine. |
AttributeSet |
getLayoutReport(java.lang.String layoutContext)
This method submits a report about the last layout process. |
AttributeSet |
getNodeDefaultLayoutAttributes(java.lang.String layoutContext)
This method returns the default node attributes of specified layout-context. |
java.lang.String[] |
getNodeLayoutContextList()
This method returns the list of all defined node layout-contexts. |
java.lang.String[] |
getNodeLayoutEngineList()
Returns an array of registered layouter. |
void |
init()
Initializes the internal state of the layout Service. |
boolean |
isValidLayoutContext(java.lang.String layoutContext)
Verifies whether the specified layout-context is valid. |
void |
keepCurrentEdgesRoute(LayoutableEdge edge)
Call this method to keep the current edge's route. |
boolean |
layout(java.util.List objectList,
java.lang.String nodeLayoutContext,
java.lang.String edgeLayoutContext)
Applies layout on the nodes and edges of viusalGraph.
|
boolean |
layout(VisualGraphObjectContainer visualgraph,
java.lang.String nodeLayoutContext,
java.lang.String edgeLayoutContext)
Applies layout on the graph specified by viusalGraph.
|
boolean |
layoutEdges(java.util.List objectList,
java.lang.String edgeLayoutContext,
java.lang.String nodeLayoutContext)
Applies layout on the edges of the graph specified by objectList |
boolean |
layoutEdges(VisualGraphObjectContainer visualgraph,
java.lang.String edgeLayoutContext,
java.lang.String nodeLayoutContext)
Applies layout on the edges of the graph specified by viusalGraph. |
void |
onBeginLayout()
Informs the layout service that the layout of a nested graph is beginning. |
void |
onEndLayout()
Informs the layout service that the layout of a nested graph is finished. |
boolean |
registerLayoutEngine(EdgeLayout edgeLayoutEngine)
This method may be used to add a new edge layouter into the layout pool. |
boolean |
registerLayoutEngine(NodeLayout newBasicLayoutEngine)
This method may be used to add a new layouter into the layout pool. |
boolean |
removeLayoutContext(java.lang.String layoutContext)
Removes the specified layout-context |
void |
removeProgressListener(ProgressListener progresslistener)
Removes the specified Progress-listener. |
void |
setAttribute(AttributeSet attributeSet)
This method may be used to set the attribute-set for this object. |
void |
setAttribute(java.lang.String key,
java.lang.Object value)
This method may be used to modify a specified attribute of the LayoutService.
|
void |
setConfiguration(AttributeSet attributeSet)
This method uses the given AttributeSet to configure the
layout contexts and the LayouService itself.
|
boolean |
setDefaultLayoutContext(java.lang.String defaultLayoutContext)
Deprecated. This method is become redundant since the method layoutEdges is expanded to a new parameter for the according edge layout context. |
boolean |
setLayoutAttribute(java.lang.String layoutContext,
java.lang.String key,
java.lang.Object value)
This method may be used to change the value of an attribute
specified by layout-context and key. |
boolean |
setLayoutAttributeSet(java.lang.String layoutContext,
AttributeSet attributeSet)
Returns the attribute-set of the layout context specified by layout-context. |
void |
updateLayoutAttributeSet(java.lang.String layoutContext,
AttributeSet layoutAttribute)
This method updates a specified attributes-set with the view of consistency. |
| Method Detail |
public boolean registerLayoutEngine(NodeLayout newBasicLayoutEngine)
Layout.
newBasicLayoutEngine - A new layouter.
public boolean registerLayoutEngine(EdgeLayout edgeLayoutEngine)
EdgeLayout.
edgeLayoutEngine - A new edge layouter.
registerLayoutEngine(EdgeLayout)
public boolean addLayoutContext(java.lang.String basicEngine,
java.lang.String layoutContext)
isValidLayoutContext(String) to check whether
the new name already exists.
basicEngine - The name of basic NodeLayout or
EdgeLayout.layoutContext - The name for the new layout context
registerLayoutEngine(NodeLayout)
public AttributeSet duplicateLayoutContext(java.lang.String templateLayoutContext,
java.lang.String newLayoutContext)
templateLayoutContext and adds it into the pool of .
templateLayoutContext - The source layout-contextnewLayoutContext - The name for the new copy of templateLayoutContext
public boolean removeLayoutContext(java.lang.String layoutContext)
layoutContext - The layout-contextto be removed
public boolean isValidLayoutContext(java.lang.String layoutContext)
layoutContext - layout-context that is to be checked
true if the specified layout-context is valid,
otherwise false.public java.lang.String[] getLayoutContextList()
public java.lang.String[] getNodeLayoutContextList()
public java.lang.String[] getEdgeLayoutContextList()
String array which contains a list of layout-contexts.public java.lang.String[] getLayoutContextList(java.lang.String basicLayoutEngine)
basicLayoutEngine.
basicLayoutEngine - The basic Layout of which the derived
layout contexts is requested.
public java.lang.String[] getNodeLayoutEngineList()
String array of registered layouter.public java.lang.String[] getEdgeLayoutEngineList()
public AttributeSet getNodeDefaultLayoutAttributes(java.lang.String layoutContext)
setLayoutAttribute(String, String, Object)
and setLayoutAttributeSet(String, AttributeSet).
The layout-attributes configure the layout as a whole. But some
layouter also accept configuration of nodes to allow
different treatment.
layoutContext - specifies the target layout context.
AttributeSet.
It may be null since some layouter does not offer
special attributes for nodes.public AttributeSet getEdgeDefaultLayoutAttributes(java.lang.String layoutContext)
setLayoutAttribute(String, String, Object)
and setLayoutAttributeSet(String, AttributeSet).
The layout-attributes configure the layout as a whole. But some
layouter also accept configuration of edges to allow
different treatment.
layoutContext - specifies the target layout context
AttributeSet. It may be
null since some layouter does not offer special
attributes for nodes.public boolean setDefaultLayoutContext(java.lang.String defaultLayoutContext)
Layoutable.getLayoutContext().
defaultLayoutContext - The layout context which is to be used.
public boolean layout(VisualGraphObjectContainer visualgraph,
java.lang.String nodeLayoutContext,
java.lang.String edgeLayoutContext)
viusalGraph.
Note: This method calls layoutEdges(VisualGraphObjectContainer, String, String)
internally.
visualgraph - The VisualGraph that should be arranged.nodeLayoutContext - The layout-context that should be used to layout nodes.edgeLayoutContext - The layout-context that should be used to layout edges.
getErrorMessage()
could be used to obtain details about the error.
public boolean layout(java.util.List objectList,
java.lang.String nodeLayoutContext,
java.lang.String edgeLayoutContext)
viusalGraph.
Note:: This method calls layoutEdges(List, String, String)
internally.
objectList - The list of VisualNode
and VisualEdge that should be arranged.nodeLayoutContext - The node layout-context that should be used.edgeLayoutContext - The edge layout-context that should be used.
getErrorMessage()
could be used to obtain details about the error.
public boolean layoutEdges(VisualGraphObjectContainer visualgraph,
java.lang.String edgeLayoutContext,
java.lang.String nodeLayoutContext)
viusalGraph.
visualgraph - The VisualGraph of which the edges should be arranged.edgeLayoutContext - The layout-context that should be used to arrange edge of the graph.nodeLayoutContext - The layout-context that should be used to arrange nodes of the graph.
The layout-context must associate with a Edge layouter.
getErrorMessage()
could be used to obtain details about the error.
public boolean layoutEdges(java.util.List objectList,
java.lang.String edgeLayoutContext,
java.lang.String nodeLayoutContext)
objectList - The list of nodes and edges of the graphedgeLayoutContext - The layout-context that should be used to arrange edge of the graph.nodeLayoutContext - The layout-context that should be used to arrange nodes of the graph.
getErrorMessage()
could be used to obtain details about the error.public AttributeSet getLayoutAttributeSet(java.lang.String layoutContext)
layoutContext - layout-context of which the attribute
set is required.
setLayoutAttribute(String, String, Object),
AttributeSet
public boolean setLayoutAttributeSet(java.lang.String layoutContext,
AttributeSet attributeSet)
LayoutService ensures that the modified
AttributeSet will updated by corresponding layouter.
A layouter may change the attribute set if necessarily.
A tree layouter for example may change the attribute
layer distance to radius if the user changes
the arrangement type from plan to radial.
layoutContext - layout-context of which the attribute set
is to be set.attributeSet - The new AttributeSet
setLayoutAttribute(String, String, Object),
AttributeSet
public boolean setLayoutAttribute(java.lang.String layoutContext,
java.lang.String key,
java.lang.Object value)
value of an attribute
specified by layout-context and key.
layoutContext - The layout context which attribute is to
be changed.key - The name of attribute which is to be set.value - The new value of the attribute specified by key
setLayoutAttributeSet(String, AttributeSet)
public java.lang.Object getLayoutAttribute(java.lang.String layoutContext,
java.lang.String key)
key and the layout-context.
layoutContext - The layout context of target layoutkey - The name of the target attribute.
getLayoutAttributeSet(String)
public void updateLayoutAttributeSet(java.lang.String layoutContext,
AttributeSet layoutAttribute)
A tree layouter for example may change the attribute
layer distance to radius if the user changes
the arrangement type from plan to radial.
layoutContext - The according layout contextlayoutAttribute - The attribute-Set which should be updatedpublic java.lang.Object getAttribute(java.lang.String key)
LayoutService.
Note: This Attributes are global and have an effect of all
layout-context. To obtain the attributes of a layout instance, use
getLayoutAttribute(String, String);
key - The name of the target attribute.
key.getAttribute(),
AttributeSet
public void setAttribute(java.lang.String key,
java.lang.Object value)
LayoutService.
Note: This Attributes are global and have an effect of all
layout-context. To set change the attributes of a layouter
use setLayoutAttribute(String, String, Object);
key - The name of the attribute which is to be set.value - The new value of the specified attribute.setAttribute(AttributeSet)public AttributeSet getAttribute()
LayoutService.
Note: This Attributes are global and have an effect of all
layout-context. To obtain the attributes of a layouter use
getLayoutAttributeSet(String);
AttributeSet of LayoutServicegetAttribute(String)public void setAttribute(AttributeSet attributeSet)
Attributes are global and have an effect of all
layout-context. To obtain the attributes of a layouter use
setLayoutAttributeSet(String, AttributeSet);
attributeSet - The AttributeSet that is to be used.setAttribute(String, Object)public AttributeSet getConfiguration(java.lang.String[] listOfLayoutContexts)
listOfLayoutContexts.
It may be used to obtain attributes of a set of layout contexts with
the view of saving of the current state of the layout contexts and the
LayoutService.
The Atribute tree has following structure:
LayoutConfiguration (Attr)
+--- Global attributes (Attr)
|
+---- Layout Contexts (Attr)
|
+---- Context
| |--- Base Layouter (string)
| |--- Attributes (Attr)
+----- Context
| |--- Base Layouter (string)
| |--- Attributes (Attr)
+----- ........
listOfLayoutContexts - the list of the requested layout contexts, or
null if the configuration of all registered layout contexts is required.
AttributeSet.setConfiguration(AttributeSet)public void setConfiguration(AttributeSet attributeSet)
AttributeSet to configure the
layout contexts and the LayouService itself.
Note: The LayoutService creates a new layout-context
automatically if a layout-context was saved but not existing
at the loading time.
attributeSet - The attribute set that contains the global options
and the attributes of each layout context.getConfiguration(String[])public boolean error()
true if an error has occurred; otherwise false.
Use method getErrorMessage() to obtain
a description text about the last occurred error.
true if an error has occurred; otherwise false.public java.lang.String getErrorMessage()
error() to find out whether
an error has occurred.
public void init()
public AttributeSet getLayoutReport(java.lang.String layoutContext)
layoutContext - The layout-context of which the report is required.
AttributeSetpublic void addProgressListener(ProgressListener progresslistener)
progresslistener - a ProgressListenerpublic void removeProgressListener(ProgressListener progresslistener)
progresslistener - the ProgressListener that is
to be removed.public void onBeginLayout()
public void onEndLayout()
public java.lang.String getBaseLayoutEngine(java.lang.String layoutContext)
layoutContext - the layout context of which the base layouter is requested.
base layouter with which the specified
layoutContext associates. The return value is null if the specified
layoutContext is not valid.public void keepCurrentEdgesRoute(LayoutableEdge edge)
edge - the edge of which the current route is to be considered.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||