Skip to main content



      Home
Home » Eclipse Projects » GEF » Border usage
Border usage [message #80671] Fri, 23 May 2003 09:38 Go to next message
Eclipse UserFriend
Hi,

Is it possible to create a border that is a combination of lines and some
shapes for a figure? Below is an example of a border that I would like to
create:

________________________________
| |
| |
| |
|_____ /\_________ _ _ ____/\____|
------>/__\ \/----->

The arrow to the triangle and from the diamond indicate that a
connection could exist from another element to the border and/or from the
border to another element.
Re: Border usage [message #80704 is a reply to message #80671] Fri, 23 May 2003 09:59 Go to previous messageGo to next message
Eclipse UserFriend
Borders are fairly simple to implement. You could subclass LineBorder and
override paint(...) and getInsets(). Just draw the triangle, diamond and arrows
in the paint method and in getInsets(), return insets big enough to contain
these shapes. Be sure to call super.paint(...) so the outline gets painted.

Eric


AK wrote:

> Hi,
>
> Is it possible to create a border that is a combination of lines and some
> shapes for a figure? Below is an example of a border that I would like to
> create:
>
> ________________________________
> | |
> | |
> | |
> |_____ /\_________ _ _ ____/\____|
> ------>/__\ \/----->
>
> The arrow to the triangle and from the diamond indicate that a
> connection could exist from another element to the border and/or from the
> border to another element.
>
>
Re: Border usage [message #80745 is a reply to message #80671] Fri, 23 May 2003 10:38 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

This is a multi-part message in MIME format.

------=_NextPart_000_0053_01C32117.6191DEE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

It would be nice if we could define the metaphor for this type of thing. =
Other IBM applications use a shape like this:

+-----\
| \
| /
+-----/

Which appear on the right or left side. It is the same shape in either =
case, but for outgoing the "tip" is pointed outside the shape.

Remember that a figures bounds has to encompass everything that will be =
painted. So, your bounds will be slightly larger than the box around =
the figure, since the shape hangs outside of the box. If you don't like =
where selection handles end up as a result of this, implement the =
interface HandleBounds.

"AK" <akatti@ca.ibm.com> wrote in message =
news:bal884$khg$1@rogue.oti.com...
> Hi,
>=20
> Is it possible to create a border that is a combination of lines and =
some
> shapes for a figure? Below is an example of a border that I would like =
to
> create:
>=20
> ________________________________
> | |
> | |
> | |
> |_____ /\_________ _ _ ____/\____|
> ------>/__\ \/----->
>=20
> The arrow to the triangle and from the diamond indicate that a
> connection could exist from another element to the border and/or from =
the
> border to another element.=20
> =20
>=20

------=_NextPart_000_0053_01C32117.6191DEE0
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.2723.2500" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>It would be nice if we could define the =
metaphor=20
for this type of thing.&nbsp; Other IBM applications use a shape like=20
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>+-----\</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

\</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

/</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>+-----/</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Which appear on the right or left =
side.&nbsp; It is=20
the same shape in either case, but for outgoing the "tip" is pointed =
outside the=20
shape.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Remember that a figures bounds has to =
encompass=20
everything that will be painted.&nbsp; So, your bounds will be slightly =
larger=20
than the box around the figure, since the shape hangs outside of the =
box.&nbsp;=20
If you don't like where selection handles end up as a result of this, =
implement=20
the interface HandleBounds.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"AK" &lt;</FONT><A=20
href=3D"mailto:akatti@ca.ibm.com"><FONT face=3DArial=20
size=3D2>akatti@ca.ibm.com</FONT></A><FONT face=3DArial size=3D2>&gt; =
wrote in message=20
</FONT><A href=3D"news:bal884$khg$1@rogue.oti.com"><FONT face=3DArial=20
size=3D2>news:bal884$khg$1@rogue.oti.com</FONT></A><FONT face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; Hi,<BR>&gt; =
<BR>&gt; Is it=20
possible to create a border that is a combination of lines and =
some<BR>&gt;=20
shapes for a figure? Below is an example of a border that I would like=20
to<BR>&gt; create:<BR>&gt; <BR>&gt; &nbsp;&nbsp;&nbsp;=20
________________________________<BR>&gt; &nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;=20
|<BR>&gt; &nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;=20
|<BR>&gt; &nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;=20
|<BR>&gt; &nbsp;&nbsp; |_____ /\_________ _ _ ____/\____|<BR>&gt; &nbsp; =

------&gt;/__\&nbsp;&nbsp;&nbsp;&nbsp;&a mp;nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=20
\/-----&gt;<BR>&gt; <BR>&gt; &nbsp;&nbsp; The arrow to the triangle and =
from the=20
diamond indicate that a<BR>&gt; connection could exist from another =
element to=20
the border and/or from the<BR>&gt; border to another element. <BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;=20
<BR>&gt; </FONT></BODY></HTML>

------=_NextPart_000_0053_01C32117.6191DEE0--
Previous Topic:Move Bendpoints With ManhattanConnection Router
Next Topic:Java Media Framework
Goto Forum:
  


Current Time: Fri Jul 25 07:54:03 EDT 2025

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

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

Back to the top