@ -21,8 +21,8 @@
import net.java.sip.communicator.util.swing.* ;
/ * *
* The < tt > CallP articipant Panel< / tt > is the panel containing data for a call
* p articipant in a given call . It contains information like call p articipant
* The < tt > CallP eer Panel< / tt > is the panel containing data for a call
* p eer in a given call . It contains information like call p eer
* name , photo , call duration , etc .
*
* @author Yana Stamcheva
@ -43,7 +43,7 @@ public class CallPeerPanel
private final JLabel timeLabel = new JLabel ( "00:00:00" , JLabel . CENTER ) ;
/ * *
* This date is meant to be used in the GuiCallP articipant Record, which is
* This date is meant to be used in the GuiCallP eer Record, which is
* added to the CallList after a call .
* /
private final Date callStartTime = new Date ( System . currentTimeMillis ( ) ) ;
@ -54,9 +54,9 @@ public class CallPeerPanel
private String callType ;
private final String p articipant Name;
private final String p eer Name;
private final CallPeer callP articipant ;
private final CallPeer callP eer ;
private final java . util . List < Container > videoContainers =
new ArrayList < Container > ( ) ;
@ -84,16 +84,16 @@ public class CallPeerPanel
private final CallDialog callDialog ;
/ * *
* Creates a < tt > CallP articipant Panel< / tt > for the given call p articipant .
* Creates a < tt > CallP eer Panel< / tt > for the given call p eer .
*
* @param callP articipant a call participant
* @param callP eer a call peer
* /
public CallPeerPanel ( CallDialog callDialog ,
CallPeer callP articipant )
CallPeer callP eer )
{
this . callDialog = callDialog ;
this . callP articipant = callParticipant ;
this . p articipantName = callParticipant . getDisplayName ( ) ;
this . callP eer = callPeer ;
this . p eerName = callPeer . getDisplayName ( ) ;
this . securityStatusLabel = new SecurityStatusLabel (
this ,
@ -179,12 +179,12 @@ private Component createButtonBar( boolean heavyweight,
/ * *
* Creates the < code > Component < / code > hierarchy of the central area of this
* < code > CallP articipant Panel< / code > which displays the photo of the
* < code > CallP articipant < / code > or the video if any .
* < code > CallP eer Panel< / code > which displays the photo of the
* < code > CallP eer < / code > or the video if any .
*
* @return the root of the < code > Component < / code > hierarchy of the central
* area of this < code > CallP articipant Panel< / code > which displays the
* photo of the < code > CallP articipant < / code > or the video if any
* area of this < code > CallP eer Panel< / code > which displays the
* photo of the < code > CallP eer < / code > or the video if any
* /
private Component createCenter ( )
{
@ -249,7 +249,7 @@ private Component createNameBar()
{
// nameLabel
JLabel nameLabel = new JLabel ( "" , JLabel . CENTER ) ;
nameLabel . setText ( p articipant Name) ;
nameLabel . setText ( p eer Name) ;
nameLabel . setAlignmentX ( JLabel . CENTER ) ;
return nameLabel ;
@ -257,21 +257,20 @@ private Component createNameBar()
/ * *
* Creates the < code > Component < / code > hierarchy of the area of
* status - related information such as < code > CallP articipant < / code > display
* status - related information such as < code > CallP eer < / code > display
* name , call duration , security status .
*
* @return the root of the < code > Component < / code > hierarchy of the area of
* status - related information such as < code > CallP articipant < / code >
* status - related information such as < code > CallP eer < / code >
* display name , call duration , security status
* /
private Component createStatusBar ( )
{
// stateLabel
callStatusLabel . setForeground ( Color . WHITE ) ;
callStatusLabel . setText ( callP articipant . getState ( ) . getStateString ( ) ) ;
callStatusLabel . setText ( callP eer . getState ( ) . getStateString ( ) ) ;
ParticipantStatusPanel statusPanel
= new ParticipantStatusPanel (
PeerStatusPanel statusPanel = new PeerStatusPanel (
new FlowLayout ( FlowLayout . CENTER , 10 , 0 ) ) ;
TransparentPanel statusIconsPanel
@ -303,16 +302,16 @@ private Component createStatusBar()
/ * *
* Creates a new < code > Component < / code > representing a UI means to transfer
* the < code > Call < / code > of the associated < code > callP articipant < / code > or
* the < code > Call < / code > of the associated < code > callP eer < / code > or
* < tt > null < / tt > if call - transfer is unsupported .
*
* @return a new < code > Component < / code > representing the UI means to
* transfer the < code > Call < / code > of < code > callP articipant < / code > or
* transfer the < code > Call < / code > of < code > callP eer < / code > or
* < tt > null < / tt > if call - transfer is unsupported
* /
private Component createTransferCallButton ( )
{
Call call = callP articipant . getCall ( ) ;
Call call = callP eer . getCall ( ) ;
if ( call ! = null )
{
@ -321,7 +320,7 @@ private Component createTransferCallButton()
. getOperationSet ( OperationSetAdvancedTelephony . class ) ;
if ( telephony ! = null )
return new TransferCallButton ( callP articipant ) ;
return new TransferCallButton ( callP eer ) ;
}
return null ;
}
@ -329,7 +328,7 @@ private Component createTransferCallButton()
public void createSecurityPanel (
CallPeerSecurityOnEvent event )
{
Call call = callP articipant . getCall ( ) ;
Call call = callP eer . getCall ( ) ;
if ( call ! = null )
{
@ -342,7 +341,7 @@ public void createSecurityPanel(
{
if ( securityPanel = = null )
{
securityPanel = new SecurityPanel ( callP articipant ) ;
securityPanel = new SecurityPanel ( callP eer ) ;
GridBagConstraints constraints = new GridBagConstraints ( ) ;
@ -390,7 +389,7 @@ public void videoRemoved(VideoEvent event)
/ * *
* Sets up listening to notifications about adding or removing video for the
* < code > CallP articipant < / code > this panel depicts and displays the video in
* < code > CallP eer < / code > this panel depicts and displays the video in
* question in the last - known of { @link # videoContainers } ( because the video
* is represented by a < code > Component < / code > and it cannot be displayed in
* multiple < code > Container < / code > s at one and the same time ) as soon as it
@ -398,7 +397,7 @@ public void videoRemoved(VideoEvent event)
* /
private OperationSetVideoTelephony addVideoListener ( )
{
final Call call = callP articipant . getCall ( ) ;
final Call call = callP eer . getCall ( ) ;
if ( call = = null )
return null ;
@ -412,7 +411,7 @@ private OperationSetVideoTelephony addVideoListener()
= new VideoTelephonyListener ( ) ;
/ *
* The video is only available while the # callP articipant is in a Call
* The video is only available while the # callP eer is in a Call
* and that call is in progress so only listen to VideoEvents during
* that time .
* /
@ -423,7 +422,7 @@ private OperationSetVideoTelephony addVideoListener()
private void addVideoListener ( )
{
telephony . addVideoListener (
callP articipant , videoTelephonyListener ) ;
callP eer , videoTelephonyListener ) ;
telephony . addPropertyChangeListener (
call , videoTelephonyListener ) ;
videoListenerIsAdded = true ;
@ -440,17 +439,17 @@ private void addVideoListener()
}
/ *
* When the # callP articipant of this CallParticipant Panel gets added
* When the # callP eer of this CallPeer Panel gets added
* to the Call , starts listening for changes in the video in order
* to display it .
* /
public synchronized void callPeerAdded (
CallPeerEvent event )
{
if ( callP articipant . equals ( event . getSourceCallPeer ( ) )
if ( callP eer . equals ( event . getSourceCallPeer ( ) )
& & ! videoListenerIsAdded )
{
Call call = callP articipant . getCall ( ) ;
Call call = callP eer . getCall ( ) ;
if ( ( call ! = null )
& & CallState . CALL_IN_PROGRESS . equals (
@ -460,17 +459,17 @@ public synchronized void callPeerAdded(
}
/ *
* When the # callP articipant of this CallParticipant Panel leaves the
* When the # callP eer of this CallPeer Panel leaves the
* Call , stops listening for changes in the video because it should
* no longer be updated anyway .
* /
public synchronized void callPeerRemoved (
CallPeerEvent event )
{
if ( callP articipant . equals ( event . getSourceCallPeer ( ) )
if ( callP eer . equals ( event . getSourceCallPeer ( ) )
& & videoListenerIsAdded )
{
Call call = callP articipant . getCall ( ) ;
Call call = callP eer . getCall ( ) ;
if ( call ! = null )
removeVideoListener ( ) ;
@ -478,11 +477,11 @@ public synchronized void callPeerRemoved(
}
/ *
* When the Call of # callP articipant ends , stops tracking the
* When the Call of # callP eer ends , stops tracking the
* updates in the video because there should no longer be any video
* anyway . When the Call in question starts , starts tracking any
* changes to the video because it ' s negotiated and it should be
* displayed in this CallP articipant Panel.
* displayed in this CallP eer Panel.
* /
public synchronized void callStateChanged ( CallChangeEvent event )
{
@ -504,7 +503,7 @@ else if (CallState.CALL_IN_PROGRESS.equals(newCallState))
private void removeVideoListener ( )
{
telephony . removeVideoListener (
callP articipant , videoTelephonyListener ) ;
callP eer , videoTelephonyListener ) ;
telephony . removePropertyChangeListener (
call , videoTelephonyListener ) ;
videoListenerIsAdded = false ;
@ -512,7 +511,7 @@ private void removeVideoListener()
if ( localVideo ! = null )
{
telephony . disposeLocalVisualComponent (
callP articipant , localVideo ) ;
callP eer , localVideo ) ;
localVideo = null ;
}
@ -533,7 +532,7 @@ private void removeVideoListener()
}
/ * *
* When a video is added or removed for the < code > callP articipant < / code > ,
* When a video is added or removed for the < code > callP eer < / code > ,
* makes sure to display or hide it respectively .
*
* @param event a < code > VideoEvent < / code > describing the added visual
@ -610,7 +609,7 @@ public void run()
// REMOTE
Component [ ] videos =
videoTelephony . getVisualComponents ( callP articipant ) ;
videoTelephony . getVisualComponents ( callP eer ) ;
Component video =
( ( videos = = null ) | | ( videos . length < 1 ) ) ? null
@ -641,12 +640,12 @@ private void handleLocalVideoStreamingChange(
if ( videoTelephony = = null )
return ;
if ( videoTelephony . isLocalVideoStreaming ( callP articipant . getCall ( ) ) )
if ( videoTelephony . isLocalVideoStreaming ( callP eer . getCall ( ) ) )
{
try
{
videoTelephony . createLocalVisualComponent (
callP articipant , listener ) ;
callP eer , listener ) ;
}
catch ( OperationFailedException ex )
{
@ -658,17 +657,17 @@ private void handleLocalVideoStreamingChange(
else if ( localVideo ! = null )
{
videoTelephony . disposeLocalVisualComponent (
callP articipant , localVideo ) ;
callP eer , localVideo ) ;
localVideo = null ;
}
}
}
/ * *
* Sets the state of the contained call p articipant by specifying the
* Sets the state of the contained call p eer by specifying the
* state name and icon .
*
* @param state the state of the contained call p articipant
* @param state the state of the contained call p eer
* @param icon the icon of the state
* /
public void setState ( String state , Icon icon )
@ -680,7 +679,7 @@ public void setState(String state, Icon icon)
/ * *
* Sets the secured status icon to the status panel .
*
* @param isSecured indicates if the call with this p articipant is
* @param isSecured indicates if the call with this p eer is
* secured
* /
public void setSecured ( boolean isSecured )
@ -696,7 +695,7 @@ public void setSecured(boolean isSecured)
/ * *
* Sets the mute status icon to the status panel .
*
* @param isMute indicates if the call with this p articipant is
* @param isMute indicates if the call with this p eer is
* muted
* /
public void setMute ( boolean isMute )
@ -710,7 +709,7 @@ public void setMute(boolean isMute)
/ * *
* Sets the audio security on or off .
*
*
* @param isAudioSecurityOn indicates if the audio security is turned on or
* off .
* /
@ -721,7 +720,7 @@ public void setAudioSecurityOn(boolean isAudioSecurityOn)
/ * *
* Sets the video security on or off .
*
*
* @param isVideoSecurityOn indicates if the video security is turned on or
* off .
* /
@ -732,7 +731,7 @@ public void setVideoSecurityOn(boolean isVideoSecurityOn)
/ * *
* Indicates if the audio security is turned on or off .
*
*
* @return < code > true < / code > if the audio security is on , otherwise -
* < code > false < / code > .
* /
@ -743,7 +742,7 @@ public boolean isAudioSecurityOn()
/ * *
* Indicates if the video security is turned on or off .
*
*
* @return < code > true < / code > if the video security is on , otherwise -
* < code > false < / code > .
* /
@ -754,7 +753,7 @@ public boolean isVideoSecurityOn()
/ * *
* Returns the cipher used for the encryption of the current call .
*
*
* @return the cipher used for the encryption of the current call .
* /
public String getEncryptionCipher ( )
@ -764,7 +763,7 @@ public String getEncryptionCipher()
/ * *
* Sets the cipher used for the encryption of the current call .
*
*
* @param encryptionCipher the cipher used for the encryption of the
* current call .
* /
@ -801,7 +800,7 @@ public void actionPerformed(ActionEvent e)
{
Date time =
GuiUtils . substractDates ( new Date ( System . currentTimeMillis ( ) ) ,
new Date ( callP articipant . getCallDurationStartTime ( ) ) ) ;
new Date ( callP eer . getCallDurationStartTime ( ) ) ) ;
callDuration . setTime ( time . getTime ( ) ) ;
@ -810,13 +809,13 @@ public void actionPerformed(ActionEvent e)
}
/ * *
* Returns the start time of the contained p articipant call . Note that the
* Returns the start time of the contained p eer call . Note that the
* start time of the call is different from the conversation start time . For
* example if we receive a call , the call start time is when the call is
* received and the conversation start time would be when we accept the
* call .
*
* @return the start time of the contained p articipant call
* @return the start time of the contained p eer call
* /
public Date getCallStartTime ( )
{
@ -824,9 +823,9 @@ public Date getCallStartTime()
}
/ * *
* Returns the duration of the contained p articipant call .
* Returns the duration of the contained p eer call .
*
* @return the duration of the contained p articipant call
* @return the duration of the contained p eer call
* /
public Date getCallDuration ( )
{
@ -834,7 +833,7 @@ public Date getCallDuration()
}
/ * *
* Returns this call type - GuiCallP articipant Record: INCOMING_CALL or
* Returns this call type - GuiCallP eer Record: INCOMING_CALL or
* OUTGOING_CALL
*
* @return Returns this call type : INCOMING_CALL or OUTGOING_CALL
@ -849,8 +848,8 @@ public String getCallType()
/ * *
* Sets the type of the call . Call type could be
* < tt > GuiCallP articipant Record. INCOMING_CALL < / tt > or
* < tt > GuiCallP articipant Record. INCOMING_CALL < / tt > .
* < tt > GuiCallP eer Record. INCOMING_CALL < / tt > or
* < tt > GuiCallP eer Record. INCOMING_CALL < / tt > .
*
* @param callType the type of call to set
* /
@ -860,13 +859,13 @@ public void setCallType(String callType)
}
/ * *
* Returns the name of the p articipant , contained in this panel .
* Returns the name of the p eer , contained in this panel .
*
* @return the name of the p articipant , contained in this panel
* @return the name of the p eer , contained in this panel
* /
public String getP articipant Name( )
public String getP eer Name( )
{
return p articipant Name;
return p eer Name;
}
private Component createEnterFullScreenButton ( )
@ -913,17 +912,17 @@ public void actionPerformed(ActionEvent event)
private Component createFullScreenButtonBar ( )
{
CallPeerState p articipant State
= callP articipant . getState ( ) ;
CallPeerState p eer State
= callP eer . getState ( ) ;
Component [ ] buttons =
new Component [ ]
{ new HoldButton ( callP articipant . getCall ( ) ,
{ new HoldButton ( callP eer . getCall ( ) ,
true ,
CallPeerState . isOnHold ( p articipant State) ) ,
new MuteButton ( callP articipant . getCall ( ) ,
CallPeerState . isOnHold ( p eer State) ) ,
new MuteButton ( callP eer . getCall ( ) ,
true ,
callP articipant . isMute ( ) ) ,
callP eer . isMute ( ) ) ,
createExitFullScreenButton ( ) } ;
Component fullScreenButtonBar = createButtonBar ( true , buttons ) ;
@ -936,7 +935,7 @@ private void enterFullScreen()
// Create the main Components of the UI.
final JFrame frame = new JFrame ( ) ;
frame . setDefaultCloseOperation ( WindowConstants . DISPOSE_ON_CLOSE ) ;
frame . setTitle ( getP articipant Name( ) ) ;
frame . setTitle ( getP eer Name( ) ) ;
frame . setUndecorated ( true ) ;
Component center = createCenter ( ) ;
@ -1056,7 +1055,7 @@ private void addKeyListener(Component component, KeyListener l)
}
}
private static class P articipant StatusPanel
private static class P eer StatusPanel
extends TransparentPanel
{
@ -1067,7 +1066,7 @@ private static class ParticipantStatusPanel
* /
private static final long serialVersionUID = 0 L ;
public P articipant StatusPanel( LayoutManager layout )
public P eer StatusPanel( LayoutManager layout )
{
super ( layout ) ;
this . setBorder ( BorderFactory . createEmptyBorder ( 0 , 5 , 0 , 5 ) ) ;