Skip to main content



      Home
Home » Eclipse Projects » GEF » Routing
Routing [message #19214] Tue, 10 September 2002 05:06 Go to next message
Eclipse UserFriend
Originally posted by: mati.ncdc.pl

Hi all,


I have spend a lot of time figuring out what for is routing in draw2d.
Currently we are developing one project using draw2d, because we failed to
launch GEF in standalone enviroment.

I already know what does BendpointConnectionRouter does and it works but i
see no point in ManhatanConnectionRouter as well as FanRouter. What is the
purpouse of this classes.

I have figured out (demo4 as an example) that routing is not necessary for
two figuires to be connected.

If someone could explain I would appreciate.

2. We have been trying GEF from tigris.org but it is Swing alike but it
works for standalone application, we wish Gef worked for standalone
purpoused.

What is more, what are the features draw2d is missing and GEF provided from
IBM.
Re: Routing [message #19273 is a reply to message #19214] Tue, 10 September 2002 10:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

> I have spend a lot of time figuring out what for is routing in draw2d.
> Currently we are developing one project using draw2d, because we failed to
> launch GEF in standalone enviroment.

We are not making efforts to support standalone environment. If someone in
the community wishes to help out by making changes which do not affect GEF
in Eclipse, we would probably integrate these changes.

> I already know what does BendpointConnectionRouter does and it works but i
> see no point in ManhatanConnectionRouter as well as FanRouter. What is the
> purpouse of this classes.

ManhatanConnectionRouter - see the Logic example.

FanRouter - this class is to prevent to connections between the same 2 nodes
from completely overlapping. VA-Java did this by default when you had 2 or
more connections between the same 2 objects.

> I have figured out (demo4 as an example) that routing is not necessary for
> two figuires to be connected.

Correct, you will get a straight line between them.

> If someone could explain I would appreciate.

The purpose of routing is to bend the connection somewhere between its
source and target endpoints.

> 2. We have been trying GEF from tigris.org but it is Swing alike but it
> works for standalone application, we wish Gef worked for standalone
> purpoused.

> What is more, what are the features draw2d is missing and GEF provided
from
> IBM.

I do not understand this question. draw2d is for rendering and layout. GEF
is for interactive editing by the user, it uses draw2d.
Re: Routing [message #19456 is a reply to message #19273] Wed, 11 September 2002 05:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mati.ncdc.pl

> We are not making efforts to support standalone environment. If someone
in
> the community wishes to help out by making changes which do not affect GEF
> in Eclipse, we would probably integrate these changes.

That is a pity becuase SWT has been designed so that applications can be
launched in stand-alone enviroment. Draw2d as I can see also can be launched
in stand-alone application. I then do not understand why IBM does not want
to provide support for GEF outside eclipse platform. I know it can we very
helpful to design tools such as UML editor, as well as is a first step to
make a GUI designer for eclipse. But it still is eclipse oriented. Many ppl
want to use SWT instead of AWT or Swing these days.

> > I have figured out (demo4 as an example) that routing is not necessary
for
> > two figuires to be connected.
>
> Correct, you will get a straight line between them.

is it possible to use FanRouter and to have bendline? What for then
BendpointConnectionRouter.

What I also figured out that it is possible to use several routers. using
method next or nextrouter u can route connection through different routers.
I dislike a bit Logic Example because it is too much GEF oriented and we do
not want to use GEF because it is not standalone friendly. I would
appreciate if there were more examples such as demo4 but unformtunately I
failed to find any except eclipsewiki.

> > If someone could explain I would appreciate.
>
> The purpose of routing is to bend the connection somewhere between its
> source and target endpoints.

I though that it is only purpouse of BendpointConnectionRouter

> > What is more, what are the features draw2d is missing and GEF provided
> from
> > IBM.
>
> I do not understand this question. draw2d is for rendering and layout.
GEF
> is for interactive editing by the user, it uses draw2d.

I have designed selection box that uses FocusBorder but unfortunately even I
set it's opaque it ain't transparent. I though maybe subclassing Shape and
writing own implementation of RectangleFigure might help since
RectangleFigure class uses graphics.FillRectangle.

What is more I cannot select figures in figure in which I am drawing. I used
FigureIterator but it only itarates through all figures but I wonder how to
iterate through figures at given rectangle in provided figure.


---------------------------------
| ----- |
| | | |
| ----- |
| |
| |
---------------------------------

How to itarate through figures in the smaller box that would use parent as a
box underneath.


Thank you very much for help and for help that will be coming in advance ;)
Re: Routing [message #19546 is a reply to message #19456] Wed, 11 September 2002 09:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

> > We are not making efforts to support standalone environment. If someone
> in
> > the community wishes to help out by making changes which do not affect
GEF
> > in Eclipse, we would probably integrate these changes.
>
> That is a pity becuase SWT has been designed so that applications can be
> launched in stand-alone enviroment. Draw2d as I can see also can be
launched
> in stand-alone application. I then do not understand why IBM does not
want
> to provide support for GEF outside eclipse platform. I know it can we very
> helpful to design tools such as UML editor, as well as is a first step to
> make a GUI designer for eclipse. But it still is eclipse oriented. Many
ppl
> want to use SWT instead of AWT or Swing these days.
>
> > > I have figured out (demo4 as an example) that routing is not necessary
> for
> > > two figuires to be connected.
> >
> > Correct, you will get a straight line between them.
>
> is it possible to use FanRouter and to have bendline? What for then
> BendpointConnectionRouter.

BendpointCR is for manual bendpoints that the user makes. FanRouter inserts
bendpoints without the user doing anything. You can also chain them
together, so that connections without user bendpoints still might have
automatic bendpoints.

>
> What I also figured out that it is possible to use several routers. using
> method next or nextrouter u can route connection through different
routers.
> I dislike a bit Logic Example because it is too much GEF oriented and we
do
> not want to use GEF because it is not standalone friendly. I would
> appreciate if there were more examples such as demo4 but unformtunately I
> failed to find any except eclipsewiki.
>
> > > If someone could explain I would appreciate.
> >
> > The purpose of routing is to bend the connection somewhere between its
> > source and target endpoints.
>
> I though that it is only purpouse of BendpointConnectionRouter
>
> > > What is more, what are the features draw2d is missing and GEF provided
> > from
> > > IBM.
> >
> > I do not understand this question. draw2d is for rendering and layout.
> GEF
> > is for interactive editing by the user, it uses draw2d.
>
> I have designed selection box that uses FocusBorder but unfortunately even
I
> set it's opaque it ain't transparent. I though maybe subclassing Shape and
> writing own implementation of RectangleFigure might help since
> RectangleFigure class uses graphics.FillRectangle.

If you put this border on RectangleFigure, you must use setFill(false).
isOpaque() means that the figure completely fills its RECTANGULAR bounds,
but setFill() just means that a SHAPE will fill its geometric region, which
isn't necessarily a rectangle.

>
> What is more I cannot select figures in figure in which I am drawing. I
used
> FigureIterator but it only itarates through all figures but I wonder how
to
> iterate through figures at given rectangle in provided figure.
>
>
> ---------------------------------
> | ----- |
> | | | |
> | ----- |
> | |
> | |
> ---------------------------------
>
> How to itarate through figures in the smaller box that would use parent as
a
> box underneath.

Are you making you own MarqueeTool? Please look at the code in GEF's
marquee tool.

>
>
> Thank you very much for help and for help that will be coming in advance
;)
>
>
>
>
Re: Routing [message #19636 is a reply to message #19546] Thu, 12 September 2002 07:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mati.ncdc.pl

Arc conn = new Arc();
conn.setSourceAnchor(new ChopboxAnchor(f));
conn.setTargetAnchor(new ChopboxAnchor(f2));
conn.setForegroundColor(ColorConstants.blue);
conn.setTargetDecoration(new PolygonDecoration());
//BendpointConnectionRouter b = new BendpointConnectionRouter();
FanRouter f = new FanRouter();
ManhattanConnectionRouter m = new ManhattanConnectionRouter();
//AbsoluteBendpoint a1 = new AbsoluteBendpoint(240, 240);
//AbsoluteBendpoint a2 = new AbsoluteBendpoint(340, 340);
//ArrayList list = new ArrayList();
//list.add(a1);
conn.setConnectionRouter(f);
f.route(conn);
f.setNextRouter(m);
f.setSeparation(12);
//conn.setRoutingConstraint(list);
f.route(conn);
panel.add(conn);

ManhatanConnectionRouter works fine, but still FanRouter is not working at
all. I dunno what am i doing wrong.
Re: Routing [message #19681 is a reply to message #19636] Thu, 12 September 2002 10:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

It is not necessary to call route(Connection);

if you call f.setNextRouter(m), the fan router will *only* function if the
"next" router does not insert any bendpoints. manhattan will insert
bendpoints, so it does nothing. The purpose of setNextRouter(next), is to
allow next to be the manual router, and fan to be the "default" router when
the user has not created any bendpoints.

"Mateusz Szczap" <mati@ncdc.pl> wrote in message
news:alpsec$dng$1@rogue.oti.com...
> Arc conn = new Arc();
> conn.setSourceAnchor(new ChopboxAnchor(f));
> conn.setTargetAnchor(new ChopboxAnchor(f2));
> conn.setForegroundColor(ColorConstants.blue);
> conn.setTargetDecoration(new PolygonDecoration());
> //BendpointConnectionRouter b = new BendpointConnectionRouter();
> FanRouter f = new FanRouter();
> ManhattanConnectionRouter m = new ManhattanConnectionRouter();
> //AbsoluteBendpoint a1 = new AbsoluteBendpoint(240, 240);
> //AbsoluteBendpoint a2 = new AbsoluteBendpoint(340, 340);
> //ArrayList list = new ArrayList();
> //list.add(a1);
> conn.setConnectionRouter(f);
> f.route(conn);
> f.setNextRouter(m);
> f.setSeparation(12);
> //conn.setRoutingConstraint(list);
> f.route(conn);
> panel.add(conn);
>
> ManhatanConnectionRouter works fine, but still FanRouter is not working at
> all. I dunno what am i doing wrong.
>
>
Re: Routing [message #19726 is a reply to message #19681] Fri, 13 September 2002 05:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mati.ncdc.pl

> > ManhatanConnectionRouter works fine, but still FanRouter is not working
at
> > all. I dunno what am i doing wrong.


Thanks, do u have any sample code for FanRouter, beccause I cannot really
see whether it is working or not. It behaves the same way as straight line
between two figures.

The API states:
Automatic router that spreads its Connections in a fan-like fashion upon
collision.
Re: Routing [message #19771 is a reply to message #19726] Fri, 13 September 2002 12:07 Go to previous messageGo to next message
Eclipse UserFriend
Try this. It works for me. You should have 3 connections in between the 2
rectangles that are "fanned out" and one connection that uses the
BendpointConnectionRouter with 2 bendpoints.

import java.util.*;

import org.eclipse.draw2d.*;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.*;

public class FanRouterTest {

public static void main(String[] args) {
Shell shell = new Shell();
shell.setSize(600, 400);
shell.setLayout(new FillLayout());

LightweightSystem lws = new LightweightSystem(shell);

Figure contents = new Figure();
FanRouter router = new FanRouter();
router.setNextRouter(new BendpointConnectionRouter());

Figure source = new RectangleFigure();
source.setLocation(new Point(10,80));
ConnectionAnchor sourceAnchor = new ChopboxAnchor(source);
contents.add(source);
Figure target = new RectangleFigure();
target.setLocation(new Point(200,80));
ConnectionAnchor targetAnchor = new ChopboxAnchor(target);
contents.add(target);

PolylineConnection conn1 = new PolylineConnection();
contents.add(conn1);
conn1.setSourceAnchor(sourceAnchor);
conn1.setTargetAnchor(targetAnchor);
conn1.setConnectionRouter(router);

java.util.List bendpoints = new ArrayList(2);
bendpoints.add(new AbsoluteBendpoint(10,10));
bendpoints.add(new AbsoluteBendpoint(200,200));
conn1.setRoutingConstraint(bendpoints);

PolylineConnection conn2 = new PolylineConnection();
contents.add(conn2);
conn2.setSourceAnchor(sourceAnchor);
conn2.setTargetAnchor(targetAnchor);
conn2.setConnectionRouter(router);

PolylineConnection conn3 = new PolylineConnection();
contents.add(conn3);
conn3.setSourceAnchor(sourceAnchor);
conn3.setTargetAnchor(targetAnchor);
conn3.setConnectionRouter(router);

PolylineConnection conn4 = new PolylineConnection();
contents.add(conn4);
conn4.setSourceAnchor(sourceAnchor);
conn4.setTargetAnchor(targetAnchor);
conn4.setConnectionRouter(router);

lws.setContents(contents);

shell.open();
Display display = Display.getDefault();
while (!shell.isDisposed())
if (!display.readAndDispatch())
display.sleep();
shell.dispose();
}

}

"Mateusz S" <mati@ncdc.pl> wrote in message news:als8m2$lte$1@rogue.oti.com...
> > > ManhatanConnectionRouter works fine, but still FanRouter is not working
> at
> > > all. I dunno what am i doing wrong.
>
>
> Thanks, do u have any sample code for FanRouter, beccause I cannot really
> see whether it is working or not. It behaves the same way as straight line
> between two figures.
>
> The API states:
> Automatic router that spreads its Connections in a fan-like fashion upon
> collision.
>
>
Re: Routing [message #19797 is a reply to message #19771] Mon, 16 September 2002 04:06 Go to previous message
Eclipse UserFriend
Originally posted by: mati.ncdc.pl

U
Previous Topic:Commercial graphical product using SWT?
Next Topic:Eclipse version supported by GEF?
Goto Forum:
  


Current Time: Sun May 11 18:32:03 EDT 2025

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

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

Back to the top