Fixes calls status bar layout (both in one-to-one and conference calls).

cusax-fix
Yana Stamcheva 16 years ago
parent d7d11b433e
commit e8767ee881

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 B

After

Width:  |  Height:  |  Size: 258 B

@ -286,14 +286,26 @@ private Component createStatusBar()
dtmfLabel.setForeground(Color.WHITE);
callStatusLabel.setText(callPeer.getState().getStateString());
PeerStatusPanel statusPanel = new PeerStatusPanel(
new FlowLayout(FlowLayout.CENTER, 5, 0));
statusPanel.add(securityStatusLabel);
statusPanel.add(holdStatusLabel);
statusPanel.add(muteStatusLabel);
statusPanel.add(callStatusLabel);
statusPanel.add(dtmfLabel);
PeerStatusPanel statusPanel = new PeerStatusPanel(new GridBagLayout());
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = 0;
constraints.gridy = 0;
statusPanel.add(securityStatusLabel, constraints);
constraints.gridx++;
statusPanel.add(holdStatusLabel, constraints);
constraints.gridx++;
statusPanel.add(muteStatusLabel, constraints);
constraints.gridx++;
statusPanel.add(callStatusLabel, constraints);
constraints.gridx++;
constraints.weightx = 1f;
statusPanel.add(dtmfLabel, constraints);
return statusPanel;
}

@ -45,7 +45,7 @@ public class BasicConferenceParticipantPanel
/**
* The panel containing the title of the participant.
*/
private final JPanel titleBar = new CallTitlePanel(new BorderLayout());
private final JPanel titleBar = new CallTitlePanel(new GridBagLayout());
/**
* The label showing the image of the participant.
@ -58,10 +58,16 @@ public class BasicConferenceParticipantPanel
private final JLabel callStatusLabel = new JLabel();
private final JPanel statusBar
= new TransparentPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
= new TransparentPanel(new GridBagLayout());
private final GridBagConstraints statusBarConstraints
= new GridBagConstraints();
private final JPanel nameBar
= new TransparentPanel(new FlowLayout(FlowLayout.LEFT, 0, 0));
= new TransparentPanel(new GridBagLayout());
private final GridBagConstraints nameBarConstraints
= new GridBagConstraints();
private final TransparentPanel peerDetailsPanel = new TransparentPanel();
@ -277,7 +283,9 @@ public boolean isFocusUI()
*/
public void addToStatusBar(Component component)
{
this.statusBar.add(component);
statusBarConstraints.gridx = statusBarConstraints.gridx + 1;
statusBarConstraints.weightx = 0f;
this.statusBar.add(component, statusBarConstraints);
}
/**
@ -286,7 +294,9 @@ public void addToStatusBar(Component component)
*/
public void addToNameBar(Component component)
{
this.nameBar.add(component);
nameBarConstraints.gridx = nameBarConstraints.gridx + 1;
nameBarConstraints.weightx = 0f;
this.nameBar.add(component, nameBarConstraints);
}
/**
@ -315,13 +325,31 @@ private void initTitleBar()
{
titleBar.setBorder(BorderFactory.createEmptyBorder(2, 8, 2, 8));
nameBar.add(nameLabel);
nameBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
nameBarConstraints.gridx = 0;
nameBarConstraints.gridy = 0;
nameBarConstraints.weightx = 1f;
nameBar.add(nameLabel, nameBarConstraints);
statusBar.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
statusBar.add(callStatusLabel);
statusBarConstraints.gridx = 0;
statusBarConstraints.gridy = 0;
statusBarConstraints.weightx = 1f;
statusBar.add(callStatusLabel, statusBarConstraints);
GridBagConstraints constraints = new GridBagConstraints();
constraints.gridx = 0;
constraints.gridy = 0;
constraints.weightx = 1f;
constraints.anchor = GridBagConstraints.WEST;
titleBar.add(nameBar, constraints);
titleBar.add(nameBar, BorderLayout.WEST);
titleBar.add(statusBar, BorderLayout.EAST);
constraints.gridx = 1;
constraints.gridy = 0;
constraints.weightx = 1f;
constraints.anchor = GridBagConstraints.EAST;
titleBar.add(statusBar, constraints);
}
/**

@ -57,11 +57,13 @@ public CallPeerMenu(CallPeer peer)
this.callPeer = peer;
this.setOpaque(false);
this.setPreferredSize(new Dimension(20, 20));
// Should explicitly remove any border in order to align correctly the
// icon.
this.setBorder(BorderFactory.createEmptyBorder());
this.setPreferredSize(new Dimension(16, 16));
this.setHorizontalAlignment(SwingConstants.CENTER);
this.setIcon(new ImageIcon(ImageLoader
.getImage(ImageLoader.CALL_PEER_TOOLS)));
this.setIconTextGap(0);

@ -40,6 +40,8 @@ public SIPCommMenu()
/**
* Creates an instance of <tt>SIPCommMenu</tt> by specifying
* the text and the icon.
* @param text the text of the menu
* @param defaultIcon the menu icon
*/
public SIPCommMenu(String text, Icon defaultIcon)
{
@ -140,15 +142,16 @@ public void setMouseOver(boolean isMouseOver)
*/
public void paintComponent(Graphics g)
{
g = g.create();
Graphics g2 = g.create();
try
{
internalPaintComponent(g);
internalPaintComponent(g2);
}
finally
{
g.dispose();
g2.dispose();
}
super.paintComponent(g);
}
/**
@ -175,8 +178,6 @@ private void internalPaintComponent(Graphics g)
g.fillRoundRect(0, 0, this.getWidth(), this.getHeight(), 20, 20);
g.setColor(UIManager.getColor("Menu.foreground"));
super.paintComponent(g);
}
/**

@ -19,8 +19,6 @@
public class SIPCommMenuBar
extends JMenuBar
{
private boolean isRollover;
public SIPCommMenuBar()
{
this.setBorder(BorderFactory.createEmptyBorder());

Loading…
Cancel
Save