com.telelogic.rhapsody.core
Interface IRPDiagram

All Superinterfaces:
IRPModelElement, IRPUnit
All Known Subinterfaces:
IRPActivityDiagram, IRPCollaborationDiagram, IRPComponentDiagram, IRPDeploymentDiagram, IRPObjectModelDiagram, IRPPanelDiagram, IRPSequenceDiagram, IRPStatechartDiagram, IRPStructureDiagram, IRPTimingDiagram, IRPUseCaseDiagram

public interface IRPDiagram
extends IRPUnit

The IRPDiagram interface contains the methods shared by all the interfaces that represent specific types of diagrams.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.telelogic.rhapsody.core.IRPModelElement
IRPModelElement.OSLCLink
 
Method Summary
 IRPGraphElement addFreeShapeByType(java.lang.String metaType, IRPCollection xPoints, IRPCollection yPoints)
          Adds a free shape of the type specified, using the x coordinates and y coordinates provided.
 IRPGraphElement addImage(java.lang.String filename, int xPosition, int yPosition, int nWidth, int nHeight)
          Adds an image to the diagram, using the specified file, starting point, width, and height.
 IRPGraphEdge addNewEdgeByType(java.lang.String metaType, IRPGraphElement src, int xSrcPosition, int ySrcPosition, IRPGraphElement trg, int xTrgPosition, int yTrgPosition)
          Adds a connector element of the specified type to the diagram, using the source and target elements specified.
 IRPGraphEdge addNewEdgeForElement(IRPModelElement element, IRPGraphNode src, int xSrcPosition, int ySrcPosition, IRPGraphNode trg, int xTrgPosition, int yTrgPosition)
          Adds a connector graphical element to the diagram to represent the specified model element.
 IRPGraphNode addNewNodeByType(java.lang.String metaType, int xPosition, int yPosition, int nWidth, int nHeight)
          Adds a diagram element of the specified type to the diagram, using the position and dimensions specified.
 IRPGraphNode addNewNodeForElement(IRPModelElement element, int xPosition, int yPosition, int nWidth, int nHeight)
          Adds a graphical element to the diagram to represent the specified model element.
 IRPGraphElement addTextBox(java.lang.String text, int xPosition, int yPosition, int nWidth, int nHeight)
          Adds a text box using the specified text, starting point, width, and height.
 void closeDiagram()
          Closes the diagram.
 void completeRelations(IRPCollection graphElements, int selectedToAll)
          Adds connectors to the diagram to reflect the existing relations between the specified elements.
 IRPCollection getCorrespondingGraphicElements(IRPModelElement modelElement)
          Returns the graphical elements that represent the specified model element in the diagram.
 IRPCollection getElementsInDiagram()
          Returns a collection of all the model elements in the diagram.
 IRPCollection getGraphicalElements()
          Returns a collection of all the graphical elements in the diagram.
 java.lang.String getLastVisualizationModifiedTime()
          Returns the time at which the visual representation of the diagram was last changed.
 void getPicture(java.lang.String filename)
          Saves the diagram as an emf format file, using the path and filename provided as a parameter.
 IRPCollection getPictureAs(java.lang.String firstFileName, java.lang.String imageFormat, int getImageMaps, IRPCollection diagrammap)
          Saves the diagram in the specified graphic format, breaking the diagram into a number of files if necessary.
 IRPCollection getPictureAsDividedMetafiles(java.lang.String firstFileName)
          Saves the diagram as an emf format file, breaking the diagram into a number of such files if necessary.
 void getPictureEx(java.lang.String filename, java.lang.String exportScale, int smartZoom)
          method getPictureEx
 IRPCollection getPicturesWithImageMap(java.lang.String firstFileName, IRPCollection diagrammap)
          Saves the diagram as an emf format file, breaking the diagram into a number of files if necessary.
 int isOpen()
          method isOpen
 int isShowDiagramFrame()
          Checks whether the diagram frame is currently visible.
 void openDiagram()
          Opens the diagram.
 IRPAXViewCtrl openDiagramView()
          Used internally by Rational Rhapsody to display diagrams within Eclipse (when using the Rhapsody-Eclipse platform integration).
 void populateDiagram(IRPCollection elementsToPopulate, IRPCollection relationsTypes, java.lang.String createContent)
          Populates the diagram with the elements and types of relations specified.
 void removeGraphElements(IRPCollection elementsToRemove)
          Removes the specified graphic elements from the diagram.
 void setShowDiagramFrame(int bShow)
          Shows/hides the diagram frame.
 
