neto
Class ProgressEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byneto.ProgressEvent
All Implemented Interfaces:
java.io.Serializable

public class ProgressEvent
extends java.util.EventObject

Object used by ProgressListener. The Progress event is for signaling the progress of the file transfer. The total progress when multiple files are transmitted and the progress of a single file are shown. The progress amount is signaled by percentage. The percentage range is from 0 to 100 percent. After a succesful file transfer the progress indicators are set back to 0.

Author:
Vincent Ramp
See Also:
ProgressListener, Serialized Form

Constructor Summary
ProgressEvent(java.lang.Object source, int current, int total, java.lang.String port)
          Initializes a new instance of this object.
 
Method Summary
 int GetCurrentPercentage()
          Returns the percentage of a succesful transfer of the current file.
 java.lang.String getPort()
          Returns a string that specifies which serial port the message comes from.
 int GetTotalPercentage()
          Returns the percentage of a succesful transfer of all files together.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProgressEvent

public ProgressEvent(java.lang.Object source,
                     int current,
                     int total,
                     java.lang.String port)
Initializes a new instance of this object. It sets the percentages of the total progress and of a single file. Also the serial port wich is used to send the files is set.

NOTE: When only 1 file is transferred, current and total are equal to eachother.

Parameters:
source - object wich created this ProtocolMessageEvent object.
current - an integer expression that specifies the progress of the current file. The current parameter represents the percentage of a succesful transfer.
total - an integer expression that specifies the progress of all files together. The total parameter represents the percentage of a succesful transfer.
port - a string that specifies which serial port the message comes from.
Method Detail

GetCurrentPercentage

public int GetCurrentPercentage()
Returns the percentage of a succesful transfer of the current file.

Returns:
Percentage between and including 0 to 100.

getPort

public java.lang.String getPort()
Returns a string that specifies which serial port the message comes from.

Returns:
The serial port wich launches this message.

GetTotalPercentage

public int GetTotalPercentage()
Returns the percentage of a succesful transfer of all files together.

Returns:
Percentage between and including 0 and 100.