[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
|
[news.eclipse.tools.gef] Re: How to draw a line?
|
The issue is that you want to create a line seemingly "in space" on your
diagram?
In fact, this can be done but the ends would still be "attached". The
anchor could be an XYAnchor and you would be "attaching" to your
DiagramEditPart...You'd have to implement something similar to what
NodeFigure has done to retrieve an anchor in the figure for the
DiagramEditPart.
-Steve
"Brandon" <brandonchen@xxxxxxxxxxxxxx> wrote in message
news:dugj47$njm$1@xxxxxxxxxxxxxx
> I want to draw a line. Here are the problems I met.
>
> 1. The line supposed to be no connections to any other figures. So it
seems
> that I should not try connection editpart, anchors...
> 2. The line should have no constraint on it. What am I suppoed to do if
the
> constraint returns null?
> 3. If the line has a constraint on it, I can draw the line from left-top
to
> right-bottom. However, drawing the line from its constraint has some
> problems. If I want to drag a line from (left-top/right-bottom) to
> (left-bottom / right-top), I would not be able to do so. The constraint is
> restricted to draw once the constraint area is zero.
>
> Please give some ideas about how to draw a line. What policy, editpart and
> class I shoudl use? Appreciated for any reply. Thanks
>
>
> Brandon
>
>