Methods inherited from interface com.telelogic.rhapsody.core.IRPUnit
copyToAnotherProject, getAddToModelMode, getCMHeader, getCMState, getCurrentDirectory, getFilename, getIncludeInNextLoad, getIsStub, getLanguage, getLastModifiedTime, getNestedSaveUnits, getNestedSaveUnitsCount, getStructureDiagrams, isReadOnly, isReferenceUnit, isSeparateSaveUnit, load, moveToAnotherProjectLeaveAReference, referenceToAnotherProject, save, setCMHeader, setFilename, setIncludeInNextLoad, setLanguage, setReadOnly, setSeparateSaveUnit, setUnitPath, unload
 
Methods inherited from interface com.telelogic.rhapsody.core.IRPModelElement
addAssociation, addDependency, addDependencyBetween, addDependencyTo, addLinkToElement, addNewAggr, addProperty, addRedefines, addRemoteDependencyTo, addSpecificStereotype, addStereotype, becomeTemplateInstantiationOf, changeTo, clone, createOSLCLink, deleteDependency, deleteFromProject, deleteOSLCLink, errorMessage, findElementsByFullName, findNestedElement, findNestedElementRecursive, getAllTags, getAnnotations, getAssociationClasses, getBinaryID, getConstraints, getConstraintsByHim, getControlledFiles, getDecorationStyle, getDependencies, getDescription, getDescriptionHTML, getDescriptionPlainText, getDescriptionRTF, getDisplayName, getDisplayNameRTF, getErrorMessage, getFullPathName, getFullPathNameIn, getGUID, getHyperLinks, getIconFileName, getInterfaceName, getIsExternal, getIsOfMetaClass, getIsShowDisplayName, getIsUnresolved, getLocalTags, getMainDiagram, getMetaClass, getName, getNestedElements, getNestedElementsByMetaClass, getNestedElementsRecursive, getNewTermStereotype, getOfTemplate, getOSLCLinks, getOverlayIconFileName, getOverriddenProperties, getOverriddenPropertiesByPattern, getOwnedDependencies, getOwner, getProject, getPropertyValue, getPropertyValueConditional, getPropertyValueConditionalExplicit, getPropertyValueExplicit, getRedefines, getReferences, getRemoteDependencies, getRemoteURI, getRequirementTraceabilityHandle, getSaveUnit, getStereotype, getStereotypes, getTag, getTemplateParameters, getTi, getToolTipHTML, getUserDefinedMetaClass, hasNestedElements, hasPanelWidget, highLightElement, isATemplate, isDescriptionRTF, isDisplayNameRTF, isModified, isRemote, locateInBrowser, lockOnDesignManager, openFeaturesDialog, removeProperty, removeRedefines, removeStereotype, setDecorationStyle, setDescription, setDescriptionAndHyperlinks, setDescriptionHTML, setDescriptionRTF, setDisplayName, setDisplayNameRTF, setGUID, setIsShowDisplayName, setMainDiagram, setName, setOfTemplate, setOwner, setPropertyValue, setRequirementTraceabilityHandle, setStereotype, setTagContextValue, setTagElementValue, setTagValue, setTi, synchronizeTemplateInstantiation, unlockOnDesignManager
 

Method Detail

addFreeShapeByType

IRPGraphElement addFreeShapeByType(java.lang.String metaType,
                                   IRPCollection xPoints,
                                   IRPCollection yPoints)
Adds a free shape of the type specified, using the x coordinates and y coordinates provided.

Parameters:
metaType - the type of shape to add. The possible values for this parameter are: "Polyline", "Polygon", "Rectangle", "Polycurve", "Closed Curve", "Ellipse".
xPoints - collection of integers representing the x coordinates for the shape
yPoints - collection of integers representing the y coordinates for the shape
Returns:
the new shape that was created

addImage

IRPGraphElement addImage(java.lang.String filename,
                         int xPosition,
                         int yPosition,
                         int nWidth,
                         int nHeight)
Adds an image to the diagram, using the specified file, starting point, width, and height.

Parameters:
filename - the full path to the image
xPosition - the x coordinate for the top left corner of the image, in pixels
yPosition - the y coordinate for the top left corner of the image, in pixels
nWidth - the width of the image, in pixels
nHeight - the height of the image, in pixels
Returns:
the new image element that was created

addNewEdgeByType

IRPGraphEdge addNewEdgeByType(java.lang.String metaType,
                              IRPGraphElement src,
                              int xSrcPosition,
                              int ySrcPosition,
                              IRPGraphElement trg,
                              int xTrgPosition,
                              int yTrgPosition)
Adds a connector element of the specified type to the diagram, using the source and target elements specified. Note that this method can only be used for connector elements that only have graphical representations and are not actual elements in the model. "Ordinary" connector elements are added to a diagram by carrying out two steps: 1) adding the new element to your model 2) adding a graphical representation of the element to the diagram using the method IRPDiagram.addNewEdgeForElement.

Parameters:
metaType - the type of connector element to add to the diagram. The strings that can be used for this parameter are: "anchor", "compRealization", "Containment Arrow", and "communication path".
src - the graphical element that is the source for the connector
xSrcPosition - the distance, in pixels, from the the left edge of the diagram to a point within the source graphical element
ySrcPosition - the distance, in pixels, from the the top edge of the diagram to a point within the source graphical element
trg - the graphical element that is the target for the connector
xTrgPosition - the distance, in pixels, from the the left edge of the diagram to a point within the target graphical element
yTrgPosition - the distance, in pixels, from the the top edge of the diagram to a point within the target graphical element
Returns:
the graphical element that was added to the diagram
See Also:
addNewEdgeForElement(com.telelogic.rhapsody.core.IRPModelElement, com.telelogic.rhapsody.core.IRPGraphNode, int, int, com.telelogic.rhapsody.core.IRPGraphNode, int, int)

addNewEdgeForElement

IRPGraphEdge addNewEdgeForElement(IRPModelElement element,
                                  IRPGraphNode src,
                                  int xSrcPosition,
                                  int ySrcPosition,
                                  IRPGraphNode trg,
                                  int xTrgPosition,
                                  int yTrgPosition)
Adds a connector graphical element to the diagram to represent the specified model element.

Parameters:
element - the model element to add to the diagram.
src - the graphical element that is the source for the connector
xSrcPosition - the distance, in pixels, from the the left edge of the diagram to a point within the source graphical element
ySrcPosition - the distance, in pixels, from the the top edge of the diagram to a point within the source graphical element
trg - the graphical element that is the target for the connector
xTrgPosition - the distance, in pixels, from the the left edge of the diagram to a point within the target graphical element
yTrgPosition - the distance, in pixels, from the the top edge of the diagram to a point within the target graphical element
Returns:
the connector graphical element that was added to the diagram

addNewNodeByType

IRPGraphNode addNewNodeByType(java.lang.String metaType,
                              int xPosition,
                              int yPosition,
                              int nWidth,
                              int nHeight)
Adds a diagram element of the specified type to the diagram, using the position and dimensions specified. Note that this method can only be used for diagram elements that only have graphical representations and are not actual elements in the model. "Ordinary" model elements are added to a diagram by carrying out two steps: 1) adding the new element to your model 2) adding a graphical representation of the element to the diagram using the method IRPDiagram.addNewNodeForElement.

Parameters:
metaType - the type of element to add to the diagram. The strings that can be used for this parameter are: "OrState"(for And Line), "Interaction Operand", "Swimlane" (for swimlane divider), "System Border", "PartitionLine", "SDActionBlock" (for action block in sequence diagram), "Note"; panel diagram elements: "Knob", "Gauge", "Meter", "LevelIndicator", "MatrixDisplay", "DigitalDisplay", "Led", "OnOffSwitch", "PushButton", "ButtonArray", "TextBox", "Slider"; free shapes: "Polyline", "Ploygon", "Rectangle", "Polycurve", "Closed Curve","Ellipse","Image".
xPosition - the position of the left edge of the graphical object, in pixels, relative to the left edge of the diagram
yPosition - the position of the top edge of the graphical object, in pixels, relative to the top edge of the diagram
nWidth - the width of the graphical object
nHeight - the height of the graphical object
Returns:
the graphical element that was added to the diagram
See Also:
addNewNodeForElement(com.telelogic.rhapsody.core.IRPModelElement, int, int, int, int)

