1 | /*
|
---|
2 | Launch4j (http://launch4j.sourceforge.net/)
|
---|
3 | Cross-platform Java application wrapper for creating Windows native executables.
|
---|
4 |
|
---|
5 | Copyright (C) 2004, 2006 Grzegorz Kowal
|
---|
6 |
|
---|
7 | This program is free software; you can redistribute it and/or modify
|
---|
8 | it under the terms of the GNU General Public License as published by
|
---|
9 | the Free Software Foundation; either version 2 of the License, or
|
---|
10 | (at your option) any later version.
|
---|
11 |
|
---|
12 | This program is distributed in the hope that it will be useful,
|
---|
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
15 | GNU General Public License for more details.
|
---|
16 |
|
---|
17 | You should have received a copy of the GNU General Public License
|
---|
18 | along with this program; if not, write to the Free Software
|
---|
19 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
---|
20 | */
|
---|
21 |
|
---|
22 | /*
|
---|
23 | * Created on Apr 21, 2005
|
---|
24 | */
|
---|
25 | package net.sf.launch4j.config;
|
---|
26 |
|
---|
27 | import java.io.File;
|
---|
28 |
|
---|
29 | import net.sf.launch4j.binding.IValidatable;
|
---|
30 | import net.sf.launch4j.binding.Validator;
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * @author Copyright (C) 2005 Grzegorz Kowal
|
---|
34 | */
|
---|
35 | public class Splash implements IValidatable {
|
---|
36 | public static final String SPLASH_FILE = "splash"; //$NON-NLS-1$
|
---|
37 | public static final String WAIT_FOR_TITLE = "waitForTitle"; //$NON-NLS-1$
|
---|
38 | public static final String TIMEOUT = "splashTimeout"; //$NON-NLS-1$
|
---|
39 | public static final String TIMEOUT_ERR = "splashTimeoutErr"; //$NON-NLS-1$
|
---|
40 |
|
---|
41 | private File file;
|
---|
42 | private boolean waitForWindow = true;
|
---|
43 | private int timeout = 60;
|
---|
44 | private boolean timeoutErr = true;
|
---|
45 |
|
---|
46 | public void checkInvariants() {
|
---|
47 | Validator.checkFile(file, "splash.file", Messages.getString("Splash.splash.file")); //$NON-NLS-1$ //$NON-NLS-2$
|
---|
48 | Validator.checkRange(timeout, 1, 60 * 15, "splash.timeout", Messages.getString("Splash.splash.timeout")); //$NON-NLS-1$ //$NON-NLS-2$
|
---|
49 | }
|
---|
50 |
|
---|
51 | /** Splash screen in BMP format. */
|
---|
52 | public File getFile() {
|
---|
53 | return file;
|
---|
54 | }
|
---|
55 |
|
---|
56 | public void setFile(File file) {
|
---|
57 | this.file = file;
|
---|
58 | }
|
---|
59 |
|
---|
60 | /** Splash timeout in seconds. */
|
---|
61 | public int getTimeout() {
|
---|
62 | return timeout;
|
---|
63 | }
|
---|
64 |
|
---|
65 | public void setTimeout(int timeout) {
|
---|
66 | this.timeout = timeout;
|
---|
67 | }
|
---|
68 |
|
---|
69 | /** Signal error on splash timeout. */
|
---|
70 | public boolean isTimeoutErr() {
|
---|
71 | return timeoutErr;
|
---|
72 | }
|
---|
73 |
|
---|
74 | public void setTimeoutErr(boolean timeoutErr) {
|
---|
75 | this.timeoutErr = timeoutErr;
|
---|
76 | }
|
---|
77 |
|
---|
78 | /** Hide splash screen when the child process displayes the first window. */
|
---|
79 | public boolean getWaitForWindow() {
|
---|
80 | return waitForWindow;
|
---|
81 | }
|
---|
82 |
|
---|
83 | public void setWaitForWindow(boolean waitForWindow) {
|
---|
84 | this.waitForWindow = waitForWindow;
|
---|
85 | }
|
---|
86 | }
|
---|