Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to connect to one node within a composite Figure
How to connect to one node within a composite Figure [message #185945] Thu, 30 June 2005 22:21 Go to next message
Eclipse UserFriend
Originally posted by: bencomo.us.ibm.com

This is a multipart message in MIME format.
--=_related 007ACE5588257030_=
Content-Type: multipart/alternative; boundary="=_alternative 007ACE5688257030_="


--=_alternative 007ACE5688257030_=
Content-Type: text/plain; charset="US-ASCII"

I need to build a figure consisting of an icon and text under it. However,
I would like to create connections between the icon nodes only. In other
words, the text under the icon should not be selectable or countable as a
connection anchor, but still move with the icon when it is dragged.

I am using the code posted by Guy Slade (
http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 0118.html ),
but the container handles both (the icon and the text under it) as a
single until. How can I make the icon the only selectable for
connections?



Thanks in advance,
Al.-
--=_alternative 007ACE5688257030_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=3>I need to build a figure consisting of an icon and text
under it. However, I would like to create connections between the icon
nodes only. In other words, the text under the icon should not be selectable
or countable as a connection anchor, but still move with the icon when
it is dragged.<br>
<br>
I am using the code posted by Guy Slade ( </font><a href= http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 0118.html target=_blank><font size=3 color=blue><u> http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 0118.html</u></font></a><font size=3>
), but the container handles both (the icon and the text under it) as a
single until.&nbsp; How can I make the icon the only selectable for connections?</font>
<br>
<br><img src=cid:_1_04DAD7C404DAD474007ACE5588257030><font size=3><br>
<br>
Thanks in advance,<br>
Al.-</font>
--=_alternative 007ACE5688257030_=--
--=_related 007ACE5588257030_=
Content-Type: image/gif
Content-ID: <_1_04DAD7C404DAD474007ACE5588257030>
Content-Transfer-Encoding: base64

R0lGODlhkAG8AOcAAPj4yAAAAP////gAAGBgUPjYmEhImOjouNj4+Lj4+Ojg sEgAAAAAcHAAAHC4
+NiYSPj4uABImJjY+LjYmNjYmABwuEgAcNj4uPi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ZIoIY6meYl2gJv7tZEWriFcLc/bodYpgYTp1Nacjcj osY4NKV1I5R1EqRT
uZKGAERWRYRrdLYkeVVEclNVYyVXVyRspUVmaqJs8NJUcKJdCHFzTsFsHiOI qv9FiPaiLrOCiAeh
iFvRcWmFV1UCiY5DF4zVh4HFiUXkVnf1VHmobYEDV6DYN6K4RFnidHi4ifMG AGcVYCXmh+rWV5lo
irI4i1GyJZSoI61oL5iYdJ4BVcNoL3WlivoCcB/hWJuzW0sYii63WMHVY704 V1oFjI3ljAtRbiAX
cgqBWSSHXaxYVjmXhLx4EZbIFIT1iSYRjuZmWyeXWxJnj1LEW/lYJ7wljx7X N0tnL0NnhWgCXu04
JmWyIP7YWftmbvtoWwZTchDpcPhYRur4jwVhdH/TdAR5dRaTROwYkOhCWtoj h3LijeOIWw1njwAD
Gf5GWxRXKIECWYGohM7Fhjj/WXXJpYQ6QS8mmYgiKSZlWJJgV0BuhyNniEN2 sTtQGIVRWIVDtIpx
5IgaE4wHQ5XNYpUVh5UW4pFdY2IRBkrEVHijJB2YYoFXeIyLElfCt3olE07r RXv4tzIzYzQDgTPy
tTMW5mLxRzR2mZaRQRXX4V9KM5YHkXgOwYDilH47eYuQ10rnkwD1JUvtIzS1 BB7SFxsGSH+85Evl
F0yZiT18Y0zIpB5B5kzQY3gCIU2SJ37qQwHmVF7WxGIGAU6xSU6wmU3p55Vc I161URu3kRtHBiqn
OZimt5qf1BxdNh3FOX0YGYsCwH/DdH3/Z3jo8UxkWWHRgz/94R+biR3xtR/c iRkq/wFzYRYrhsmN
6yidqQkzOpY+8kRP9hdjwNcdKqZPBfV+wPNPjRdQDkZQBuUz9qcb5vlAvNld mjgiB6o1CypW6ygi
DYo1EQqPv1KUSmmhcDahE4OEjciTjfmcd6F2Xbh2Ijqiz8J2SZU6JkosK/pS GtqEX/eTkvGFHpOU
MHqjOJqjOrqjQhgQADs=
--=_related 007ACE5588257030_=--
Re: How to connect to one node within a composite Figure [message #186556 is a reply to message #185945] Tue, 05 July 2005 19:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is a multi-part message in MIME format.

------=_NextPart_000_0058_01C58173.6CBB17F0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0059_01C58173.6CBB17F0"


------=_NextPart_001_0059_01C58173.6CBB17F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Write your own anchor implementation which chops to the shape unless =
doing so would go through the text.

<bencomo@us.ibm.com> wrote in message =
news:da1r93$jp3$1@main1.eclipse.org...

I need to build a figure consisting of an icon and text under it. =
However, I would like to create connections between the icon nodes only. =
In other words, the text under the icon should not be selectable or =
countable as a connection anchor, but still move with the icon when it =
is dragged.

I am using the code posted by Guy Slade ( =
http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 0118.html ), =
but the container handles both (the icon and the text under it) as a =
single until. How can I make the icon the only selectable for =
connections?=20



Thanks in advance,
Al.-
------=_NextPart_001_0059_01C58173.6CBB17F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2627" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Write your own anchor implementation =
which chops to=20
the shape unless doing so would go through the text.</FONT></DIV>
<DIV>&nbsp;</DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>&lt;<A =
href=3D"mailto:bencomo@us.ibm.com">bencomo@us.ibm.com</A>&gt; wrote=20
in message <A=20
=
href=3D"news:da1r93$jp3$1@main1.eclipse.org">news:da1r93$jp3$1@main1.ecli=
pse.org</A>...</DIV><BR><FONT=20
size=3D3>I need to build a figure consisting of an icon and text under =
it.=20
However, I would like to create connections between the icon nodes =
only. In=20
other words, the text under the icon should not be selectable or =
countable as=20
a connection anchor, but still move with the icon when it is =
dragged.<BR><BR>I=20
am using the code posted by Guy Slade ( </FONT><A=20
=
href=3D" http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 0118.=
html"=20
target=3D_blank><FONT color=3Dblue=20
=
size=3D3><U> http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 0=
118.html</U></FONT></A><FONT=20
size=3D3> ), but the container handles both (the icon and the text =
under it) as=20
a single until.&nbsp; How can I make the icon the only selectable for=20
connections?</FONT> <BR><BR><IMG=20
src=3D"cid:005001c58194$f3c82410$46814109@coisa"><FONT =
size=3D3><BR><BR>Thanks in=20
advance,<BR>Al.-</FONT></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_0059_01C58173.6CBB17F0--

------=_NextPart_000_0058_01C58173.6CBB17F0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-ID: <005001c58194$f3c82410$46814109@coisa>

R0lGODlhkAG8AOcAAPj4yAAAAP////gAAGBgUPjYmEhImOjouNj4+Lj4+Ojg sEgAAAAAcHAAAHC4
+NiYSPj4uABImJjY+LjYmNjYmABwuEgAcNj4uPi4cHAAcPj42AAASEiY2JhI SODgsLhwcLj4uFBI
OFBIQFhQSGBYUGhoWHAASHCY2HhwYIiAaIiAeJCQcLhwALiwqMDAmMDAuNDQ yPDwwPj4wEgASEhw
cJhIAJhwAJiYiJi4mFhQQHhwWHh4aICAcJCIeJhIcJiQiJjYuKCYeKCggKig mKioiKiomLCwiLhw
SLi4kMjAmNDIoNDQqNjYqNj42ODYsOjguPDw8EhIcEhwuFBQQFhYSGBYSHBI AHBImHBoUHBwcLCo
oLj42NjY0Ojo4PDo6Pjw8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAA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gCXu04
JmWyIP7YWftmbvtoWwZTchDpcPhYRur4jwVhdH/TdAR5dRaTROwYkOhCWtoj h3LijeOIWw1njwAD
Gf5GWxRXKIECWYGohM7Fhjj/WXXJpYQ6QS8mmYgiKSZlWJJgV0BuhyNniEN2 sTtQGIVRWIVDtIpx
5IgaE4wHQ5XNYpUVh5UW4pFdY2IRBkrEVHijJB2YYoFXeIyLElfCt3olE07r RXv4tzIzYzQDgTPy
tTMW5mLxRzR2mZaRQRXX4V9KM5YHkXgOwYDilH47eYuQ10rnkwD1JUvtIzS1 BB7SFxsGSH+85Evl
F0yZiT18Y0zIpB5B5kzQY3gCIU2SJ37qQwHmVF7WxGIGAU6xSU6wmU3p55Vc I161URu3kRtHBiqn
OZimt5qf1BxdNh3FOX0YGYsCwH/DdH3/Z3jo8UxkWWHRgz/94R+biR3xtR/c iRkq/wFzYRYrhsmN
6yidqQkzOpY+8kRP9hdjwNcdKqZPBfV+wPNPjRdQDkZQBuUz9qcb5vlAvNld mjgiB6o1CypW6ygi
DYo1EQqPv1KUSmmhcDahE4OEjciTjfmcd6F2Xbh2Ijqiz8J2SZU6JkosK/pS GtqEX/eTkvGFHpOU
MHqjOJqjOrqjQhgQADs=

------=_NextPart_000_0058_01C58173.6CBB17F0--
Re: How to connect to one node within a composite Figure [message #186571 is a reply to message #185945] Tue, 05 July 2005 20:28 Go to previous messageGo to next message
Steve Jones is currently offline Steve JonesFriend
Messages: 95
Registered: July 2009
Member
bencomo@us.ibm.com wrote:

> I need to build a figure consisting of an icon and text under it. However,
> I would like to create connections between the icon nodes only. In other
> words, the text under the icon should not be selectable or countable as a
> connection anchor, but still move with the icon when it is dragged.
>
> I am using the code posted by Guy Slade (
> http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg0 0118.html ),
> but the container handles both (the icon and the text under it) as a
> single until. How can I make the icon the only selectable for
> connections?
>
>
>
> Thanks in advance,
> Al.-

I do this by getting the container figure to implement:

org.eclipse.gef.handles.HandleBounds

Just return the bounds of the child you want the selection handles to fit
round, eg:

public Rectangle getHandleBounds() {
Rectangle rec = getFigureBody().getBounds().getCopy();
rec.translate(getBounds().getTopLeft());
return rec;
}


Cheers, Steve.
Re: How to connect to one node within a composite Figure [message #186601 is a reply to message #186556] Wed, 06 July 2005 08:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bencomo.us.ibm.com

This is a multipart message in MIME format.
--=_related 002C01FE88257036_=
Content-Type: multipart/alternative; boundary="=_alternative 002C020088257036_="


--=_alternative 002C020088257036_=
Content-Type: text/plain; charset="US-ASCII"

Randy:

Thank you for your reply. Did you mean write my own anchor implementation
similar to the one implemented in the org.eclipse.gef.examples.ediagram
plug-in? That sort of worked since I can now see the selection rectangle
only around the icon, not including the label. However, the labels are
clipped and it forces me to resize the selection rectangle causing the
connection to start and end where the labels begin and end. How can I get
the connection to reach the connectors and go through the text/labels? Is
that possible?

Thank you in advance,
Al.-





public class ERUPTaskFigure extends Figure implements HandleBounds
{
private Label theTaskIcon;
protected ERUPSelectableLabel label;

public ERUPTaskFigure()
{
ToolbarLayout layout = new ToolbarLayout();
layout.setStretchMinorAxis(false);
layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);
layout.setSpacing(2);
setLayoutManager(layout);
add(theTaskIcon = new Label());
add(label = new ERUPSelectableLabel());
label.setBorder(new MarginBorder(0, 1, 0, 0));
}

public Rectangle getHandleBounds()
{
return getTheIcon().getBounds();
}
.....
...
..
}

------------------------------------------------------------ ----------------------------------------------------

public abstract class NodeEditPart
extends BaseEditPart
implements org.eclipse.gef.NodeEditPart
{

private ChopboxAnchor anchor;
.....
...
..
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart
connection)
{
if (anchor == null)
anchor = new ChopboxAnchor(getFigure());
return anchor;
}

public ConnectionAnchor getSourceConnectionAnchor(Request request)
{
if (anchor == null)
anchor = new ChopboxAnchor(getFigure());
return anchor;
}

public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart
connection)
{
if (anchor == null)
anchor = new ChopboxAnchor(getFigure());
return anchor;
}

public ConnectionAnchor getTargetConnectionAnchor(Request request)
{
if (anchor == null)
anchor = new ChopboxAnchor(getFigure());
return anchor;
}
...
.....
.......
}


--=_alternative 002C020088257036_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Randy:</font>
<br>
<br><font size=2 face="sans-serif">Thank you for your reply. Did you mean
write my own anchor implementation similar to the one implemented in the
org.eclipse.gef.examples.ediagram plug-in? &nbsp;That sort of worked since
I can now see the selection rectangle only around the icon, not including
the label. However, the labels are clipped and it forces me to resize the
selection rectangle causing the connection to start and end where the labels
begin and end. &nbsp;How can I get the connection to reach the connectors
and go through the text/labels? &nbsp;Is that possible?</font>
<br>
<br><font size=2 face="sans-serif">Thank you in advance,</font>
<br><font size=2 face="sans-serif">Al.-</font>
<br>
<br>
<br><img src=cid:_1_056629780457ECA0002C01FE88257036>
<br>
<br><font size=2 face="sans-serif">&nbsp;</font>
<br><font size=2 face="sans-serif">public class ERUPTaskFigure extends
Figure implements HandleBounds</font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif">&nbsp; private Label theTaskIcon;</font>
<br><font size=2 face="sans-serif">&nbsp; protected ERUPSelectableLabel
label;</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; public ERUPTaskFigure()</font>
<br><font size=2 face="sans-serif">&nbsp; {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; ToolbarLayout layout =
new ToolbarLayout();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; layout.setStretchMinorAxis(false);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);</font >
<br><font size=2 face="sans-serif">&nbsp; &nbsp; layout.setSpacing(2);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; setLayoutManager(layout);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; add(theTaskIcon = new
Label());</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; add(label = new ERUPSelectableLabel());</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; label.setBorder(new MarginBorder(0,
1, 0, 0));</font>
<br><font size=2 face="sans-serif">&nbsp; }</font>
<br><font size=2 face="sans-serif">&nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; public Rectangle getHandleBounds()</font>
<br><font size=2 face="sans-serif">&nbsp; {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; return getTheIcon().getBounds();</font>
<br><font size=2 face="sans-serif">&nbsp; }</font>
<br><font size=2 face="sans-serif">.....</font>
<br><font size=2 face="sans-serif">...</font>
<br><font size=2 face="sans-serif">..</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif"> ------------------------------------------------------------ ---------------------------------------------------- </font>
<br>
<br><font size=2 face="sans-serif">public abstract class NodeEditPart </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; extends
BaseEditPart</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; implements
org.eclipse.gef.NodeEditPart</font>
<br><font size=2 face="sans-serif">{</font>
<br>
<br><font size=2 face="sans-serif">private ChopboxAnchor anchor;</font>
<br><font size=2 face="sans-serif">.....</font>
<br><font size=2 face="sans-serif">...</font>
<br><font size=2 face="sans-serif">..</font>
<br><font size=2 face="sans-serif">public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart
connection) </font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; if
(anchor == null)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; anchor = new ChopboxAnchor(getFigure());</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; return
anchor;</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif">public ConnectionAnchor getSourceConnectionAnchor(Request
request) </font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; if
(anchor == null)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; anchor = new ChopboxAnchor(getFigure());</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; return
anchor;</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif">public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart
connection)</font>
<br><font size=2 face="sans-serif">&nbsp;{</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; if
(anchor == null)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; anchor = new ChopboxAnchor(getFigure());</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; return
anchor;</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br><font size=2 face="sans-serif">public ConnectionAnchor getTargetConnectionAnchor(Request
request) </font>
<br><font size=2 face="sans-serif">{</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; if
(anchor == null)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; anchor = new ChopboxAnchor(getFigure());</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; return
anchor;</font>
<br><font size=2 face="sans-serif">}</font>
<br><font size=2 face="sans-serif">...</font>
<br><font size=2 face="sans-serif">.....</font>
<br><font size=2 face="sans-serif">.......</font>
<br><font size=2 face="sans-serif">}</font>
<br>
<br>
--=_alternative 002C020088257036_=--
--=_related 002C01FE88257036_=
Content-Type: image/gif
Content-ID: <_1_056629780457ECA0002C01FE88257036>
Content-Transfer-Encoding: base64

R0lGODlhk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aakPREzXZJtS
4sk1eHRyIPrA192m0lZAskur2xRrqCYRh2zPMaxHBYIdPcVXq4ydHnT+mdP3 BudQ+OWUaTDLnZZS
RzWomV2qlPs5rUKmv/RFT4Khg+EtXXc/edVIiI0IUXZuRK0mTjE7AwIAOw==
--=_related 002C01FE88257036_=--
Re: How to connect to one node within a composite Figure [message #186969 is a reply to message #186601] Thu, 07 July 2005 21:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

This is a multi-part message in MIME format.

------=_NextPart_000_0462_01C5831A.513B8250
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_0463_01C5831A.513B8250"


------=_NextPart_001_0463_01C5831A.513B8250
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

No, the EDiagram example doesn't do exactly what you want. Something =
like this:=20
new ChopboxAnchor(getERUPTaskFigure().getTheIcon());

However, as you will see when you try that, the connections will cut =
through the text to connect to the icon. You'll have to handle that =
case smartly.

BTW, in your ERUPTaskFigure, the task icon should be an ImageFigure, not =
a Label.
<bencomo@us.ibm.com> wrote in message =
news:dag338$iqe$1@news.eclipse.org...

Randy:=20

Thank you for your reply. Did you mean write my own anchor =
implementation similar to the one implemented in the =
org.eclipse.gef.examples.ediagram plug-in? That sort of worked since I =
can now see the selection rectangle only around the icon, not including =
the label. However, the labels are clipped and it forces me to resize =
the selection rectangle causing the connection to start and end where =
the labels begin and end. How can I get the connection to reach the =
connectors and go through the text/labels? Is that possible?=20

Thank you in advance,=20
Al.-=20


=20

=20
public class ERUPTaskFigure extends Figure implements HandleBounds=20
{=20
private Label theTaskIcon;=20
protected ERUPSelectableLabel label;=20

public ERUPTaskFigure()=20
{=20
ToolbarLayout layout =3D new ToolbarLayout();=20
layout.setStretchMinorAxis(false);=20
layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);=20
layout.setSpacing(2);=20
setLayoutManager(layout);=20
add(theTaskIcon =3D new Label());=20
add(label =3D new ERUPSelectableLabel());=20
label.setBorder(new MarginBorder(0, 1, 0, 0));=20
}=20
=20
public Rectangle getHandleBounds()=20
{=20
return getTheIcon().getBounds();=20
}=20
.....=20
...=20
..=20
}=20

