|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.LayoutServices
public class LayoutServices
Singleton class for access to the KIML layout services. This class is used
globally to retrieve data for automatic layout through KIML. The class cannot
be instantiated directly, but only through a subclass that calls
createLayoutServices()
. The subclass is then responsible to add
appropriate data to the nested registry instance.
Nested Class Summary | |
---|---|
class |
LayoutServices.Registry
Class used to register the layout services. |
Field Summary | |
---|---|
static String |
DIAGRAM_TYPE_GENERAL
identifier of the 'general' diagram type, which applies to all diagrams. |
Constructor Summary | |
---|---|
protected |
LayoutServices()
The default constructor is hidden to prevent others from instantiating this singleton class. |
Method Summary | |
---|---|
static void |
createLayoutServices()
Creates an instance of the layout services and assigns the singleton instance of the registry. |
protected static void |
createLayoutServices(LayoutServices subclassInstance)
Sets a layout services instance created by a specific subclass and assigns the singleton instance of the registry. |
String |
getCategoryName(String id)
Returns the name of the given category. |
String |
getDiagramTypeName(String id)
Returns the name of the given diagram type. |
List<Pair<String,String>> |
getDiagramTypes()
Returns a collection of registered diagram types. |
static LayoutServices |
getInstance()
Returns the singleton instance of the layout services class. |
Collection<LayoutOptionData> |
getLayoutOptionData()
Returns a data collection for all registered layout options. |
LayoutOptionData |
getLayoutOptionData(String id)
Returns the layout option data associated with the given identifier. |
List<LayoutOptionData> |
getLayoutOptions(LayoutProviderData providerData,
LayoutOptionData.Target target)
Returns a list of layout options that are suitable for the given layout provider and layout option target. |
AbstractLayoutProvider |
getLayoutProvider(KNode layoutNode)
Returns the most appropriate layout provider for the given node. |
Collection<LayoutProviderData> |
getLayoutProviderData()
Returns a data collection for all registered layout providers. |
LayoutProviderData |
getLayoutProviderData(String id)
Returns the layout provider data associated with the given identifier. |
LayoutProviderData |
getLayoutProviderData(String layoutHint,
String diagramType)
Returns the layout provider with highest priority for the given layout hint and diagram type. |
String |
getLayoutTypeName(String id)
Returns the name of the layout type with given identifier. |
List<Pair<String,String>> |
getLayoutTypes()
Returns a list of layout type identifiers and names. |
Object |
getOption(String objectId,
String optionId)
Retrieves the layout option with given identifier for an object identifier. |
Map<String,Object> |
getOptions(String id)
Returns a map that contains all layout options for an object identifier. |
static LayoutServices.Registry |
getRegistry()
Returns the singleton instance of the registry class. |
void |
layoutPerformed(KNode layoutGraph,
IKielerProgressMonitor monitor)
Calls the layoutPerformed method
of all registered layout listeners. |
void |
layoutRequested(KNode layoutGraph)
Calls the layoutRequested method
of all registered layout listeners. |
protected LayoutServices.Registry |
registry()
Returns the associated instance of the registry class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DIAGRAM_TYPE_GENERAL
Constructor Detail |
---|
protected LayoutServices()
Method Detail |
---|
public static void createLayoutServices()
protected static void createLayoutServices(LayoutServices subclassInstance)
subclassInstance
- an instance created by a subclasspublic static LayoutServices getInstance()
public static final LayoutServices.Registry getRegistry()
protected final LayoutServices.Registry registry()
public final void layoutRequested(KNode layoutGraph)
layoutRequested
method
of all registered layout listeners.
layoutGraph
- layout graph for which layout is requestedpublic final void layoutPerformed(KNode layoutGraph, IKielerProgressMonitor monitor)
layoutPerformed
method
of all registered layout listeners.
layoutGraph
- layout graph for which layout was performedmonitor
- progress monitor containing execution time resultspublic final LayoutProviderData getLayoutProviderData(String id)
id
- layout provider identifier
null
if there
is no provider with the given identifierpublic final Collection<LayoutProviderData> getLayoutProviderData()
public final LayoutProviderData getLayoutProviderData(String layoutHint, String diagramType)
layoutHint
- identifier of either a layout provider or a layout typediagramType
- identifier of a diagram type
null
if
there is no registered layout providerpublic final AbstractLayoutProvider getLayoutProvider(KNode layoutNode) throws KielerException
layoutNode
- node for which a layout provider is requested
KielerException
- if there is no registered layout providerpublic final LayoutOptionData getLayoutOptionData(String id)
id
- layout option identifier
null
if there is
no option with the given identifierpublic final Collection<LayoutOptionData> getLayoutOptionData()
public final List<LayoutOptionData> getLayoutOptions(LayoutProviderData providerData, LayoutOptionData.Target target)
providerData
- layout provider datatarget
- layout option target
public final String getLayoutTypeName(String id)
id
- identifier of the type
null
if the layout
type is not registeredpublic final List<Pair<String,String>> getLayoutTypes()
public final String getCategoryName(String id)
id
- identifier of the category
null
if there
is no category with the given identifierpublic final String getDiagramTypeName(String id)
id
- identifier of the diagram type
null
if there
is no diagram type with the given identifierpublic final List<Pair<String,String>> getDiagramTypes()
public final Map<String,Object> getOptions(String id)
id
- an object identifier
public final Object getOption(String objectId, String optionId)
objectId
- an object identifieroptionId
- the layout option identifier
null
if the
option is not set for the given object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |