Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 369220 - Visualization and GraphitiAlgorithm Problems
Summary: Visualization and GraphitiAlgorithm Problems
Status: CLOSED MOVED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.8.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 369371 369373
Blocks:
  Show dependency tree
 
Reported: 2012-01-20 08:11 EST by Fabio Filippelli CLA
Modified: 2012-01-23 06:16 EST (History)
2 users (show)

See Also:


Attachments
ellipse behavior on 2nd point (ConnectionDecorator visualization cut) (42.90 KB, application/zip)
2012-01-20 08:11 EST, Fabio Filippelli CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Filippelli CLA 2012-01-20 08:11:34 EST
Created attachment 209816 [details]
ellipse behavior on 2nd point (ConnectionDecorator visualization cut)

I am committer for the spray project and we wrote a Xtext based DSL to develop Graphiti Shapes, that will finally be integrated into the Spray project.

Now we noticed some problems and maybe bugs on Graphiti code base. 
Can you analyse it and maybe fix it in the next mayor release?

1. ConnectionDecorator with Rectangles and RoundedRectangles:
ConnectionDecorator decorator = peCreateService.createConnectionDecorator(newConnection, false, 0.5, true);
Rectangle rectangle = gaService.createRectangle(decorator);
gaService.setLocationAndSize(rectangle, 1, 9, 100, 50);

If we add an invisible rectangle, a rectangle or a rounded rectangle to the connection decorator it will not be drawn at all. The visualization will be empty.
Because of this problem, we are not able to draw nested or multiple shapes, because we want to add an invisible rectangle as first element, so we can use more than one shape on the same level.


2. ConnectionDecorator visualization cut:
Therefore we have a problem that the visualization of the decorating shape will be cut if we move the start or end shape of the connection. Then the angle changes and the shape (e.g. ellipse) will be cut at a border. If the shape is bigger or the zoom is activated this problem will occur more frequently.
See following example code for reproduce it and the two appended files in the zip.

ConnectionDecorator decorator = peCreateService.createConnectionDecorator(newConnection, false, 0.5, true);
Ellipse ellipse = gaService.createEllipse(decorator);
gaService.setLocationAndSize(ellipse, 1, 9, 150, 150);


3. Visualization cut on Shapes:
The shapes will all be drawn with a strange behavior. The borders (e.g.) the line-width have different width on top/bottom as on left/right. For reproduce it, just draw a ContainerShape and add a Ellipse. Then zoom in and analyze the borders of the shape. The same problem occurs on lines and all other Shapes (Rectangle, Polygons, ...).


4. Line is not on top of all elements (behind of invisible rectangles)
As written on 1. we add firstly an invisible rectangle on the container shape. So we are able to add more then one shape on the same abstraction level. (e.g containershape->invisiblerectangle->ellipse1,ellipse2->rectangle)
Now if we use ChopBoxAnchors the connections will start at the borders of the invisible rectangle and not on the first visible shape within the invisible rectangle.
Comment 1 Michael Wenz CLA 2012-01-23 05:19:22 EST
Hi Fabio,
thanks for the input, but this is too many different issues for just one bug. I would like to split off concrete issue and enhancements from this one.

1) This is a limitation of the Graphiti framework: Graphiti supports as passive connection decorators only the rotatable objects ellipse and polyline (plus polygon as subclass). All others are currently not drawn (as active decorators all types of GAs should work). Passive decorators have so far only been used as simple shapes decorating ends of mids of connections, so far there has been no need or requests for complex shapes. Rectangles could be modeled as polygons that would be a workaround here, but still nesting would not be supported. Providing complex shapes here would be a huge effort, because the underlying Draw2D does not support rotating other shapes than polylines (Graphiti added support for rotating ellipses). Nevertheless if you would like to see support for this, please open a seperate enhancement bugzilla.

2) This is a real bug, although it only appears in the rare scenario when you have really large decorators. There is some clipping in place that hides everything around the connection borders; it seems that the children of the connection are no evaluated for this. I will file a bug for this.

3) This is simply a rounding issue as it seems. There are plain ints in the game here that cause this when zooming.

4) That's not a bug and works as specified. Connections are always drawn between anchors, anchors belong to anchor containers. Only shapes (and not graphics algorithms) are anchor containers. So if you would like to draw connections from an inner graphics algorithm you will need to use a shape for this graphics algorithm. Pure graphics algorithm nesting is not possible in this case.

Please add your comments to 1, 3 and 4 to this bug.

Michael
Comment 2 Fabio Filippelli CLA 2012-01-23 05:57:48 EST
Hi Michael,

thank you for your fast answer!

1) I think indeed that it would be a nice enhancement to be able to add all custom shapes to an connection decorator. 
For this i think it would be nice to allow it. Although I don´t think it is good to allow adding rectangles on the code base (EMF/API) and then don´t visualize anything in the resulting diagram. Do you see my point?
I already thought about your workaround with polygons as rectangles, too. 
But this works only for simple shape and not for multiple or nested shapes. 
I have also just tried to nest ellipses and polygons and this works very well, so in my opinion it is better to allow all shapes (only rectangles (+rounded,invisible) are missing, as I can see)?

3) Ok, understood! Can be closed.

4) Ok - fine, too!

Fabio
Comment 3 Michael Wenz CLA 2012-01-23 06:16:09 EST
> 1) I think indeed that it would be a nice enhancement to be able to add all
> custom shapes to an connection decorator. 
> For this i think it would be nice to allow it. Although I don´t think it is
> good to allow adding rectangles on the code base (EMF/API) and then don´t
> visualize anything in the resulting diagram. Do you see my point?
> I already thought about your workaround with polygons as rectangles, too. 
> But this works only for simple shape and not for multiple or nested shapes. 
> I have also just tried to nest ellipses and polygons and this works very well,
> so in my opinion it is better to allow all shapes (only rectangles
> (+rounded,invisible) are missing, as I can see)?

Yes, I see your point. The Graphiti API is rather generic and not all things that are allowed in the API are also supported in the framework. I have created bug 369373 to track this as an enhancement. But as I already wrote: this is a large think and i doubt that we will be able to do something on this for Juno.

I close this with reference to the other two bugzillas.

Michael