Renames occurrences of callParticipant to callPeer so that it would better reflect our new Call architecture that also includes conferencing and ConferenceMembers

cusax-fix
Emil Ivov 17 years ago
parent 160bd718bf
commit 123b333c04

@ -25,7 +25,7 @@
/**
* The <tt>DialPanel</tt> is the panel that contains the buttons to dial a
* phone number.
*
*
* @author Yana Stamcheva
*/
public class DialPanel
@ -69,18 +69,18 @@ public DialPanel(MainCallPanel parentCallPanel)
/**
* Creates an instance of <tt>DialPanel</tt> for a specific call, by
* specifying the parent <tt>CallManager</tt> and the
* <tt>CallParticipant</tt>.
*
* @param callParticipants the <tt>CallParticipant</tt>s, for which the
* <tt>CallPeer</tt>.
*
* @param callPeers the <tt>CallPeer</tt>s, for which the
* dialpad will be opened.
*/
public DialPanel(Iterator<CallPeer> callParticipants)
public DialPanel(Iterator<CallPeer> callPeers)
{
// We need to send DTMF tones to all participants each time the user
// We need to send DTMF tones to all peers each time the user
// presses a dial button, so we put the iterator into a list.
while (callParticipants.hasNext())
while (callPeers.hasNext())
{
this.callPeersList.add(callParticipants.next());
this.callPeersList.add(callPeers.next());
}
this.init();
@ -404,29 +404,27 @@ public void actionPerformed(ActionEvent e)
/**
* Sends a DTMF tone to the current DTMF operation set.
*
*
* @param dtmfTone The DTMF tone to send.
*/
private void sendDtmfTone(DTMFTone dtmfTone)
{
Iterator<CallPeer> callParticipants
= this.callPeersList.iterator();
Iterator<CallPeer> callPeers = this.callPeersList.iterator();
try
{
while (callParticipants.hasNext())
while (callPeers.hasNext())
{
CallPeer participant
= callParticipants.next();
CallPeer peer = callPeers.next();
if (participant.getProtocolProvider()
if (peer.getProtocolProvider()
.getOperationSet(OperationSetDTMF.class) != null)
{
OperationSetDTMF dtmfOpSet
= (OperationSetDTMF) participant.getProtocolProvider()
= (OperationSetDTMF) peer.getProtocolProvider()
.getOperationSet(OperationSetDTMF.class);
dtmfOpSet.sendDTMF(participant, dtmfTone);
dtmfOpSet.sendDTMF(peer, dtmfTone);
}
}
}

@ -96,14 +96,14 @@ public Component getListCellRendererComponent(JList list, Object value,
this.dataPanel.remove(durationLabel);
this.remove(iconLabel);
if (value instanceof GuiCallParticipantRecord)
if (value instanceof GuiCallPeerRecord)
{
GuiCallParticipantRecord participant = (GuiCallParticipantRecord) value;
GuiCallPeerRecord participant = (GuiCallPeerRecord) value;
this.direction = participant.getDirection();
if (direction.equals(GuiCallParticipantRecord.INCOMING_CALL))
if (direction.equals(GuiCallPeerRecord.INCOMING_CALL))
iconLabel.setIcon(incomingIcon);
else
iconLabel.setIcon(outgoingIcon);
@ -195,7 +195,7 @@ private void internalPaintComponent(Graphics g)
}
else
{
if (direction.equals(GuiCallParticipantRecord.INCOMING_CALL))
if (direction.equals(GuiCallPeerRecord.INCOMING_CALL))
{
GradientPaint p = new GradientPaint(0, 0,
@ -206,7 +206,7 @@ private void internalPaintComponent(Graphics g)
g2.fillRoundRect(1, 1, this.getWidth(), this.getHeight() - 1,
7, 7);
}
else if (direction.equals(GuiCallParticipantRecord.OUTGOING_CALL))
else if (direction.equals(GuiCallPeerRecord.OUTGOING_CALL))
{
GradientPaint p = new GradientPaint(0, 0,

@ -36,7 +36,7 @@ public void closeDate(Object date)
for(int i = startIndex + 1; i < currentSize; i ++) {
Object o = this.getElementAt(i);
if(o instanceof GuiCallParticipantRecord) {
if(o instanceof GuiCallPeerRecord) {
this.closedDates.put(o, date);
c.add(o);
endIndex++;

@ -358,12 +358,12 @@ private String checkCallType(int callType, CallRecord callRecord)
if (callRecord.getDirection().equals(CallRecord.IN)
&& ((callType == Constants.INCOMING_CALL)
|| callType == Constants.INOUT_CALL))
direction = GuiCallParticipantRecord.INCOMING_CALL;
direction = GuiCallPeerRecord.INCOMING_CALL;
// out
else if (callRecord.getDirection().equals(CallRecord.OUT)
&& (callType == Constants.OUTGOING_CALL
|| callType == Constants.INOUT_CALL))
direction = GuiCallParticipantRecord.OUTGOING_CALL;
direction = GuiCallPeerRecord.OUTGOING_CALL;
return direction;
}
@ -462,7 +462,7 @@ private void loadTableRecords(Collection historyCalls, int calltype,
direction = checkCallType(calltype, callRecord);
if (direction != null)
callList.addItem(new GuiCallParticipantRecord(
callList.addItem(new GuiCallPeerRecord(
participantRecord, direction));
else
addMe = false;

@ -1,120 +0,0 @@
/*
* SIP Communicator, the OpenSource Java VoIP and Instant Messaging client.
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package net.java.sip.communicator.plugin.callhistoryform;
import java.util.*;
import net.java.sip.communicator.service.callhistory.*;
import net.java.sip.communicator.util.*;
/**
* The <tt>GuiCallParticipantRecord</tt> is meant to be used in the call history
* to represent a history call participant record. It wraps a
* <tt>CallParticipant</tt> or a <tt>CallParticipantRecord</tt> object.
*
* @author Yana Stamcheva
*/
public class GuiCallParticipantRecord
{
public static final String INCOMING_CALL = "IncomingCall";
public static final String OUTGOING_CALL = "OutgoingCall";
private String direction;
private String participantName;
private Date startTime;
private Date callTime;
/**
* Creates an instance of <tt>GuiCallParticipantRecord</tt> by specifying
* the participant name, the call direction (incoming or outgoing), the
* time at which the call has started and the duration of the call.
*
* @param participantName the name of the call participant
* @param direction the direction of the call - INCOMING_CALL
* or OUTGOING_CALL
* @param startTime the time at which the call has started
* @param callTime the duration of the call
*/
public GuiCallParticipantRecord(String participantName,
String direction,
Date startTime,
Date callTime)
{
this.direction = direction;
this.participantName = participantName;
this.startTime = startTime;
this.callTime = callTime;
}
/**
* Creates an instance of <tt>GuiCallParticipantRecord</tt> by specifying
* the corresponding <tt>CallParticipantRecord</tt>, which gives all the
* information for the participant and the call duration.
*
* @param participantRecord the corresponding <tt>CallParticipantRecord</tt>
* @param direction the call direction - INCOMING_CALL or OUTGOING_CALL
*/
public GuiCallParticipantRecord(CallPeerRecord participantRecord,
String direction)
{
this.direction = direction;
this.participantName = participantRecord.getPeerAddress();
this.startTime = participantRecord.getStartTime();
this.callTime = GuiUtils.substractDates(
participantRecord.getEndTime(), startTime);
}
/**
* Returns the call direction - INCOMING_CALL or OUTGOING_CALL.
*
* @return the call direction - INCOMING_CALL or OUTGOING_CALL.
*/
public String getDirection()
{
return direction;
}
/**
* Returns the duration of the call.
*
* @return the duration of the call
*/
public Date getCallTime()
{
return callTime;
}
/**
* Returns the name of the participant.
*
* @return the name of the participant
*/
public String getParticipantName()
{
return participantName;
}
/**
* Returns the time at which the call has started.
*
* @return the time at which the call has started
*/
public Date getStartTime()
{
return startTime;
}
}
Loading…
Cancel
Save