use of mage.client.cards.CardEventProducer in project mage by magefree.
the class MageActionCallback method popupMenuCard.
@Override
public void popupMenuCard(MouseEvent e, TransferData data) {
// send popup menu request over card
if (e.isConsumed()) {
return;
}
e.consume();
if (data.getComponent().getCardContainer() instanceof CardEventProducer) {
CardEventProducer area = (CardEventProducer) data.getComponent().getCardContainer();
mage.client.util.Event clientEvent = new mage.client.util.Event(data.getComponent().getOriginal(), ClientEventType.CARD_POPUP_MENU, 0, e.getX(), e.getY(), data.getComponent(), e, false);
area.getCardEventSource().fireEvent(clientEvent);
}
}
use of mage.client.cards.CardEventProducer in project mage by magefree.
the class MageActionCallback method mouseClicked.
@Override
public void mouseClicked(MouseEvent e, TransferData data, boolean doubleClick) {
// send mouse clicked event to the card's area and other cards list components for processing
if (e.isConsumed()) {
return;
}
if (data.getComponent().getCardContainer() instanceof CardEventProducer) {
ClientEventType clickType = doubleClick ? ClientEventType.CARD_DOUBLE_CLICK : ClientEventType.CARD_CLICK;
CardEventProducer cardContainer = (CardEventProducer) data.getComponent().getCardContainer();
mage.client.util.Event clientEvent = new mage.client.util.Event(data.getComponent().getOriginal(), clickType, 0, e.getX(), e.getY(), data.getComponent(), e, false);
cardContainer.getCardEventSource().fireEvent(clientEvent);
}
}
use of mage.client.cards.CardEventProducer in project mage by magefree.
the class MageActionCallback method popupMenuPanel.
@Override
public void popupMenuPanel(MouseEvent e, Component sourceComponent) {
// over non card component
if (e.isConsumed()) {
return;
}
e.consume();
if (sourceComponent instanceof CardEventProducer) {
CardEventProducer area = (CardEventProducer) sourceComponent;
// card param must be empty
mage.client.util.Event clientEvent = new mage.client.util.Event(null, ClientEventType.CARD_POPUP_MENU, 0, e.getX(), e.getY(), e.getComponent(), e, false);
area.getCardEventSource().fireEvent(clientEvent);
}
}
Aggregations