Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Logic example and GEF question
Logic example and GEF question [message #154971] Thu, 21 October 2004 19:39 Go to next message
Eclipse UserFriend
Originally posted by: mathew_benson.hotmail.com

I'm considering starting a new project to solve a problem I have. I wrote
a similar application using JGraph, but ran into some problems ending up
recoding more of JGraph and JGraphpad that I expected. I didn't know
about GEF at the time, but it looks like its a better solution.

I looked at the Logic example, which seems to exercise all functionality
that I need except one. I haven't dug through the code yet, but I assume
that the "canned parts" object is actually a container that contains
another GEF drawing. When you connect an object outside of Canned Parts
to a part inside, it connects an edge directly from one port to the other.
I would like to create a port on the container object that the two
(inside and outside) objects connect to instead of direct connect.

For example, in LabView, the Sequence object is a container that can
contain other objects. When you click and drag a wire from something on
the outside, to something on the inside, LabView automatically creates a
port that shares a connection both on the inside and outside of the
container object. The outside object connects to the outside side of the
port on the container object. The inside object connects to the inside
side of the port on the container object.

I know I could add this functionality if GEF didn't already have it. I
can make it play Space Invaders if I wanted to. But I would like to know
how much work it would require to do this. Does GEF support this
natively, leaving me very little user code to write? Does GEF not support
this at all, requiring extensive GEF recode? I had to leave some basic
functionality out of my JGraph app because the time to recode it was not
worth the hassle.
Re: Logic example and GEF question [message #155026 is a reply to message #154971] Thu, 21 October 2004 23:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This would be simple to enforce in the Logic example. Simply change the
canExecute method to verify that:

1) source and target have the same parent
OR
2) source is parent of target or vice versa.

The user will get the NOT cursor the rest of the time preventing the from
making such container-spanning connections.

"Mathew Benson" <mathew_benson@hotmail.com> wrote in message
news:cl939m$9op$1@eclipse.org...
> I'm considering starting a new project to solve a problem I have. I wrote
> a similar application using JGraph, but ran into some problems ending up
> recoding more of JGraph and JGraphpad that I expected. I didn't know
> about GEF at the time, but it looks like its a better solution.
>
> I looked at the Logic example, which seems to exercise all functionality
> that I need except one. I haven't dug through the code yet, but I assume
> that the "canned parts" object is actually a container that contains
> another GEF drawing. When you connect an object outside of Canned Parts
> to a part inside, it connects an edge directly from one port to the other.
> I would like to create a port on the container object that the two
> (inside and outside) objects connect to instead of direct connect.
>
> For example, in LabView, the Sequence object is a container that can
> contain other objects. When you click and drag a wire from something on
> the outside, to something on the inside, LabView automatically creates a
> port that shares a connection both on the inside and outside of the
> container object. The outside object connects to the outside side of the
> port on the container object. The inside object connects to the inside
> side of the port on the container object.
>
> I know I could add this functionality if GEF didn't already have it. I
> can make it play Space Invaders if I wanted to. But I would like to know
> how much work it would require to do this. Does GEF support this
> natively, leaving me very little user code to write? Does GEF not support
> this at all, requiring extensive GEF recode? I had to leave some basic
> functionality out of my JGraph app because the time to recode it was not
> worth the hassle.
>
Re: Logic example and GEF question [message #155117 is a reply to message #155026] Fri, 22 October 2004 11:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mathew_benson.hotmail.com

Thanks. Now I know I can at least prevent them from doing this. Would it
be possible to automatically create the port on the container object, and
connect the two through the new port? So they can still connect them, but
it behaves more like the way LabView connects outside objects to objects
inside containers. I guess, the easiest way would be to:

1. Determine if its a connection from outside the container to inside the
container. If so, continue. If not, break out of logic and continue as
normal.
2. Determine if there is already another outside object connected to the
inside object. If so, connect the two through the port created when those
objects were linked. To ensure there is only one port to the outside for
that inside object. If not, continue with logic.
2. Determine where the previewed edge intersects with the container
boundry.
3. Add new port at intersection.
4. Add new connection (edge?) between the object outside of the
container, to the new port.
5. Add new connection between the object inside the container, to the new
port.

I'm asking because I'm considering writing something very similar to
LabView. The language that I would like to create the GUI for is very
sequential, not in the least object oriented, which lends itself well to
this application. For example, programmatic structures like IF...THEN
would be container objects. The container object would have a header that
would show the logic operator and operands. The container would have two
pages, that the user/developer could switch between. One page for true,
one for false. Variables defined outside the scope of the structure could
be accessed if the user connected the definition to whatever object is
accessing it inside the structure, i.e. a SET statement. Then, if the
user/developer switches to the other page, there is already a port added
to the container object for the outside accessed variable. If they want
to access it in the other logic branch, they just connect to the already
existing port. Like LabView.

Randy Hudson wrote:

> This would be simple to enforce in the Logic example. Simply change the
> canExecute method to verify that:

> 1) source and target have the same parent
> OR
> 2) source is parent of target or vice versa.

