|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.ui.layout.KimlUiUtil
public final class KimlUiUtil
Utility methods used for the KIML UI.
Method Summary | |
---|---|
static KOption |
addKOption(LayoutOptionStyle optionStyle,
LayoutOptionData optionData)
Adds a KOption to the given layout option style. |
static Insets |
calcInsets(IFigure parent,
IFigure child)
Determines the insets for a parent figure, relative to the given child. |
static String |
getClassName(EditPart editPart,
boolean forDomainModel)
Returns the class name for which to store layout options for the given edit part. |
static Object |
getDefault(LayoutOptionData optionData,
LayoutProviderData providerData,
EditPart editPart,
EditPart containerEditPart,
boolean hasChildren)
Retrieves the default value for the given layout option. |
static org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart |
getDiagramEditPart(EditPart editPart)
Finds the diagram edit part of an edit part. |
static KOption |
getKOption(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart editPart,
String optionId)
Returns the KOption with given key that is stored for the edit part. |
static Object |
getOption(EditPart editPart,
String optionId)
Retrieves a layout option from the given edit part by querying the option for the edit part's class name and its domain model name. |
static boolean |
isNoLayout(EditPart editPart)
Determines whether the given edit part should not be layouted. |
static boolean |
isRelative(IFigure parent,
IFigure child)
Determines whether the position of the given child figure is relative to the position of the given parent figure. |
static void |
removeKOption(LayoutOptionStyle optionStyle,
String optionId)
Removes the KOption with given identifier from the notation view. |
static void |
removeOptionStyle(View view)
Removes the LayoutOptionStyle from the notation view, if it exists. |
static void |
runModelChange(Runnable runnable,
TransactionalEditingDomain editingDomain,
String label)
Performs the model changes specified in the given runnable in a safe context. |
static void |
setLayoutOptions(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart editPart,
KLayoutData layoutData,
boolean setUserOptions)
Sets all predefined and user defined layout options for the given edit part. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Insets calcInsets(IFigure parent, IFigure child)
parent
- the figure of a parent edit partchild
- the figure of a child edit part
public static boolean isRelative(IFigure parent, IFigure child)
parent
- the figure of a parent edit partchild
- the figure of a child edit part
public static Object getDefault(LayoutOptionData optionData, LayoutProviderData providerData, EditPart editPart, EditPart containerEditPart, boolean hasChildren)
optionData
- a layout option dataproviderData
- the active layout provider dataeditPart
- the current edit partcontainerEditPart
- the edit part that contains the objects for
which options are sethasChildren
- indicates whether the given edit part has children
in the layout graph
public static void setLayoutOptions(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart editPart, KLayoutData layoutData, boolean setUserOptions)
editPart
- edit part for which options are setlayoutData
- layout data where options are writtensetUserOptions
- if true, the user defined options are also setpublic static KOption getKOption(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart editPart, String optionId)
KOption
with given key that is stored for the edit part.
editPart
- the edit part for which the option shall be fetchedoptionId
- the identifier of the option
null
if there is no such optionpublic static void runModelChange(Runnable runnable, TransactionalEditingDomain editingDomain, String label)
runnable
- a runnable that performs model changeseditingDomain
- the editing domain for the changeslabel
- a user friendly label shown for the undo actionpublic static KOption addKOption(LayoutOptionStyle optionStyle, LayoutOptionData optionData)
KOption
to the given layout option style. This operation must be run in
a safe context; use runModelChange(java.lang.Runnable, org.eclipse.emf.transaction.TransactionalEditingDomain, java.lang.String)
to achieve this.
optionStyle
- layout option style of a notation viewoptionData
- the layout option data for which the KOption
shall be created
KOption
public static void removeKOption(LayoutOptionStyle optionStyle, String optionId)
KOption
with given identifier from the notation view. This operation
must be run in a safe context; use runModelChange(java.lang.Runnable, org.eclipse.emf.transaction.TransactionalEditingDomain, java.lang.String)
to achieve this.
optionStyle
- layout option style of a notation viewoptionId
- the layout option identifier for which the KOption
shall be removedpublic static void removeOptionStyle(View view)
LayoutOptionStyle
from the notation view, if it exists. This
operation must be run in a safe context; use runModelChange(java.lang.Runnable, org.eclipse.emf.transaction.TransactionalEditingDomain, java.lang.String)
to achieve this.
view
- the notation view from which to remove the layout option stylepublic static org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart getDiagramEditPart(EditPart editPart)
editPart
- an edit part
null
if there is no containing diagram
edit partpublic static String getClassName(EditPart editPart, boolean forDomainModel)
editPart
- an edit partforDomainModel
- if true the class of the edit part's domain model is taken,
else the edit part class itself is taken
null
if there is no such class namepublic static Object getOption(EditPart editPart, String optionId)
editPart
- an edit partoptionId
- layout option identifier
public static boolean isNoLayout(EditPart editPart)
editPart
- an edit part
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |