Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How can I set and show anchors in IconNode (Read 1894 times)
gamjaradio
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 42
Joined: Jul 16th, 2010
How can I set and show anchors in IconNode
Feb 7th, 2011 at 11:40am
Print Post  
I made an IconNode , but it doesn't show out anchors around it.

I want show eight number of anchors on it , and that looks colorful.

How can I sort i out?

please help me.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How can I set and show anchors in IconNode
Reply #1 - Feb 7th, 2011 at 2:05pm
Print Post  
You can find the diagram coordinates for each anchor point as shown below, and then render some shape at (cX,cY) by calling Graphics2D.draw(...) from the IconNode.draw override. We could also add a public method to let you run the standard AnchorPattern drawing code from your custom class.

double cX = nodeRect.getX() + nodeRect.getWidth() * x / 100;
double cY = nodeRect.getY() + nodeRect.getHeight() * y / 100;

cX,cY above are the absolute coordinates you can pass to Graphics2D, and x,y are the node-relative coordinates returned by AnchorPoint.getX/Y().

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint