facebook

Basic UML sequence diagram questions for MyEclipse

  1. MyEclipse Archived
  2.  > 
  3. UML Development
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #306348 Reply

    kvancamp
    Member

    I’m trying to create some simple sequence diagrams in MyEclipse (using version 7.5). I tried it under UML1 with partial success, but the I don’t like the way it puts the labels on my calls so far away from the arrow, and I can’t figure out how to get the tool to let me drag it closer. I tried it under UML2 but I can’t even figure out how to create a sequence diagram at all in that module. I checked the on-line help and found a tutorial about UML1, but no tuturial on UML2. I did see a comment on the forum from a user doing a sequence diagram with UML2, so apparently it’s possible.

    Help! Which is better for creating sequence diagrams – UML1 or UML2? If UML1, can I get my labels to move? If UML2, how do I get started?

    Thanks.
    Ken

    #306503 Reply

    Ken,
    Please find my comments below,

    Creating a Sequence Diagram using MyEclipse UML2 –
    1) Create a simple Java Project.
    2) Right click context menu->New->UML2 model. This will create a new UML2 model(.uml and .umldi files) in your project. The workbench would automatically switch to the MyEclipse UML2 Perspective and you will be presented with a new UML2 diagram. You may rather like to use the “New UML2 Model” action (blue cube) in the toolbar to create a new UML2 model.
    3) There are two ways you can create a new UML2 Sequence Diagram – a) Using “Add UML2 Diagram” drop down menu in the toolbar(beside the diagrams menu) and b) In the outline view, Select the root Model and Right click context menu->Add Diagram->Sequence diagram.
    4) The above action will add a new UML2 Sequence diagram to the current diagram and you will be presented with the same.
    5) You can use the palette provided to select the sequence diagram artifacts and drop the same in the UML2 editor. You wont face issues related to placing and movement of labels and other artifacts.

    I believe the above steps should easily allow you to get started with creating Sequence diagram in UML2. As far as UML1/UML2 goes, I would suggest you to use UML2 because of its robustness and ease of use. All the features in UML1 are also supported in UML2.

    NOTE: In addition you may also like to take a look at the “Reverse Engineering to Sequence Diagram” feature. For that you need to upgrade to MyEclispe 8.0 or higher. Steps below.
    1) Select a Java class. Right Click context menu->Generate UML2 Sequence diagram.
    2) On executing the action, a wizard shows up. Press Finish and a new UML2 Sequence diagram is generated.
    3) In the wizard you can also choose to – Generate a new model, or you can merge the generated Sequence diagram in the existing UML2 model.

    Hope this helps.

    #306667 Reply

    kvancamp
    Member

    Neeraj, thanks for your reply.

    I think you mean the MyEclipse UML perspective – there isn’t any MyEclipse UML2 perspective. I was not able to see the drop-down in my toolbar to add a new diagram, but after some experimenting I’ve discovered that UML2 creates both a .uml and a .umldi file. I was clicking on the .uml file, whereas if I click on the .umldi file I can see all you are describing.

    It might be worthwhile if you provided a tutorial or faq to get users past the basics like this, it’s really not obvious. Thanks.

    #307234 Reply

    kvancamp
    Member

    I’m sorry but I have another really basic UML2 question. After I create my sequence diagram, it’s called in my UML2 model “sequenceDiagram1”. I can’t figure out how to rename it to something else! Right-clicking and using “Show Properties” brings up a Model property with a Name field. I’ve changed the name here, but it doesn’t change the name of the diagram itself.

    Ken

    #307511 Reply

    Hi Ken,

    Can you try the follwoing steps and let me know whether that worked or not?

    1) Make sure you are in UML perspective (When you try to create an UML file, it asks you to change to UML perspective).
    2) Open “Properties View” (You can do so by going to “Window–>Show View–>Others–>Properties”).
    3) Now select the Sequence diagram from Outline view or click on the sequence diagram from UML file as shown in the attached figure with this post. Marked with red in two places, one in Outline view and the other in Properties view.
    4) In the property view, you’ll find an entry with “Name” below “Diagram Link”.

    Thanks,
    Chakri.

    Attachments:
    You must be logged in to view attached files.
    #307546 Reply

    kvancamp
    Member

    That’s working, thanks. Part of my confusion was that the UML2 diagram drop-down in the toolbar wasn’t doing anything if I selected a different diagram. I only noticed yesterday that unhandled event exceptions were being logged in my console when I made a selection there. This is no longer occurring, and I don’t know what’s changed, but here’s the exception stack trace I saved in case you care to delve into it:

    org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.ClassCastException: org.topcased.modeler.di.model.internal.impl.SimpleSemanticModelElementImpl cannot be cast to org.topcased.modeler.di.model.EMFSemanticModelBridge)
    at org.eclipse.swt.SWT.error(SWT.java:3884)
    at org.eclipse.swt.SWT.error(SWT.java:3799)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:137)
    at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3855)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3476)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2405)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2221)
    at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:493)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:113)
    at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
    at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:368)
    at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:559)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
    Caused by: java.lang.ClassCastException: org.topcased.modeler.di.model.internal.impl.SimpleSemanticModelElementImpl cannot be cast to org.topcased.modeler.di.model.EMFSemanticModelBridge
    at org.topcased.modeler.uml.actions.AddNewFieldAction.isEnableAction(AddNewFieldAction.java:123)
    at org.topcased.modeler.uml.actions.AddNewFieldAction.selectionChanged(AddNewFieldAction.java:104)
    at org.eclipse.ui.internal.PluginAction.refreshEnablement(PluginAction.java:206)
    at org.eclipse.ui.internal.PluginAction.selectionChanged(PluginAction.java:277)
    at org.eclipse.ui.internal.PluginAction.selectionChanged(PluginAction.java:289)
    at org.eclipse.ui.internal.ViewerActionBuilder$ViewerContribution.selectionChanged(ViewerActionBuilder.java:191)
    at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer.flushSelectionEvents(DiagramGraphicalViewer.java:269)
    at org.eclipse.gmf.runtime.diagram.ui.parts.DiagramGraphicalViewer$1.run(DiagramGraphicalViewer.java:247)
    at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
    at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
    … 22 more

    #307554 Reply

    Hi Ken,

    Good to hear that you are all set. Thanks for the information and stack trace. I’ll ask dev team to debug into it. Please feel free to post feature requests as well.

    Thanks,
    Chakri.

Viewing 7 posts - 1 through 7 (of 7 total)
Reply To: Basic UML sequence diagram questions for MyEclipse

This topic is marked as closed to new replies, however your posting capabilities still allow you to do so.

You must be logged in to post in the forum log in