com.telelogic.rhapsody.core
Interface IRPStatechart

All Superinterfaces:
IRPClass, IRPClassifier, IRPModelElement, IRPUnit
All Known Subinterfaces:
IRPFlowchart

public interface IRPStatechart
extends IRPClass

The IRPStatechart interface represents the statechart elements underlying a statechart. The statechart itself is represented by the IRPStatechartDiagram interface. You can create an IRPStatechart object with the method IRPClass.addStatechart().


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 statechart, 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 statechart, 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 statechart to represent the specified model element.
 IRPGraphNode addNewNodeByType(java.lang.String metaType, int xPosition, int yPosition, int nWidth, int nHeight)
          Adds a statechart element of the specified type to the statechart, using the position and dimensions specified.
 IRPGraphNode addNewNodeForElement(IRPModelElement element, int xPosition, int yPosition, int nWidth, int nHeight)
          Adds a graphical element to the statechart 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 statechart.
 void createGraphics()
          Creates the graphical representation of the elements in the statechart.
 void deleteState(IRPState state)
          Deletes the specified state from the statechart.
 int findTrigger(IRPInterfaceItem Item)
          Checks whether the specified IRPInterfaceItem element serves as the trigger of a transition in the statechart.
 IRPCollection getAllTriggers()
          Returns a collection of all the triggers in the statechart
 IRPCollection getElementsInDiagram()
          Returns a collection of all of the elements in the statechart.
 IRPCollection getGraphicalElements()
          Returns a collection of all the graphical elements in the statechart.
 IRPStatechart getInheritsFrom()
          Returns the statechart of the base class of this class.
 int getIsMainBehavior()
          Checks whether the statechart is the main behavior for the class.
 int getIsOverridden()
          Checks whether the inheritance relationship between this statechart and the statechart of the base class was overridden.
 IRPClassifier getItsClass()
          Returns the class that the statechart is associated with.
 void getPicture(java.lang.String filename)
          Saves the statechart 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 statechart in the specified graphic format, breaking the diagram into a number of files if necessary.
 IRPCollection getPictureAsDividedMetafiles(java.lang.String firstFileName)
          Saves the statechart as an emf format file, breaking the diagram into a number of such files if necessary.
 IRPCollection getPicturesWithImageMap(java.lang.String firstFileName, IRPCollection diagrammap)
          Saves the statechart as an emf format file, breaking the diagram into a number of files if necessary.
 IRPState getRootState()
          Returns the root state of the statechart.
 IRPStatechartDiagram getStatechartDiagram()
          Returns the IRPStatechartDiagram object associated with the statechart.
 IRPAXViewCtrl openDiagramView()
          Used internally by Rational Rhapsody to display diagrams within Eclipse (when using the Rhapsody-Eclipse platform integration).
 void overrideInheritance()
          Breaks the inheritance relationship between this statechart and the statechart of the base class.
 void populateDiagram(IRPCollection elementsToPopulate, IRPCollection relationsTypes, java.lang.String createContent)
          Populates the statechart with the elements and types of relations specified.
 void setAsMainBehavior()
          Specifies that this statechart should be the main behavior for the class.
 void setShowDiagramFrame(int bShow)
          Shows/hides the diagram frame.
 void unoverrideInheritance()
          Restores the inheritance relationship between this statechart and the statechart of the base class.
 
Methods inherited from interface com.telelogic.rhapsody.core.IRPClass
addClass, addConstructor, addDestructor, addEventReception, addLink, addLinkToPartViaPort, addReception, addSuperclass, addTriggeredOperation, addType, deleteClass, deleteConstructor, deleteDestructor, deleteEventReception, deleteReception, deleteSuperclass, deleteType, getIsAbstract, getIsActive, getIsBehaviorOverriden, getIsComposite, getIsFinal, getIsReactive, setIsAbstract, setIsActive, setIsBehaviorOverriden, setIsFinal
 
Methods inherited from interface com.telelogic.rhapsody.core.IRPClassifier
addActivityDiagram, addAttribute, addFlowItems, addFlows, addGeneralization, addOperation, addRelation, addRelationTo, addStatechart, addUnidirectionalRelation, addUnidirectionalRelationTo, deleteAttribute, deleteFlowItems, deleteFlows, deleteGeneralization, deleteOperation, deleteRelation, findAttribute, findBaseClassifier, findDerivedClassifier, findGeneralization, findInterfaceItem, findNestedClassifier, findNestedClassifierRecursive, findRelation, findTrigger, getActivityDiagram, getAttributes, getAttributesIncludingBases, getBaseClassifiers, getBehavioralDiagrams, getDerivedClassifiers, getFlowItems, getFlows, getGeneralizations, getInterfaceItems, getInterfaceItemsIncludingBases, getLinks, getNestedClassifiers, getOperations, getPorts, getRelations, getRelationsIncludingBases, getSequenceDiagrams, getSourceArtifacts, getStatechart
 
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 statechart, 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 statechart, 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 statechart by carrying out two steps: 1) adding the new element to your model 2) adding a graphical representation of the element to the statechart using the method IRPStatechart.addNewEdgeForElement.

