I'm just using StarUML to create my UML Class diagram and something is bothering me. I create an interface representation, which is a circle, however, there is no room to add which methods and attributes the interface defines. Is this normal UML practice?
If not, how do you know (say a class implements this interface and has 4 methods defined) which of the 4 methods came from the interface and which didnt?
Solved:
Ok just incase someone else has this problem- there are two notations, both are possible in StarUML but only one explicitly (the dot notation). To create the <> notation, enter the name as <> IInterface_Name and then draw a realisation line between the implementing classes. Be sure to manually delete the old (wrong) relationship you had by right clicking the class, collection editor and then relations.
It is very simple:
If you need just show method of interface - right click on interface and un-select Format/Suppress operation (see blue circle on picture)
If you need to display instead of circle just squared form of interface (on my picture it is ISome) use Format/Stereotype Display/Decoration (see red circle on picture bellow)
Related
My previous company used to prefix interfaces with an I. For instance: ICar. I found that useful as the answer to whether a class was an interface or a concrete class was 0 clicks away. My current company, however, does not adopt that rule and just name the interfaces normally, without prefixing it with anything. Now if I come across this type of code:
Car car = new Tesla();
I have to go into the Car class to know if it is an interface or a class. I find that pretty annoying. Is there a way to make the IDE (in this case Android Studio/IntelliJ) to color/style those in a different way? (Much like they do with fields, i.e., fields are coloured in purple so you know you are not dealing with a local variable instead).
Go to File → Settings, then in the sidebar select Editor → Color Scheme → Language Defaults.
Expand "Classes" and you will be able to apply custom styling options to Classes and Interfaces. (I personally color class names light blue and interface names green to match their icons in IntelliJ.)
If you want to color Abstract classes and Enum classes uniquely as well, you can do so under the "Java" section, rather than "Language Defaults".
I want to edit my ecore model in a diagram. I created an ecorediag but I cannot find any way to add the existing classes in it. The only way it works is if I use the "Initialize the diagram with existing domain model objects". But if I create new classes or accidentally remove them, there is no way I could add them again.
You can drag & drop existing elements to the diagram from the Outline view.
Smth's obviously not working right for you because that should be reasonably easy. Two options I'm aware of:
If you reveal the palette (it might be collapsed to a little triangle in the top-left hand corner of your ecorediag), the EClass icon (2nd from top) lets you create a new EClass by drag-dropping it onto the diagram.
If this isn't working for some obscure reason, you could go to the ecore model linked to your diagram, right-click an EPackage and select New Child->EClass. That new class can then be dragged & dropped onto your diagram.
Hope this helps; let me know if not.
I have been trying to create a Class diagram in UML 2.0 using Rational Architect.
However when I look at the palette options there is no icon for Class to click and position a class item on the diagram.
Screenshot:
Following this example here , on page 2 you can clearly see the palette has an icon for "Class"
Why can I not find it? Is it a specific type of project or model I have to use ?
Thanks
Problem solved,
Was in "Use-case" view instead of "Model" view.
I'm using JUNG2 to draw some graphs.
This is the image I get:
http://img841.imageshack.us/img841/205/graphvizkk3312164f020b4.png
I'd like to:
1) change the rendering order (labels should be the last objects to be drawn);
2) add a semi-transparent background to the labels.
3) change background color of the whole image.
Any idea on how to do this?
The JUNG2 documentation is not very extensive on these issues.
Mulone
(1) To do this you'd have to hack the rendering code; I don't believe that we support this at the moment.
UPDATE: I took a closer look. Actually JUNG does support this without hacking the existing libraries; the easiest way is perhaps to subclass BasicRenderer and then override the render() method so that things happen in the order that you want. (I recommend that you render vertices after edges.) Once you do that, you create an instance of your custom Renderer, and call VisualizationViewer.setRenderer(customRenderer).
(2) The labels respect HTML code (i.e., surround your label with <html></html> and then put whatever tags you like in it).
(3) BasicVisualizationServer (and its subclasses, e.g. VisualizationViewer) inherit from JComponent, which defines setBackground(Color).
I have used a gesture recognizer and the boundingRect for a given overlay to determine when a user taps on it. However I would now like to make a callout appear over the overlay region that the user taps, just like how it is done for annotations. Must I create the overlays as annotations in order to accomplish this? Thanks.
Overlays are also annotation objects if you wish.
From the Location Awareness Programming Guide:
The MKOverlay protocol conforms to the MKAnnotation protocol. As a result, all overlay objects are also annotation objects and can be treated as one or both in your code. If you opt to treat an overlay object as both, you are responsible for managing that object in two places. If you want to display both an overlay view and annotation view for it, you must implement both the mapView:viewForOverlay: and mapView:viewForAnnotation: methods in your application delegate. It also means that you must add and remove the object from both the overlays and annotations arrays of your map.