|
UML Modeling Layer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IUMLDiagramHelper
This class provides API for manipulating UML diagrams.
| Method Summary | |
|---|---|
boolean |
canCreateViews(Diagram diagram,
List<?> objects)
Returns whether views can be created for the objects specified by objects in the diagram specified by diagram |
Diagram |
createDiagram(Namespace container,
UMLDiagramKind kind)
Creates a UML diagram with a given kind and inserts it into a given container |
Diagram |
createDiagram(Namespace container,
UMLDiagramKind kind,
Element context)
Creates a UML diagram with a given context and kind and inserts it into a given container |
Edge |
createEdge(View source,
View target,
Element element)
Creates an edge for a given element and connects it between a given source and a given target |
Edge |
createEdge(View source,
View target,
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" |
List<Edge> |
createEdges(Diagram diagram,
Relationship element)
Creates diagram edges between the related elements of a relationship |
Node |
createNode(View container,
Element element)
Creates a node for a given element and inserts it into a given container |
Node |
createNode(View container,
String type)
Creates a node with a given type and inserts it into a given container basic types are "Note" "Text" "DiagramName" "DiagramLink" |
List<View> |
createViews(Diagram diagram,
List<?> objects)
Creates views for the objects specified by objects in the
diagram specified by diagram. |
void |
destroyView(View view)
Destroys a given view |
Diagram |
findDiagram(Element root,
String id,
IProgressMonitor monitor)
Finds diagram whose ID matches exactly the specified id. |
Diagram |
findDiagramById(Model model,
String id,
IProgressMonitor monitor)
Deprecated. Since 7.5, use the IUMLDiagramHelper.findDiagram(Element, String, IProgressMonitor)
method, instead. |
Set<Diagram> |
findDiagramByName(Element container,
String name,
IProgressMonitor monitor)
Finds the diagrams whose name and type match exactly the specified name and type respectively. |
View |
getChildView(View container,
String type)
Gets the child view with a given type from a given view |
List<Diagram> |
getDiagrams(Namespace element)
Gets a list of diagrams for a given element |
List<Diagram> |
getDiagrams(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(Node node)
getLayoutNode Gets the ILayoutNode in order to retrieve the actual size of the Node object irrespective of the autosize properties. |
Diagram |
getMainDiagram(Namespace element)
Gets the main diagram of an element |
UMLDiagramKind |
getUmlDiagramKind(Diagram diagram)
Retrieves the UMLDiagramKind of the specified diagram |
void |
layout(View view,
String hint)
layout Utility method to layout the children of a view container. |
void |
layoutNodes(List<? extends Node> nodes,
String hint)
layoutNodes Utility method to layout a list of Node children on a diagram. |
void |
openDiagramEditor(Diagram diagram)
Opens an editor for a given diagram |
Image |
renderToAWTImage(Diagram diagram)
renderToAWTImage Utility api to generate an AWT based image representation of the diagram contents. |
void |
renderToImageFile(Diagram diagram,
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. |
Image |
renderToSWTImage(Diagram diagram)
renderToSWTImage Utility api to generate an SWT based image representation of the diagram contents. |
void |
setMainDiagram(Namespace element,
Diagram diagram)
Sets the main diagram of an element |
| Method Detail |
|---|
Diagram createDiagram(Namespace container,
UMLDiagramKind kind)
container - The container namespace for the diagramkind - The UML diagram kind
Diagram
Diagram createDiagram(Namespace container,
UMLDiagramKind kind,
Element context)
container - The container namespace for the diagramcontext - The UML diagram element contextkind - The UML diagram kind
Diagram
Node createNode(View container,
Element element)
container - The node view containerelement - The node view element context
Node
Node createNode(View container,
String type)
container - The node view containertype - The node view type
Node
Edge createEdge(View source,
View target,
Element element)
source - The edge's source viewtarget - The edge's target viewelement - The edge view element context
Edge
Edge createEdge(View source,
View target,
String type)
source - The edge's source viewtarget - The edge's target viewtype - The edge view type
Edgevoid destroyView(View view)
view - The view to be destroyedvoid openDiagramEditor(Diagram diagram)
diagram - The diagram to be openedList<Diagram> getDiagrams(Namespace element)
element - The namespace element
Diagram s
List<Diagram> getDiagrams(Namespace element,
UMLDiagramKind kind)
element - The namespace elementkind - The diagram kind
Diagram sDiagram getMainDiagram(Namespace element)
element - The namespace element
Diagram
void setMainDiagram(Namespace element,
Diagram diagram)
element - The namespace elementdiagram - The main diagram
View getChildView(View container,
String type)
container - The container viewtype - The type of the child view
ViewUMLDiagramKind getUmlDiagramKind(Diagram diagram)
diagram - The diagram to retrieve the UMLDiagramKind for
void renderToImageFile(Diagram diagram,
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 formats
NullPointerException - diagram is null
NullPointerException - file is null
NullPointerException - format is null
IllegalArgumentException - file is an empty string
UnsupportedOperationException - Unable to render diagram to
formatImage renderToAWTImage(Diagram diagram)
diagram - The Diagram to render the image from.
NullPointerException - diagram is nullImage renderToSWTImage(Diagram diagram)
diagram - The Diagram to render the image from.
NullPointerException - diagram is nullorg.eclipse.gmf.runtime.diagram.ui.services.layout.ILayoutNode getLayoutNode(Node node)
node - Node to get the layout node equivalent from
NullPointerException - node is null
void layout(View view,
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 of
NullPointerException - view is null
NullPointerException - hint is nullLayoutType.DEFAULT,
Other values would have to understand by custom providers.,
ILayoutNodeProvider
void layoutNodes(List<? extends Node> nodes,
String hint)
nodes - List of Node objectshint - String representing a hint for what kind of layout will be
applied. Value can be one of
NullPointerException - nodes is null
IllegalArgumentException - nodes is an empty list
NullPointerException - hint is null
IllegalArgumentException - Argument nodes contains objects which aren't
of type Node
IllegalArgumentException - Argument nodes contains objects which have a
different parent containmentLayoutType.DEFAULT,
Other values would have to understand by custom providers.,
ILayoutNodeProvider
List<View> createViews(Diagram diagram,
List<?> objects)
objects in the
diagram specified by diagram.
diagram - The diagram where to add views toobjects - The objects to add views for
NullPointerException - diagram or object is null
IllegalArgumentException - diagram has no associated edit part (internal
error)
boolean canCreateViews(Diagram diagram,
List<?> objects)
objects in the diagram specified by diagram
diagram - The diagram where to add a views toobjects - The objects to add views for
true if at least one object can be viewed in the
specified diagram
NullPointerException - diagram or objects is null
@Deprecated
Diagram findDiagramById(Model model,
String id,
IProgressMonitor monitor)
throws InterruptedException
IUMLDiagramHelper.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 match
InterruptedException - The query operation was interrupted
IllegalArgumentException - is is an empty string
ClassCastException - is if the element associated with the
specified id is not a diagramcom.ibm.xtools.emf.index.IIndexSearchManager
Diagram findDiagram(Element root,
String id,
IProgressMonitor monitor)
throws 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 match
InterruptedException - The query operation was interrupted
IllegalArgumentException - is is an empty string
ClassCastException - is if the element associated with the
specified id is not a diagramcom.ibm.xtools.emf.index.IIndexSearchManager
Set<Diagram> findDiagramByName(Element container,
String name,
IProgressMonitor monitor)
throws InterruptedException
name and type respectively. The search
begins at the element specified by container and recurses
within its owned elements
container - 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 operation
Diagrams matching the specified criteria
InterruptedException - The query operation was interrupted
IllegalArgumentException - name is an empty string
NullPointerException - One of the passed parameters was nullcom.ibm.xtools.emf.index.IIndexSearchManager
List<Edge> createEdges(Diagram diagram,
Relationship element)
diagram - The diagram to created edges inelement - The relationship element
Edge s
|
UML Modeling Layer | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||