Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Refresh tool tip on figure
Refresh tool tip on figure [message #172302] Thu, 17 March 2005 16:30 Go to next message
Diana Lau is currently offline Diana LauFriend
Messages: 8
Registered: July 2009
Junior Member
Hi,

Is there a way to force the tool tip of the figure to refresh?

I have a scenario that there are two figures: ChildFigure and ParentFigure
which both extends from IFigure, and ParentFigure contains ChildFigure. I
have a mouse motion listener, so that when the mouse is hover over
ChildFigure or ParentFigure, it gives the corresponding tool tip.

But if I hover over ChildFigure, it shows the tool tip for ChildFigure,
then the mouse is moved to the ParentFigure (without hovering other
figures in between), the tool tip still shows the ChildFigure one.

Thanks,
Diana
Re: Refresh tool tip on figure [message #172527 is a reply to message #172302] Fri, 18 March 2005 23:22 Go to previous messageGo to next message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
You must be doing something wrong. Maybe you didn't set up the listeners,
etc. properly.

"Diana" <dhmlau@ca.ibm.com> wrote in message
news:d1cbak$dt7$1@www.eclipse.org...
> Hi,
>
> Is there a way to force the tool tip of the figure to refresh?
>
> I have a scenario that there are two figures: ChildFigure and ParentFigure
> which both extends from IFigure, and ParentFigure contains ChildFigure. I
> have a mouse motion listener, so that when the mouse is hover over
> ChildFigure or ParentFigure, it gives the corresponding tool tip.
>
> But if I hover over ChildFigure, it shows the tool tip for ChildFigure,
> then the mouse is moved to the ParentFigure (without hovering other
> figures in between), the tool tip still shows the ChildFigure one.
>
> Thanks,
> Diana
>
Re: Refresh tool tip on figure [message #172746 is a reply to message #172527] Mon, 21 March 2005 16:14 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

Dynamically changing the tooltip of a *single* figure does not update the
displayed tooltip. But, as Pratik pointed out, changing the figure under
the mouse, and therefore the source of the tooltip, should work. Please
post test case code.

"Pratik Shah" <ppshah@us.ibm.com> wrote in message
news:d1fnrc$g49$1@www.eclipse.org...
> You must be doing something wrong. Maybe you didn't set up the listeners,
> etc. properly.
>
> "Diana" <dhmlau@ca.ibm.com> wrote in message
> news:d1cbak$dt7$1@www.eclipse.org...
>> Hi,
>>
>> Is there a way to force the tool tip of the figure to refresh?
>>
>> I have a scenario that there are two figures: ChildFigure and
>> ParentFigure
>> which both extends from IFigure, and ParentFigure contains ChildFigure.
>> I
>> have a mouse motion listener, so that when the mouse is hover over
>> ChildFigure or ParentFigure, it gives the corresponding tool tip.
>>
>> But if I hover over ChildFigure, it shows the tool tip for ChildFigure,
>> then the mouse is moved to the ParentFigure (without hovering other
>> figures in between), the tool tip still shows the ChildFigure one.
>>
>> Thanks,
>> Diana
>>
>
>
Re: Refresh tool tip on figure [message #173097 is a reply to message #172746] Tue, 22 March 2005 22:03 Go to previous message
Diana Lau is currently offline Diana LauFriend
Messages: 8
Registered: July 2009
Junior Member
My scenario is that I have an edit part called MyEditPart, which has a
MyFigure. Inside the figure, it keeps track of its child figures (I'm
calling them marker figures, as they are marker-related decorators).

When I hover the mouse over MyFigure, it gives me the tool tip text for
MyFigure. And when I hover over one of the marker figure which is still
belong to MyFigure, it continues to show tool tip text for MyFigure.

I have two listeners:
1) on MyEditPart to listen to mouse motion on the figure (need to set it
on the edit part level, so it knows the model of the edit part)

protected MouseMotionListener fMouseMotionListener = new
MouseMotionListener.Stub() {
public void mouseHover(MouseEvent me)
{
if (me.getSource().equals(getFigure())) {
String hoverText =
HoverHelperManager.getHoverText(getPropertyMapModel());
if (hoverText == null)
getFigure().setToolTip(null);
else
getFigure().setToolTip(new Label(hoverText));

}
}
};



2) on MyFigure to listen to mouse motion on the marker figures

protected MouseMotionListener fMouseMotionListner = new
MouseMotionListener.Stub() {
public void mouseHover(MouseEvent me)
{
if (me.getSource() instanceof MarkerImageFigure) {
IMarker marker = ((MarkerImageFigure)me.getSource()).getMarker();
String hoverText = HoverHelperManager.getHoverText(marker);
if (hoverText == null)
setToolTip(null);
else
setToolTip(new Label(hoverText));
}

}
};


Thanks for your help.

Diana
Previous Topic:Move object by keyboard
Next Topic:transforming a tree-like model to a"flat" editpart hierachy
Goto Forum:
  


Current Time: Fri Apr 26 08:35:12 GMT 2024

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

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

Back to the top