=
------------------------------------------------------------ -------------=
---------------------------------------=20

public abstract class NodeEditPart=20
extends BaseEditPart=20
implements org.eclipse.gef.NodeEditPart=20
{=20

private ChopboxAnchor anchor;=20
.....=20
...=20
..=20
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart =
connection)=20
{=20
if (anchor =3D=3D null)=20
anchor =3D new ChopboxAnchor(getFigure());=20
return anchor;=20
}=20

public ConnectionAnchor getSourceConnectionAnchor(Request request)=20
{=20
if (anchor =3D=3D null)=20
anchor =3D new ChopboxAnchor(getFigure());=20
return anchor;=20
}=20

public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart =
connection)=20
{=20
if (anchor =3D=3D null)=20
anchor =3D new ChopboxAnchor(getFigure());=20
return anchor;=20
}=20

public ConnectionAnchor getTargetConnectionAnchor(Request request)=20
{=20
if (anchor =3D=3D null)=20
anchor =3D new ChopboxAnchor(getFigure());=20
return anchor;=20
}=20
...=20
.....=20
.......=20
}=20


------=_NextPart_001_0463_01C5831A.513B8250
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1505" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>No, the EDiagram example doesn't do =
exactly what=20
you want.&nbsp; Something like this: </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>new=20
ChopboxAnchor(getERUPTaskFigure().getTheIcon());</FONT></DIV >
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>However, as you will see when you try =
that, the=20
connections will cut through the text to connect to the icon.&nbsp; =
You'll have=20
to handle that case smartly.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>BTW, in your ERUPTaskFigure, the task =
icon should=20
be an ImageFigure, not a Label.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>&lt;<A =
href=3D"mailto:bencomo@us.ibm.com">bencomo@us.ibm.com</A>&gt; wrote=20
in message <A=20
=
href=3D"news:dag338$iqe$1@news.eclipse.org">news:dag338$iqe$1@news.eclips=
e.org</A>...</DIV><BR><FONT=20
face=3Dsans-serif size=3D2>Randy:</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>Thank you for your reply. Did you mean write my own anchor=20
implementation similar to the one implemented in the=20
org.eclipse.gef.examples.ediagram plug-in? &nbsp;That sort of worked =
since I=20
can now see the selection rectangle only around the icon, not =
including the=20
label. However, the labels are clipped and it forces me to resize the=20
selection rectangle causing the connection to start and end where the =
labels=20
begin and end. &nbsp;How can I get the connection to reach the =
connectors and=20
go through the text/labels? &nbsp;Is that possible?</FONT> =
<BR><BR><FONT=20
face=3Dsans-serif size=3D2>Thank you in advance,</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>Al.-</FONT> <BR><BR><BR><IMG=20
src=3D"cid:045a01c5833b$d84273f0$a6d02509@Dravid"> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp;</FONT> <BR><FONT face=3Dsans-serif size=3D2>public =
class=20
ERUPTaskFigure extends Figure implements HandleBounds</FONT> <BR><FONT =

