Revision: 4106
          http://vexi.svn.sourceforge.net/vexi/?rev=4106&view=rev
Author:   mkpg2
Date:     2011-04-11 23:09:54 +0000 (Mon, 11 Apr 2011)

Log Message:
-----------
Improve. Centre text in applet display.

Modified Paths:
--------------
    trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java

Modified: trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java
===================================================================
--- trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java       
2011-04-11 13:30:53 UTC (rev 4105)
+++ trunk/org.vexi-launcher/src/main/java/org/vexi/launcher/Launcher.java       
2011-04-11 23:09:54 UTC (rev 4106)
@@ -312,7 +312,7 @@
             String codebase = getCodeBase()+"";
             updateStatus(""+codebase);
             //log("Codebase is "+url);
-
+            
             if (!checkUrl(codebase)) {
                 permitAlternativeURL(codebase);
             }
@@ -386,9 +386,6 @@
             updateError("Error; please check the Java console");
             e.printStackTrace();
         }
-//        finally{
-//            Splash.close();
-//        }
     }
     
     static public class Problem extends Exception {
@@ -521,9 +518,11 @@
         g.setColor(Color.white);
         g.fillRect(0, 0, getSize().width, getSize().height);
         
-        
+        int centerOffset = (getSize().width-(int)font.getStringBounds(text, 
g.getFontRenderContext()).getWidth())/2;
+        System.err.println(centerOffset);
         g.setColor(color);
-        g.drawString(text, 0, 15);
+        g.setFont(font);
+        g.drawString(text, centerOffset, 15);
         
         g2.setClip(0, 0, getSize().width, getSize().height);
         g2.drawImage(backbuffer, 0, 0, null);


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Forrester Wave Report - Recovery time is now measured in hours and minutes
not days. Key insights are discussed in the 2010 Forrester Wave Report as
part of an in-depth evaluation of disaster recovery service providers.
Forrester found the best-in-class provider in terms of services and vision.
Read this report now!  http://p.sf.net/sfu/ibm-webcastpromo
_______________________________________________
Vexi-svn mailing list
Vexi-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vexi-svn

Reply via email to