Fix some conference UI visual problems, related to changes in focus state of a certain call peer.

cusax-fix
Yana Stamcheva 16 years ago
parent c6f76e9f58
commit f8fbcfaf7f

@ -515,7 +515,7 @@ public void conferenceMemberRemoved(CallPeerConferenceEvent conferenceEvent) {}
public boolean isConference()
{
// If we're the focus of the conference.
if (call.isConferenceFocus() && call.getCallPeerCount() > 1)
if (call.isConferenceFocus())
return true;
// If one of our peers is a conference focus, we're in a

@ -16,8 +16,6 @@
import net.java.sip.communicator.impl.gui.utils.*;
import net.java.sip.communicator.service.protocol.*;
import net.java.sip.communicator.service.protocol.event.*;
import net.java.sip.communicator.service.protocol.event.VideoEvent;
import net.java.sip.communicator.service.protocol.event.VideoListener;
import net.java.sip.communicator.util.*;
import net.java.sip.communicator.util.swing.*;
@ -343,7 +341,7 @@ public void soundLevelChanged(SoundLevelChangeEvent event)
remoteLevelIndicator.updateSoundLevel(event.getLevel());
}
});
this.callPeer.getCall().addLocalUserSoundLevelListener(
new SoundLevelListener()
{

@ -164,6 +164,10 @@ public void setParticipantImage(ImageIcon icon)
*/
public void setSingleFocusUI(boolean isSingleFocusUI)
{
// Only set the single focus UI if we're in a focus UI at all.
if (!isFocusUI)
return;
this.isSingleFocusUI = isSingleFocusUI;
if (isSingleFocusUI)
@ -273,7 +277,8 @@ public void addToNameBar(Component component)
*/
public void updateSoundBar(int soundLevel)
{
soundIndicator.updateSoundLevel(soundLevel);
if (soundIndicator != null)
soundIndicator.updateSoundLevel(soundLevel);
}
/**

@ -8,7 +8,6 @@
import java.awt.*;
import java.util.*;
import java.util.Map.*;
import javax.swing.*;
@ -127,7 +126,8 @@ public ConferencePeerPanel(CallDialog callDialog, CallPeer callPeer)
this.setPeerName(callPeer.getDisplayName());
if (callPeer.isConferenceFocus())
// If we have any members we switch to the focus UI.
if (callPeer.getConferenceMemberCount() > 0)
setFocusUI(true);
// We initialize the status bar for call peers only.
@ -429,6 +429,10 @@ public void conferenceMemberAdded(CallPeerConferenceEvent conferenceEvent)
String localUserAddress
= callPeer.getProtocolProvider().getAccountID().getAccountAddress();
// If we're not in a focus UI, when a new member is added we switch to it.
if (!isFocusUI())
setFocusUI(true);
/*
* The local user isn't depicted by this ConferencePeerPanel and its
* ConferenceMemberPanels.
@ -520,6 +524,9 @@ public void conferenceMemberRemoved(CallPeerConferenceEvent conferenceEvent)
{
ConferenceMember member = conferenceEvent.getConferenceMember();
if (callPeer.getConferenceMemberCount() == 0 && isFocusUI())
setFocusUI(false);
this.removeConferenceMemberPanel(member);
}
@ -537,8 +544,12 @@ public void conferenceMemberRemoved(CallPeerConferenceEvent conferenceEvent)
*/
public void conferenceFocusChanged(CallPeerConferenceEvent conferenceEvent)
{
if (conferenceEvent.getSourceCallPeer().equals(callPeer))
setFocusUI(callPeer.isConferenceFocus());
// We disable the focus UI when a callPeer looses focus. However in the
// other direction we'll only enable it when we receive the first
// conference member.
if (conferenceEvent.getSourceCallPeer().equals(callPeer)
&& !callPeer.isConferenceFocus() && isFocusUI())
setFocusUI(false);
}
/**
@ -638,9 +649,10 @@ public void soundLevelChanged(SoundLevelChangeEvent evt)
{
Object evtSource = evt.getSource();
if ((evtSource instanceof CallPeer) &&
((CallPeer) evtSource).isConferenceFocus())
if (evtSource.equals(callPeer))
{
updateSoundBar(evt.getLevel());
}
}
}
}

Loading…
Cancel
Save