face=3Dsans-serif size=3D2>{</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
private Label theTaskIcon;</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
protected ERUPSelectableLabel label;</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; public ERUPTaskFigure()</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; {</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; =
&nbsp;=20
ToolbarLayout layout =3D new ToolbarLayout();</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; &nbsp; layout.setStretchMinorAxis(false);</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp;=20
layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);</FONT > <BR><FONT =

face=3Dsans-serif size=3D2>&nbsp; &nbsp; layout.setSpacing(2);</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
setLayoutManager(layout);</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; add(theTaskIcon =3D =
new=20
Label());</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
add(label =3D=20
new ERUPSelectableLabel());</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; label.setBorder(new MarginBorder(0, 1, 0, 0));</FONT> <BR><FONT =

face=3Dsans-serif size=3D2>&nbsp; }</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
</FONT><BR><FONT face=3Dsans-serif size=3D2>&nbsp; public Rectangle=20
getHandleBounds()</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; =
{</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; return=20
getTheIcon().getBounds();</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
}</FONT> <BR><FONT face=3Dsans-serif size=3D2>.....</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>...</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>..</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>}</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
=
size=3D2> ------------------------------------------------------------ ----=
------------------------------------------------</FONT>=20
<BR><BR><FONT face=3Dsans-serif size=3D2>public abstract class =
NodeEditPart=20
</FONT><BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; =
&nbsp; extends=20
BaseEditPart</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
&nbsp;=20
&nbsp; implements org.eclipse.gef.NodeEditPart</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>{</FONT> <BR><BR><FONT face=3Dsans-serif =
size=3D2>private=20
ChopboxAnchor anchor;</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>.....</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>...</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>..</FONT> <BR><FONT face=3Dsans-serif size=3D2>public =
ConnectionAnchor=20
getSourceConnectionAnchor(ConnectionEditPart connection) =
</FONT><BR><FONT=20
face=3Dsans-serif size=3D2>{</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp; &nbsp;=20
&nbsp; &nbsp; if (anchor =3D=3D null)</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
anchor =3D new=20
ChopboxAnchor(getFigure());</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; return anchor;</FONT> <BR><FONT face=3Dsans-serif =

size=3D2>}</FONT> <BR><BR><FONT face=3Dsans-serif size=3D2>public =
ConnectionAnchor=20
getSourceConnectionAnchor(Request request) </FONT><BR><FONT =
face=3Dsans-serif=20
size=3D2>{</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
&nbsp; &nbsp;=20
if (anchor =3D=3D null)</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp; &nbsp;=20
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anchor =3D new=20
ChopboxAnchor(getFigure());</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; return anchor;</FONT> <BR><FONT face=3Dsans-serif =

size=3D2>}</FONT> <BR><BR><FONT face=3Dsans-serif size=3D2>public =
ConnectionAnchor=20
getTargetConnectionAnchor(ConnectionEditPart connection)</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp;{</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; if (anchor =3D=3D null)</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
anchor =3D new=20
ChopboxAnchor(getFigure());</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; return anchor;</FONT> <BR><FONT face=3Dsans-serif =

size=3D2>}</FONT> <BR><BR><FONT face=3Dsans-serif size=3D2>public =
ConnectionAnchor=20
getTargetConnectionAnchor(Request request) </FONT><BR><FONT =
face=3Dsans-serif=20
size=3D2>{</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
&nbsp; &nbsp;=20
if (anchor =3D=3D null)</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp; &nbsp;=20
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anchor =3D new=20
ChopboxAnchor(getFigure());</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; return anchor;</FONT> <BR><FONT face=3Dsans-serif =

size=3D2>}</FONT> <BR><FONT face=3Dsans-serif size=3D2>...</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>.....</FONT> <BR><FONT face=3Dsans-serif=20
size=3D2>.......</FONT> <BR><FONT face=3Dsans-serif size=3D2>}</FONT>=20
<BR><BR></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_0463_01C5831A.513B8250--

------=_NextPart_000_0462_01C5831A.513B8250
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-ID: <045a01c5833b$d84273f0$a6d02509@Dravid>

