However, this
has not been completely nice and clean. For example, MOGraphElement defines #bounds,
#absoluteBounds. MONode defines #translatedBy:. Shall these methods be moved into the
shape?
I disagree that this is a problem. The Element has a physical location and dimension, the
Shape is responsible for retrieving the actual values from the model.
bounds is about the size of the shape. Is it reasonable to have a graph element answering
to the message #bounds?
Currently, we have the following
responsibilities:
a graph element:
- keeping a ref to its shape
This is not a responsibility, it's a collaboration
sure
- managing
attributes
- managing nesting of nodes and edges
- layout
It is responsible for the positioning, but this is achieved through a collaboration
In addition, the layouting should not be at the level of GraphElement. It does not make
sense for an edge to do a layout.
- supporting
announcement
This is again a collaboration, because the interaction responsibility is handled by the
announcer.
Sure (bis)
a node:
- keeping a location
- maintaining a zordered-list of elements to display
- dedicated caches (e.g., bitmap)
This is internal implementation, but it could probably be pushed externally somewhere.
Yes. The node location should not be hosted within a node.
- rendering on
a canvas
Not quite correct. The actual rendering is taken care of by the shape.
MONode and MOEdge define displayOn:
A node needs the zordered-list to display its inner nodes.
I will move this into a visitor soon.
>> an edge:
>> - target and source node
- rendering on
a canvas
Not quite correct. The actual rendering is taken care of by the shape.
But it is called by the graph element
a root:
- selection box
I think this could go to the Canvas.
Yes, I agree.
- another
event management
I am not sure what this is.
Updating the size of the root if you drag and drop a node. This could go in the Canvas
maybe.
Clearly, some
responsibilities are ill located. I will do soon some cleaning...
I think there are some places for refactoring, but not that many as it might sound from
your mail. One thing that you might need to know is that we used to have an explicit Graph
entity. However, we ended up merging it in the Element because of scalability issues (less
objects). Perhaps the situation is different now, but we nevertheless should take care of
this aspect, too.
As far as I remember, what was called a graph was an instance of the formally named Figure
(which was replaced by GraphElement).
Cheers,
Alexandre
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
www.tudorgirba.com
"Some battles are better lost than fought."
_______________________________________________
Moose-dev mailing list
Moose-dev(a)iam.unibe.ch
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel
http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.