|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.LayoutDataService
public class LayoutDataService
Singleton class for access to the KIML layout data. 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. Multiple instances of subclasses can register
themselves by calling createLayoutServices(subInstance)
, where subInstance is the
instance of the subclass, but only one instance per subclass is allowed. Registering another
instance will overwrite the prior instance. The different instances are identified by class name
and the currently used instance can be determined by calling getMode()
. You can switch
between the different instances by calling setMode(final Class extends
LayoutDataService> clas)
or setMode(final Object object)
, where object
has to be
an instance of a subclass of LayoutDataService
.
Nested Class Summary | |
---|---|
class |
LayoutDataService.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 |
LayoutDataService()
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 an instance of the registry. |
|
protected static void |
createLayoutServices(LayoutDataService subInstance)
Registers a layout data service instance created by a specific subclass and assigns it an instance of the registry. |
|
Collection<LayoutAlgorithmData> |
getAlgorithmData()
Returns a data collection for all registered layout algorithms. |
|
LayoutAlgorithmData |
getAlgorithmData(String id)
Returns the layout algorithm data associated with the given identifier. |
|
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 LayoutDataService |
getInstance()
Returns the instance of the currently used layout data service. |
|
static
|
getInstanceOf(Class<? extends LayoutDataService> clas)
Returns the instance of a specific layout data service identified by its class name. |
|
static Class<? extends LayoutDataService> |
getMode()
Returns the mode in which the layout data service is operating identified by the class name of the layout data service. |
|
Object |
getOption(EClass clazz,
String optionId)
Retrieves a layout option value for a domain model class. |
|
Object |
getOption(String objectId,
String optionId)
Retrieves a layout option value for an object identifier. |
|
Collection<LayoutOptionData<?>> |
getOptionData()
Returns a data collection for all registered layout options. |
|
List<LayoutOptionData<?>> |
getOptionData(LayoutAlgorithmData algorithmData,
LayoutOptionData.Target targetType)
Returns a list of layout options that are suitable for the given layout algorithm and layout option target. |
|
LayoutOptionData<?> |
getOptionData(String id)
Returns the layout option data associated with the given identifier. |
|
Map<String,Object> |
getOptions(EClass clazz)
Returns a map that contains all layout option values for a domain model class. |
|
Map<String,Object> |
getOptions(String objectId)
Returns a map that contains all layout option values for an object identifier. |
|
static LayoutDataService.Registry |
getRegistry()
Returns the instance of the registry class associated with the current layout data service. |
|
List<SemanticLayoutConfig> |
getSemanticConfigs(EClass clazz)
Return the semantic layout configurations that are associated with the given domain model class. |
|
Collection<LayoutTypeData> |
getTypeData()
Returns a list of layout type identifiers and names. |
|
LayoutTypeData |
getTypeData(String id)
Returns the data instance of the layout type with given identifier. |
|
static void |
removeLayoutServices(Class<? extends LayoutDataService> clazz)
Removes a layout data service instance identified by its class name. |
|
static void |
removeLayoutServices(LayoutDataService subInstance)
Removes a layout data service identified by its instance. |
|
static Class<? extends LayoutDataService> |
setMode(Class<? extends LayoutDataService> clas)
Sets the mode in which the layout data service is operating identified by the class name of the layout data service to be used. |
|
static Class<? extends LayoutDataService> |
setMode(Object object)
Sets the mode in which the layout data service is operating identified by the class name of the object which has to be an instance of a sublass of LayoutDataService . |
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 LayoutDataService()
Method Detail |
---|
public static void createLayoutServices()
protected static void createLayoutServices(LayoutDataService subInstance)
subInstance
- an instance created by a subclasspublic static void removeLayoutServices(LayoutDataService subInstance)
setMode(final Class extends LayoutDataService> clas)
or
setMode(final Object object)
.
subInstance
- The instance to be removed.public static void removeLayoutServices(Class<? extends LayoutDataService> clazz)
clazz
- Class identifier of the instance to be removed.public static Class<? extends LayoutDataService> getMode()
public static Class<? extends LayoutDataService> setMode(Class<? extends LayoutDataService> clas)
clas
- The class name of the service to be used.
public static Class<? extends LayoutDataService> setMode(Object object)
object
which has to be an instance of a sublass of LayoutDataService
. If
no service with this class name has been registered, the mode is not changed.
object
- An instance identifying the new mode by its class name.
public static LayoutDataService getInstance()
null
if either no instance has been registered yet or the
currently used service has been removed.public static <T extends LayoutDataService> T getInstanceOf(Class<? extends LayoutDataService> clas)
clas
- Class name of the required layout data service.
null
if either no instance has been registered yet or it has
been removedpublic static final LayoutDataService.Registry getRegistry()
null
if either no layout data service has been
registered yet or it has been removedpublic final LayoutAlgorithmData getAlgorithmData(String id)
id
- layout algorithm identifier
null
if there is no algorithm
with the given identifierpublic final Collection<LayoutAlgorithmData> getAlgorithmData()
public final LayoutOptionData<?> getOptionData(String id)
id
- layout option identifier
null
if there is no option with the
given identifierpublic final Collection<LayoutOptionData<?>> getOptionData()
public final List<LayoutOptionData<?>> getOptionData(LayoutAlgorithmData algorithmData, LayoutOptionData.Target targetType)
algorithmData
- layout algorithm datatargetType
- type of layout option target
public final LayoutTypeData getTypeData(String id)
id
- identifier of the type
null
if the layout type
is not registeredpublic final Collection<LayoutTypeData> getTypeData()
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 objectId)
objectId
- an object identifier, such as an edit part class name, a domain model class name,
or a diagram type id
public final Object getOption(String objectId, String optionId)
objectId
- an object identifier, such as an edit part class name, a domain model class name,
or a diagram type idoptionId
- a layout option identifier
null
if the option is not set for
the given objectpublic final Map<String,Object> getOptions(EClass clazz)
clazz
- a domain model class
public final Object getOption(EClass clazz, String optionId)
clazz
- a domain model classoptionId
- a layout option identifier
null
if the option is not
set for the classpublic final List<SemanticLayoutConfig> getSemanticConfigs(EClass clazz)
clazz
- a domain model class
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |