templates.diagram
Class TemplateDiagramMessage

java.lang.Object
  extended by templates.diagram.TemplateDiagramMessage

public class TemplateDiagramMessage
extends java.lang.Object

Describes messages sent by TemplateDiagram to listeners for changes (i.e., TemplateDiagramSubscribers).

Author:
Lenko Grigorov

Field Summary
protected  java.util.Collection<DiagramElement> elements
          The DiagramElements affected by the change described by this message.
protected  java.lang.String message
          Text message.
static int OP_ADD
          Addition to the template diagram.
static int OP_MODIFY
          Modification of the template diagram which is not addition or removal.
static int OP_REMOVE
          Removal from the template diagram.
protected  int operationType
          The type of the operation (OP_ADD, OP_REMOVE or OP_MODIFY)
protected  TemplateDiagram source
          The source of the message.
 
Constructor Summary
TemplateDiagramMessage(TemplateDiagram source, java.util.Collection<DiagramElement> elements, int operationType)
          Create a message with the given parameters.
TemplateDiagramMessage(TemplateDiagram source, java.util.Collection<DiagramElement> elements, int operationType, java.lang.String message)
          Create a message with the given parameters.
 
Method Summary
 java.util.Collection<DiagramElement> getElements()
          Retrieve the DiagramElements affected by the change described by this message.
 java.lang.String getMessage()
          Retrieve the text message.
 int getOperationType()
          Retrieve the type of the operation.
 TemplateDiagram getSource()
          Retrieve the source of the message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OP_ADD

public static final int OP_ADD
Addition to the template diagram.

See Also:
Constant Field Values

OP_REMOVE

public static final int OP_REMOVE
Removal from the template diagram.

See Also:
Constant Field Values

OP_MODIFY

public static final int OP_MODIFY
Modification of the template diagram which is not addition or removal.

See Also:
Constant Field Values

source

protected TemplateDiagram source
The source of the message.


elements

protected java.util.Collection<DiagramElement> elements
The DiagramElements affected by the change described by this message.


operationType

protected int operationType
The type of the operation (OP_ADD, OP_REMOVE or OP_MODIFY)


message

protected java.lang.String message
Text message.

Constructor Detail

TemplateDiagramMessage

public TemplateDiagramMessage(TemplateDiagram source,
                              java.util.Collection<DiagramElement> elements,
                              int operationType)
Create a message with the given parameters.

Parameters:
source - the source of the message
elements - the diagram elements affected by the change
operationType - the type of the operation (OP_ADD, OP_REMOVE or OP_MODIFY)

TemplateDiagramMessage

public TemplateDiagramMessage(TemplateDiagram source,
                              java.util.Collection<DiagramElement> elements,
                              int operationType,
                              java.lang.String message)
Create a message with the given parameters.

Parameters:
source - the source of the message
elements - the diagram elements affected by the change
operationType - the type of the operation (OP_ADD, OP_REMOVE or OP_MODIFY)
message - text message
Method Detail

getSource

public TemplateDiagram getSource()
Retrieve the source of the message.

Returns:
the source of the message

getElements

public java.util.Collection<DiagramElement> getElements()
Retrieve the DiagramElements affected by the change described by this message.

Returns:
the DiagramElements affected by the change described by this message

getOperationType

public int getOperationType()
Retrieve the type of the operation.

Returns:
the type of the operation (OP_ADD, OP_REMOVE or OP_MODIFY)

getMessage

public java.lang.String getMessage()
Retrieve the text message. May be null.

Returns:
the text message