perfsonar-dev - perfsonar: r5345 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ui
Subject: perfsonar development work
List archive
- From:
- To:
- Subject: perfsonar: r5345 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ui
- Date: Fri, 6 Nov 2009 14:42:12 -0500
Author: michael.bischoff
Date: 2009-11-06 14:42:11 -0500 (Fri, 06 Nov 2009)
New Revision: 5345
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/PerfSonarApp.java
Log:
- fixed some indenting and style
- Added additional fallback step for LaF to use Nimbus if avail
Modified:
branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/PerfSonarApp.java
===================================================================
--- branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/PerfSonarApp.java
2009-11-06 19:20:11 UTC (rev 5344)
+++ branches/perfsonarui/src/org/perfsonar/perfsonarui/ui/PerfSonarApp.java
2009-11-06 19:42:11 UTC (rev 5345)
@@ -44,6 +44,7 @@
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.WindowConstants;
+import javax.swing.UIManager.LookAndFeelInfo;
import javax.swing.plaf.metal.DefaultMetalTheme;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.plaf.metal.OceanTheme;
@@ -270,41 +271,37 @@
/*
* This is to run it within eclipse and with Jawa Web Start.
*/
- if (perfsonarTabs.size()==0) {
- logger.info("Plugins not found, loading MA and IPPM tabs.");
-
- String[] tabs = {
- "org.perfsonar.perfsonarui.ma.MAPerfsonarModel",
- "org.perfsonar.perfsonarui.ippm.IPPMPerfsonarModel",
- "org.perfsonar.perfsonarui.flowsa.FlowsaMATab",
-
"org.perfsonar.perfsonarui.playground.PerfsonarPlaygroundModel",
- "org.perfsonar.perfsonarui.bwctl.BWCTLPerfsonarTab",
- "org.perfsonar.perfsonarui.lookingglass.LookingGlassTab",
-
"org.perfsonar.perfsonarui.lsplayground.LSPlaygroundModel"
- };
-
- for (String tabclass : tabs)
- try {
- Object object = Introspection.loadCreateObject(tabclass);
- if (object instanceof IPerfsonarTab) {
-
- IPerfsonarTab tab = (IPerfsonarTab) object;
- tab.setParameters(cmdOpts);
- perfsonarTabs.add(tab);
- System.out.println(tabclass + " loaded.");
- } else {
- System.out.println(tabclass);
- }
-
-
- } catch (Exception x) {
- x.printStackTrace();
- logger.error(x);
- }
-
- Collections.sort(perfsonarTabs);
-
- }
+ if (perfsonarTabs.size()==0) {
+ logger.info("Plugins not found, loading MA and IPPM
tabs.");
+
+ String[] tabs = {
+ "org.perfsonar.perfsonarui.ma.MAPerfsonarModel",
+
"org.perfsonar.perfsonarui.ippm.IPPMPerfsonarModel",
+ "org.perfsonar.perfsonarui.flowsa.FlowsaMATab",
+
"org.perfsonar.perfsonarui.playground.PerfsonarPlaygroundModel",
+
"org.perfsonar.perfsonarui.bwctl.BWCTLPerfsonarTab",
+
"org.perfsonar.perfsonarui.lookingglass.LookingGlassTab",
+
"org.perfsonar.perfsonarui.lsplayground.LSPlaygroundModel"
+ };
+
+ for (String tabclass : tabs) {
+ try {
+ Object object =
Introspection.loadCreateObject(tabclass);
+ if (object instanceof IPerfsonarTab) {
+ IPerfsonarTab tab = (IPerfsonarTab)
object;
+ tab.setParameters(cmdOpts);
+ perfsonarTabs.add(tab);
+ System.out.println(tabclass + "
loaded.");
+ } else {
+ System.out.println(tabclass);
+ }
+ } catch (Exception x) {
+ x.printStackTrace();
+ logger.error(x);
+ }
+ }
+ Collections.sort(perfsonarTabs);
+ }
} catch (Exception x) {
x.printStackTrace();
logger.error(x);
@@ -467,9 +464,19 @@
if (LOOKANDFEEL != null) {
String osName = System.getProperty("os.name");
- if (osName.startsWith("Windows")) lookAndFeel =
UIManager.getSystemLookAndFeelClassName();
- else lookAndFeel =
UIManager.getCrossPlatformLookAndFeelClassName();
-
+ if (osName.startsWith("Windows")) {
+ lookAndFeel =
UIManager.getSystemLookAndFeelClassName();
+ } else {
+ for(LookAndFeelInfo info :
UIManager.getInstalledLookAndFeels()) {
+ if(info.getName().equalsIgnoreCase("Nimbus"))
{
+ lookAndFeel = info.getClassName();
+ }
+ }
+ }
+ if(lookAndFeel == null) {
+ lookAndFeel =
UIManager.getCrossPlatformLookAndFeelClassName();
+ }
+
/*
if (LOOKANDFEEL.equals("Metal")) {
lookAndFeel =
UIManager.getCrossPlatformLookAndFeelClassName();
- perfsonar: r5345 - branches/perfsonarui/src/org/perfsonar/perfsonarui/ui, svnlog, 11/06/2009
Archive powered by MHonArc 2.6.16.