Parameters:
metaType - the type of connector element to add to the statechart. 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 statechart
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 statechart to represent the specified model element.

Parameters:
element - the model element to add to the statechart.
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 statechart

addNewNodeByType

IRPGraphNode addNewNodeByType(java.lang.String metaType,
                              int xPosition,
                              int yPosition,
                              int nWidth,
                              int nHeight)
Adds a statechart element of the specified type to the statechart, using the position and dimensions specified. Note that this method can only be used for statechart elements that only have graphical representations and are not actual elements in the model. "Ordinary" model elements are added to a statechart by carrying out two steps: 1) adding the new element to your model 2) adding a graphical representation of the element to the statechart using the method IRPStatechart.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), "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 statechart
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 statechart to represent the specified model element. For connector elements, use the method addNewEdgeForElement.

Parameters:
element - the model element to add to the statechart.
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 statechart

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 statechart.


createGraphics

void createGraphics()
Creates the graphical representation of the elements in the statechart. When you create a statechart with the API, the graphical representation is not created by default. This means that the first time you open the statechart in Rational Rhapsody, you will be asked if the graphics should be created. You can create the graphical representation directly by calling createGraphics().


deleteState

void deleteState(IRPState state)
Deletes the specified state from the statechart.

Parameters:
state - the state to delete

findTrigger

int findTrigger(IRPInterfaceItem Item)
Checks whether the specified IRPInterfaceItem element serves as the trigger of a transition in the statechart.

Parameters:
Item - the IRPInterfaceItem element to check
Returns:
1 if the specified element serves as the trigger of a transition in the statechart, 0 otherwise

getAllTriggers

IRPCollection getAllTriggers()
Returns a collection of all the triggers in the statechart

Returns:
all of the triggers in the statechart

getElementsInDiagram

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

Returns:
all of the elements in the statechart

getGraphicalElements

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

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

getInheritsFrom

IRPStatechart getInheritsFrom()
Returns the statechart of the base class of this class.

Returns:
the statechart of the base class of this class

getIsMainBehavior

int getIsMainBehavior()
Checks whether the statechart is the main behavior for the class. Rational Rhapsody allows you to define multiple statecharts and activities. One of these is defined as the "main" behavior, which is executed and can then reference other statecharts and activities.

Returns:
1 if the statechart is the main behavior, 0 otherwise

getIsOverridden

int getIsOverridden()
Checks whether the inheritance relationship between this statechart and the statechart of the base class was overridden.

Returns:
1 if the inheritance relationship between the statecharts was overridden, 0 if the relationship still exists.

getItsClass

IRPClassifier getItsClass()
Returns the class that the statechart is associated with.

Returns:
the class that the statechart is associated with

getPicture

void getPicture(java.lang.String filename)
Saves the statechart 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 statechart 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 statechart 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

getPicturesWithImageMap

IRPCollection getPicturesWithImageMap(java.lang.String firstFileName,
                                      IRPCollection diagrammap)
Saves the statechart 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

getRootState

IRPState getRootState()
Returns the root state of the statechart. To create a top-level state in a statechart, you add it to the root state.

Returns:
the root state of the statechart

getStatechartDiagram

IRPStatechartDiagram getStatechartDiagram()
Returns the IRPStatechartDiagram object associated with the statechart.

Returns:
the IRPStatechartDiagram object associated with the statechart

overrideInheritance

void overrideInheritance()
Breaks the inheritance relationship between this statechart and the statechart of the base class.


populateDiagram

void populateDiagram(IRPCollection elementsToPopulate,
                     IRPCollection relationsTypes,
                     java.lang.String createContent)
Populates the statechart 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

setAsMainBehavior

void setAsMainBehavior()
Specifies that this statechart should be the main behavior for the class. Rational Rhapsody allows you to define multiple statecharts and activities. One of these is defined as the "main" behavior, which is executed and can then reference other statecharts and activities.


setShowDiagramFrame

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

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

unoverrideInheritance

void unoverrideInheritance()
Restores the inheritance relationship between this statechart and the statechart of the base class.