|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.cau.cs.kieler.kiml.ui.diagram.GefDiagramLayoutManager<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart>
de.cau.cs.kieler.kiml.gmf.GmfDiagramLayoutManager
public class GmfDiagramLayoutManager
Diagram layout manager that is able to generically layout diagrams generated by GMF. The internal
KGraph graph structure is built from the structure of edit parts in the diagram. The new layout
is applied to the diagram using GmfLayoutEditPolicy
, which creates a
GmfLayoutCommand
to directly manipulate data in the GMF notation model, where layout
information is stored persistently.
Field Summary | |
---|---|
static IProperty<CommandStack> |
COMMAND_STACK
the command stack that executes the command. |
static IProperty<List<org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart>> |
CONNECTIONS
list of connection edit parts that were found in the diagram. |
static IProperty<org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart> |
DIAGRAM_EDIT_PART
diagram edit part of the currently layouted diagram. |
static IProperty<org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor> |
DIAGRAM_EDITOR
editor part of the currently layouted diagram. |
static IProperty<Command> |
LAYOUT_COMMAND
the command that applies the transferred layout to the diagram. |
Constructor Summary | |
---|---|
GmfDiagramLayoutManager()
|
Method Summary | |
---|---|
protected void |
applyLayout(LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> mapping)
Apply the transferred layout to the original diagram. |
protected LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> |
buildLayoutGraph(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart layoutRootPart)
Creates the actual mapping given an edit part which functions as the root for the layout. |
LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> |
buildLayoutGraph(IWorkbenchPart workbenchPart,
Object diagramPart)
Build a KGraph instance for the given diagram. |
IMutableLayoutConfig |
getLayoutConfig()
Return a framework-specific layout configuration. |
protected void |
processEdgeLabels(LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> mapping,
org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection,
KEdge edge,
EdgeLabelPlacement placement,
KVector offset)
Process the labels of an edge. |
protected void |
setEdgeLayout(KEdgeLayout edgeLayout,
org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection,
KVector offset)
Stores the layout information of the given connection edit part into an edge layout. |
boolean |
supports(Object object)
Determine whether this layout manager is able to perform layout for the given object. |
protected void |
transferLayout(LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> mapping)
Transfer all layout data from the last created KGraph instance to the original diagram. |
Methods inherited from class de.cau.cs.kieler.kiml.ui.diagram.GefDiagramLayoutManager |
---|
applyLayout |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final IProperty<List<org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart>> CONNECTIONS
public static final IProperty<org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor> DIAGRAM_EDITOR
public static final IProperty<org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart> DIAGRAM_EDIT_PART
public static final IProperty<Command> LAYOUT_COMMAND
public static final IProperty<CommandStack> COMMAND_STACK
Constructor Detail |
---|
public GmfDiagramLayoutManager()
Method Detail |
---|
public boolean supports(Object object)
object
- a workbench part or edit part
public LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> buildLayoutGraph(IWorkbenchPart workbenchPart, Object diagramPart)
workbenchPart
- the workbench part for which layout is performeddiagramPart
- the parent object for which layout is performed, or
null
if the whole diagram shall be layouted
protected LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> buildLayoutGraph(org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart layoutRootPart)
layoutRootPart
- the layout root edit part
protected void transferLayout(LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> mapping)
transferLayout
in class GefDiagramLayoutManager<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart>
mapping
- a layout mapping that was created by this layout managerprotected void applyLayout(LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> mapping)
applyLayout
in class GefDiagramLayoutManager<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart>
mapping
- a layout mapping that was created by this layout managerpublic IMutableLayoutConfig getLayoutConfig()
protected void setEdgeLayout(KEdgeLayout edgeLayout, org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection, KVector offset)
edgeLayout
- an edge layoutconnection
- a connection edit partoffset
- offset to be subtracted from coordinatesprotected void processEdgeLabels(LayoutMapping<org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart> mapping, org.eclipse.gmf.runtime.diagram.ui.editparts.ConnectionEditPart connection, KEdge edge, EdgeLabelPlacement placement, KVector offset)
mapping
- the layout mappingconnection
- the connection edit partedge
- the layout edgeplacement
- predefined placement for all labels, or UNDEFINED
if the placement shall
be derived from the edit partoffset
- the offset for coordinates
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |