use of java.awt.event.MouseListener in project lotro-companion by dmorcellet.
the class TomesEditionPanelController method buildTomeController.
private TomeIconController buildTomeController(TomesSet tomes, STAT stat) {
TomeIconController controller = new TomeIconController(tomes, stat);
JLabel label = controller.getLabel();
MouseListener listener = buildLeftClickListener();
label.addMouseListener(listener);
return controller;
}
use of java.awt.event.MouseListener in project cytoscape-impl by cytoscape.
the class NetworkMediator method addMouseListenersForSelection.
private void addMouseListenersForSelection(final AbstractNetworkPanel<?> item, final JComponent... components) {
// This mouse listener listens for mouse pressed events to select the list items
final MouseListener selectionListener = new MouseAdapter() {
@Override
public void mousePressed(MouseEvent e) {
networkMainPanel.onMousePressedItem(e, item);
}
};
// This mouse listener listens for the right-click events to show the pop-up window
final PopupListener popupListener = new PopupListener(item);
for (JComponent c : components) {
c.addMouseListener(selectionListener);
c.addMouseListener(popupListener);
}
}
use of java.awt.event.MouseListener in project cytoscape-impl by cytoscape.
the class NetworkViewMediator method addMouseListeners.
private void addMouseListeners(final ThumbnailPanel tp, final Component... components) {
// This mouse listener listens for mouse pressed events to select the list items
final MouseListener selectionListener = new MouseAdapter() {
@Override
public void mousePressed(final MouseEvent e) {
getNetworkViewGrid().onMousePressedItem(e, tp);
}
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() == 2 && !e.isPopupTrigger()) {
// Double-Click: set this one as current and show attached view or view frame
final NetworkViewFrame frame = getNetworkViewFrame(tp.getNetworkView());
if (frame != null)
getNetworkViewMainPanel().showViewFrame(frame);
else
gridViewToggleModel.setMode(Mode.VIEW);
}
}
};
// This mouse listener listens for the right-click events to show the pop-up window
final PopupListener popupListener = new PopupListener(tp);
for (Component c : components) {
c.addMouseListener(selectionListener);
c.addMouseListener(popupListener);
}
}
use of java.awt.event.MouseListener in project tray by qzind.
the class LinkLabel method initialize.
private void initialize() {
actionListeners = new ArrayList<>();
addMouseListener(new MouseListener() {
@Override
public void mouseClicked(MouseEvent e) {
for (ActionListener actionListener : actionListeners) {
actionListener.actionPerformed(new ActionEvent(e.getSource(), e.getID(), "mouseClicked"));
}
}
@Override
public void mousePressed(MouseEvent e) {
}
@Override
public void mouseReleased(MouseEvent e) {
}
@Override
public void mouseEntered(MouseEvent e) {
setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
}
@Override
public void mouseExited(MouseEvent e) {
setCursor(Cursor.getDefaultCursor());
}
});
}
use of java.awt.event.MouseListener in project com.revolsys.open by revolsys.
the class MouseOverlay method mousePressed.
@Override
public void mousePressed(final MouseEvent e) {
updateEventPoint(e);
final Window window = SwingUtil.getWindowAncestor(this);
window.setAlwaysOnTop(true);
window.toFront();
window.setFocusableWindowState(true);
window.requestFocus();
window.setAlwaysOnTop(false);
requestFocusInWindow();
for (final Component overlay : getOverlays()) {
if (overlay instanceof MouseListener) {
final MouseListener listener = (MouseListener) overlay;
listener.mousePressed(e);
if (e.isConsumed()) {
return;
}
}
}
}
Aggregations