001: /*
002: Launch4j (http://launch4j.sourceforge.net/)
003: Cross-platform Java application wrapper for creating Windows native executables.
004:
005: Copyright (c) 2004, 2007 Grzegorz Kowal
006:
007: All rights reserved.
008:
009: Redistribution and use in source and binary forms, with or without modification,
010: are permitted provided that the following conditions are met:
011:
012: * Redistributions of source code must retain the above copyright notice,
013: this list of conditions and the following disclaimer.
014: * Redistributions in binary form must reproduce the above copyright notice,
015: this list of conditions and the following disclaimer in the documentation
016: and/or other materials provided with the distribution.
017: * Neither the name of the Launch4j nor the names of its contributors
018: may be used to endorse or promote products derived from this software without
019: specific prior written permission.
020:
021: THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
022: "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
023: LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
024: A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
025: CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
026: EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
027: PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
028: PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
029: LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
030: NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
031: SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
032: */
033:
034: /*
035: * Created on Apr 21, 2005
036: */
037: package net.sf.launch4j.config;
038:
039: import java.io.File;
040:
041: import net.sf.launch4j.binding.IValidatable;
042: import net.sf.launch4j.binding.Validator;
043:
044: /**
045: * @author Copyright (C) 2005 Grzegorz Kowal
046: */
047: public class Splash implements IValidatable {
048:
049: // 1.x config properties_____________________________________________________________
050: public static final String SPLASH_FILE = "splash";
051: public static final String WAIT_FOR_TITLE = "waitForTitle";
052: public static final String TIMEOUT = "splashTimeout";
053: public static final String TIMEOUT_ERR = "splashTimeoutErr";
054:
055: // __________________________________________________________________________________
056: private File file;
057: private boolean waitForWindow = true;
058: private int timeout = 60;
059: private boolean timeoutErr = true;
060:
061: public void checkInvariants() {
062: Validator.checkFile(file, "splash.file", Messages
063: .getString("Splash.splash.file"));
064: Validator.checkRange(timeout, 1, 60 * 15, "splash.timeout",
065: Messages.getString("Splash.splash.timeout"));
066: }
067:
068: /** Splash screen in BMP format. */
069: public File getFile() {
070: return file;
071: }
072:
073: public void setFile(File file) {
074: this .file = file;
075: }
076:
077: /** Splash timeout in seconds. */
078: public int getTimeout() {
079: return timeout;
080: }
081:
082: public void setTimeout(int timeout) {
083: this .timeout = timeout;
084: }
085:
086: /** Signal error on splash timeout. */
087: public boolean isTimeoutErr() {
088: return timeoutErr;
089: }
090:
091: public void setTimeoutErr(boolean timeoutErr) {
092: this .timeoutErr = timeoutErr;
093: }
094:
095: /** Hide splash screen when the child process displayes the first window. */
096: public boolean getWaitForWindow() {
097: return waitForWindow;
098: }
099:
100: public void setWaitForWindow(boolean waitForWindow) {
101: this.waitForWindow = waitForWindow;
102: }
103: }
|