public interface IUMLDiagramHelper
Modifier and Type | Method and Description |
---|---|
boolean |
canCreateViews(org.eclipse.gmf.runtime.notation.Diagram diagram,
java.util.List<?> objects)
Returns whether views can be created for the objects specified by
objects in the diagram specified by diagram |
org.eclipse.gmf.runtime.notation.Diagram |
createDiagram(org.eclipse.uml2.uml.Namespace container,
UMLDiagramKind kind)
Creates a UML diagram with a given kind and inserts it into a given
container
|
org.eclipse.gmf.runtime.notation.Diagram |
createDiagram(org.eclipse.uml2.uml.Namespace container,
UMLDiagramKind kind,
org.eclipse.uml2.uml.Element context)
Creates a UML diagram with a given context and kind and inserts it into a
given container
|
org.eclipse.gmf.runtime.notation.Edge |
createEdge(org.eclipse.gmf.runtime.notation.View source,
org.eclipse.gmf.runtime.notation.View target,
org.eclipse.uml2.uml.Element element)
Creates an edge for a given element and connects it between a given
source and a given target
|
org.eclipse.gmf.runtime.notation.Edge |
createEdge(org.eclipse.gmf.runtime.notation.View source,
org.eclipse.gmf.runtime.notation.View target,
java.lang.String type)
Creates an edge with a given type and connects it between a given source
and a given target, basic edge types are
"NoteAttachment"
|
java.util.List<org.eclipse.gmf.runtime.notation.Edge> |
createEdges(org.eclipse.gmf.runtime.notation.Diagram diagram,
org.eclipse.uml2.uml.Relationship element)
Creates diagram edges between the related elements of a relationship
|
org.eclipse.gmf.runtime.notation.Node |
createNode(org.eclipse.gmf.runtime.notation.View container,
org.eclipse.uml2.uml.Element element)
Creates a node for a given element and inserts it into a given container
|
org.eclipse.gmf.runtime.notation.Node |
createNode(org.eclipse.gmf.runtime.notation.View container,
java.lang.String type)
Creates a node with a given type and inserts it into a given container
basic types are
"Note"
"Text"
"DiagramName"
"DiagramLink"
|
java.util.List<org.eclipse.gmf.runtime.notation.View> |
createViews(org.eclipse.gmf.runtime.notation.Diagram diagram,
java.util.List<?> objects)
Creates views for the objects specified by
objects in the
diagram specified by diagram . |
void |
destroyView(org.eclipse.gmf.runtime.notation.View view)
Destroys a given view
|
org.eclipse.gmf.runtime.notation.Diagram |
findDiagram(org.eclipse.uml2.uml.Element root,
java.lang.String id,
org.eclipse.core.runtime.IProgressMonitor monitor)
Finds diagram whose ID matches exactly the specified
id . |
org.eclipse.gmf.runtime.notation.Diagram |
findDiagramById(org.eclipse.uml2.uml.Model model,
java.lang.String id,
org.eclipse.core.runtime.IProgressMonitor monitor)
Deprecated.
Since 7.5, use the
findDiagram(Element, String, IProgressMonitor)
method, instead. |
java.util.Set<org.eclipse.gmf.runtime.notation.Diagram> |
findDiagramByName(org.eclipse.uml2.uml.Element container,
java.lang.String name,
org.eclipse.core.runtime.IProgressMonitor monitor)
Finds the diagrams whose name and type match exactly the specified
name and type respectively. |
org.eclipse.gmf.runtime.notation.View |
getChildView(org.eclipse.gmf.runtime.notation.View container,
java.lang.String type)
Gets the child view with a given type from a given view
|
java.util.List<org.eclipse.gmf.runtime.notation.Diagram> |
getDiagrams(org.eclipse.uml2.uml.Namespace element)
Gets a list of diagrams for a given element
|
java.util.List<org.eclipse.gmf.runtime.notation.Diagram> |
getDiagrams(org.eclipse.uml2.uml.Namespace element,
UMLDiagramKind kind)
Gets a list of diagrams of a given kind for a given element
|
org.eclipse.gmf.runtime.diagram.ui.services.layout.ILayoutNode |
getLayoutNode(org.eclipse.gmf.runtime.notation.Node node)
getLayoutNode Gets the ILayoutNode in order to retrieve the actual size
of the Node object irrespective of the autosize properties.
|
org.eclipse.gmf.runtime.notation.Diagram |
getMainDiagram(org.eclipse.uml2.uml.Namespace element)
Gets the main diagram of an element
|
UMLDiagramKind |
getUmlDiagramKind(org.eclipse.gmf.runtime.notation.Diagram diagram)
Retrieves the UMLDiagramKind of the specified diagram
|
void |
layout(org.eclipse.gmf.runtime.notation.View view,
java.lang.String hint)
layout Utility method to layout the children of a view container.
|
void |
layoutNodes(java.util.List<? extends org.eclipse.gmf.runtime.notation.Node> nodes,
java.lang.String hint)
layoutNodes Utility method to layout a list of Node children on a
diagram.
|
void |
openDiagramEditor(org.eclipse.gmf.runtime.notation.Diagram diagram)
Opens an editor for a given diagram
|
java.awt.Image |
renderToAWTImage(org.eclipse.gmf.runtime.notation.Diagram diagram)
renderToAWTImage Utility api to generate an AWT based image
representation of the diagram contents.
|
void |
renderToImageFile(org.eclipse.gmf.runtime.notation.Diagram diagram,
java.lang.String file,
org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat format)
renderToImageFile Utility api to render the diagram to a specified image
formatation of the diagram contents.
|
org.eclipse.swt.graphics.Image |
renderToSWTImage(org.eclipse.gmf.runtime.notation.Diagram diagram)
renderToSWTImage Utility api to generate an SWT based image
representation of the diagram contents.
|
void |
setMainDiagram(org.eclipse.uml2.uml.Namespace element,
org.eclipse.gmf.runtime.notation.Diagram diagram)
Sets the main diagram of an element
|
org.eclipse.gmf.runtime.notation.Diagram createDiagram(org.eclipse.uml2.uml.Namespace container, UMLDiagramKind kind)
container
- The container namespace for the diagramkind
- The UML diagram kindDiagram
org.eclipse.gmf.runtime.notation.Diagram createDiagram(org.eclipse.uml2.uml.Namespace container, UMLDiagramKind kind, org.eclipse.uml2.uml.Element context)
container
- The container namespace for the diagramcontext
- The UML diagram element contextkind
- The UML diagram kindDiagram
org.eclipse.gmf.runtime.notation.Node createNode(org.eclipse.gmf.runtime.notation.View container, org.eclipse.uml2.uml.Element element)
container
- The node view containerelement
- The node view element contextNode
org.eclipse.gmf.runtime.notation.Node createNode(org.eclipse.gmf.runtime.notation.View container, java.lang.String type)
container
- The node view containertype
- The node view typeNode
org.eclipse.gmf.runtime.notation.Edge createEdge(org.eclipse.gmf.runtime.notation.View source, org.eclipse.gmf.runtime.notation.View target, org.eclipse.uml2.uml.Element element)
source
- The edge's source viewtarget
- The edge's target viewelement
- The edge view element contextEdge
org.eclipse.gmf.runtime.notation.Edge createEdge(org.eclipse.gmf.runtime.notation.View source, org.eclipse.gmf.runtime.notation.View target, java.lang.String type)
source
- The edge's source viewtarget
- The edge's target viewtype
- The edge view typeEdge
void destroyView(org.eclipse.gmf.runtime.notation.View view)
view
- The view to be destroyedvoid openDiagramEditor(org.eclipse.gmf.runtime.notation.Diagram diagram)
diagram
- The diagram to be openedjava.util.List<org.eclipse.gmf.runtime.notation.Diagram> getDiagrams(org.eclipse.uml2.uml.Namespace element)
element
- The namespace elementDiagram
sjava.util.List<org.eclipse.gmf.runtime.notation.Diagram> getDiagrams(org.eclipse.uml2.uml.Namespace element, UMLDiagramKind kind)
element
- The namespace elementkind
- The diagram kindDiagram
sorg.eclipse.gmf.runtime.notation.Diagram getMainDiagram(org.eclipse.uml2.uml.Namespace element)
element
- The namespace elementDiagram
void setMainDiagram(org.eclipse.uml2.uml.Namespace element, org.eclipse.gmf.runtime.notation.Diagram diagram)
element
- The namespace elementdiagram
- The main diagramorg.eclipse.gmf.runtime.notation.View getChildView(org.eclipse.gmf.runtime.notation.View container, java.lang.String type)
container
- The container viewtype
- The type of the child viewView
UMLDiagramKind getUmlDiagramKind(org.eclipse.gmf.runtime.notation.Diagram diagram)
diagram
- The diagram to retrieve the UMLDiagramKind forvoid renderToImageFile(org.eclipse.gmf.runtime.notation.Diagram diagram, java.lang.String file, org.eclipse.gmf.runtime.diagram.ui.image.ImageFileFormat format)
diagram
- The Diagram to render the image from.file
- String that is the image file path to write to.format
- ImageFileFormat enumeration of valid file formatsjava.lang.NullPointerException
- diagram
is null
java.lang.NullPointerException
- file
is null
java.lang.NullPointerException
- format
is null
java.lang.IllegalArgumentException
- file
is an empty stringjava.lang.UnsupportedOperationException
- Unable to render diagram
to
format
java.awt.Image renderToAWTImage(org.eclipse.gmf.runtime.notation.Diagram diagram)
diagram
- The Diagram to render the image from.java.lang.NullPointerException
- diagram
is null
org.eclipse.swt.graphics.Image renderToSWTImage(org.eclipse.gmf.runtime.notation.Diagram diagram)
diagram
- The Diagram to render the image from.java.lang.NullPointerException
- diagram
is null
org.eclipse.gmf.runtime.diagram.ui.services.layout.ILayoutNode getLayoutNode(org.eclipse.gmf.runtime.notation.Node node)
node
- Node to get the layout node equivalent fromjava.lang.NullPointerException
- node
is null
void layout(org.eclipse.gmf.runtime.notation.View view, java.lang.String hint)
view
- View object that is the container whose children will be laid
out. Typically this would be the Diagram notation element.hint
- String representing a hint for what kind of layout will be
applied. Value can be one ofjava.lang.NullPointerException
- view
is null
java.lang.NullPointerException
- hint
is null
LayoutType.DEFAULT
,
Other values would have to understand by custom providers.
,
ILayoutNodeProvider
void layoutNodes(java.util.List<? extends org.eclipse.gmf.runtime.notation.Node> nodes, java.lang.String hint)
nodes
- List of Node objectshint
- String representing a hint for what kind of layout will be
applied. Value can be one ofjava.lang.NullPointerException
- nodes
is null
java.lang.IllegalArgumentException
- nodes
is an empty listjava.lang.NullPointerException
- hint
is null
java.lang.IllegalArgumentException
- Argument nodes
contains objects which aren't
of type Node
java.lang.IllegalArgumentException
- Argument nodes
contains objects which have a
different parent containmentLayoutType.DEFAULT
,
Other values would have to understand by custom providers.
,
ILayoutNodeProvider
java.util.List<org.eclipse.gmf.runtime.notation.View> createViews(org.eclipse.gmf.runtime.notation.Diagram diagram, java.util.List<?> objects)
objects
in the
diagram specified by diagram
.diagram
- The diagram where to add views toobjects
- The objects to add views forjava.lang.NullPointerException
- diagram
or object
is nulljava.lang.IllegalArgumentException
- diagram
has no associated edit part (internal
error)boolean canCreateViews(org.eclipse.gmf.runtime.notation.Diagram diagram, java.util.List<?> objects)
objects
in the diagram specified by diagram
diagram
- The diagram where to add a views toobjects
- The objects to add views fortrue
if at least one object can be viewed in the
specified diagramjava.lang.NullPointerException
- diagram
or objects
is null@Deprecated org.eclipse.gmf.runtime.notation.Diagram findDiagramById(org.eclipse.uml2.uml.Model model, java.lang.String id, org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.InterruptedException
findDiagram(Element, String, IProgressMonitor)
method, instead.id
.
The search is performed in the model specified by model
model
- The UML model where to perform the searchid
- The ID of the diagram to matchjava.lang.InterruptedException
- The query operation was interruptedjava.lang.IllegalArgumentException
- is
is an empty stringjava.lang.ClassCastException
- is
if the element associated with the
specified id is not a diagramcom.ibm.xtools.emf.index.search.IIndexSearchManager
org.eclipse.gmf.runtime.notation.Diagram findDiagram(org.eclipse.uml2.uml.Element root, java.lang.String id, org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.InterruptedException
id
.
The search is performed in the model specified by model
root
- The root element of the UML model where to perform the searchid
- The ID of the diagram to matchjava.lang.InterruptedException
- The query operation was interruptedjava.lang.IllegalArgumentException
- is
is an empty stringjava.lang.ClassCastException
- is
if the element associated with the
specified id is not a diagramcom.ibm.xtools.emf.index.search.IIndexSearchManager
java.util.Set<org.eclipse.gmf.runtime.notation.Diagram> findDiagramByName(org.eclipse.uml2.uml.Element container, java.lang.String name, org.eclipse.core.runtime.IProgressMonitor monitor) throws java.lang.InterruptedException
name
and type
respectively. The search
begins at the element specified by container
and recurses
within its owned elementscontainer
- The root Element
where to perform the searchname
- The name of the Diagram
to matchmonitor
- The monitor to use to display progress and/or cancel operationDiagrams
matching the specified criteriajava.lang.InterruptedException
- The query operation was interruptedjava.lang.IllegalArgumentException
- name
is an empty stringjava.lang.NullPointerException
- One of the passed parameters was null
com.ibm.xtools.emf.index.search.IIndexSearchManager
java.util.List<org.eclipse.gmf.runtime.notation.Edge> createEdges(org.eclipse.gmf.runtime.notation.Diagram diagram, org.eclipse.uml2.uml.Relationship element)
diagram
- The diagram to created edges inelement
- The relationship elementEdge
s