Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic How can I keep the node size as same bulk of Text (Read 6560 times)
gamjaradio
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 42
Joined: Jul 16th, 2010
How can I keep the node size as same bulk of Text
Aug 18th, 2010 at 6:55am
Print Post  
the Elglish is very well for 'resizeToFitText( FitSize.KeepRatio)'

However , it is flipped when using Korean.

I have to use korean , that is unicode so 2byte per a word.

How can I solve this problem.

please help me
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How can I keep the node size as same bulk of T
Reply #1 - Aug 18th, 2010 at 8:22am
Print Post  
I've tried the following with some text from yahoo.co.kr, and in the node it looks the same as on the web page. Could you email to support@mindfusion.eu some sample code that shows the problem?

  
Back to top
 
IP Logged
 
gamjaradio
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 42
Joined: Jul 16th, 2010
Re: How can I keep the node size as same bulk of T
Reply #2 - Aug 18th, 2010 at 12:55pm
Print Post  
I did as you write. but it goes wrong

this is the exception

Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index: 1, Size: 2
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.get(Unknown Source)
at com.mindfusion.diagramming.TextLayout.a(Unknown Source)
at com.mindfusion.diagramming.ShapeNode.a(Unknown Source)
at com.mindfusion.diagramming.ShapeNode.a(Unknown Source)
at com.mindfusion.diagramming.ShapeNode.draw(Unknown Source)
at com.mindfusion.diagramming.PainterVisitor.a(Unknown Source)
at com.mindfusion.diagramming.DiagramItem.a(Unknown Source)
at com.mindfusion.diagramming.DiagramNode.a(Unknown Source)
at com.mindfusion.diagramming.Diagram.c(Unknown Source)
at com.mindfusion.diagramming.Diagram.a(Unknown Source)
at com.mindfusion.diagramming.Diagram.b(Unknown Source)
at com.mindfusion.diagramming.Diagram.a(Unknown Source)
at com.mindfusion.diagramming.DiagramView.a(Unknown Source)
at com.mindfusion.diagramming.DiagramView.paintComponent(Unknown Source)
at javax.swing.JComponent.paint(Unknown Source)
at javax.swing.JComponent.paintToOffscreen(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(Unknown Source)
at javax.swing.RepaintManager$PaintManager.paint(Unknown Source)
at javax.swing.RepaintManager.paint(Unknown Source)
at javax.swing.JComponent._paintImmediately(Unknown Source)
at javax.swing.JComponent.paintImmediately(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.paintDirtyRegions(Unknown Source)
at javax.swing.RepaintManager.seqPaintDirtyRegions(Unknown Source)
at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

and the size of Shape doensnt fit to text.

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


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How can I keep the node size as same bulk of T
Reply #3 - Aug 18th, 2010 at 1:21pm
Print Post  
Are you calling this method from a worker thread or from JavaScript?
  
Back to top
 
IP Logged
 
gamjaradio
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 42
Joined: Jul 16th, 2010
Re: How can I keep the node size as same bulk of T
Reply #4 - Aug 18th, 2010 at 9:52pm
Print Post  
I did it in the RCP thread.

Display.getDefault().asyncExec(new Runnable() {
     
       public void run() {
}

in the run
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How can I keep the node size as same bulk of T
Reply #5 - Aug 19th, 2010 at 7:07am
Print Post  
This control is not thread-safe and any modifications must be done from the Swing UI thread. If your original code does not run in the Swing thread anyway, use SwingUtilities.invokeAndWait() instead of Display.asyncExec(). RCP threads are part from the Eclipse API from what I can understand; if you can't use invokeAndWait() from Eclipse, try to stop diagram rendering while doing modifications, by means of the suspendRepaint() and resumeRepaint() methods of DiagramView.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
gamjaradio
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 42
Joined: Jul 16th, 2010
Re: How can I keep the node size as same bulk of T
Reply #6 - Aug 19th, 2010 at 9:35am
Print Post  
It's great , I solved the exception by your amazing support.

but the problem is remaining.

the size of Node as big as Text.

I did you do in that source code.

I can't figure out this one.
please help me

and some thing weird there,
How did you wrap the Korean Text?
the Node of mine doesn't do that.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: How can I keep the node size as same bulk of T
Reply #7 - Aug 19th, 2010 at 9:48am
Print Post  
Are there any space characters in your text? I think the control wraps text only at word boundaries by default.
  
Back to top
 
IP Logged
 
gamjaradio
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 42
Joined: Jul 16th, 2010
Re: How can I keep the node size as same bulk of T
Reply #8 - Aug 19th, 2010 at 10:42am
Print Post  
ah ha..
I made mistake at my own.

Thank a lot. your great help always make me up and impressed.

Thanks stoyo
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint