Revision: 4360
          http://sourceforge.net/p/jump-pilot/code/4360
Author:   ma15569
Date:     2015-03-31 05:35:18 +0000 (Tue, 31 Mar 2015)
Log Message:
-----------


Modified Paths:
--------------
    core/trunk/src/com/vividsolutions/jump/workbench/ui/LayerNameRenderer.java

Modified: 
core/trunk/src/com/vividsolutions/jump/workbench/ui/LayerNameRenderer.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/workbench/ui/LayerNameRenderer.java  
2015-03-31 05:27:24 UTC (rev 4359)
+++ core/trunk/src/com/vividsolutions/jump/workbench/ui/LayerNameRenderer.java  
2015-03-31 05:35:18 UTC (rev 4360)
@@ -957,6 +957,38 @@
 
     }
 
+    // /////////////////////////////////////////////////////////////////
+    // This method takes a String of text and simulates word wrapping
+    // by applying HTML code <BR> after 300 characters per line. It
+    // will check to make sure that we are not in the middle of a word
+    // before breaking the line.
+    // /////////////////////////////////////////////////////////////////
+    public static String SplitString(String string) {
+
+        StringBuffer buf = new StringBuffer();
+        String tempString = string;
+
+        if (string != null) {
+
+            while (tempString.length() > 190) {
+                String block = tempString.substring(0, 400);
+                int index = block.lastIndexOf(' ');
+                if (index < 0) {
+                    index = tempString.indexOf(' ');
+                }
+                if (index >= 0) {
+                    buf.append(tempString.substring(0, index) + "<BR>");
+                }
+                tempString = tempString.substring(index + 1);
+            }
+        } else {
+            tempString = " ";
+        }
+        buf.append(tempString);
+        return buf.toString();
+
+    }
+    
     @Override
     // [ede 11.2012] this is necessary for comboboxes with transparent bg, like
     // in


------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the 
conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to