com.dlsc.flexgantt.swing
Class Message

java.lang.Object
  extended by com.dlsc.flexgantt.swing.Message
All Implemented Interfaces:
IMessage
Direct Known Subclasses:
TimelineObjectPathMessage, TreePathMessage

public class Message
extends java.lang.Object
implements IMessage

The default implementation of the IMessage interface. Objects of this type can contain general information, warnings, or errors. Whether a message is either one can be determined by checking the message type ID.

Since:
1.0
Author:
Dirk Lemmermann
See Also:
TimelineObjectPathMessage, TreePathMessage

Constructor Summary
Message(MessageTypeId id, java.lang.String text)
          Constructs a new message.
Message(MessageTypeId id, java.lang.String text, java.util.Date time)
          Constructs a new message.
Message(MessageTypeId id, java.lang.String text, java.lang.Object details)
          Constructs a new message.
Message(MessageTypeId id, java.lang.String text, java.lang.Object details, java.util.Date time)
          Constructs a new message.
Message(java.lang.String text)
          Constructs a new information message.
Message(java.lang.String text, java.lang.Object details)
          Constructs a new error message with some details attached to it.
 
Method Summary
 java.lang.Object getMessageDetails()
          Returns an object that contains some more details about the message.
 java.lang.String getMessageText()
          Returns the text that will be displayed to the user.
 java.util.Date getMessageTime()
          Returns the time stamp when the message occured.
 MessageTypeId getMessageTypeId()
          Returns the type of the message (information, warning, error).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Message

public Message(MessageTypeId id,
               java.lang.String text,
               java.lang.Object details,
               java.util.Date time)
Constructs a new message.

Parameters:
id - a message type identifier used to distinguish between plain information messages or warning and error messages
text - the message that will be shown to the user
details - an object storing additional information about the cause of the message
time - a message time stamp
Since:
1.0
See Also:
TreePathMessage, TimelineObjectPathMessage

Message

public Message(MessageTypeId id,
               java.lang.String text,
               java.util.Date time)
Constructs a new message. The message does not carry any detailed information.

Parameters:
id - a message type identifier used to distinguish between plain information messages or warning and error messages
text - the message that will be shown to the user
time - a message time stamp
Since:
1.0
See Also:
TreePathMessage, TimelineObjectPathMessage

Message

public Message(MessageTypeId id,
               java.lang.String text,
               java.lang.Object details)
Constructs a new message.

Parameters:
id - a message type identifier used to distinguish between plain information messages or warning and error messages
text - the message that will be shown to the user
details - an object storing additional information about the cause of the message
Since:
1.0
See Also:
TreePathMessage, TimelineObjectPathMessage

Message

public Message(MessageTypeId id,
               java.lang.String text)
Constructs a new message.

Parameters:
id - a message type identifier used to distinguish between plain information messages or warning and error messages
text - the message that will be shown to the user
Since:
1.0
See Also:
TreePathMessage, TimelineObjectPathMessage

Message

public Message(java.lang.String text,
               java.lang.Object details)
Constructs a new error message with some details attached to it.

Parameters:
text - the message that will be shown to the user
details - an object storing additional information about the cause of the message
Since:
1.0
See Also:
TreePathMessage, TimelineObjectPathMessage

Message

public Message(java.lang.String text)
Constructs a new information message.

Parameters:
text - the message that will be shown to the user
Since:
1.0
See Also:
TreePathMessage, TimelineObjectPathMessage
Method Detail

getMessageTypeId

public MessageTypeId getMessageTypeId()
Description copied from interface: IMessage
Returns the type of the message (information, warning, error).

Specified by:
getMessageTypeId in interface IMessage
Returns:
the message type

getMessageText

public java.lang.String getMessageText()
Description copied from interface: IMessage
Returns the text that will be displayed to the user.

Specified by:
getMessageText in interface IMessage
Returns:
the text of the message

getMessageDetails

public java.lang.Object getMessageDetails()
Description copied from interface: IMessage
Returns an object that contains some more details about the message. This could for example be a Throwable. The return type is this generic in order to support different kinds of detailed information in the future that can not be foreseen, yet.

Specified by:
getMessageDetails in interface IMessage
Returns:
detailed information about the message

getMessageTime

public java.util.Date getMessageTime()
Description copied from interface: IMessage
Returns the time stamp when the message occured.

Specified by:
getMessageTime in interface IMessage
Returns:
the message's time stamp