com.telelogic.rhapsody.core
Interface IRPStatechartDiagram

All Superinterfaces:
IRPDiagram, IRPModelElement, IRPUnit
All Known Subinterfaces:
IRPActivityDiagram

public interface IRPStatechartDiagram
extends IRPDiagram

The IRPStatechartDiagram interface represents statecharts in a Rational Rhapsody model.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.telelogic.rhapsody.core.IRPModelElement
IRPModelElement.OSLCLink
 
Method Summary
 IRPCollection addAndLine(IRPGraphNode sourceState, int xStartPosition, int yStartPosition, int xEndPosition, int yEndPosition)
          Adds an And Line to the specified state.
 void createGraphics()
          Creates the graphical representation of the elements in the statechart.
 IRPStatechart getStatechart()
          Returns the IRPStatechart object underlying the statechart.
 
Methods inherited from interface com.telelogic.rhapsody.core.IRPDiagram
addFreeShapeByType, addImage, addNewEdgeByType, addNewEdgeForElement, addNewNodeByType, addNewNodeForElement, addTextBox, closeDiagram, completeRelations, getCorrespondingGraphicElements, getElementsInDiagram, getGraphicalElements, getLastVisualizationModifiedTime, getPicture, getPictureAs, getPictureAsDividedMetafiles, getPictureEx, getPicturesWithImageMap, isOpen, isShowDiagramFrame, openDiagram, openDiagramView, populateDiagram, removeGraphElements, setShowDiagramFrame
 
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

addAndLine

IRPCollection addAndLine(IRPGraphNode sourceState,
                         int xStartPosition,
                         int yStartPosition,
                         int xEndPosition,
                         int yEndPosition)
Adds an And Line to the specified state.

Parameters:
sourceState - the graphical element representing the state to which the And Line should be added
xStartPosition - the x position at which the And Line should begin
yStartPosition - the y position at which the And Line should begin
xEndPosition - the x position at which the And Line should end
yEndPosition - the y position at which the And Line should end
Returns:
a collection of the new orthogonal states created
 IRPApplication app = RhapsodyAppServer.getActiveRhapsodyApplication();
 	IRPProject prj = app.activeProject();
 	IRPPackage vehiclePackage = prj.addPackage("Vehicles");
 	IRPClass carClass = vehiclePackage.addClass("Car");
 	IRPStatechart carStatechart = carClass.addStatechart(); 
 	IRPState rootState = carStatechart.getRootState();
 	IRPState runningState = rootState.addState("Running");
 	IRPStatechartDiagram scDiagram = carStatechart.getStatechartDiagram();
 	IRPGraphNode runningStateNode = scDiagram.addNewNodeForElement(runningState, 100, 100, 400, 400);
 	IRPCollection stateNodesCreated = scDiagram.addAndLine(runningStateNode, 300, 100, 300, 500);
 	IRPGraphNode newStateNodeCreated = null;
 	for (int stateNodeCounter = 1; stateNodeCounter < stateNodesCreated.getCount()+1;stateNodeCounter++ ) {
 		newStateNodeCreated = (IRPGraphNode)stateNodesCreated.getItem(stateNodeCounter);
 		System.out.println(newStateNodeCreated.getModelObject().getName());
 	} 
 
 

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().


getStatechart

IRPStatechart getStatechart()
Returns the IRPStatechart object underlying the statechart.

Returns:
the IRPStatechart object underlying the statechart