Added JavaFX initialization
*
* This file is part of MZmine 2.
*
- * MZmine 2 is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
+ * MZmine 2 is free software; you can redistribute it and/or modify it under the terms of the GNU
+ * General Public License as published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
*
- * MZmine 2 is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ * MZmine 2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
+ * even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along with
- * MZmine 2; if not, write to the Free Software Foundation, Inc., 51 Franklin St,
- * Fifth Floor, Boston, MA 02110-1301 USA
+ * You should have received a copy of the GNU General Public License along with MZmine 2; if not,
+ * write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
+ * USA
*/
package net.sf.mzmine.desktop.impl;
@@ -28,11 +27,11 @@ import java.util.logging.Logger;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
+import javafx.embed.swing.JFXPanel;
import net.sf.mzmine.util.components.MultiLineToolTipUI;
/**
- * This class has just a single method which sets desktop (Swing) properties for
- * MZmine 2
+ * This class has just a single method which sets desktop (Swing) properties for MZmine 2
*/
public class DesktopSetup {
@@ -77,8 +76,7 @@ public class DesktopSetup {
// Set tooltip UI to support multi-line tooltips
UIManager.put("ToolTipUI", MultiLineToolTipUI.class.getName());
- UIManager.put(MultiLineToolTipUI.class.getName(),
- MultiLineToolTipUI.class);
+ UIManager.put(MultiLineToolTipUI.class.getName(), MultiLineToolTipUI.class);
// If we are running on Mac OS X, we can setup some Mac-specific
// features. The MacSpecificSetup class is located in
@@ -93,8 +91,7 @@ public class DesktopSetup {
Method setupMethod = macSetupClass.getMethod("init");
setupMethod.invoke(macSetup, new Object[0]);
} catch (Throwable e) {
- logger.log(Level.WARNING,
- "Error setting mac-specific properties", e);
+ logger.log(Level.WARNING, "Error setting mac-specific properties", e);
}
}
@@ -102,6 +99,11 @@ public class DesktopSetup {
// would appear at the top left corner by default.
System.setProperty("java.awt.Window.locationByPlatform", "true");
+ // Initialize JavaFX
+ logger.finest("Initializing the JavaFX subsystem by creating a JFXPanel instance");
+ @SuppressWarnings("unused")
+ JFXPanel dummyPanel = new JFXPanel();
+
}
}
