[UI] card image zoom in/out on mouse wheel with 700 ms timeout

This commit is contained in:
magenoxx 2012-07-16 16:08:12 +04:00
parent 6d24c7001b
commit 7443e2a9fa
4 changed files with 55 additions and 5 deletions

View file

@ -28,10 +28,10 @@ import java.util.UUID;
/**
* Main class for drawing Mage card object.
*
* @author arcane, nantuko
* @author arcane, nantuko, noxx
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public class CardPanel extends MagePermanent implements MouseListener, MouseMotionListener {
public class CardPanel extends MagePermanent implements MouseListener, MouseMotionListener, MouseWheelListener {
private static final long serialVersionUID = -3272134219262184410L;
private static final Logger log = Logger.getLogger(CardPanel.class);
@ -146,6 +146,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
addMouseListener(this);
addMouseMotionListener(this);
addMouseWheelListener(this);
titleText = new GlowText();
setText(gameCard);
@ -891,4 +892,11 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
updateImage();
}
}
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
if (gameCard.isFaceDown()) return;
data.component = this;
callback.mouseWheelMoved(e, data);
}
}