* Implements a state which is private to * VideoConferenceCallPanel and is of no concern to * ConferenceParticipantContainer. *
*/ List* Implements a state which is private to * VideoConferenceCallPanel and is of no concern to * ConferenceParticipantContainer. *
*/ boolean toBeRemoved; /** * The BasicConferenceParticipantPanel which is displayed at * the bottom of this instance, bellow the {@link #video} (i.e. * {@link #videoContainer}) and is referred to as the tool bar. */ private final BasicConferenceParticipantPanel> toolBar; /** * The visual Component, if any, displaying video which is * depicted by this instance. */ private Component video; /** * The VideoContainer which lays out the video depicted by this * instance i.e. {@link #video}. */ private final VideoContainer videoContainer; /** * The CallPeer associated with this container, if it has been * created to represent a CallPeer. */ private CallPeer callPeer; /** * The conferenceMember associated with this container, if it * has been created to represent a conferenceMember. */ private ConferenceMember conferenceMember; /** * Indicates that this container contains information for the local * user. */ private boolean isLocalUser; /** * Initializes a new ConferenceParticipantContainer instance * which is to depict the local peer/user. * * @param call a Call which is to provide information about the * local peer/user * @param video the visual Component, if any, displaying the * video streaming from the local peer/user to the remote peer(s) */ public ConferenceParticipantContainer(Call call, Component video) { this( createDefaultPhotoPanel(call), video, new ConferencePeerPanel( VideoConferenceCallPanel.this, call, true), null, null, true); } public ConferenceParticipantContainer( CallPeer callPeer, Component video) { this( createDefaultPhotoPanel(callPeer), video, new ConferencePeerPanel( VideoConferenceCallPanel.this, callPeer, true), callPeer, null, false); } private ConferenceParticipantContainer( Component noVideo, Component video, BasicConferenceParticipantPanel> toolBar, CallPeer callPeer, ConferenceMember conferenceMember, boolean isLocalUser) { super(new BorderLayout()); this.callPeer = callPeer; this.conferenceMember = conferenceMember; this.isLocalUser = isLocalUser; videoContainer = new VideoContainer(noVideo, false); add(videoContainer, BorderLayout.CENTER); this.toolBar = toolBar; if (this.toolBar != null) add(this.toolBar, BorderLayout.SOUTH); if (video != null) { setVideo(video); } else setVisible(false); } public ConferenceParticipantContainer( ConferenceMember conferenceMember, Component video) { this( createDefaultPhotoPanel(conferenceMember), video, new ConferenceMemberPanel( VideoConferenceCallPanel.this, conferenceMember, true), null, conferenceMember, false); } public void dispose() { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.dispose(); // Dispose of the conferenceMemberContainers if any. /* * XXX The field conferenceMemberContainers implements a state * private to VideoConferenceCallPanel which the latter makes sure * to access on the AWT event dispatching thread only. Since we are * going out of our way here to help VideoConferenceCallPanel, * ensure that the mentioned synchronization rule is not violated. */ CallManager.assertIsEventDispatchingThread(); if (conferenceMemberContainers != null) { for (ConferenceParticipantContainer cmc : conferenceMemberContainers) { cmc.dispose(); } } } public CallPanel getCallPanel() { return getCallRenderer().getCallContainer(); } public SwingCallRenderer getCallRenderer() { return VideoConferenceCallPanel.this; } public Component getComponent() { return this; } private ConferenceCallPeerRenderer getConferenceCallPeerRendererDelegate() { return (toolBar instanceof ConferenceCallPeerRenderer) ? (ConferenceCallPeerRenderer) toolBar : null; } /** * Gets the conference participant depicted by this instance. * * @return the conference participant depicted by this instance */ public Object getParticipant() { return (toolBar == null) ? null : toolBar.getParticipant(); } public Component getVideo() { return video; } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. Otherwise, returns false. */ public boolean isLocalVideoVisible() { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); return (delegate == null) ? false : delegate.isLocalVideoVisible(); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void printDTMFTone(char dtmfChar) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.printDTMFTone(dtmfChar); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void securityNegotiationStarted( CallPeerSecurityNegotiationStartedEvent ev) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.securityNegotiationStarted(ev); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void securityOff(CallPeerSecurityOffEvent ev) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.securityOff(ev); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void securityOn(CallPeerSecurityOnEvent ev) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.securityOn(ev); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void securityPending() { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.securityPending(); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void securityTimeout(CallPeerSecurityTimeoutEvent ev) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.securityTimeout(ev); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void setErrorReason(String reason) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.setErrorReason(reason); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void setLocalVideoVisible(boolean visible) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.setLocalVideoVisible(visible); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void setMute(boolean mute) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.setMute(mute); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void setOnHold(boolean onHold) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.setOnHold(onHold); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void setPeerImage(byte[] image) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.setPeerImage(image); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void setPeerName(String name) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.setPeerName(name); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void setPeerState( CallPeerState oldState, CallPeerState newState, String stateString) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.setPeerState(oldState, newState, stateString); } /** * {@inheritDoc} * * Delegates to the toolBar, if the latter implements * ConferenceCallPeerRenderer, because this instance is a * container only. */ public void setSecurityPanelVisible(boolean visible) { ConferenceCallPeerRenderer delegate = getConferenceCallPeerRendererDelegate(); if (delegate != null) delegate.setSecurityPanelVisible(visible); } /** * Sets the visual Component displaying the video associated * with the participant depicted by this instance. * * @param video the visual Component displaying video which is * to be associated with the participant depicted by this instance */ void setVideo(Component video) { if (this.video != video) { if (this.video != null) videoContainer.remove(this.video); this.video = video; if (this.video != null) { setVisible(true); videoContainer.add(this.video, VideoLayout.CENTER_REMOTE); } else setVisible(false); // Update thumbnails container according to video status. if (thumbnailContainer != null) { if (conferenceMember != null) thumbnailContainer .updateThumbnail(conferenceMember, (video != null)); else if (callPeer != null) thumbnailContainer .updateThumbnail(callPeer, (video != null)); else if (isLocalUser) thumbnailContainer .updateThumbnail((video != null)); } } } } }