R0lGODlhkAE1AOcAAP////j4yAAAAEhImPjYmNj4+GBgUOjouNjYmLj4+ABI mNiYSJjY+EgAAHC4
+AAAcPj4uHAAAOjgsPi4cABwuEgAcEiY2LjYmPj42LhwAAAASEhwcJhIAJhI SNj4uEgASHAASHAA
cLhwcJhwAHCY2ODgsEhIcJi4mFBIOFBIQFhQSGBYUGhoWHBIAHhwYIiAaIiA eJCQcLiwqLj4uMDA
mMDAuNDQyPDwwPj4wJiYiFBQQFhQQGBYSHC42HhwWHh4aICAcJCIeJiQiJjY uKCYeKCggKigmKio
iKiomLCwiLi4kLj42MjAmNDIoNDQqNjYqODYsOjguOjo4PDw8Pjw8EhwuFhY SHBISHBoUHC4uJhI
cLCooLhwSNjY0Nj42PDo6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAA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aCLEDLk1InSe9/f/rnXGkFUKcC71addWBm3Vcr6hFqVke1zGMd 59evo76tn30lrEC4
cIIqvHO19fts9d6GAOFuKQNZwJJCWscm/fGvgPwjja5YY0Do5m1xpH3gmo4X p/I5aakPREzXZJtS
4sk1eHRyIPrA192m0lZAskur2xRrqCYRh2zPMaxHBYIdPcVXq4ydHnT+mdP3 BudQ+OWUaTDLnZZS
RzWomV2qlPs5rUKmv/RFT4Khg+EtXXc/edVIiI0IUXZuRK0mTjE7AwIAOw==

------=_NextPart_000_0462_01C5831A.513B8250--
Re: How to connect to one node within a composite Figure [message #186979 is a reply to message #186969] Thu, 07 July 2005 21:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

This is a multi-part message in MIME format.

------=_NextPart_000_04A5_01C5831B.826C79F0
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_04A6_01C5831B.826C79F0"


------=_NextPart_001_04A6_01C5831B.826C79F0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Your subclass of ChopboxAnchor can take a HandleBounds in the =
constructor. Then, using the handle bounds and the actual bounds of the =
figure, you'll be able to determine if a connection is going to cut =
through text, and if so, you can just return a point that is on =
circumference of the figure, rather than the icon.

Once you have this working, maybe you can contribute it to the EDiagram =
example :-)
"Pratik Shah" <none@unknown.com> wrote in message =
news:dak77p$noc$1@news.eclipse.org...
No, the EDiagram example doesn't do exactly what you want. Something =
like this:=20
new ChopboxAnchor(getERUPTaskFigure().getTheIcon());

However, as you will see when you try that, the connections will cut =
through the text to connect to the icon. You'll have to handle that =
case smartly.

BTW, in your ERUPTaskFigure, the task icon should be an ImageFigure, =
not a Label.
<bencomo@us.ibm.com> wrote in message =
news:dag338$iqe$1@news.eclipse.org...

Randy:=20

Thank you for your reply. Did you mean write my own anchor =
implementation similar to the one implemented in the =
org.eclipse.gef.examples.ediagram plug-in? That sort of worked since I =
can now see the selection rectangle only around the icon, not including =
the label. However, the labels are clipped and it forces me to resize =
the selection rectangle causing the connection to start and end where =
the labels begin and end. How can I get the connection to reach the =
connectors and go through the text/labels? Is that possible?=20

Thank you in advance,=20
Al.-=20


=20

=20
public class ERUPTaskFigure extends Figure implements HandleBounds=20
{=20
private Label theTaskIcon;=20
protected ERUPSelectableLabel label;=20

public ERUPTaskFigure()=20
{=20
ToolbarLayout layout =3D new ToolbarLayout();=20
layout.setStretchMinorAxis(false);=20
layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);=20
layout.setSpacing(2);=20
setLayoutManager(layout);=20
add(theTaskIcon =3D new Label());=20
add(label =3D new ERUPSelectableLabel());=20
label.setBorder(new MarginBorder(0, 1, 0, 0));=20
}=20
=20
public Rectangle getHandleBounds()=20
{=20
return getTheIcon().getBounds();=20
}=20
.....=20
...=20
..=20
}=20

=
------------------------------------------------------------ -------------=
---------------------------------------=20

public abstract class NodeEditPart=20
extends BaseEditPart=20
implements org.eclipse.gef.NodeEditPart=20
{=20

private ChopboxAnchor anchor;=20
.....=20
...=20
..=20
public ConnectionAnchor getSourceConnectionAnchor(ConnectionEditPart =
connection)=20
{=20
if (anchor =3D=3D null)=20
anchor =3D new ChopboxAnchor(getFigure());=20
return anchor;=20
}=20

public ConnectionAnchor getSourceConnectionAnchor(Request request)=20
{=20
if (anchor =3D=3D null)=20
anchor =3D new ChopboxAnchor(getFigure());=20
return anchor;=20
}=20

public ConnectionAnchor getTargetConnectionAnchor(ConnectionEditPart =
connection)=20
{=20
if (anchor =3D=3D null)=20
anchor =3D new ChopboxAnchor(getFigure());=20
return anchor;=20
}=20

public ConnectionAnchor getTargetConnectionAnchor(Request request)=20
{=20
if (anchor =3D=3D null)=20
anchor =3D new ChopboxAnchor(getFigure());=20
return anchor;=20
}=20
...=20
.....=20
.......=20
}=20


