Mp3dings 
20100427

de.mospace.swing.event
Class MessageEvent

java.lang.Object
  extended by java.util.EventObject
      extended by de.mospace.swing.event.MessageEvent
All Implemented Interfaces:
Serializable

public class MessageEvent
extends EventObject

A simple event consisting of a String message and a timeout for the duration of the message display.

Version:
$Revision: 12 $ ($Date: 2007-07-27 11:48:53 +0200 (Fr, 27 Jul 2007) $)
Author:
Moritz Ringler
See Also:
Serialized Form

Field Summary
static int DEFAULT_TIMEOUT
          Timeout argument for the 4-argument MessageEvent constructor that tells MessageListeners to use their respective default timeouts.
static int NO_CLEAR
          Timeout argument for the 4-argument MessageEvent constructor that tells MessageListeners to not clear the message display.
static int TYPE_ERROR
          Type argument for the 3- and 4-argument MessageEvent constructors - for error messages.
static int TYPE_INFO
          Type argument for the 3- and 4-argument MessageEvent constructors - for information messages.
static int TYPE_WARNING
          Type argument for the 3- and 4-argument MessageEvent constructors - for warning messages.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
MessageEvent(Object source, String message)
          Constructs a new message event with the specified source, and message.
MessageEvent(Object source, String message, int type)
          Constructs a new message event with the specified source, message, and type.
MessageEvent(Object source, String message, int type, int timeout)
          Constructs a new message event with the specified source, message, type, and timeout.
 
Method Summary
 String getMessage()
          Returns the message of this message event.
 int getTimeout()
          Returns the timeout for this message event.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_INFO

public static final int TYPE_INFO
Type argument for the 3- and 4-argument MessageEvent constructors - for information messages.

See Also:
Constant Field Values

TYPE_ERROR

public static final int TYPE_ERROR
Type argument for the 3- and 4-argument MessageEvent constructors - for error messages.

See Also:
Constant Field Values

TYPE_WARNING

public static final int TYPE_WARNING
Type argument for the 3- and 4-argument MessageEvent constructors - for warning messages.

See Also:
Constant Field Values

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
Timeout argument for the 4-argument MessageEvent constructor that tells MessageListeners to use their respective default timeouts.

See Also:
Constant Field Values

NO_CLEAR

public static final int NO_CLEAR
Timeout argument for the 4-argument MessageEvent constructor that tells MessageListeners to not clear the message display.

See Also:
Constant Field Values
Constructor Detail

MessageEvent

public MessageEvent(Object source,
                    String message)
Constructs a new message event with the specified source, and message. Equivalent to MessageEvent(source, message, TYPE_INFO, DEFAULT_TIMEOUT)

Parameters:
source - the source for the new event
message - the message for the new event

MessageEvent

public MessageEvent(Object source,
                    String message,
                    int type)
Constructs a new message event with the specified source, message, and type. Equivalent to MessageEvent(source, message, type, DEFAULT_TIMEOUT)

Parameters:
source - the source for the new event
message - the message for the new event
type - the type of message for the new event. One of TYPE_INFO, TYPE_ERROR, TYPE_WARNING

MessageEvent

public MessageEvent(Object source,
                    String message,
                    int type,
                    int timeout)
Constructs a new message event with the specified source, message, type, and timeout.

Parameters:
source - the source for the new event
message - the message for the new event
type - the type of message for the new event. One of TYPE_INFO, TYPE_ERROR, TYPE_WARNING
timeout - the time period during which a listener should display the message
Method Detail

getMessage

public String getMessage()
Returns the message of this message event.

Returns:
the message of this message event.

getTimeout

public int getTimeout()
Returns the timeout for this message event.

Returns:
the timeout for this message event.

Mp3dings 
20100427