verinec.netsim.loggers.events
Class EventDetail

java.lang.Object
  extended by org.jdom.Content
      extended by org.jdom.Element
          extended by verinec.netsim.loggers.events.EventDetail
All Implemented Interfaces:
Serializable, Cloneable, Parent
Direct Known Subclasses:
ApplicationEvent, ARPEvent, ConsumeEvent, EthernetEvent, FirewallEvent, IPEvent, TCPEventStateChange, UDPEvent

public abstract class EventDetail
extends Element

EventDetail is the abstract Class that has all common features of event details

Version:
$Revision: 454 $
Author:
Dominik Jungo
See Also:
Serialized Form

Field Summary
private  boolean anim_init
           
protected  double dHeight
          the label's height
protected  double dWidth
          the labels width
protected  double dx
          one moving step in on the x axis
protected  double dy
          one moving step in on the y axis
protected  int endX
          end position of the moving label on x axis
protected  int endY
          end position of the moving label on y axis
protected  JLabel label
          the label of this event, used to display a graphic
protected  PCNode ownerPCNode
          the node, on which this event will be displayed
protected  int startX
          start position of the moving label on x axis
protected  int startY
          start position of the moving label on y axis
 
Fields inherited from class org.jdom.Element
additionalNamespaces, name, namespace
 
Fields inherited from class org.jdom.Content
parent
 
Constructor Summary
EventDetail(String name)
          Constructs a new Event Detail
EventDetail(String name, String type)
          Constructs a new Event Detail
 
Method Summary
 void animate(int time, int substep, int myPhase, int totalPhase)
          Alternates Events if they occur on the same location during the same periode of time.
abstract  Event createSimEvent(Model model, ILogger logger)
          creates a schedulable Simulation event from a Logevent
 String getType()
          gets the Type of the Event Detail
 void initAnimation(DrawPanel drawPanel)
          Initializes the event to be displayed on a panel as a animation
abstract  void initializeLabel(DrawPanel drawpanel)
          Initializes the label (the animated object)
 boolean isAnimationInitialized()
          checks if the animation is initialized
 void setType(String type)
          sets the Type of the Event Detail
protected abstract  void subanimate(int time, int substep, int myPhase, int totalPhase)
          animates a substep of the whole animation
 String toString()
           
 
Methods inherited from class org.jdom.Element
addContent, addContent, addContent, addContent, addContent, addNamespaceDeclaration, clone, cloneContent, getAdditionalNamespaces, getAttribute, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getAttributeValue, getAttributeValue, getChild, getChild, getChildren, getChildren, getChildren, getChildText, getChildText, getChildTextNormalize, getChildTextNormalize, getChildTextTrim, getChildTextTrim, getContent, getContent, getContent, getContentSize, getDescendants, getDescendants, getName, getNamespace, getNamespace, getNamespacePrefix, getNamespaceURI, getQualifiedName, getText, getTextNormalize, getTextTrim, getValue, indexOf, isAncestor, isRootElement, removeAttribute, removeAttribute, removeAttribute, removeChild, removeChild, removeChildren, removeChildren, removeContent, removeContent, removeContent, removeContent, removeNamespaceDeclaration, setAttribute, setAttribute, setAttribute, setAttributes, setContent, setContent, setContent, setContent, setName, setNamespace, setText
 
Methods inherited from class org.jdom.Content
detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jdom.Parent
getDocument, getParent
 

Field Detail

anim_init

private boolean anim_init

label

protected JLabel label
the label of this event, used to display a graphic


startX

protected int startX
start position of the moving label on x axis


startY

protected int startY
start position of the moving label on y axis


endX

protected int endX
end position of the moving label on x axis


endY

protected int endY
end position of the moving label on y axis


dx

protected double dx
one moving step in on the x axis


dy

protected double dy
one moving step in on the y axis


ownerPCNode

protected PCNode ownerPCNode
the node, on which this event will be displayed


dHeight

protected double dHeight
the label's height


dWidth

protected double dWidth
the labels width

Constructor Detail

EventDetail

public EventDetail(String name,
                   String type)
Constructs a new Event Detail

Parameters:
name - a Name of the detail
type - a Type

EventDetail

public EventDetail(String name)
Constructs a new Event Detail

Parameters:
name - a Name of the detail
Method Detail

getType

public final String getType()
gets the Type of the Event Detail

Returns:
the Type of the Event Detail

setType

public final void setType(String type)
sets the Type of the Event Detail

Parameters:
type - a Type

toString

public String toString()
Overrides:
toString in class Element
See Also:
Element.toString()

isAnimationInitialized

public boolean isAnimationInitialized()
checks if the animation is initialized

Returns:
true if the animation is initialized, false otherwise

initAnimation

public void initAnimation(DrawPanel drawPanel)
                   throws NetSimException
Initializes the event to be displayed on a panel as a animation

Parameters:
drawPanel - the panel on which this event is displayed graphically
Throws:
NetSimException - if the node for this even't can't be found

animate

public final void animate(int time,
                          int substep,
                          int myPhase,
                          int totalPhase)
                   throws NetSimException
Alternates Events if they occur on the same location during the same periode of time.

Parameters:
time - Current simulation time.
substep - Current substep.
myPhase - Phase the event belongs to.
totalPhase - Total number of events occurring at the same time and location.
Throws:
NetSimException - if the DrawPanel is not set

createSimEvent

public abstract Event createSimEvent(Model model,
                                     ILogger logger)
                              throws NetSimException
creates a schedulable Simulation event from a Logevent

Parameters:
model - a network model
logger - a log event
Returns:
a schedulable Simulation event
Throws:
NetSimException - if the event can't be gererated. E.g. it references to a non existing host

initializeLabel

public abstract void initializeLabel(DrawPanel drawpanel)
                              throws NetSimException
Initializes the label (the animated object)

Parameters:
drawpanel - the panel containing the label
Throws:
NetSimException - if the label can't be set up

subanimate

protected abstract void subanimate(int time,
                                   int substep,
                                   int myPhase,
                                   int totalPhase)
animates a substep of the whole animation

Parameters:
time - actual time
substep - the n'th substep that is animated
myPhase - the phase length that is animated in this substep
totalPhase - the complete phase length

Copyright © 2005 Verinec, DIUF