de.cau.cs.kieler.kiml.ui.layout
Interface ILayoutInspector

All Known Implementing Classes:
GmfLayoutInspector

public interface ILayoutInspector

Interface for edit part inspectors for handling of layout options. A layout inspector is always associated with a specific edit part instance.

Rating red

Method Summary
 LayoutProviderData getContainerLayouterData()
          Returns the layout provider descriptor for the container of the associated edit part.
 EditPart getContainerPart()
          Returns the edit part that contains the associated edit part.
 Object getDefault(LayoutOptionData optionData)
          Returns the default value for the associated diagram.
 IFigure getDrawingLayer()
          Returns a layer figure for the associated diagram that can be used to draw additional information.
 TransactionalEditingDomain getEditingDomain()
          Returns a transactional editing domain in which to perform model changes.
 LayoutProviderData getFocusLayouterData()
          Returns the layout provider descriptor for the associated edit part.
 EObject getFocusModel()
          Returns the domain model element that is associated with this inspector.
 EditPart getFocusPart()
          Returns the edit part that is associated with this layout inspector.
 KOption getKOption(LayoutOptionData optionData, boolean create)
          Returns the currently stored KOption value for the given layout option.
 List<LayoutOptionData> getOptionData()
          Returns a list of layout option descriptors that are available for the associated edit part.
 boolean hasChildren()
          Returns true if the associated edit part has children that can be layouted.
 void initOptions()
          Initialize available layout options for the associated edit part.
 void removeAllKOptions()
          Removes all stored layout options from the associated edit part and its children.
 void removeKOption(LayoutOptionData optionData)
          Removes any stored value for the given layout option.
 void setDefault(LayoutOptionData optionData, Object value)
          Sets the given option as default value for all elements of the associated diagram.
 

Method Detail

initOptions

void initOptions()
Initialize available layout options for the associated edit part. Some methods require this to be called before they are used.


getOptionData

List<LayoutOptionData> getOptionData()
Returns a list of layout option descriptors that are available for the associated edit part. initOptions() must be called before this method is used.

Returns:
list of available layout options

getKOption

KOption getKOption(LayoutOptionData optionData,
                   boolean create)
Returns the currently stored KOption value for the given layout option. initOptions() must be called before this method is used.

Parameters:
optionData - layout option data
create - if true and the KOption is not available, a new instance is created and returned
Returns:
the current value, or null if there is no such value and create is false

removeKOption

void removeKOption(LayoutOptionData optionData)
Removes any stored value for the given layout option. initOptions() must be called before this method is used.

Parameters:
optionData - layout option data

getFocusLayouterData

LayoutProviderData getFocusLayouterData()
Returns the layout provider descriptor for the associated edit part. initOptions() must be called before this method is used.

Returns:
the associated layout provider data

getContainerPart

EditPart getContainerPart()
Returns the edit part that contains the associated edit part. initOptions() must be called before this method is used.

Returns:
the container edit part

getContainerLayouterData

LayoutProviderData getContainerLayouterData()
Returns the layout provider descriptor for the container of the associated edit part. initOptions() must be called before this method is used.

Returns:
the layout provider data for the container edit part

hasChildren

boolean hasChildren()
Returns true if the associated edit part has children that can be layouted.

Returns:
whether the edit part has children

removeAllKOptions

void removeAllKOptions()
Removes all stored layout options from the associated edit part and its children.


getDefault

Object getDefault(LayoutOptionData optionData)
Returns the default value for the associated diagram.

Parameters:
optionData - layout option data
Returns:
default value of the layout option, or null if no default value is set for the diagram

setDefault

void setDefault(LayoutOptionData optionData,
                Object value)
Sets the given option as default value for all elements of the associated diagram.

Parameters:
optionData - layout option data
value - new default value

getFocusPart

EditPart getFocusPart()
Returns the edit part that is associated with this layout inspector.

Returns:
the associated edit part

getFocusModel

EObject getFocusModel()
Returns the domain model element that is associated with this inspector.

Returns:
the associated domain model element

getEditingDomain

TransactionalEditingDomain getEditingDomain()
Returns a transactional editing domain in which to perform model changes.

Returns:
an editing domain for model changes

getDrawingLayer

IFigure getDrawingLayer()
Returns a layer figure for the associated diagram that can be used to draw additional information.

Returns:
a drawing layer