Page Index Toggle Pages: 1 Send TopicPrint
Hot Topic (More than 10 Replies) Item hover action (Read 9839 times)
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Item hover action
May 31st, 2007 at 11:42am
Print Post  
Hi,

Is there an Item hover action?
I am using FlowChartAdapter, and it has many items actions - but no hover.

Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Item hover action
Reply #1 - May 31st, 2007 at 12:16pm
Print Post  
Hi,

There isn't a hover event available. You could handle MouseListener.mouseMoved(), convert the mouse coordinates to document ones using deviceToDoc(), and call getItemAt() to find out what item is under the mouse cursor.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Item hover action
Reply #2 - May 31st, 2007 at 1:02pm
Print Post  
I will do that.

Abother question related to the FlowChartAdapter: I have overriden the method drawItem, and set the custom draw to Shadows.
It seems that no matter what I draw there, it is truncated to about 2 pixels on the right of the box and 2 pixels under the box (like the two edges of a regular shadow).
I tried using Additional - it colored only inside the rectangle and that's it. I've tried the All - and suddnely only the Overview panel (?) got colored. It seems that the items that are drawn are also the Overview and the entire FlowChart somehow.
All I want is to add a rectangle around a Box. How can it be done?

Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Item hover action
Reply #3 - May 31st, 2007 at 3:26pm
Print Post  
The control sets the clipping region to the box shape before calling your custom drawing code. You could clear the clipping region and will be able to draw anywhere in the chart.

When the CustomDraw property is set to Full, the DrawItem event is raised once to draw the item's shadow and second time to draw the item itself. In that case you should check the value of the "shadow" parameter and run the appropriate drawing code.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Item hover action
Reply #4 - Jun 3rd, 2007 at 10:15am
Print Post  
That's true that changing the clipping region allows me to draw anywhere - but what I got then is that the border I've added was painted outside of the FlowChart whenever the Box stood near the edge.
I've tried to paint the border inside the clipping zone but it looks as though the box filling goes over it and hides it.
Finally, I've tried using Full CustomDraw - and somehow this caused the draw to run for the entire FlowChart and the Overview. All I did in the drawItem method is to fill the box in yellow, and this is what I got...
http://albums.tapuz.co.il/Albums/getImage.aspa=1248443&b=0&c=1248443200763151420...
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Item hover action
Reply #5 - Jun 3rd, 2007 at 2:18pm
Print Post  
Ok, instead of clearing the clipping region, set it to fc.deviceToDoc(fc.getVisibleRect()). Also keep the original clipping region in a variable, and restore it once you finish painting.

On a side note, it seems you haven't received the email messages we sent you; perhaps they went into the junk-email folder or were blocked altogether by your anti-spam software. Try contacting us from another email address, e.g. at yahoo or google, where you can receive the email from us.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Item hover action
Reply #6 - Jun 4th, 2007 at 5:06am
Print Post  
Regarding getting updated source code, you might open a ticket in our HelpDesk:

http://mindfusion.org/cgi/HelpDesk/index.php

and we will send you links to the updated source code and licensed builds of the jar there.

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Item hover action
Reply #7 - Jun 4th, 2007 at 7:13am
Print Post  
Hi Stoyo,
I received today an email from you Support and replied it. They explained they we must have blocked by mistake one of your domains.

About your suggestion: there is no deviceToDoc in FlowChart. I found a method like that in Utilities class - but it's protected. What method did you mean?
And in that subject - did you mean getVisibleRect of the surrounding JPanel?

Thanks!
Yoav

  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Item hover action
Reply #8 - Jun 4th, 2007 at 8:12am
Print Post  
Hi Yoav,

I can see a

public Rectangle2D.Float deviceToDoc(Rectangle devRect)

method in the Flowchart.java; can't you access it when using the compiled class?

Why not call Box.setPen() to draw a wider frame around the box, instead of custom drawing?

Stoyan
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Item hover action
Reply #9 - Jun 4th, 2007 at 8:54am
Print Post  
Hi,

As far as I know, when not stating the publicity of a method, it is by defualt protected. And since I do not reside in your package - I can't access it.

Our graphic designer suggested in order to create a prettier diagram, to use an outer grey border - meaning that we will have the box, a pixel wide border of empty space (white border) and then another pixel wide grey border.
When box is selected, the white (empty) border will be colored in red.
I've attached how it should look:

http://albums.tapuz.co.il/Albums/getImage.aspa=1248443&b=0&c=1248443200764135329...

So this is why I need some kind of customize draw. And it is important to do it like that in order to match look&feel of other products we have.


By the way: Do you think I can do that by setShape() and painting the border as Decoration?

Thanks,
Yoav
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Item hover action
Reply #10 - Jun 4th, 2007 at 9:32am
Print Post  
Hi,

Exactly, but the method starts with a "public" modifier, at least in the Flowchart class.

public Rectangle2D.Float deviceToDoc(Rectangle devRect)

Do you refer to the one in Utilities?

I guess the easiest implementation is to use the Additional custom-draw style and draw the white borders in a rectangle that's two pixels smaller than the original one. That should prevent the clipping issue as well, since you will draw inside the clipping region. Also set the Box.Pen to have the same color as the Brush, so that the outher frame and the interior have the same color.

Stoyan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Item hover action
Reply #11 - Jun 4th, 2007 at 9:40am
Print Post  
... that will work unless you want to see through the white borders ...
  
Back to top
 
IP Logged
 
ymoran00
Full Member
***
Offline



Posts: 163
Joined: May 2nd, 2007
Re: Item hover action
Reply #12 - Jun 4th, 2007 at 9:47am
Print Post  
Hurrah!  Grin
It was my mistake - since the method drawItem ran inside inner class in my Chart, I used this.deviceToDoc() and didn't understand why I can't find that method.
Once I reffered to the chart itself - I found that method.
And it works great!
Thanks!
Yoav
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint