Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.service.neomedia.event
Class VideoEvent

java.lang.Object
  extended by java.util.EventObject
      extended by net.java.sip.communicator.service.neomedia.event.VideoEvent
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SizeChangeVideoEvent

public class VideoEvent
extends EventObject

Represents an event fired by providers of visual Components depicting video to notify about changes in the availability of such Components.

Author:
Lubomir Marinov
See Also:
Serialized Form

Field Summary
static int LOCAL
          The video origin of a VideoEvent which is local to the executing client such as a local video capture device.
static int REMOTE
          The video origin of a VideoEvent which is remote to the executing client such as a video being remotely streamed from a CallPeer.
static int VIDEO_ADDED
          The type of a VideoEvent which notifies about a specific visual Component depicting video being made available by the firing provider.
static int VIDEO_REMOVED
          The type of a VideoEvent which notifies about a specific visual Component depicting video no longer being made available by the firing provider.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
VideoEvent(Object source, int type, Component visualComponent, int origin)
          Initializes a new VideoEvent which is to notify about a specific change in the availability of a specific visual Component depicting video and being provided by a specific source.
 
Method Summary
 void consume()
          Consumes this event and, more specifically, marks the Component it describes as owned, referenced in order to let other potential consumers know about its current ownership status (which is important because Components belong to a single Container at a time).
 int getOrigin()
          Gets the origin of the video this VideoEvent notifies about which is one of LOCAL and REMOTE.
 int getType()
          Gets the type of availability change this VideoEvent notifies about which is one of VIDEO_ADDED and VIDEO_REMOVED.
 Component getVisualComponent()
          Gets the visual Component depicting video which had its availability changed and which this VideoEvent notifies about.
 boolean isConsumed()
          Determines whether this event and, more specifically, the visual Component it describes have been consumed and should be considered owned, referenced (which is important because Components belong to a single Container at a time).
static String originToString(int origin)
          Returns a human-readable representation of a specific VideoEvent origin constant in the form of a String value.
static String typeToString(int type)
          Returns a human-readable representation of a specific VideoEvent type constant in the form of a String value.
 
Methods inherited from class java.util.EventObject
getSource, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCAL

public static final int LOCAL
The video origin of a VideoEvent which is local to the executing client such as a local video capture device.

See Also:
Constant Field Values

REMOTE

public static final int REMOTE
The video origin of a VideoEvent which is remote to the executing client such as a video being remotely streamed from a CallPeer.

See Also:
Constant Field Values

VIDEO_ADDED

public static final int VIDEO_ADDED
The type of a VideoEvent which notifies about a specific visual Component depicting video being made available by the firing provider.

See Also:
Constant Field Values

VIDEO_REMOVED

public static final int VIDEO_REMOVED
The type of a VideoEvent which notifies about a specific visual Component depicting video no longer being made available by the firing provider.

See Also:
Constant Field Values
Constructor Detail

VideoEvent

public VideoEvent(Object source,
                  int type,
                  Component visualComponent,
                  int origin)
Initializes a new VideoEvent which is to notify about a specific change in the availability of a specific visual Component depicting video and being provided by a specific source.

Parameters:
source - the source of the new VideoEvent and the provider of the visual Component depicting video
type - the type of the availability change which has caused the new VideoEvent to be fired
visualComponent - the visual Component depicting video which had its availability in the source provider changed
origin - the origin of the video the new VideoEvent is to notify about
Method Detail

consume

public void consume()
Consumes this event and, more specifically, marks the Component it describes as owned, referenced in order to let other potential consumers know about its current ownership status (which is important because Components belong to a single Container at a time).


getOrigin

public int getOrigin()
Gets the origin of the video this VideoEvent notifies about which is one of LOCAL and REMOTE.

Returns:
one of LOCAL and REMOTE which specifies the origin of the video this VideoEvent notifies about

getType

public int getType()
Gets the type of availability change this VideoEvent notifies about which is one of VIDEO_ADDED and VIDEO_REMOVED.

Returns:
one of VIDEO_ADDED and VIDEO_REMOVED which describes the type of availability change this VideoEvent notifies about

getVisualComponent

public Component getVisualComponent()
Gets the visual Component depicting video which had its availability changed and which this VideoEvent notifies about.

Returns:
the visual Component depicting video which had its availability changed and which this VideoEvent notifies about

isConsumed

public boolean isConsumed()
Determines whether this event and, more specifically, the visual Component it describes have been consumed and should be considered owned, referenced (which is important because Components belong to a single Container at a time).

Returns:
true if this event and, more specifically, the visual Component it describes have been consumed and should be considered owned, referenced (which is important because Components belong to a single Container at a time); otherwise, false

originToString

public static String originToString(int origin)
Returns a human-readable representation of a specific VideoEvent origin constant in the form of a String value.

Parameters:
origin - one of the VideoEvent origin constants such as LOCAL or REMOTE
Returns:
a String value which gives a human-readable representation of the specified VideoEvent origin constant

typeToString

public static String typeToString(int type)
Returns a human-readable representation of a specific VideoEvent type constant in the form of a String value.

Parameters:
type - one of the VideoEvent type constants such as VIDEO_ADDED or VIDEO_REMOVED
Returns:
a String value which gives a human-readable representation of the specified VideoEvent type constant

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.