mirror of
https://github.com/arduino/Arduino.git
synced 2025-01-18 07:52:14 +01:00
Splashscreen
This commit is contained in:
parent
af3c2bd1f6
commit
2a0bc2bfca
6
.gitignore
vendored
6
.gitignore
vendored
@ -21,7 +21,8 @@ build/windows/libastylej*
|
||||
build/windows/arduino-*.zip
|
||||
build/windows/dist/*.tar.gz
|
||||
build/windows/dist/*.tar.bz2
|
||||
build/windows/launch4j-*
|
||||
build/windows/launch4j-*.tgz
|
||||
build/windows/launch4j-*.zip
|
||||
build/windows/launcher/launch4j
|
||||
build/windows/WinAVR-*.zip
|
||||
build/macosx/arduino-*.zip
|
||||
@ -44,8 +45,5 @@ test-bin
|
||||
.idea
|
||||
.DS_Store
|
||||
.directory
|
||||
build/windows/launch4j-*
|
||||
build/windows/launcher/launch4j
|
||||
build/windows/WinAVR-*.zip
|
||||
hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/passwords.h
|
||||
avr-toolchain-*.zip
|
||||
|
96
app/src/cc/arduino/view/SplashScreenHelper.java
Normal file
96
app/src/cc/arduino/view/SplashScreenHelper.java
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* This file is part of Arduino.
|
||||
*
|
||||
* Code inspired by this tutorial http://wiki.netbeans.org/Splash_Screen_Beginner_Tutorial. License says "You may modify and use it as you wish."
|
||||
*
|
||||
* Copyright 2015 Arduino LLC (http://www.arduino.cc/)
|
||||
*
|
||||
* Arduino 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.
|
||||
*
|
||||
* This program 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 this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*
|
||||
* As a special exception, you may use this file as part of a free software
|
||||
* library without restriction. Specifically, if other files instantiate
|
||||
* templates or use macros or inline functions from this file, or you compile
|
||||
* this file and link it with other files to produce an executable, this
|
||||
* file does not by itself cause the resulting executable to be covered by
|
||||
* the GNU General Public License. This exception does not however
|
||||
* invalidate any other reasons why the executable file might be covered by
|
||||
* the GNU General Public License.
|
||||
*/
|
||||
|
||||
package cc.arduino.view;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.util.Map;
|
||||
|
||||
public class SplashScreenHelper {
|
||||
|
||||
private final Map desktopHints;
|
||||
private SplashScreen splash;
|
||||
private Rectangle2D.Double splashTextArea;
|
||||
private Graphics2D splashGraphics;
|
||||
|
||||
public SplashScreenHelper(SplashScreen splash) {
|
||||
this.splash = splash;
|
||||
Toolkit tk = Toolkit.getDefaultToolkit();
|
||||
desktopHints = (Map) tk.getDesktopProperty("awt.font.desktophints");
|
||||
}
|
||||
|
||||
public void splashText(String str) {
|
||||
if (splash == null) {
|
||||
printText(str);
|
||||
return;
|
||||
}
|
||||
if (!splash.isVisible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (splashTextArea == null) {
|
||||
// stake out some area for our status information
|
||||
splashTextArea = new Rectangle2D.Double(0, 300, 520, 30);
|
||||
|
||||
// create the Graphics environment for drawing status info
|
||||
splashGraphics = splash.createGraphics();
|
||||
|
||||
if (desktopHints != null) {
|
||||
splashGraphics.addRenderingHints(desktopHints);
|
||||
}
|
||||
}
|
||||
|
||||
// erase the last status text
|
||||
splashGraphics.setPaint(new Color(245, 245, 245));
|
||||
splashGraphics.fill(splashTextArea);
|
||||
|
||||
// draw the text
|
||||
splashGraphics.setPaint(Color.BLACK);
|
||||
FontMetrics metrics = splashGraphics.getFontMetrics();
|
||||
splashGraphics.drawString(str, (int) splashTextArea.getX() + 10, (int) splashTextArea.getY() + (30 - metrics.getHeight()) + 4);
|
||||
|
||||
// make sure it's displayed
|
||||
splash.update();
|
||||
}
|
||||
|
||||
public void close() {
|
||||
if (splash == null) {
|
||||
return;
|
||||
}
|
||||
splash.close();
|
||||
}
|
||||
|
||||
public void printText(String str) {
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
}
|
@ -23,6 +23,7 @@
|
||||
package processing.app;
|
||||
|
||||
import cc.arduino.packages.DiscoveryManager;
|
||||
import cc.arduino.view.SplashScreenHelper;
|
||||
import processing.app.debug.TargetBoard;
|
||||
import processing.app.debug.TargetPackage;
|
||||
import processing.app.debug.TargetPlatform;
|
||||
@ -56,6 +57,7 @@ import static processing.app.I18n._;
|
||||
public class Base {
|
||||
|
||||
static private boolean commandLine;
|
||||
public static SplashScreenHelper splashScreenHelper;
|
||||
|
||||
// A single instance of the preferences window
|
||||
Preferences preferencesFrame;
|
||||
@ -87,6 +89,8 @@ public class Base {
|
||||
System.setProperty("awt.useSystemAAFontSettings", "on");
|
||||
System.setProperty("swing.aatext", "true");
|
||||
|
||||
splashScreenHelper = new SplashScreenHelper(SplashScreen.getSplashScreen());
|
||||
|
||||
BaseNoGui.initLogger();
|
||||
|
||||
BaseNoGui.notifier = new GUIUserNotifier();
|
||||
@ -221,8 +225,10 @@ public class Base {
|
||||
}
|
||||
}
|
||||
|
||||
splashScreenHelper.splashText(_("Initializing packages..."));
|
||||
BaseNoGui.initPackages();
|
||||
|
||||
splashScreenHelper.splashText(_("Preparing boards..."));
|
||||
|
||||
// Setup board-dependent variables.
|
||||
onBoardOrPortChange();
|
||||
|
||||
@ -263,6 +269,7 @@ public class Base {
|
||||
Preferences.save();
|
||||
|
||||
if (parser.isVerifyOrUploadMode()) {
|
||||
splashScreenHelper.close();
|
||||
// Set verbosity for command line build
|
||||
Preferences.set("build.verbose", "" + parser.isDoVerboseBuild());
|
||||
Preferences.set("upload.verbose", "" + parser.isDoVerboseUpload());
|
||||
@ -290,6 +297,8 @@ public class Base {
|
||||
System.exit(0);
|
||||
}
|
||||
else if (parser.isGuiMode()) {
|
||||
splashScreenHelper.splashText(_("Starting..."));
|
||||
|
||||
// Check if there were previously opened sketches to be restored
|
||||
restoreSketches();
|
||||
|
||||
|
@ -302,6 +302,7 @@
|
||||
|
||||
<option value="-Xms128M"/>
|
||||
<option value="-Xmx512M"/>
|
||||
<option value="-splash:$APP_ROOT/Contents/Java/lib/splash.png"/>
|
||||
|
||||
<bundledocument extensions="ino,c,cpp,h"
|
||||
icon="macosx/template.app/Contents/Resources/pde.icns"
|
||||
|
10
build/linux/dist/arduino
vendored
10
build/linux/dist/arduino
vendored
@ -1,4 +1,4 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
CURDIR=`pwd`
|
||||
APPDIR="$(dirname -- "$(readlink -f -- "${0}")" )"
|
||||
@ -20,5 +20,11 @@ export LD_LIBRARY_PATH
|
||||
|
||||
export PATH="${APPDIR}/java/bin:${PATH}"
|
||||
|
||||
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel processing.app.Base --curdir $CURDIR "$@"
|
||||
if [[ "$@" == *"--upload"* || "$@" == *"--upload"* || "$@" == *"--get-pref"* ]] ; then
|
||||
SPLASH=""
|
||||
else
|
||||
SPLASH="-splash:./lib/splash.png"
|
||||
fi
|
||||
|
||||
java -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel $SPLASH processing.app.Base --curdir $CURDIR "$@"
|
||||
|
||||
|
@ -87,6 +87,9 @@
|
||||
<key>MainClass</key>
|
||||
<string>processing.app.Base</string>
|
||||
|
||||
<key>SplashFile</key>
|
||||
<string>$APP_PACKAGE/Contents/Resources/Java/lib/splash.png</string>
|
||||
|
||||
<key>JVMVersion</key>
|
||||
<string>1.6*</string>
|
||||
|
||||
|
BIN
build/shared/lib/splash.png
Normal file
BIN
build/shared/lib/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 122 KiB |
@ -4,6 +4,7 @@ ARDUINO 1.6.2
|
||||
[ide]
|
||||
* In platform.txt, pre and post build hooks can now be specified. Example: recipe.hooks.prebuild.0.pattern=echo "Hello {build.source.path}". Thanks @Wackerbarth
|
||||
* Windows and MacOSX JVM Xmx halved to 512M
|
||||
* Introduced starting splashscreen with progress status: will be used for notifying user of long running startup tasks
|
||||
|
||||
ARDUINO 1.6.1 - 2015.03.10
|
||||
|
||||
|
@ -29,21 +29,16 @@
|
||||
</classPath>
|
||||
<jre>
|
||||
<path>java</path>
|
||||
<minVersion>1.6.0</minVersion>
|
||||
<minVersion>1.8.0</minVersion>
|
||||
<maxVersion></maxVersion>
|
||||
<jdkPreference>preferJre</jdkPreference>
|
||||
<opt>-splash:./lib/splash.png</opt>
|
||||
</jre>
|
||||
<splash>
|
||||
<file>about.bmp</file>
|
||||
<waitForWindow>true</waitForWindow>
|
||||
<timeout>60</timeout>
|
||||
<timeoutErr>true</timeoutErr>
|
||||
</splash>
|
||||
<messages>
|
||||
<startupErr>An error occurred while starting the application.</startupErr>
|
||||
<bundledJreErr>This application was configured to use a bundled Java Runtime Environment but the runtime is missing or corrupted.</bundledJreErr>
|
||||
<jreVersionErr>This application requires at least Java Development Kit</jreVersionErr>
|
||||
<launcherErr>The registry refers to a nonexistent Java Development Kit installation or the runtime is corrupted.</launcherErr>
|
||||
<launcherErr>The registry refers to a nonexistent Java Development Kit installation or the runtime is corrupted.</launcherErr>
|
||||
<instanceAlreadyExistsMsg>An application instance is already running.</instanceAlreadyExistsMsg>
|
||||
</messages>
|
||||
</launch4jConfig>
|
||||
|
@ -29,7 +29,7 @@
|
||||
</classPath>
|
||||
<jre>
|
||||
<path>java</path>
|
||||
<minVersion>1.6.0</minVersion>
|
||||
<minVersion>1.8.0</minVersion>
|
||||
<maxVersion></maxVersion>
|
||||
<jdkPreference>preferJre</jdkPreference>
|
||||
</jre>
|
||||
|
Loading…
x
Reference in New Issue
Block a user