Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Modifying figure on a mouse click
Modifying figure on a mouse click [message #154993] Thu, 21 October 2004 20:57 Go to next message
Eclipse UserFriend
Originally posted by: bo.fubar.majewski.com

I need to implement a figure that by default is very small, say a simple
label with a 16 x 16 pixels icon. I want to enable the user to click on
a hot spot of this figure to reveal or hide information. Something along
these lines:

[X some text @]<--------------.
| |
mouse click |
| mouse click
\/ |
-------------- |
|X some text @|---------------
|-------------|
| more text_1 |
| more text_2 |
| ... |
| more text_n |
--------------

Can I use any existing requests and/or policies? Or do I need to modify
SelectionTool and post Requests when it notices a click over a hot spot
of a figure, create a policy that handles it and so on? Are there any
examples of how to modify existing tools and create new types of
Requests? Any help and pointers to relevant information are greatly
appreciated!
Re: Modifying figure on a mouse click [message #155056 is a reply to message #154993] Fri, 22 October 2004 03:43 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_00C4_01C4B7C7.B52DD070
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

HotDraw used hotspot figures and the selection tool I think, but this =
isn't a general solution.

In your case, you can use Clickable or Toggle in Draw2d, which is a =
Figure designed for receiving mouse input. GEF is designed to allow =
figures like these to preempt whatever tool is active.

For an example, look at the PaletteDrawerFigure (although it's pretty =
complex I'll admit). You just need to create the clickable, and add an =
action listener.

"Bo Majewski" <bo@fubar.majewski.com> wrote in message =
news:cl97gc$hsg$1@eclipse.org...
> I need to implement a figure that by default is very small, say a =
simple=20
> label with a 16 x 16 pixels icon. I want to enable the user to click =
on=20
> a hot spot of this figure to reveal or hide information. Something =
along=20
> these lines:
>=20
> [X some text @]<--------------.
> | |
> mouse click |
> | mouse click
> \/ |
> -------------- |
> |X some text @|---------------
> |-------------|
> | more text_1 |
> | more text_2 |
> | ... |
> | more text_n |
> --------------
>=20
> Can I use any existing requests and/or policies? Or do I need to =
modify=20
> SelectionTool and post Requests when it notices a click over a hot =
spot=20
> of a figure, create a policy that handles it and so on? Are there any=20
> examples of how to modify existing tools and create new types of=20
> Requests? Any help and pointers to relevant information are greatly=20
> appreciated!
------=_NextPart_000_00C4_01C4B7C7.B52DD070
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.1400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2></FONT><FONT face=3DArial =
size=3D2>HotDraw used hotspot=20
figures and the selection tool I think, but this isn't&nbsp;a general=20
solution.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>In your case, you can use Clickable or =
Toggle in=20
Draw2d, which is a Figure designed for receiving mouse input.&nbsp; GEF =
is=20
designed to allow figures like these to preempt whatever tool is=20
active.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>For an example, look at the =
PaletteDrawerFigure=20
(although it's pretty complex I'll admit).&nbsp; You just need to create =
the=20
clickable, and add an action listener.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>"Bo Majewski" &lt;</FONT><A=20
href=3D"mailto:bo@fubar.majewski.com"><FONT face=3DArial=20
size=3D2>bo@fubar.majewski.com</FONT></A><FONT face=3DArial =
size=3D2>&gt; wrote in=20
message </FONT><A href=3D"news:cl97gc$hsg$1@eclipse.org"><FONT =
face=3DArial=20
size=3D2>news:cl97gc$hsg$1@eclipse.org</FONT></A><FONT face=3DArial=20
size=3D2>...</FONT></DIV><FONT face=3DArial size=3D2>&gt; I need to =
implement a figure=20
that by default is very small, say a simple <BR>&gt; label with a 16 x =
16 pixels=20
icon. I want to enable the user to click on <BR>&gt; a hot spot of this =
figure=20
to reveal or hide information. Something along <BR>&gt; these =
lines:<BR>&gt;=20
<BR><FONT face=3D"Courier New">&gt; [X some text =
@]&lt;--------------.<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;=
&nbsp;&nbsp;&nbsp;=20
|<BR>&gt; =
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
mouse click&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp; |<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &=
nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
mouse=20
click<BR>&gt;=20
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =

\/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs p=
;&nbsp;&nbsp;&nbsp;=20
|<BR>&gt;=20
--------------&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|<BR>&gt; |X some text @|---------------<BR>&gt; |-------------|<BR>&gt; =
| more=20
text_1 |<BR>&gt; | more text_2 |<BR>&gt; |=20
....&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n bsp;&nbsp;&nbsp; |<BR>&gt; | more =
text_n=20
|<BR>&gt; --------------<BR></FONT>&gt; <BR>&gt; Can I use any existing =
requests=20
and/or policies? Or do I need to modify <BR>&gt; SelectionTool and post =
Requests=20
when it notices a click over a hot spot <BR>&gt; of a figure, create a =
policy=20
that handles it and so on? Are there any <BR>&gt; examples of how to =
modify=20
existing tools and create new types of <BR>&gt; Requests? Any help and =
pointers=20
to relevant information are greatly <BR>&gt; =
appreciated!</FONT></BODY></HTML>

------=_NextPart_000_00C4_01C4B7C7.B52DD070--
Re: Modifying figure on a mouse click [message #155189 is a reply to message #155056] Fri, 22 October 2004 17:18 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: bo.fubar.majewski.com

Randy Hudson wrote:
> HotDraw used hotspot figures and the selection tool I think, but this isn't a general solution.

Randy, thanks for suggestions. Just a few questions? Is HotDraw a GEF
based editor? If so, where can I download it's source code (assuming,
the author(s) made it available)?
Re: Modifying figure on a mouse click [message #155196 is a reply to message #155189] Fri, 22 October 2004 17:47 Go to previous message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

No, it's a completely separate Swing library. I thought you had taken the
term "hotspot" from that framework.

"Bo Majewski" <bo@fubar.majewski.com> wrote in message
news:clbf37$bcp$1@eclipse.org...
> Randy Hudson wrote:
> > HotDraw used hotspot figures and the selection tool I think, but this
isn't a general solution.
>
> Randy, thanks for suggestions. Just a few questions? Is HotDraw a GEF
> based editor? If so, where can I download it's source code (assuming,
> the author(s) made it available)?
Previous Topic:[ANN] The EclipseUML for Eclipse 3
Next Topic:Problem with > and . keys
Goto Forum:
  


Current Time: Thu Apr 25 12:50:00 GMT 2024

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

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

Back to the top