verinec.netsim.loggers.events
Class ApplicationEvent

java.lang.Object
  extended by org.jdom.Content
      extended by org.jdom.Element
          extended by verinec.netsim.loggers.events.EventDetail
              extended by verinec.netsim.loggers.events.ApplicationEvent
All Implemented Interfaces:
Serializable, Cloneable, Parent

public class ApplicationEvent
extends EventDetail

A ApplicationEvent Detail. This is the one and only EventDetail used for Application to keep things simple. It would be to complicated to add for each application an event detail.

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

Field Summary
private static long serialVersionUID
           
 
Fields inherited from class verinec.netsim.loggers.events.EventDetail
dHeight, dWidth, dx, dy, endX, endY, label, ownerPCNode, startX, startY
 
Fields inherited from class org.jdom.Element
additionalNamespaces, name, namespace
 
Fields inherited from class org.jdom.Content
parent
 
Constructor Summary
ApplicationEvent()
          Creates a new Application EventDetail
ApplicationEvent(String type, String program, String parameters)
          Creates a new Application EventDetail
 
Method Summary
 Event createSimEvent(Model model, ILogger logger)
          creates a schedulable Simulation event from a Logevent
 String getParameters()
          gets the parameters with which the program was called
 String getProgram()
          gets the name of the programm that caused this event
 void initializeLabel(DrawPanel drawPanel)
          Initializes the label (the animated object)
 void resolveVariables()
          Resolves all variables in the attribute by looking up their value in the parent
 Element setAttribute(Attribute attribute)
           
 void setParameters(String parameters)
          sets the parameters with which the program was called
 void setProgram(String program)
          sets the name of the programm that caused this event
protected  void subanimate(int time, int substep, int myPhase, int totalPhase)
          animates a substep of the whole animation
 
Methods inherited from class verinec.netsim.loggers.events.EventDetail
animate, getType, initAnimation, isAnimationInitialized, setType, 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, 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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

ApplicationEvent

public ApplicationEvent(String type,
                        String program,
                        String parameters)
Creates a new Application EventDetail

Parameters:
type - a Type
program - the programm which caused this event
parameters - the parameters with which this programm was called. All appearing variables between dollars are not resolved here.

ApplicationEvent

public ApplicationEvent()
Creates a new Application EventDetail

Method Detail

setAttribute

public Element setAttribute(Attribute attribute)
Overrides:
setAttribute in class Element
See Also:
Element.setAttribute(org.jdom.Attribute)

resolveVariables

public void resolveVariables()
Resolves all variables in the attribute by looking up their value in the parent


getProgram

public final String getProgram()
gets the name of the programm that caused this event

Returns:
the name of the programm that caused this event

setProgram

public final void setProgram(String program)
sets the name of the programm that caused this event

Parameters:
program - a programm name

getParameters

public final String getParameters()
gets the parameters with which the program was called

Returns:
the parameters with which the program was called

setParameters

public final void setParameters(String parameters)
sets the parameters with which the program was called

Parameters:
parameters - the parameters with which the program was called

createSimEvent

public Event createSimEvent(Model model,
                            ILogger logger)
                     throws NumberFormatException,
                            NetSimException
Description copied from class: EventDetail
creates a schedulable Simulation event from a Logevent

Specified by:
createSimEvent in class EventDetail
Parameters:
model - a network model
logger - a log event
Returns:
a schedulable Simulation event
Throws:
NetSimException - if no host with given name is found
NumberFormatException
See Also:
EventDetail.createSimEvent(desmoj.core.simulator.Model, verinec.netsim.loggers.ILogger)

initializeLabel

public void initializeLabel(DrawPanel drawPanel)
Description copied from class: EventDetail
Initializes the label (the animated object)

Specified by:
initializeLabel in class EventDetail
Parameters:
drawPanel - the panel containing the label
See Also:
EventDetail.initializeLabel(verinec.gui.core.DrawPanel)

subanimate

protected void subanimate(int time,
                          int substep,
                          int myPhase,
                          int totalPhase)
Description copied from class: EventDetail
animates a substep of the whole animation

Specified by:
subanimate in class EventDetail
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
See Also:
EventDetail.subanimate(int, int, int, int)

Copyright © 2005 Verinec, DIUF