Home » Eclipse Projects » GEF » creating LineEditPart
creating LineEditPart [message #122146] |
Sat, 13 March 2004 07:52  |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
It looks like there is currently no support for lines. I am having
difficulty adapting a handle for my line. I think I need a new handle.
Its a move type of handle, but its actually resizing my line. that is
what it should do. but currently it appears that a move handle is
defined as 8 boxes surrounding an edit part.
My line of course needs only 2 at each endpoint. I need tips on how to
make this happen...
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
|
Re: creating LineEditPart [message #122161 is a reply to message #122146] |
Sat, 13 March 2004 09:09   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Enough. This battle is becomming all too familiar. Yes I have parts of
it working, but I recall having the same fight when I created my other
"lines." Like when I decided eventhough I dont need the notion of
target and source connection, to just leave it there. And when I said I
only have 2 connections, so why do I need to pass around a list, but
decided too anyway. And when I decided instead of adding new
functionality to edit parts that would allow them to receive several
connections in various places on their perimiter, I would just add a
bunch of hidden edit parts to hold these connections and put those edit
parts on the perimiter of a parent editpart, since that functionality
was already there...
I think instead of making line work. I will simply add two hidden
editparts, use a connection and call it a day. Shouldn't affect my
models anyway...Always compromise with GEF. Nevertheless, the benefits
far out weigh the compromise.
CL
CL [dnoyeb] Gilbert wrote:
> It looks like there is currently no support for lines. I am having
> difficulty adapting a handle for my line. I think I need a new handle.
> Its a move type of handle, but its actually resizing my line. that is
> what it should do. but currently it appears that a move handle is
> defined as 8 boxes surrounding an edit part.
>
> My line of course needs only 2 at each endpoint. I need tips on how to
> make this happen...
>
>
>
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
| | |
Re: creating LineEditPart [message #122488 is a reply to message #122363] |
Mon, 15 March 2004 10:44   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
I did. Then I had to write my own HandleLocators, and own Handles,
etc... The problem persisted. I do not know why my handles on my line
refust to follow the line. When I move the line, the handles are still
in their original location.
I think this is because the appropriate area is not invalidated so they
do not get redrawn in their new place. I am not able to tell who is
doing the invalidation. I can tell that after th eline move, there is
no invalidation, but after the move of my boxes and circles there is. I
cant find the source because I cant trace the jump across threads of the
message.
Plus, are my handles are move handles or resize handles? Well they are
technically resize handles because they resize th eline, but they are
move handles because they move then endpoint. So its a totally new
handle. That means a new command and request, etc. Perhaps I even have
to modify the Drag tool.
Basically I am stuck. I really want to just use a connection now with
two hidden end edit parts because else I will be venturing far away from
GEF since GEF can't handle lines that are not connections currently.
Stuck.
CL
Randy Hudson wrote:
> Why don't you just write your own subclass of SelectionHandlesEditPolicy.
> It really isn't difficult to do.
>
> "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in message
> news:c2uvv6$mv9$1@eclipse.org...
>
>>It looks like there is currently no support for lines. I am having
>>difficulty adapting a handle for my line. I think I need a new handle.
>> Its a move type of handle, but its actually resizing my line. that is
>>what it should do. but currently it appears that a move handle is
>>defined as 8 boxes surrounding an edit part.
>>
>>My line of course needs only 2 at each endpoint. I need tips on how to
>>make this happen...
>>
>>
>>
>>--
>>Respectfully,
>>
>>
>>CL Gilbert
>>
>>"Verily, verily, I say unto you, He that entereth not by the door() into
>>the sheepfold{}, but climbeth up some other *way, the same is a thief
>>and a robber." John 10:1
>>
>>GnuPG Key Fingerprint:
>>82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
>>
>>For a free Java interface to Freechess.org see
>>http://www.rigidsoftware.com/Chess/chess.html
>>
>
>
>
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
| | |
Re: creating LineEditPart [message #122702 is a reply to message #122488] |
Tue, 16 March 2004 15:44   |
Eclipse User |
|
|
|
Originally posted by: none.us.ibm.com
> I did. Then I had to write my own HandleLocators, and own Handles,
> etc... The problem persisted. I do not know why my handles on my line
> refust to follow the line. When I move the line, the handles are still
> in their original location.
Do you ever call myHandle.revalidate()? There is no such thing as
revalidating an area. You have you revalidate a figure. Have you tried
looking at BendpointHandle#addNotify()? It hooks itself as a listener to
the polyline's "points" property, and revalidates as needed.
> I think this is because the appropriate area is not invalidated so they
> do not get redrawn in their new place. I am not able to tell who is
> doing the invalidation. I can tell that after th eline move, there is
> no invalidation, but after the move of my boxes and circles there is. I
> cant find the source because I cant trace the jump across threads of the
> message.
>
> Plus, are my handles are move handles or resize handles? Well they are
> technically resize handles because they resize th eline, but they are
> move handles because they move then endpoint. So its a totally new
> handle. That means a new command and request, etc. Perhaps I even have
> to modify the Drag tool.
Maybe you could treat them as bendpoints, which happen to be then end of a
"connection"?? IMO they are bendpoints.
> Basically I am stuck. I really want to just use a connection now with
> two hidden end edit parts because else I will be venturing far away from
> GEF since GEF can't handle lines that are not connections currently.
Sure it can, you just have to write the code to do it :-).
> Stuck.
>
>
> CL
>
> Randy Hudson wrote:
> > Why don't you just write your own subclass of
SelectionHandlesEditPolicy.
> > It really isn't difficult to do.
> >
> > "CL [dnoyeb] Gilbert" <Lamont_Gilbert@rigidsoftware.com> wrote in
message
> > news:c2uvv6$mv9$1@eclipse.org...
> >
> >>It looks like there is currently no support for lines. I am having
> >>difficulty adapting a handle for my line. I think I need a new handle.
> >> Its a move type of handle, but its actually resizing my line. that is
> >>what it should do. but currently it appears that a move handle is
> >>defined as 8 boxes surrounding an edit part.
> >>
> >>My line of course needs only 2 at each endpoint. I need tips on how to
> >>make this happen...
> >>
> >>
> >>
> >>--
> >>Respectfully,
> >>
> >>
> >>CL Gilbert
> >>
> >>"Verily, verily, I say unto you, He that entereth not by the door() into
> >>the sheepfold{}, but climbeth up some other *way, the same is a thief
> >>and a robber." John 10:1
> >>
> >>GnuPG Key Fingerprint:
> >>82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
> >>
> >>For a free Java interface to Freechess.org see
> >>http://www.rigidsoftware.com/Chess/chess.html
> >>
> >
> >
> >
>
>
> --
> Respectfully,
>
>
> CL Gilbert
>
> "Verily, verily, I say unto you, He that entereth not by the door() into
> the sheepfold{}, but climbeth up some other *way, the same is a thief
> and a robber." John 10:1
>
> GnuPG Key Fingerprint:
> 82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
>
> For a free Java interface to Freechess.org see
> http://www.rigidsoftware.com/Chess/chess.html
>
|
|
|
Re: creating LineEditPart [message #122983 is a reply to message #122702] |
Thu, 18 March 2004 12:40   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Randy Hudson wrote:
>>I did. Then I had to write my own HandleLocators, and own Handles,
>>etc... The problem persisted. I do not know why my handles on my line
>>refust to follow the line. When I move the line, the handles are still
>>in their original location.
>
>
> Do you ever call myHandle.revalidate()? There is no such thing as
> revalidating an area. You have you revalidate a figure. Have you tried
> looking at BendpointHandle#addNotify()? It hooks itself as a listener to
> the polyline's "points" property, and revalidates as needed.
The problem what the getParentEditPart().setLayoutConstraints method.
That was the method doing the invalidation. I was not calling it with
the proper size rectangle. So this command did end in revalidating an
area because the size of the restangle passed into that method is what
made the difference, appearantly. (as I posted in the other thread)
>
>
>
>>Basically I am stuck. I really want to just use a connection now with
>>two hidden end edit parts because else I will be venturing far away from
>>GEF since GEF can't handle lines that are not connections currently.
>
>
> Sure it can, you just have to write the code to do it :-).
>
>
>>
No kidding :) Of course that is why I like opensource. I wrote a slew
of new classes. I just don't have the courage to test it yet. Maybe
after a cup of coffee...
CL
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
|
Re: creating LineEditPart [message #123109 is a reply to message #122702] |
Fri, 19 March 2004 10:35   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Randy Hudson wrote:
>>I did. Then I had to write my own HandleLocators, and own Handles,
>>etc... The problem persisted. I do not know why my handles on my line
>>refust to follow the line. When I move the line, the handles are still
>>in their original location.
>
>
> Do you ever call myHandle.revalidate()? There is no such thing as
> revalidating an area. You have you revalidate a figure. Have you tried
> looking at BendpointHandle#addNotify()? It hooks itself as a listener to
> the polyline's "points" property, and revalidates as needed.
>
>
Well it seems that the handles get erased during figure moves because
the handles put themselves within the bounds of the figure. So
figure.invalidate gets the handles because they are within the bounds.
Kinda cheated there I suppose. So I can't cheat because my lines bounds
do not encompass the handles. I guess I could do the same thing, but
its confusing.
Ill have to look at bendpoints. last night I realized that I needed a
sort of points property because moving a point may not chnge the bounds
of the figure, nor the 'location' of it. well thats not true, but
something is wrong here...i guess th eproblem is i am still only
invalidating the main figure and not the handles.
we'll see.
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
| |
Re: creating LineEditPart [message #123243 is a reply to message #123230] |
Sat, 20 March 2004 09:00   |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Randy Hudson wrote:
>>
>>Well it seems that the handles get erased during figure moves because
>>the handles put themselves within the bounds of the figure. So
>>figure.invalidate gets the handles because they are within the bounds.
>>Kinda cheated there I suppose. So I can't cheat because my lines bounds
>
>
> No, handles get erased because they are figures which are moved. What are
> you talking about? Handles are definitely not within the bounds of the
> editpart's figure.
>
>
I thought I saw the handle increasing the bounds of the edit part when
it was added. If this is not the case then I do not understand why my
handles were moving at all!?
Handles don't follow a move in progress, but show up in the new position
after the drop. In my case sometimes they stayed in their original
position eventhough the figure they were 'handling' had been moved. But
they also moved with the figure sometimes. In fact, if the move was
more than a 1/4 inch, the handles always moved. But if the move was
very slight, they would not.
Dont know what mechanism is involved here.
I took your advice and looked at BendpointHandle, and I copied its
behavior wrt/ handles. So they always move now. Also was funny that it
contained a points property, the exact thing I was needing (well I need
it on the model level too). I guess that fixes it.
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
| |
Re: creating LineEditPart [message #124862 is a reply to message #124839] |
Mon, 29 March 2004 14:49  |
Eclipse User |
|
|
|
Originally posted by: Lamont_Gilbert.rigidsoftware.com
Randy Hudson wrote:
>>I thought I saw the handle increasing the bounds of the edit part when
>>it was added. If this is not the case then I do not understand why my
>>handles were moving at all!?
>
>
> They are adding themselves as figure listeners.
>
i was speaking about by handles. And the fact that they were not figure
listeners but still moved. But not in all cases.
>
>>Handles don't follow a move in progress, but show up in the new position
>>after the drop. In my case sometimes they stayed in their original
>>position eventhough the figure they were 'handling' had been moved. But
>
>
> I haven't seen this before. It would be a bug. Can you post a screenshot?
>
>
This was of course referring to my code. My handles just show in at the
end of the drop. There are no handles on the feedback figure. That is
correct right?
--
Respectfully,
CL Gilbert
"Verily, verily, I say unto you, He that entereth not by the door() into
the sheepfold{}, but climbeth up some other *way, the same is a thief
and a robber." John 10:1
GnuPG Key Fingerprint:
82A6 8893 C2A1 F64E A9AD 19AE 55B2 4CD7 80D2 0A2D
For a free Java interface to Freechess.org see
http://www.rigidsoftware.com/Chess/chess.html
|
|
|
Goto Forum:
Current Time: Thu May 08 22:19:33 EDT 2025
Powered by FUDForum. Page generated in 0.04043 seconds
|