------=_NextPart_001_04A6_01C5831B.826C79F0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1505" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Your subclass of ChopboxAnchor can take =
a=20
HandleBounds in the constructor.&nbsp; Then, using the handle bounds and =
the=20
actual bounds of the figure, you'll be able to determine if a connection =
is=20
going to cut through text, and if so, you can just return a point that =
is on=20
circumference of the figure, rather than the icon.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Once you have this working, maybe you =
can=20
contribute it to the EDiagram example :-)</FONT></DIV>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Pratik Shah" &lt;<A=20
href=3D"mailto:none@unknown.com">none@unknown.com</A>&gt; wrote in =
message <A=20
=
href=3D"news:dak77p$noc$1@news.eclipse.org">news:dak77p$noc$1@news.eclips=
e.org</A>...</DIV>
<DIV><FONT face=3DArial size=3D2>No, the EDiagram example doesn't do =
exactly what=20
you want.&nbsp; Something like this: </FONT></DIV>
<DIV><FONT face=3DArial size=3D2>new=20
ChopboxAnchor(getERUPTaskFigure().getTheIcon());</FONT></DIV >
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>However, as you will see when you try =
that, the=20
connections will cut through the text to connect to the icon.&nbsp; =
You'll=20
have to handle that case smartly.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>BTW, in your ERUPTaskFigure, the task =
icon should=20
be an ImageFigure, not a Label.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>&lt;<A =
href=3D"mailto:bencomo@us.ibm.com">bencomo@us.ibm.com</A>&gt;=20
wrote in message <A=20
=
href=3D"news:dag338$iqe$1@news.eclipse.org">news:dag338$iqe$1@news.eclips=
e.org</A>...</DIV><BR><FONT=20
face=3Dsans-serif size=3D2>Randy:</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>Thank you for your reply. Did you mean write my own anchor=20
implementation similar to the one implemented in the=20
org.eclipse.gef.examples.ediagram plug-in? &nbsp;That sort of worked =
since I=20
can now see the selection rectangle only around the icon, not =
including the=20
label. However, the labels are clipped and it forces me to resize =
the=20
selection rectangle causing the connection to start and end where =
the labels=20
begin and end. &nbsp;How can I get the connection to reach the =
connectors=20
and go through the text/labels? &nbsp;Is that possible?</FONT> =
<BR><BR><FONT=20
face=3Dsans-serif size=3D2>Thank you in advance,</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>Al.-</FONT> <BR><BR><BR><IMG=20
src=3D"cid:049d01c5833d$094110f0$a6d02509@Dravid"> <BR><BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp;</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>public=20
class ERUPTaskFigure extends Figure implements HandleBounds</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>{</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
private Label theTaskIcon;</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
protected ERUPSelectableLabel label;</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; public ERUPTaskFigure()</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; {</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; =
&nbsp;=20
ToolbarLayout layout =3D new ToolbarLayout();</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; &nbsp; layout.setStretchMinorAxis(false);</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp;=20
layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);</FONT > =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
layout.setSpacing(2);</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
setLayoutManager(layout);</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; add(theTaskIcon =
=3D new=20
Label());</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
add(label =3D=20
new ERUPSelectableLabel());</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; label.setBorder(new MarginBorder(0, 1, 0, 0));</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; }</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; </FONT><BR><FONT face=3Dsans-serif size=3D2>&nbsp; =
public=20
Rectangle getHandleBounds()</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
{</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; return=20
getTheIcon().getBounds();</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
}</FONT> <BR><FONT face=3Dsans-serif size=3D2>.....</FONT> <BR><FONT =

face=3Dsans-serif size=3D2>...</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>..</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>}</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
=
size=3D2> ------------------------------------------------------------ ----=
------------------------------------------------</FONT>=20
<BR><BR><FONT face=3Dsans-serif size=3D2>public abstract class =
NodeEditPart=20
</FONT><BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; =
&nbsp; extends=20
BaseEditPart</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; =
&nbsp; &nbsp;=20
&nbsp; implements org.eclipse.gef.NodeEditPart</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>{</FONT> <BR><BR><FONT face=3Dsans-serif =
size=3D2>private=20
ChopboxAnchor anchor;</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>.....</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>...</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>..</FONT> <BR><FONT face=3Dsans-serif size=3D2>public =
ConnectionAnchor=20
getSourceConnectionAnchor(ConnectionEditPart connection) =
</FONT><BR><FONT=20
face=3Dsans-serif size=3D2>{</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; if (anchor =3D=3D null)</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
anchor =3D new=20
ChopboxAnchor(getFigure());</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; return anchor;</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>}</FONT> <BR><BR><FONT face=3Dsans-serif size=3D2>public =
ConnectionAnchor=20
getSourceConnectionAnchor(Request request) </FONT><BR><FONT =
face=3Dsans-serif=20
size=3D2>{</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
&nbsp; &nbsp;=20
if (anchor =3D=3D null)</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp; &nbsp;=20
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; anchor =3D new=20
ChopboxAnchor(getFigure());</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; return anchor;</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>}</FONT> <BR><BR><FONT face=3Dsans-serif size=3D2>public =
ConnectionAnchor=20
getTargetConnectionAnchor(ConnectionEditPart connection)</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp;{</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; if (anchor =3D=3D null)</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;=20
&nbsp; anchor =3D new ChopboxAnchor(getFigure());</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; return =
anchor;</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>}</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>public ConnectionAnchor getTargetConnectionAnchor(Request =
request)=20
</FONT><BR><FONT face=3Dsans-serif size=3D2>{</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; if (anchor =3D=3D null)</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp;=20
&nbsp; anchor =3D new ChopboxAnchor(getFigure());</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; return =
anchor;</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>}</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>...</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>.....</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>.......</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>}</FONT> <BR><BR></BLOCKQUOTE></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_04A6_01C5831B.826C79F0--

------=_NextPart_000_04A5_01C5831B.826C79F0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-ID: <049d01c5833d$094110f0$a6d02509@Dravid>

R0lGODlhkAE1AOcAAP////j4yAAAAEhImPjYmNj4+GBgUOjouNjYmLj4+ABI mNiYSJjY+EgA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ydHnT+mdP3 BudQ+OWUaTDLnZZS
RzWomV2qlPs5rUKmv/RFT4Khg+EtXXc/edVIiI0IUXZuRK0mTjE7AwIAOw==

