|
|
|
@ -603,17 +603,10 @@ && isMobile((MetaContact)contact.getDescriptor()))
|
|
|
|
+ V_GAP
|
|
|
|
+ V_GAP
|
|
|
|
+ ComponentUtils.getStringHeight(displayDetailsLabel);
|
|
|
|
+ ComponentUtils.getStringHeight(displayDetailsLabel);
|
|
|
|
|
|
|
|
|
|
|
|
// load button height, before button is even shown
|
|
|
|
|
|
|
|
// will be the same as the image
|
|
|
|
|
|
|
|
int buttonHeight = 27;
|
|
|
|
|
|
|
|
Image img = ImageLoader.getImage(ImageLoader.CHAT_BUTTON_SMALL);
|
|
|
|
|
|
|
|
if(img != null)
|
|
|
|
|
|
|
|
buttonHeight = img.getHeight(chatButton);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
preferredSelectedContactNodeHeight =
|
|
|
|
preferredSelectedContactNodeHeight =
|
|
|
|
preferredNotSelectedContactNodeHeight
|
|
|
|
preferredNotSelectedContactNodeHeight
|
|
|
|
+ V_GAP
|
|
|
|
+ V_GAP
|
|
|
|
+ buttonHeight;
|
|
|
|
+ BUTTON_HEIGHT;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (value instanceof GroupNode)
|
|
|
|
else if (value instanceof GroupNode)
|
|
|
|
@ -873,10 +866,11 @@ else if (treeNode instanceof GroupNode)
|
|
|
|
&& !customActionButtonsUIGroup.isEmpty())
|
|
|
|
&& !customActionButtonsUIGroup.isEmpty())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(preferredGroupNodeHeight != null)
|
|
|
|
if(preferredGroupNodeHeight != null)
|
|
|
|
|
|
|
|
{
|
|
|
|
preferredSize.height = preferredGroupNodeHeight
|
|
|
|
preferredSize.height = preferredGroupNodeHeight
|
|
|
|
+ customActionButtonsUIGroup.size()
|
|
|
|
+ V_GAP
|
|
|
|
* customActionButtonsUIGroup.get(0).getHeight()
|
|
|
|
+ BUTTON_HEIGHT;
|
|
|
|
+ V_GAP;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
preferredSize.height = 70;
|
|
|
|
preferredSize.height = 70;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -941,19 +935,6 @@ private void addLabels(int nameLabelGridWidth)
|
|
|
|
constraints.gridwidth = nameLabelGridWidth;
|
|
|
|
constraints.gridwidth = nameLabelGridWidth;
|
|
|
|
constraints.gridheight = 1;
|
|
|
|
constraints.gridheight = 1;
|
|
|
|
|
|
|
|
|
|
|
|
add(displayDetailsLabel, constraints);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if (treeNode != null && treeNode instanceof GroupNode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
constraints.anchor = GridBagConstraints.WEST;
|
|
|
|
|
|
|
|
constraints.fill = GridBagConstraints.NONE;
|
|
|
|
|
|
|
|
constraints.gridx = 1;
|
|
|
|
|
|
|
|
constraints.gridy = 1;
|
|
|
|
|
|
|
|
constraints.weightx = 1f;
|
|
|
|
|
|
|
|
constraints.weighty = 0f;
|
|
|
|
|
|
|
|
constraints.gridwidth = nameLabelGridWidth;
|
|
|
|
|
|
|
|
constraints.gridheight = 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add(displayDetailsLabel, constraints);
|
|
|
|
add(displayDetailsLabel, constraints);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1029,7 +1010,7 @@ private void initButtonsPanel(UIContact uiContact)
|
|
|
|
|
|
|
|
|
|
|
|
if (imContact != null)
|
|
|
|
if (imContact != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x += addButton(chatButton, ++gridX, x, false);
|
|
|
|
x += addButton(chatButton, ++gridX, x, false, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UIContactDetail telephonyContact
|
|
|
|
UIContactDetail telephonyContact
|
|
|
|
@ -1067,7 +1048,7 @@ private void initButtonsPanel(UIContact uiContact)
|
|
|
|
&& contactPhoneUtil.isCallEnabled(detailsListener)
|
|
|
|
&& contactPhoneUtil.isCallEnabled(detailsListener)
|
|
|
|
&& providers.size() > 0))
|
|
|
|
&& providers.size() > 0))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x += addButton(callButton, ++gridX, x, false);
|
|
|
|
x += addButton(callButton, ++gridX, x, false, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UIContactDetail videoContact
|
|
|
|
UIContactDetail videoContact
|
|
|
|
@ -1078,7 +1059,7 @@ private void initButtonsPanel(UIContact uiContact)
|
|
|
|
|| (contactPhoneUtil != null
|
|
|
|
|| (contactPhoneUtil != null
|
|
|
|
&& contactPhoneUtil.isVideoCallEnabled(detailsListener)))
|
|
|
|
&& contactPhoneUtil.isVideoCallEnabled(detailsListener)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x += addButton(callVideoButton, ++gridX, x, false);
|
|
|
|
x += addButton(callVideoButton, ++gridX, x, false, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
UIContactDetail desktopContact
|
|
|
|
UIContactDetail desktopContact
|
|
|
|
@ -1089,7 +1070,7 @@ private void initButtonsPanel(UIContact uiContact)
|
|
|
|
|| (contactPhoneUtil != null
|
|
|
|
|| (contactPhoneUtil != null
|
|
|
|
&& contactPhoneUtil.isDesktopSharingEnabled(detailsListener)))
|
|
|
|
&& contactPhoneUtil.isDesktopSharingEnabled(detailsListener)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x += addButton(desktopSharingButton, ++gridX, x, false);
|
|
|
|
x += addButton(desktopSharingButton, ++gridX, x, false, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// enable add contact button if contact source has indicated
|
|
|
|
// enable add contact button if contact source has indicated
|
|
|
|
@ -1103,7 +1084,7 @@ private void initButtonsPanel(UIContact uiContact)
|
|
|
|
null).size() > 0
|
|
|
|
null).size() > 0
|
|
|
|
&& !ConfigurationUtils.isAddContactDisabled())
|
|
|
|
&& !ConfigurationUtils.isAddContactDisabled())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x += addButton(addContactButton, ++gridX, x, false);
|
|
|
|
x += addButton(addContactButton, ++gridX, x, false, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//webButton
|
|
|
|
//webButton
|
|
|
|
@ -1117,7 +1098,7 @@ private void initButtonsPanel(UIContact uiContact)
|
|
|
|
getURLDetails(uiContact, webDetailsListener, true);
|
|
|
|
getURLDetails(uiContact, webDetailsListener, true);
|
|
|
|
if(dets != null && dets.size() > 0)
|
|
|
|
if(dets != null && dets.size() > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x += addButton(webButton, ++gridX, x, false);
|
|
|
|
x += addButton(webButton, ++gridX, x, false, true);
|
|
|
|
|
|
|
|
|
|
|
|
webButton.setLinksFromURLDetail(dets);
|
|
|
|
webButton.setLinksFromURLDetail(dets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1135,7 +1116,7 @@ else if (uiContact.getDescriptor() instanceof SourceContact)
|
|
|
|
ContactDetail.Category.Web);
|
|
|
|
ContactDetail.Category.Web);
|
|
|
|
if(dets != null && dets.size() > 0)
|
|
|
|
if(dets != null && dets.size() > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
x += addButton(webButton, ++gridX, x, false);
|
|
|
|
x += addButton(webButton, ++gridX, x, false, true);
|
|
|
|
|
|
|
|
|
|
|
|
webButton.setLinksFromContactDetail(dets);
|
|
|
|
webButton.setLinksFromContactDetail(dets);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -1265,7 +1246,7 @@ private int initGroupActionButtons(
|
|
|
|
customActionButtonsUIGroup.add(actionButton);
|
|
|
|
customActionButtonsUIGroup.add(actionButton);
|
|
|
|
|
|
|
|
|
|
|
|
xBounds
|
|
|
|
xBounds
|
|
|
|
+= addButton(actionButton, ++gridX, xBounds, false);
|
|
|
|
+= addButton(actionButton, ++gridX, xBounds, false, false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return gridX;
|
|
|
|
return gridX;
|
|
|
|
@ -1305,7 +1286,7 @@ private int initContactActionButtons(
|
|
|
|
customActionButtons.add(actionButton);
|
|
|
|
customActionButtons.add(actionButton);
|
|
|
|
|
|
|
|
|
|
|
|
xBounds
|
|
|
|
xBounds
|
|
|
|
+= addButton(actionButton, ++gridX, xBounds, false);
|
|
|
|
+= addButton(actionButton, ++gridX, xBounds, false, true);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return gridX;
|
|
|
|
return gridX;
|
|
|
|
@ -2029,10 +2010,21 @@ public void run()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Adds button.
|
|
|
|
|
|
|
|
* @param button the button to add
|
|
|
|
|
|
|
|
* @param gridX the current x
|
|
|
|
|
|
|
|
* @param xBounds bounds
|
|
|
|
|
|
|
|
* @param isLast is it the last button
|
|
|
|
|
|
|
|
* @param isContact is contact or <tt>false</tt> if it is group node, that
|
|
|
|
|
|
|
|
* we are painting.
|
|
|
|
|
|
|
|
* @return the button width.
|
|
|
|
|
|
|
|
*/
|
|
|
|
private int addButton( SIPCommButton button,
|
|
|
|
private int addButton( SIPCommButton button,
|
|
|
|
int gridX,
|
|
|
|
int gridX,
|
|
|
|
int xBounds,
|
|
|
|
int xBounds,
|
|
|
|
boolean isLast)
|
|
|
|
boolean isLast,
|
|
|
|
|
|
|
|
boolean isContact)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
lastAddedButton = button;
|
|
|
|
lastAddedButton = button;
|
|
|
|
|
|
|
|
|
|
|
|
@ -2047,9 +2039,11 @@ private int addButton( SIPCommButton button,
|
|
|
|
constraints.weighty = 0f;
|
|
|
|
constraints.weighty = 0f;
|
|
|
|
add(button, constraints);
|
|
|
|
add(button, constraints);
|
|
|
|
|
|
|
|
|
|
|
|
int yBounds = TOP_BORDER + BOTTOM_BORDER + 2*V_GAP
|
|
|
|
int yBounds = ComponentUtils.getStringSize(
|
|
|
|
+ ComponentUtils.getStringSize(
|
|
|
|
nameLabel, nameLabel.getText()).height;
|
|
|
|
nameLabel, nameLabel.getText()).height
|
|
|
|
|
|
|
|
|
|
|
|
if(isContact)
|
|
|
|
|
|
|
|
yBounds += TOP_BORDER + BOTTOM_BORDER + 2*V_GAP
|
|
|
|
+ ComponentUtils.getStringSize(
|
|
|
|
+ ComponentUtils.getStringSize(
|
|
|
|
displayDetailsLabel, displayDetailsLabel.getText()).height;
|
|
|
|
displayDetailsLabel, displayDetailsLabel.getText()).height;
|
|
|
|
|
|
|
|
|
|
|
|
|