Fixes refactoring problems

cusax-fix
Emil Ivov 18 years ago
parent 02baebb228
commit 0de10aed18

@ -17,60 +17,62 @@
/**
* The UI button used to toggle on or off call securing
*
*
* @author Emanuel Onica
*
*/
public class SecureButton
extends JButton
implements ActionListener
public class SecureButton
extends JButton
implements ActionListener
{
private final CallParticipant callParticipant;
public SecureButton(CallParticipant callParticipant)
private final CallParticipant callParticipant;
public SecureButton(CallParticipant callParticipant)
{
super(new ImageIcon(ImageLoader.getImage(ImageLoader.SECURE_BUTTON_OFF)));
this.callParticipant = callParticipant;
this.addActionListener(this);
}
public void actionPerformed(ActionEvent evt)
public void actionPerformed(ActionEvent evt)
{
Call call = callParticipant.getCall();
if (call != null)
{
String command = evt.getActionCommand();
if (command.equals("startSecureMode"))
{
OperationSetBasicTelephony telephony =
(OperationSetBasicTelephony) call.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
if (telephony.getSecured(callParticipant))
{
updateSecureButton(false);
telephony.setSecured(callParticipant,
false,
OperationSetBasicTelephony.
SecureStatusChangeSource.SECURE_STATUS_CHANGE_BY_LOCAL);
}
else
{
updateSecureButton(true);
telephony.setSecured(callParticipant,
true,
OperationSetBasicTelephony.
SecureStatusChangeSource.SECURE_STATUS_CHANGE_BY_LOCAL);
}
}
}
Call call = callParticipant.getCall();
if (call != null)
{
String command = evt.getActionCommand();
if (command.equals("startSecureMode"))
{
OperationSetBasicTelephony telephony =
(OperationSetBasicTelephony) call.getProtocolProvider()
.getOperationSet(OperationSetBasicTelephony.class);
if (telephony.isSecured(callParticipant))
{
updateSecureButton(false);
telephony.setSecured(callParticipant,
false,
OperationSetBasicTelephony.
SecureStatusChangeSource
.SECURE_STATUS_CHANGE_BY_LOCAL);
}
else
{
updateSecureButton(true);
telephony.setSecured(callParticipant,
true,
OperationSetBasicTelephony.
SecureStatusChangeSource
.SECURE_STATUS_CHANGE_BY_LOCAL);
}
}
}
}
/**
/**
* The method used to update the secure button state (pressed or not pressed)
*
*
* @param isSecured parameter reflecting the current button state
*/
public void updateSecureButton(boolean isSecured)
@ -78,14 +80,18 @@ public void updateSecureButton(boolean isSecured)
if(isSecured)
{
this.setIcon(
new ImageIcon(ImageLoader.getImage(ImageLoader.SECURE_BUTTON_ON)));
this.setToolTipText(Messages.getI18NString("toggleOffSecurity").getText());
new ImageIcon(
ImageLoader.getImage(ImageLoader.SECURE_BUTTON_ON)));
this.setToolTipText(
Messages.getI18NString("toggleOffSecurity").getText());
}
else
{
this.setIcon(
new ImageIcon(ImageLoader.getImage(ImageLoader.SECURE_BUTTON_OFF)));
this.setToolTipText(Messages.getI18NString("toggleOnSecurity").getText());
new ImageIcon(
ImageLoader.getImage(ImageLoader.SECURE_BUTTON_OFF)));
this.setToolTipText(
Messages.getI18NString("toggleOnSecurity").getText());
}
}
}

@ -236,6 +236,7 @@ public void callStateChanged(CallChangeEvent evt)
* (non-Javadoc)
* @see net.java.sip.communicator.service.protocol.OperationSetBasicTelephony#setSecured(net.java.sip.communicator.service.protocol.CallParticipant, boolean, net.java.sip.communicator.service.media.CallSession.SecureStatusChangeSource)
*/
@Override
public void setSecured(CallParticipant participant, boolean secured,
OperationSetBasicTelephony.SecureStatusChangeSource source)
{
@ -245,7 +246,8 @@ public void setSecured(CallParticipant participant, boolean secured,
* (non-Javadoc)
* @see net.java.sip.communicator.service.protocol.OperationSetBasicTelephony#getSecured(net.java.sip.communicator.service.protocol.CallParticipant)
*/
public boolean getSecured(CallParticipant participant)
@Override
public boolean isSecured(CallParticipant participant)
{
return false;
}

@ -2963,7 +2963,7 @@ public void setMute(CallParticipant participant, boolean mute)
((CallSipImpl) participant.getCall()).getMediaCallSession().setMute(
mute);
}
/*
* (non-Javadoc)
* @see net.java.sip.communicator.service.protocol.OperationSetBasicTelephony#setSecured(net.java.sip.communicator.service.protocol.CallParticipant, boolean, net.java.sip.communicator.service.media.CallSession.SecureStatusChangeSource)
@ -2979,7 +2979,7 @@ public void setSecured(CallParticipant participant, boolean secured,
* (non-Javadoc)
* @see net.java.sip.communicator.service.protocol.OperationSetBasicTelephony#getSecured(net.java.sip.communicator.service.protocol.CallParticipant)
*/
public boolean getSecured(CallParticipant participant)
public boolean isSecured(CallParticipant participant)
{
return ((CallSipImpl) participant.getCall()).getMediaCallSession().
getSecureCommunicationStatus();

Loading…
Cancel
Save