------=_NextPart_000_04A5_01C5831B.826C79F0--
Re: How to connect to one node within a composite Figure [message #187245 is a reply to message #186979] Mon, 11 July 2005 07:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bencomo.us.ibm.com

This is a multipart message in MIME format.
--=_related 002A097A8825703B_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">Pratik / Randy:</font>
<br>
<br><font size=2 face="sans-serif">Thank you for your replies. &nbsp;I
have implemented your recommendations and it is working great (see attachment).
There is just one thing that Pratik mentioned regarding handling the case
when the connections cut through the text to connect to the icon. However,
I am quite new using the GEF API and I will appreciate if you can elaborate
a little bit more (small sample code) about how to determine if a connection
is going to cut through text.</font>
<br>
<br><font size=2 face="sans-serif">Thanks,</font>
<br><font size=2 face="sans-serif">Al.-</font>
<br>
<br><img src=cid:_1_06A1A6D806A1A484002A097A8825703B>
<br>
<br><font size=2 face="sans-serif">public ERUPTaskFigure()</font>
<br><font size=2 face="sans-serif">&nbsp; {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; _textFlow = new TextFlow();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; FlowPage flowPage = new
FlowPage();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; FlowLayout layout = new
FlowLayout()</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; protected Dimension
calculatePreferredSize(IFigure container, int wHint, int hHint)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; { &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; Dimension
size = super.calculatePreferredSize(container, wHint, hHint);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; size.height
= 75;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; size.width
= Math.max(size.width, 120);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; size.width
= Math.min(size.width, 120);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; return size;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; }</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; };</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);</font >
<br><font size=2 face="sans-serif">&nbsp; &nbsp; layout.setMajorAlignment(ToolbarLayout.ALIGN_CENTER);</font >
<br><font size=2 face="sans-serif">&nbsp; &nbsp; layout.setMajorSpacing(2);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; layout.setMinorSpacing(2);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; flowPage.setHorizontalAligment(PositionConstants.CENTER);
&nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; flowPage.add(_textFlow);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; add(_taskIcon = new ImageFigure());</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; add(flowPage);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; setLayoutManager(layout);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; </font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; _textFlow.setBorder(new
MarginBorder(0, 0, -1, -1)); &nbsp; &nbsp;</font>
<br><font size=2 face="sans-serif">&nbsp; }</font>
--=_related 002A097A8825703B_=
Content-Type: image/gif
Content-ID: <_1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BPprMdLUyt
GJgoNOB2b1trRG50vrR+Na3MQe5UhKvcwzC3uSiDrs+kW5TjUleC161Kdm1i 3e3ixLuaAu9vnite
bUKzn7pBb1nuyUlvrRNcBXSnCJFrw4LgMGbgjeazYPLNZdrSaTkz7y7/WzUs UROaBP4a1CSJz2Oq
BAfIdZaDU2LCZQ5lwhRmb3sTrOChPXPA14SlU7SE4BB/7Wqt3GbXbnmmU/rX aw0UW3/bO51KQqeA
XRnLfO2JGEfKCYE+FqB6y0tkmtgVny6Kq1wJuhDM0hWPT9TrYxXgV8BWKGIK IywcB4tYjXEvRFQm
zAn2mj0l61BdmS3IZgnQ2dDSdniOO02ikxEaKUEJNIg7Ym1hXftb2BbAdzPi 6UB0F7rfeQamBUio
bPYc6Cf7kbioLbKkJy0k0r1VjAS5UEApDUd5vSY2MQqYRAVHmSnYNjKKHh1G pWtSRBkPfHLskR2t
F2mzttpxC3hqF9/IVKAKRNecDrawhy2VgAAAOw==
--=_related 002A097A8825703B_=--
Re: How to connect to one node within a composite Figure [message #187367 is a reply to message #187245] Tue, 12 July 2005 00:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

This is a multi-part message in MIME format.

------=_NextPart_000_036E_01C5865A.0C76D460
Content-Type: multipart/alternative;
boundary="----=_NextPart_001_036F_01C5865A.0C76D460"


------=_NextPart_001_036F_01C5865A.0C76D460
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

getLocation() gets and returns a point -- together they form a line =
segment. Check to see if that line segment intersects the TextFlow's =
bounds (translate them to absolute first). =
PointList#intersects(Rectangle) shows how to determine whether a line =
segment intersects a rectangle.
<bencomo@us.ibm.com> wrote in message =
news:dat7n2$3e8$1@news.eclipse.org...

Pratik / Randy:=20

Thank you for your replies. I have implemented your recommendations =
and it is working great (see attachment). There is just one thing that =
Pratik mentioned regarding handling the case when the connections cut =
through the text to connect to the icon. However, I am quite new using =
the GEF API and I will appreciate if you can elaborate a little bit more =
(small sample code) about how to determine if a connection is going to =
cut through text.=20

Thanks,=20
Al.-=20

=20

public ERUPTaskFigure()=20
{=20
_textFlow =3D new TextFlow();=20
FlowPage flowPage =3D new FlowPage();=20
=20
FlowLayout layout =3D new FlowLayout()=20
{=20
protected Dimension calculatePreferredSize(IFigure container, =
int wHint, int hHint)=20
{ =20
Dimension size =3D super.calculatePreferredSize(container, =
wHint, hHint);=20
size.height =3D 75;=20
size.width =3D Math.max(size.width, 120);=20
size.width =3D Math.min(size.width, 120);=20
=20
return size;=20
}=20
};=20
layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);=20
layout.setMajorAlignment(ToolbarLayout.ALIGN_CENTER);=20
layout.setMajorSpacing(2);=20
layout.setMinorSpacing(2);=20
=20
flowPage.setHorizontalAligment(PositionConstants.CENTER); =20
flowPage.add(_textFlow);=20
add(_taskIcon =3D new ImageFigure());=20
add(flowPage);=20
setLayoutManager(layout);=20
=20
_textFlow.setBorder(new MarginBorder(0, 0, -1, -1)); =20
}
------=_NextPart_001_036F_01C5865A.0C76D460
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1505" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>getLocation()&nbsp;gets and returns a =
point --=20
together they form a line segment.&nbsp; Check to see if that line =
segment=20
intersects the TextFlow's bounds (translate them to absolute =
first).&nbsp;=20
PointList#intersects(Rectangle) shows how to determine whether a line =
segment=20
intersects a rectangle.</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>&lt;<A =
href=3D"mailto:bencomo@us.ibm.com">bencomo@us.ibm.com</A>&gt; wrote=20
in message <A=20
=
href=3D"news:dat7n2$3e8$1@news.eclipse.org">news:dat7n2$3e8$1@news.eclips=
e.org</A>...</DIV><BR><FONT=20
face=3Dsans-serif size=3D2>Pratik / Randy:</FONT> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>Thank you for your replies. &nbsp;I have implemented your=20
recommendations and it is working great (see attachment). There is =
just one=20
thing that Pratik mentioned regarding handling the case when the =
connections=20
cut through the text to connect to the icon. However, I am quite new =
using the=20
GEF API and I will appreciate if you can elaborate a little bit more =
(small=20
sample code) about how to determine if a connection is going to cut =
through=20
text.</FONT> <BR><BR><FONT face=3Dsans-serif size=3D2>Thanks,</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>Al.-</FONT> <BR><BR><IMG=20
src=3D"cid:036601c5867b$938259e0$a6d02509@Dravid"> <BR><BR><FONT =
face=3Dsans-serif=20
size=3D2>public ERUPTaskFigure()</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
{</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; _textFlow =
=3D new=20
TextFlow();</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
FlowPage=20
flowPage =3D new FlowPage();</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; </FONT><BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
FlowLayout layout=20
=3D new FlowLayout()</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp; &nbsp;=20
{</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; =
protected=20
Dimension calculatePreferredSize(IFigure container, int wHint, int=20
hHint)</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
&nbsp; { &nbsp;=20
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</FONT> <BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; Dimension size =
=3D=20
super.calculatePreferredSize(container, wHint, hHint);</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; size.height =3D =
75;</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; =
size.width =3D=20
Math.max(size.width, 120);</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; &nbsp; &nbsp; size.width =3D Math.min(size.width, 120);</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; =
</FONT><BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; &nbsp; return =
size;</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; &nbsp; }</FONT> =
<BR><FONT=20
face=3Dsans-serif size=3D2>&nbsp; &nbsp; };</FONT> <BR><FONT =
face=3Dsans-serif=20
size=3D2>&nbsp; &nbsp;=20
layout.setMinorAlignment(ToolbarLayout.ALIGN_CENTER);</FONT > <BR><FONT =

face=3Dsans-serif size=3D2>&nbsp; &nbsp;=20
layout.setMajorAlignment(ToolbarLayout.ALIGN_CENTER);</FONT > <BR><FONT =

face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
layout.setMajorSpacing(2);</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp;=20
layout.setMinorSpacing(2);</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; </FONT><BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp;=20
flowPage.setHorizontalAligment(PositionConstants.CENTER); &nbsp; =
&nbsp;</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; =
flowPage.add(_textFlow);</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp; add(_taskIcon =3D =
new=20
ImageFigure());</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; =
&nbsp;=20
add(flowPage);</FONT> <BR><FONT face=3Dsans-serif size=3D2>&nbsp; =
&nbsp;=20
setLayoutManager(layout);</FONT> <BR><FONT face=3Dsans-serif =
size=3D2>&nbsp;=20
&nbsp; </FONT><BR><FONT face=3Dsans-serif size=3D2>&nbsp; &nbsp;=20
_textFlow.setBorder(new MarginBorder(0, 0, -1, -1)); &nbsp; =
&nbsp;</FONT>=20
<BR><FONT face=3Dsans-serif size=3D2>&nbsp; =
}</FONT></BLOCKQUOTE></BODY></HTML>