addNewNodeForElement

IRPGraphNode addNewNodeForElement(IRPModelElement element,
                                  int xPosition,
                                  int yPosition,
                                  int nWidth,
                                  int nHeight)
Adds a graphical element to the diagram to represent the specified model element. For connector elements, use the method addNewEdgeForElement.

Parameters:
element - the model element to add to the diagram.
xPosition - the position of the left edge of the graphical object, in pixels, relative to the left edge of the diagram
yPosition - the position of the top edge of the graphical object, in pixels, relative to the top edge of the diagram
nWidth - the width of the graphical object
nHeight - the height of the graphical object
Returns:
the graphical element that was added to the diagram

addTextBox

IRPGraphElement addTextBox(java.lang.String text,
                           int xPosition,
                           int yPosition,
                           int nWidth,
                           int nHeight)
Adds a text box using the specified text, starting point, width, and height.

Parameters:
text - the text that should be displayed
xPosition - the x coordinate for the top left corner of the box, in pixels
yPosition - the y coordinate for the top left corner of the box, in pixels
nWidth - the width of the text box, in pixels
nHeight - the height of the text box, in pixels
Returns:
the new text box that was created

openDiagramView

IRPAXViewCtrl openDiagramView()
Used internally by Rational Rhapsody to display diagrams within Eclipse (when using the Rhapsody-Eclipse platform integration).


closeDiagram

void closeDiagram()
Closes the diagram.


completeRelations

void completeRelations(IRPCollection graphElements,
                       int selectedToAll)
Adds connectors to the diagram to reflect the existing relations between the specified elements.

Parameters:
graphElements - the elements whose relations should be reflected on the diagram
selectedToAll - Use 0 if you just want to display the relations between the specified elements. Use 1 if you would also like to display any existing relations between the specified elements and other elements on the diagram.

getCorrespondingGraphicElements

IRPCollection getCorrespondingGraphicElements(IRPModelElement modelElement)
Returns the graphical elements that represent the specified model element in the diagram. In cases where the same model element appears multiple times in a single diagram, the collection returned will contain more than one graphical element.

Parameters:
modelElement - the model element in the diagram whose graphical elements should be returned
Returns:
the graphical elements that represent the specified model element in the diagram

getElementsInDiagram

IRPCollection getElementsInDiagram()
Returns a collection of all the model elements in the diagram.

Returns:
collection of all the model elements in the diagram

getGraphicalElements

IRPCollection getGraphicalElements()
Returns a collection of all the graphical elements in the diagram.

Returns:
collection of IRPGraphElement objects, representing all the graphical elements in the diagram.

getLastVisualizationModifiedTime

java.lang.String getLastVisualizationModifiedTime()
Returns the time at which the visual representation of the diagram was last changed. This takes into account not only the information stored in the diagram element itself, but also information from other elements that is reflected on the diagram, for example, changes to an attribute of a class that is included in the diagram.

Returns:
the time at which the visual representation of the diagram was last changed

getPicture

void getPicture(java.lang.String filename)
Saves the diagram as an emf format file, using the path and filename provided as a parameter.

Parameters:
filename - the full path to use for saving the file

getPictureAs

IRPCollection getPictureAs(java.lang.String firstFileName,
                           java.lang.String imageFormat,
                           int getImageMaps,
                           IRPCollection diagrammap)
Saves the diagram in the specified graphic format, breaking the diagram into a number of files if necessary. The need to break the diagram into a number of files is based on the value of the property General:Graphics:ExportedDiagramScale. If the property is set to a value other than FitToOnePage, more than one file will be created. In addition, this method can be used to retrieve diagram element information that can be used to create an HTML image map.

