|
Modelers | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.topcased.modeler.utils.Utils
public final class Utils
Helper class to manage the graph model.
creation : 10 d�c. 2004
Method Summary | |
---|---|
static GraphEdge |
createGraphEdge(java.lang.String type)
Creates a graph edge NOT linked with a model object |
static GraphEdge |
createGraphEdge(java.lang.String type,
java.lang.String presentation)
Creates a graph edge NOT linked with a model object |
static GraphNode |
createGraphNode(java.lang.String type)
Creates a graph node NOT linked with a model object |
static GraphNode |
createGraphNode(java.lang.String type,
java.lang.String presentation)
Creates a graph node NOT linked with a model object |
static void |
exposeLocation(org.eclipse.draw2d.FigureCanvas canvas,
org.eclipse.draw2d.geometry.Point location)
This api will expose the diagram at the location given in absolute co-ordinates. |
static org.eclipse.swt.graphics.Color |
getBackgroundColor(GraphElement graphElement)
Returns the background Color of the Figure |
static Diagram |
getDiagram(GraphElement graphElement)
Used to get the Diagram node of a given graphElement |
static EObject |
getDiagramModelObject(GraphElement graphElement)
Used to get the model object that is the root of the current diagram |
static Diagram[] |
getDiagrams(GraphElement[] graphElements)
Used to get the Diagrams of GraphElements |
static EdgeGraphConf |
getEdgeGraphConf(DiagramGraphConf diagGraphConf,
EObject modelObject,
java.lang.String presentation)
Search in the DiagramGraphConf the first EdgeGraphConf with the corresponding EClass and presentation that validate all the constraints when they exist |
static java.util.List |
getEdges(GraphElement gElt)
Get the list of the incoming/outgoing connections |
static EObject |
getElement(GraphElement graphElt)
Returns the model object linked with the given graph element (If the bridge is an EMFSemanticModelBridge) |
static org.eclipse.swt.graphics.Font |
getFont(DiagramElement diagElement)
Get the Font corresponding to a DiagramElement |
static org.eclipse.swt.graphics.Color |
getForegroundColor(GraphElement graphElement)
Returns the foreground Color of the Figure |
static GraphElement |
getGraphElement(GraphElement container,
EObject model)
Returns the GraphElement child associated with the given model object |
static GraphElement |
getGraphElement(GraphElement container,
EObject model,
boolean deepSearch)
Returns the GraphElement child associated with the given model object |
static GraphElement[] |
getGraphElements(Diagrams diagrams,
EObject model)
Returns the graphElements associated with the given EObject in all the diagrams |
static java.util.List |
getGraphElements(GraphElement container,
EObject model,
boolean deepSearch)
Returns the GraphElement children associated with the given model object |
static NodeGraphConf |
getNodeGraphConf(DiagramGraphConf diagGraphConf,
EObject modelObject,
java.lang.String presentation)
Search in the DiagramGraphConf the first NodeGraphConf with the corresponding EClass and presentation that validate all the constraints when they exist |
static EList |
getOwnerList(EObject owner,
EStructuralFeature feat)
Returns the EList associated with the given feature for the given EMF object. |
static GraphElement |
getSource(GraphEdge gEdge)
Get the source GraphElement for the given connection |
static java.util.List<GraphEdge> |
getSourceEdges(GraphElement gElt)
Get the list of the outgoing connection |
static GraphElement |
getTarget(GraphEdge gEdge)
Get the target GraphElement for the given connection |
static java.util.List |
getTargetEdges(GraphElement gElt)
Get the list of the incoming connection |
static java.lang.String |
getTypeInfo(GraphElement graphElt)
Returns the type info associated with the given graph element (If the bridge is a SimpleSemanticModelBridge) |
static boolean |
isChild(GraphElement parent,
GraphElement child)
Check if an object is a child of an other object |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static EList getOwnerList(EObject owner, EStructuralFeature feat)
owner
- The EMF Objectfeat
- The list feature
null
if the feature cannot be found or it is not a multiple feature.public static EObject getElement(GraphElement graphElt)
graphElt
- the graph element
null
if unable to find a model
object.public static GraphElement getGraphElement(GraphElement container, EObject model)
container
- the graph containermodel
- the model EObject
null
if no child can be found.public static GraphElement getGraphElement(GraphElement container, EObject model, boolean deepSearch)
container
- the graph containermodel
- the model EObjectdeepSearch
- a boolean indicating if the search process must be recursive
null
if no child can be found.public static java.util.List getGraphElements(GraphElement container, EObject model, boolean deepSearch)
container
- the graph containermodel
- the model EObjectdeepSearch
- a boolean indicating if the search process must be recursive
public static GraphElement[] getGraphElements(Diagrams diagrams, EObject model)
diagrams
- the Diagrams objectmodel
- the searched EObject
public static java.lang.String getTypeInfo(GraphElement graphElt)
graphElt
- the graph element
null
if unable to find a type
info (it is not a SimpleSemanticModelBridge).public static GraphNode createGraphNode(java.lang.String type)
type
- the identifier of the node
public static GraphNode createGraphNode(java.lang.String type, java.lang.String presentation)
type
- the identifier of the nodepresentation
- the presentation of the graphical element
public static GraphEdge createGraphEdge(java.lang.String type)
type
- the identifier of the edge
public static GraphEdge createGraphEdge(java.lang.String type, java.lang.String presentation)
type
- the identifier of the edgepresentation
- the presentation of the graphical element
public static org.eclipse.swt.graphics.Color getBackgroundColor(GraphElement graphElement)
graphElement
-
public static org.eclipse.swt.graphics.Color getForegroundColor(GraphElement graphElement)
graphElement
-
public static org.eclipse.swt.graphics.Font getFont(DiagramElement diagElement)
diagElement
-
public static GraphElement getTarget(GraphEdge gEdge)
gEdge
- the connection
public static GraphElement getSource(GraphEdge gEdge)
gEdge
- the connection
public static boolean isChild(GraphElement parent, GraphElement child)
parent
- the parent graph elementchild
- the possible child element
public static java.util.List getEdges(GraphElement gElt)
gElt
- the graphical element
public static java.util.List<GraphEdge> getSourceEdges(GraphElement gElt)
gElt
- the source element
public static java.util.List getTargetEdges(GraphElement gElt)
gElt
- the source element
public static EObject getDiagramModelObject(GraphElement graphElement)
graphElement
-
public static Diagram getDiagram(GraphElement graphElement)
graphElement
-
public static Diagram[] getDiagrams(GraphElement[] graphElements)
graphElements
- the elements to have the diagram
public static void exposeLocation(org.eclipse.draw2d.FigureCanvas canvas, org.eclipse.draw2d.geometry.Point location)
canvas
- location
- public static NodeGraphConf getNodeGraphConf(DiagramGraphConf diagGraphConf, EObject modelObject, java.lang.String presentation)
diagGraphConf
- the DiagramGraphConf that contains all the NodeGraphConf objectsmodelObject
- the model object that should correspond to a NodeGraphConfpresentation
- the presentation to match
public static EdgeGraphConf getEdgeGraphConf(DiagramGraphConf diagGraphConf, EObject modelObject, java.lang.String presentation)
diagGraphConf
- the DiagramGraphConf that contains all the EdgeGraphConf objectsmodelObject
- the model object that should correspond to an EdgeGraphConfpresentation
- the presentation to match
|
Modelers | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.