> The user will get the NOT cursor the rest of the time preventing the from
> making such container-spanning connections.

> "Mathew Benson" <mathew_benson@hotmail.com> wrote in message
> news:cl939m$9op$1@eclipse.org...
> > I'm considering starting a new project to solve a problem I have. I wrote
> > a similar application using JGraph, but ran into some problems ending up
> > recoding more of JGraph and JGraphpad that I expected. I didn't know
> > about GEF at the time, but it looks like its a better solution.
> >
> > I looked at the Logic example, which seems to exercise all functionality
> > that I need except one. I haven't dug through the code yet, but I assume
> > that the "canned parts" object is actually a container that contains
> > another GEF drawing. When you connect an object outside of Canned Parts
> > to a part inside, it connects an edge directly from one port to the other.
> > I would like to create a port on the container object that the two
> > (inside and outside) objects connect to instead of direct connect.
> >
> > For example, in LabView, the Sequence object is a container that can
> > contain other objects. When you click and drag a wire from something on
> > the outside, to something on the inside, LabView automatically creates a
> > port that shares a connection both on the inside and outside of the
> > container object. The outside object connects to the outside side of the
> > port on the container object. The inside object connects to the inside
> > side of the port on the container object.
> >
> > I know I could add this functionality if GEF didn't already have it. I
> > can make it play Space Invaders if I wanted to. But I would like to know
> > how much work it would require to do this. Does GEF support this
> > natively, leaving me very little user code to write? Does GEF not support
> > this at all, requiring extensive GEF recode? I had to leave some basic
> > functionality out of my JGraph app because the time to recode it was not
> > worth the hassle.
> >
Re: Logic example and GEF question [message #155141 is a reply to message #155117] Fri, 22 October 2004 14:01 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

These things are model issues, not GEF issues. The command returned for
connection creation needs to do everything you describe to the model. Then,
your editparts will observe the model changes and build the connections and
port representations, which is probably just an anchor point on the
container and not itself an editpart.

The GEF request should contain all of the info needed for your command to do
the right thing.

"Mathew Benson" <mathew_benson@hotmail.com> wrote in message
news:clapmj$uja$1@eclipse.org...
> Thanks. Now I know I can at least prevent them from doing this. Would it
> be possible to automatically create the port on the container object, and
> connect the two through the new port? So they can still connect them, but
> it behaves more like the way LabView connects outside objects to objects
> inside containers. I guess, the easiest way would be to:
>
> 1. Determine if its a connection from outside the container to inside the
> container. If so, continue. If not, break out of logic and continue as
> normal.
> 2. Determine if there is already another outside object connected to the
> inside object. If so, connect the two through the port created when those
> objects were linked. To ensure there is only one port to the outside for
> that inside object. If not, continue with logic.
> 2. Determine where the previewed edge intersects with the container
> boundry.
> 3. Add new port at intersection.
> 4. Add new connection (edge?) between the object outside of the
> container, to the new port.
> 5. Add new connection between the object inside the container, to the new
> port.
>
Previous Topic:Strange exception
Next Topic:GEF'S logicone model to two figure?
Goto Forum:
  


Current Time: Fri Apr 26 00:33:39 GMT 2024

Powered by FUDForum. Page generated in 0.03517 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top