Parameters:
firstFileName - the name to use for the file created. If more than one file is created, the filenames used will be based on the following convention: firstFileNameZ_X_Y, where Z is the number of the created file, X is the number of the page along the X vector, and Y is the number of the page along the Y vector.
imageFormat - the graphic format in which the diagram should be saved. This can be one of the following: EMF, BMP, JPEG, JPG, TIFF.
getImageMaps - use this argument to indicate whether the method should also provide a collection of IRPImageMap objects that can be used to construct an HTML image map for the diagram. (Use 1 if you want this information, else use 0.)
diagrammap - The collection to use to store the IRPImageMap objects containing the required information for constructing an HTML image map
Returns:
collection that contains the names of the files that were created

getPictureAsDividedMetafiles

IRPCollection getPictureAsDividedMetafiles(java.lang.String firstFileName)
Saves the diagram as an emf format file, breaking the diagram into a number of such files if necessary. The need to break the diagram into a number of files is based on the value of the property General:Graphics:ExportedDiagramScale. If the property is set to a value other than FitToOnePage, more than one file will be created.

Parameters:
firstFileName - the name to use for the first file created. If more than one file is created, the filenames used will be based on the following convention: firstFileNameZ_X_Y, where Z is the number of the created file, X is the number of the page along the X vector, and Y is the number of the page along the Y vector.
Returns:
collection that contains the names of the files that were created

getPictureEx

void getPictureEx(java.lang.String filename,
                  java.lang.String exportScale,
                  int smartZoom)
method getPictureEx

Throws:
RhapsodyRuntimeException

getPicturesWithImageMap

IRPCollection getPicturesWithImageMap(java.lang.String firstFileName,
                                      IRPCollection diagrammap)
Saves the diagram as an emf format file, breaking the diagram into a number of files if necessary. The need to break the diagram into a number of files is based on the value of the property General:Graphics:ExportedDiagramScale. If the property is set to a value other than FitToOnePage, more than one file will be created. In addition, this method retrieves diagram element information that can be used to create an HTML image map.

Parameters:
firstFileName - the name to use for the file created. If more than one file is created, the filenames used will be based on the following convention: firstFileNameZ_X_Y, where Z is the number of the created file, X is the number of the page along the X vector, and Y is the number of the page along the Y vector.
diagrammap - The collection to use to store the IRPImageMap objects containing the required information for constructing an HTML image map
Returns:
collection that contains the names of the files that were created

isOpen

int isOpen()
method isOpen

Throws:
RhapsodyRuntimeException

isShowDiagramFrame

int isShowDiagramFrame()
Checks whether the diagram frame is currently visible.

Returns:
1 if the diagram frame is currently visible, 0 if it is not visible

openDiagram

void openDiagram()
Opens the diagram.


populateDiagram

void populateDiagram(IRPCollection elementsToPopulate,
                     IRPCollection relationsTypes,
                     java.lang.String createContent)
Populates the diagram with the elements and types of relations specified.

Parameters:
elementsToPopulate - the elements (nodes) to add to the diagram
relationsTypes - the types of relations that should be drawn on the diagram. You can use the string AllRelations to display all types, or use any combination of the following strings: Composition, Association, Link, Dependency, Inheritance, Anchor, InformationFlow
createContent - the elements that should be included in addition to those specified. This argument can take any of the following strings: among, from, to, fromto. If you use "among", only the elements you specified will be included. If you use one of the other strings, the diagram will also include elements that the selected elements are related to
 IRPApplication app = RhapsodyAppServer.getActiveRhapsodyApplication();
 IRPProject project = app.activeProject();
 IRPCollection packages = project.getPackages();
 IRPCollection relTypes = app.createNewCollection();
 relTypes.setSize(3);
 relTypes.setString(1, "Composition");
 relTypes.setString(2, "Association");
 relTypes.setString(3, "Dependency");
 IRPObjectModelDiagram diagram2 = project.addObjectModelDiagram("PopulateTest1");
 diagram2.populateDiagram(packages, relTypes, "fromto"); 
 
 

removeGraphElements

void removeGraphElements(IRPCollection elementsToRemove)
Removes the specified graphic elements from the diagram.

Parameters:
elementsToRemove - a collection of IRPGraphElement objects, representing the graphic elements that should be removed from the diagram

setShowDiagramFrame

void setShowDiagramFrame(int bShow)
Shows/hides the diagram frame.

Parameters:
bShow - use 1 to show the diagram frame, 0 to hide the frame.