|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.DefaultLayoutConfig
de.cau.cs.kieler.kiml.ui.layout.EclipseLayoutConfig
public class EclipseLayoutConfig
A layout configuration for extension point configurations and user preferences.
Constructor Summary | |
---|---|
EclipseLayoutConfig()
Create a stand-alone Eclipse layout configuration. |
|
EclipseLayoutConfig(ILayoutConfig externalConfig)
Create an Eclipse layout configuration embedding an external configuration. |
Method Summary | ||
---|---|---|
protected void |
addProperties(Map<IProperty<?>,Object> options)
Add all options that have pre-configured or user defined default values to the given map. |
|
protected
|
doGetProperty(LayoutOptionData<T> optionData)
Retrieve the pre-configured or user defined default value for a layout option. |
|
Map<IProperty<?>,Object> |
getAllProperties()
Returns a map of all options that have pre-configured or user defined default values. |
|
EditPart |
getEditPart()
Returns the edit part for the selected element. |
|
ILayoutConfig |
getExternalConfig()
Returns the external layout configuration embedded in this configuration, if present. |
|
protected Boolean |
getFixedSizeValue()
Return the dynamic value for the fixed size option. |
|
static Object |
getOption(EditPart editPart,
EObject modelElement,
IProperty<?> property)
Retrieves a layout option for the given edit part and model element by querying the option for the edit part's class name and its domain model name. |
|
static Object |
getOption(EditPart editPart,
IProperty<?> optionData)
Retrieves a layout option from the given edit part by using the framework bridge associated with the edit part type. |
|
protected PortConstraints |
getPortConstraintsValue()
Return the dynamic value for the port constraints option. |
|
|
getProperty(IProperty<T> property)
Retrieve the pre-configured or user defined default value for a layout option. |
|
void |
initialize(LayoutOptionData.Target targetType,
EditPart editPart,
String theLayoutHint)
Initialize the configuration with a layout hint and an edit part for the content (if target type is LayoutOptionData.Target#PARENTS ) or
the container of the selected element. |
|
void |
setAspectRatio(float ratio)
Set the suggested aspect ratio. |
|
void |
setChildren(boolean children)
Set whether the node in focus has any children. |
|
void |
setFocus(Object element)
Set the edit part or domain model element as focus for this layout configuration. |
|
void |
setPorts(boolean ports)
Set whether the node in focus has any ports. |
Methods inherited from class de.cau.cs.kieler.kiml.DefaultLayoutConfig |
---|
clearProperties, copyProperties, getContainerLayouterData, getContentLayouterData, getLayouterData, getOptionData, initialize, isDefault, setDiagramDefault, setProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public EclipseLayoutConfig()
public EclipseLayoutConfig(ILayoutConfig externalConfig)
externalConfig
- an external layout configurationMethod Detail |
---|
public static Object getOption(EditPart editPart, IProperty<?> optionData)
editPart
- an edit partoptionData
- layout option data
null
public static Object getOption(EditPart editPart, EObject modelElement, IProperty<?> property)
editPart
- an edit partmodelElement
- the corresponding model elementproperty
- layout option data
null
public void setFocus(Object element)
getAllProperties()
efficiently, since the same configuration instance can
be reused multiple times. Passing null
clears the current focus and resets
information about children and ports.
setFocus
in interface ILayoutConfig
setFocus
in class DefaultLayoutConfig
element
- an EditPart
or EObject
public void setChildren(boolean children)
children
- whether the selected node has childrenpublic void setPorts(boolean ports)
ports
- whether the selected node has portspublic void setAspectRatio(float ratio)
ratio
- the suggested value for aspect ratiopublic final void initialize(LayoutOptionData.Target targetType, EditPart editPart, String theLayoutHint)
LayoutOptionData.Target#PARENTS
) or
the container of the selected element.
targetType
- type of the selected element (parent, node, edge, port, etc.)editPart
- the edit parttheLayoutHint
- a layout hint, or null
public final <T> T getProperty(IProperty<T> property)
initialize
and setFocus
to be called first in order to give correct results.
getProperty
in interface IPropertyHolder
getProperty
in class DefaultLayoutConfig
T
- type of optionproperty
- a layout option
protected <T> T doGetProperty(LayoutOptionData<T> optionData)
T
- type of optionoptionData
- a layout option
protected Boolean getFixedSizeValue()
true
if the selected node has no children, and false
otherwiseprotected PortConstraints getPortConstraintsValue()
FIXED_POS
if the selected node has ports and no children,
and FREE
otherwisepublic final Map<IProperty<?>,Object> getAllProperties()
getAllProperties
in interface IPropertyHolder
getAllProperties
in class DefaultLayoutConfig
protected void addProperties(Map<IProperty<?>,Object> options)
options
- a map of layout option valuespublic final EditPart getEditPart()
null
if none is selectedpublic final ILayoutConfig getExternalConfig()
null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |