[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.tools.gef] Re: How to draw a line?

Appreciated for reply. Yes, I want to create a line simply in space.
And the user can drag from the head and end point of the line to change
the length and direction.

I just implemented the idea you gave and it worked well. And there are some
other new questions now.

1. Is it possible to change the line width for XYAnchor connection?
2. When I use Chopbox(figure), the feedback works well. But when
I use XYAnchor(Point) instead, there is no feedback of the line after
choosing the
source point. Should I override some function such as
showTargetConnectionFeedback()
to enable the feedback??
3. Is it possible to move the line with whole shape? Right now I have to
move head and end
point seperately to move the line. I can not move the whole line.

Thanks..

Brandon


Do you mean that I still need to create two nodes as the head and end point
of the line? And I should add source and target

----- Original Message ----- 
From: "Steven Shaw" <steveshaw@xxxxxxxxxx>
Newsgroups: eclipse.tools.gef
Sent: Monday, March 06, 2006 11:28 PM
Subject: 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
> >
> >
>
>