------=_NextPart_001_036F_01C5865A.0C76D460--

------=_NextPart_000_036E_01C5865A.0C76D460
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-ID: <036601c5867b$938259e0$a6d02509@Dravid>

R0lGODlh4gCnAOcAAP////j4yAAAAPjYmEhImNj4+GBgUOjouEgAAHC4+NjY mLj4+ABImHAAAAAA
cPj4uOjgsJjY+Pi4cAAASLjYmNj4uEgAcHAAcNiYSEiY2JhwAABwuJhIALhw APj42HAASLj4uJi4
mEhwcJhISODgsEgASHCY2LhwcFBIOFBIQFhQSGBYUGhoWHhwYIiAaJCQcLiw qMDAuNDQyNj42PDw
wPj4wNi4cEhIcFhQQHBIAHhwWHh4aICAcIiAeJCIeJiQiJiYiJjYuKCYeKCg gKigmKioiKiomLCw
iLi4kMDAmMjAmNDIoNDQqNjYqODYsOjguPDw8EiYmHC42LiYSLj42AAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAA
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UpTG/E44U5LD nR0SmEYClzoN0CRy
hRKEY2wSCIn5zl0CsZoX+RwXPeX/w4fccXn7kuNaEAXAOuELAP3hjPEE5gAB kOZEqWvNYGgDmXq5
Tl9XHEh/HEUoQLnrbvai4kFf97Y3oqpfM5kV+fzUPJWqa0cMg5dguJi8yXCU VeebVBVTVVKCsuVu
nREAgCSzIZ5qbnBF7ZNbMMAwCA21IJhyGAgUxCBSRWBWluNdggyVROj1b6Bd 9U0Z3wdPfHakrGZF
IVoxckd0GkRChdvIqsIqkbYOb1vTuwAIHpbFyZ2gRZvLYuZ8NCjGvasCfGVQ oSQAGc0l9k6DRSJW
KbdP9GltiVQEnvlaZKk+WbGLWVyUq06a0Tiar7Jbi5+MILM4ytjOdb3TybuU 2tqc/zBPprMdLUyt
GJgoNOB2b1trRG50vrR+Na3MQe5UhKvcwzC3uSiDrs+kW5TjUleC161Kdm1i 3e3ixLuaAu9vnite
bUKzn7pBb1nuyUlvrRNcBXSnCJFrw4LgMGbgjeazYPLNZdrSaTkz7y7/WzUs UROaBP4a1CSJz2Oq
BAfIdZaDU2LCZQ5lwhRmb3sTrOChPXPA14SlU7SE4BB/7Wqt3GbXbnmmU/rX aw0UW3/bO51KQqeA
XRnLfO2JGEfKCYE+FqB6y0tkmtgVny6Kq1wJuhDM0hWPT9TrYxXgV8BWKGIK IywcB4tYjXEvRFQm
zAn2mj0l61BdmS3IZgnQ2dDSdniOO02ikxEaKUEJNIg7Ym1hXftb2BbAdzPi 6UB0F7rfeQamBUio
bPYc6Cf7kbioLbKkJy0k0r1VjAS5UEApDUd5vSY2MQqYRAVHmSnYNjKKHh1G pWtSRBkPfHLskR2t
F2mzttpxC3hqF9/IVKAKRNecDrawhy2VgAAAOw==

------=_NextPart_000_036E_01C5865A.0C76D460--
Re: How to connect to one node within a composite Figure [message #187487 is a reply to message #187367] Tue, 12 July 2005 20:13 Go to previous message
Eclipse UserFriend
Originally posted by: bencomo.us.ibm.com

Pratik:

In my subclass of ChopboxAnchor, I have overridden the getLocation method
to implement your suggestion and check if the line segment intersects the
TextFlow's bounds. However, PointList#intersects(Rectangle) is not
returning true when the line segment intersects. I probably did not
understand correctly your previous message, please let me know if you see
what I am missing.

Thank you in advance,
Al.-

public Point getLocation(Point reference)
{
Rectangle textRect = null;
PointList pointList = new PointList();

textRect = taskFigure.getLabel().getBounds().getCopy();
taskFigure.getLabel().translateToAbsolute(textRect);

Rectangle r = Rectangle.SINGLETON;
r.setBounds(getBox());
r.translate(-1, -1);
r.resize(1, 1);

getOwner().translateToAbsolute(r);

float centerX = r.x + 0.5f * r.width;
float centerY = r.y + 0.5f * r.height;

if (r.isEmpty() || (reference.x == (int) centerX && reference.y ==
(int) centerY))
return new Point((int) centerX, (int) centerY);

float dx = reference.x - centerX;
float dy = reference.y - centerY;

float scale = 0.5f / Math.max(Math.abs(dx) / r.width, Math.abs(dy) /
r.height);

dx *= scale;
dy *= scale;
centerX += dx;
centerY += dy;

Point linkPoint = new Point(Math.round(centerX), Math.round(centerY));

pointList.addPoint(linkPoint);

if (pointList.intersects(textRect))
{
// I am not doing anyhting here yet...
// I just want to check if intersects() returns true
return linkPoint; // Apply offset before return it..
}
return linkPoint;
}
Previous Topic:Toogle buttons on the pallete
Next Topic:Draw2d and modifying default Canvas scrolling
Goto Forum:
  


Current Time: Mon Dec 30 16:53:37 GMT 2024

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

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

Back to the top