Updates contact list search buttons.

cusax-fix
Yana Stamcheva 13 years ago
parent 0110981ab4
commit 15b365abd6

@ -99,6 +99,7 @@ service.gui.icons.UNAUTHORIZED_CONTACT_16x16=resources/images/impl/gui/common/un
service.gui.icons.CALL_TOOLBAR_SEPARATOR=resources/images/impl/gui/common/callToolbarSeparator.png
service.gui.icons.CALL_HISTORY_BUTTON_NOTIFICATION=resources/images/impl/gui/common/callHistoryButtonNotification.png
service.gui.icons.AUTO_ANSWER_CHECK=resources/images/impl/gui/common/autoAnswerCheck.png
service.gui.icons.SEARCH_SEPARATOR=resources/images/impl/gui/common/searchSeparator.png
# Status icons
service.gui.statusicons.USER_ONLINE_ICON=resources/images/impl/gui/common/statusicons/online.png
@ -206,6 +207,7 @@ service.gui.buttons.CALL_HISTORY_BUTTON=resources/images/impl/gui/buttons/callHi
service.gui.buttons.CALL_HISTORY_BUTTON_PRESSED=resources/images/impl/gui/buttons/callHistoryButtonPressed.png
service.gui.buttons.SEARCH_CALL_ICON=resources/images/impl/gui/buttons/searchCallIcon.png
service.gui.buttons.SEARCH_CALL_ROLLOVER_ICON=resources/images/impl/gui/buttons/searchCallRolloverIcon.png
service.gui.buttons.SEARCH_CALL_PRESSED_ICON=resources/images/impl/gui/buttons/searchCallPressedIcon.png
service.gui.buttons.ZOOM_OUT=resources/images/impl/gui/buttons/magnifier_zoom_out.png
service.gui.buttons.ZOOM_IN=resources/images/impl/gui/buttons/magnifier_zoom_in.png
service.gui.buttons.RESET=resources/images/impl/gui/buttons/reset.png
@ -265,6 +267,7 @@ service.gui.lookandfeel.TAB_MIDDLE_BG=resources/images/impl/gui/lookandfeel/tabM
service.gui.lookandfeel.TAB_RIGHT_BG=resources/images/impl/gui/lookandfeel/tabRight.png
service.gui.lookandfeel.DELETE_TEXT_ICON=resources/images/impl/gui/lookandfeel/delete.png
service.gui.lookandfeel.DELETE_TEXT_ROLLOVER_ICON=resources/images/impl/gui/lookandfeel/deleteRollover.png
service.gui.lookandfeel.DELETE_TEXT_PRESSED_ICON=resources/images/impl/gui/lookandfeel/deletePressed.png
service.gui.lookandfeel.BUTTON=resources/images/impl/gui/lookandfeel/button1.png
service.gui.lookandfeel.BUTTON_ROLLOVER=resources/images/impl/gui/lookandfeel/button2.png
service.gui.lookandfeel.TOGGLE_BUTTON_PRESSED=resources/images/impl/gui/lookandfeel/button3.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 469 B

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -42,16 +42,31 @@ public class SearchFieldUI
*/
private Image callIcon;
/**
* The separator icon shown between the call icon and the close.
*/
private Image separatorIcon;
/**
* The roll over icon of the call button.
*/
private Image callRolloverIcon;
/**
* The pressed icon of the call button.
*/
private Image callPressedIcon;
/**
* Indicates if the mouse is currently over the call button.
*/
private boolean isCallMouseOver = false;
/**
* Indicates if the mouse is currently over the call button.
*/
private boolean isCallMousePressed = false;
/**
* The call button tool tip string.
*/
@ -139,11 +154,19 @@ protected void customPaintBackground(Graphics g)
int dx = callRect.x;
dy = callRect.y;
if (isCallMouseOver)
if (isCallMousePressed)
g2.drawImage(callPressedIcon, dx, dy, null);
else if (isCallMouseOver)
g2.drawImage(callRolloverIcon, dx, dy, null);
else
g2.drawImage(callIcon, dx, dy, null);
g2.drawImage( separatorIcon,
dx + callRect.width + 3,
dy + (callRect.height
- separatorIcon.getHeight(null))/2,
null);
isCallIconVisible = true;
}
else
@ -223,11 +246,17 @@ public void mouseExited(MouseEvent e)
public void mousePressed(MouseEvent e)
{
super.mousePressed(e);
if(isCallButtonEnabled)
updateCallIcon(e);
}
public void mouseReleased(MouseEvent e)
{
super.mouseReleased(e);
if(isCallButtonEnabled)
updateCallIcon(e);
}
/**
@ -284,8 +313,18 @@ private void updateCallIcon(MouseEvent evt)
x, y, // X-Y of the mouse for the tool tip
0, false));
if (evt.getID() == MouseEvent.MOUSE_PRESSED)
{
isCallMouseOver = false;
isCallMousePressed = true;
}
else
{
isCallMouseOver = true;
isCallMousePressed = false;
}
// Update the default cursor.
isCallMouseOver = true;
getComponent().setCursor(Cursor.getDefaultCursor());
// Perform call action when the call button is clicked.
@ -305,6 +344,7 @@ private void updateCallIcon(MouseEvent evt)
0, false));
isCallMouseOver = false;
isCallMousePressed = false;
}
getComponent().repaint();
@ -320,7 +360,7 @@ protected Rectangle getCallButtonRect()
Component c = getComponent();
Rectangle rect = c.getBounds();
int dx = getDeleteButtonRect().x - callRolloverIcon.getWidth(null) - 2;
int dx = getDeleteButtonRect().x - callRolloverIcon.getWidth(null) - 8;
int dy = (rect.y + rect.height) / 2 - callRolloverIcon.getHeight(null)/2;
return new Rectangle( dx,
@ -347,6 +387,13 @@ public void loadSkin()
callRolloverIcon = UtilActivator.getResources()
.getImage("service.gui.buttons.SEARCH_CALL_ROLLOVER_ICON")
.getImage();
callPressedIcon = UtilActivator.getResources()
.getImage("service.gui.buttons.SEARCH_CALL_PRESSED_ICON")
.getImage();
separatorIcon = UtilActivator.getResources()
.getImage("service.gui.icons.SEARCH_SEPARATOR").getImage();
}
}

@ -34,6 +34,11 @@ public class SIPCommTextFieldUI
*/
protected boolean isDeleteMouseOver = false;
/**
* Indicates if the mouse is currently pressed on the delete button.
*/
protected boolean isDeleteMousePressed = false;
/**
* The gap between the delete button and the text in the field.
*/
@ -49,6 +54,11 @@ public class SIPCommTextFieldUI
*/
private Image deleteButtonRolloverImg;
/**
* The image for the pressed state of the delete text button.
*/
private Image deleteButtonPressedImg;
/**
* Indicates if the text field contains a
* delete button allowing to delete all the content at once.
@ -201,6 +211,8 @@ protected void customPaintBackground(Graphics g)
&& c.getText().length() > 0
&& isDeleteButtonEnabled)
{
if (isDeleteMousePressed)
g2.drawImage(deleteButtonPressedImg, dx, dy, null);
if (isDeleteMouseOver)
g2.drawImage(deleteButtonRolloverImg, dx, dy, null);
else
@ -264,14 +276,27 @@ protected void updateDeleteIcon(MouseEvent evt)
if (isDeleteIconVisible && deleteRect.contains(x, y))
{
isDeleteMouseOver = true;
if (evt.getID() == MouseEvent.MOUSE_PRESSED)
{
isDeleteMouseOver = false;
isDeleteMousePressed = true;
}
else
{
isDeleteMouseOver = true;
isDeleteMousePressed = false;
}
getComponent().setCursor(Cursor.getDefaultCursor());
if (evt.getID() == MouseEvent.MOUSE_CLICKED)
getComponent().setText("");
}
else
{
isDeleteMouseOver = false;
isDeleteMousePressed = false;
}
getComponent().repaint();
}
@ -290,7 +315,7 @@ protected Rectangle getDeleteButtonRect()
Rectangle rect = c.getBounds();
int dx = rect.width - deleteButton.getWidth() - BUTTON_GAP - 5;
int dx = rect.width - deleteButton.getWidth() - BUTTON_GAP;
int dy = rect.height / 2 - deleteButton.getHeight()/2;
return new Rectangle( dx,
@ -378,15 +403,23 @@ public void loadSkin()
.getImage("service.gui.lookandfeel.DELETE_TEXT_ROLLOVER_ICON")
.getImage();
deleteButtonPressedImg = UtilActivator.getResources()
.getImage("service.gui.lookandfeel.DELETE_TEXT_PRESSED_ICON")
.getImage();
if(deleteButton != null)
{
deleteButton.setBackgroundImage(deleteButtonImg);
deleteButton.setIconImage(deleteButtonRolloverImg);
deleteButton.setRolloverImage(deleteButtonRolloverImg);
deleteButton.setPressedImage(deleteButtonPressedImg);
}
else
{
deleteButton = new SIPCommButton(
deleteButtonImg, deleteButtonRolloverImg);
deleteButtonImg,
deleteButtonRolloverImg,
deleteButtonPressedImg,
null, null, null);
}
deleteButton.setSize ( deleteButtonImg.getWidth(null),
@ -423,10 +456,15 @@ public void mouseExited(MouseEvent e)
updateCursor(e);
}
public void mousePressed(MouseEvent e) {}
public void mouseReleased(MouseEvent e) {}
public void mousePressed(MouseEvent e)
{
updateDeleteIcon(e);
}
public void mouseReleased(MouseEvent e)
{
updateDeleteIcon(e);
}
/**
* Updates the delete icon when the mouse is dragged over.
@ -448,6 +486,11 @@ public void mouseMoved(MouseEvent e)
updateCursor(e);
}
/**
* Updates the cursor type depending on a given <tt>MouseEvent</tt>.
*
* @param mouseEvent the <tt>MouseEvent</tt> on which the cursor depends
*/
private void updateCursor(MouseEvent mouseEvent)
{
Rectangle rect = getVisibleEditorRect();

Loading…
Cancel
Save