Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 361736

Summary: Clarify-document GraphicAlgorithm properties
Product: [Modeling] Graphiti Reporter: Hernan Gonzalez <hjg.com.ar>
Component: CoreAssignee: Project Inbox <graphiti-inbox>
Status: CLOSED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: juergen.pasch, matthias.gorning, michael.wenz
Version: 0.8.0Flags: michael.wenz: juno+
Target Milestone: 0.9.0   
Hardware: All   
OS: All   
Whiteboard: Juno M7 theme_round_offs

Description Hernan Gonzalez CLA 2011-10-22 16:35:22 EDT
Build Identifier: 

I believe some clarification about basic GA properties, in docs and/or Javadocs is  much needed. 

1. Location (X,Y) 
 - Are these coordinates relative to... what? The parent GA ? I think so, but I'm not absolutely sure.
(More basically: has a GA always a parent GA? (except for the diagram's GA)

 - What does the GA location exactly represent? 
 I'm not being pedantic, I don't think this is clear. For rectangles it represents the upper/left corner coordinate (let's use the standard axis convention), and in general it seems to be assumed as the upper-left corner of the bounding box. Is this true? 

An issue arose recently, related to this http://www.eclipse.org/forums/index.php/t/244953/

Suppose I create a triangle (Graphiti.getGaService().createPolygon()) with points :

p1 = (100, 100)  p2 = (100, 120) p3 =(120, 100)

(its center is about (110,110) and I set the "Location" of this 
gaService.setLocation(polygon, 300, 300);

The triangle then would be (relative to the parent GA) around position (410,410)
Which is its bounding box (and its width)? Would it extend to 300 or not?
What does the fact GA.X = 300 means here?

Would the above be equivalent or not to using

p1 = (0, 0)  p2 = (0, 20) p3 =(20, 0)

and  gaService.setLocation(polygon, 400, 400) ?

Another example: what if some of the points coordinates are negative?

2- Width/Height 
 Every GA has Location (X/Y) and Size (Width/Height), it's not very clear when this is computed internally by Graphiti and when it's specified by the user. It also not clear if every GA must have a weel defined Size, if this is equivalent to the concept of the "bounding box". See the example above.
Also, dcouemtn what happens when the size of a children GA exceeds the parent.







Reproducible: Always
Comment 1 Michael Wenz CLA 2011-10-24 04:07:23 EDT
True, there should be more docu on that
Comment 2 Juergen Pasch CLA 2012-04-18 10:45:56 EDT
I have added Graphiti based definitions of coordinate systems, location, size used by graphics algorithms. Additionally it is explained what the framework is doing automatically and what the diagram type agent has to provide when a shape is moved or transformed.

commit e65c59d72c506148643cdff51565b5970b360918
Author: jpasch <juergen.pasch@sap.com> 2012-04-18 16:31:55
Committer: jpasch <juergen.pasch@sap.com> 2012-04-18 16:31:55
Parent: 0bfce4c3cc524f7656ba402077eeb48073cddee2 (Bug 371513 - Not yet loaded resources must not be saved)
Branches: master
Comment 3 Michael Wenz CLA 2012-06-29 04:23:29 EDT
Part of Graphiti 0.9.0 (Eclipse Juno)