add a moveable label to a conenction [message #206098] |
Sat, 24 December 2005 14:50  |
Eclipse User |
|
|
|
Originally posted by: marguu.libero.it
Hi all! I'd like to add a Text Label to a connection. I've tried to
add(new Label()) but this label can't move. How can i do it? Thanks
|
|
|
|
|
|
Re: add a moveable label to a conenction [message #206160 is a reply to message #206143] |
Sun, 25 December 2005 10:29  |
Eclipse User |
|
|
|
Moveable label to a node (as you asked) looks like more of an ANNOTATION or a VISUAL-ATTACHMENT to a node. The semantics of such elements could be like ..
a) when node is moved, attachments should also move.
b) when node is deleted, attachments should also get deleted.
c) attachments should be moveable independently.
d) to add a visual cue that attachments belong to a node, a thin dull greyish line could connect the annotation to node.
c) to add an attachment, pick an entry from palette, click anywhere on a desired node. Attachment may get created surrounding the boundary (may be in any of the four quadrants)
Plausible implementation:
------------------------
Have a model like ...
class Node
{
List attachments; /* Attachment */
void addAttachment();
void removeAttachment();
}
class Attachment extends Node
{
}
When an attachment is created for a node, add it to node's attachments by addAttachment API. But visually, attachment is outside the node..so add attachment figure to node's parent figure..then attachment figure may look like a sibling of node itself. Whatever applies to node movement should apply to attachment as well(since it is also a node). In order to move attachment along with node, do it with a polylineconnection (normal connection creation)
A container-editpolicy on node can serve for creating attachment-create commands.
Hope I have given a fair idea.
Thanks
~Venkat
|
|
|
Powered by
FUDForum. Page generated in 0.03292 seconds