List of usage examples for java.awt.event MouseEvent getClickCount
public int getClickCount()
From source file:eu.esdihumboldt.hale.ui.views.styledmap.tool.InstanceTool.java
/** * @see AbstractMapTool#click(MouseEvent, GeoPosition) *///ww w. ja v a 2s .c o m @Override public void click(MouseEvent me, GeoPosition pos) { if (me.getClickCount() == 2) { mapKit.setCenterPosition(pos); mapKit.setZoom(mapKit.getMainMap().getZoom() - 1); } else if (me.getClickCount() == 1) { if (me.isAltDown() && getPositions().size() < 1) { // add pos addPosition(pos); } else if (getPositions().size() == 1) { // finish box selection // action & reset addPosition(pos); // action try { List<Point2D> points = getPoints(); Rectangle rect = new Rectangle((int) points.get(0).getX(), (int) points.get(0).getY(), 0, 0); rect.add(points.get(1)); updateSelection(rect, me.isControlDown() || me.isMetaDown(), true); } catch (IllegalGeoPositionException e) { log.error("Error calculating selection box", e); //$NON-NLS-1$ } reset(); } else { // click selection reset(); updateSelection(me.getPoint(), me.isControlDown() || me.isMetaDown(), true); } } }
From source file:org.parosproxy.paros.view.TabbedPanel.java
/** * This method initializes this/*from www . j a v a 2s . c o m*/ */ private void initialize() { if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) { this.setSize(225, 145); } this.addMouseListener(new java.awt.event.MouseAdapter() { @Override public void mouseClicked(java.awt.event.MouseEvent e) { if (e.getClickCount() >= 2) { alternateParent(); } } }); }
From source file:MouseEventDemo.java
public void mousePressed(MouseEvent e) { saySomething("Mouse pressed (# of clicks: " + e.getClickCount() + ")", e); }
From source file:MouseEventDemo.java
public void mouseClicked(MouseEvent e) { saySomething("Mouse clicked (# of clicks: " + e.getClickCount() + ")", e); }
From source file:MouseEventDemo.java
public void mouseReleased(MouseEvent e) { saySomething("Mouse released (# of clicks: " + e.getClickCount() + ")", e); }
From source file:org.zaproxy.zap.view.ComponentMaximiserMouseListener.java
/** * Calls {@link #triggerMaximisation(Component)} when clicked twice, with the source of the event as parameter. *///from w ww .ja va2 s.c o m @Override public void mouseClicked(MouseEvent evt) { if (evt.getClickCount() == 2) { triggerMaximisation((Component) evt.getSource()); } }
From source file:pt.lsts.neptus.plugins.sunfish.iridium.IridiumVisualization.java
@Override public JComponent getVisualization(IMraLogGroup source, double timestep) { LsfIterator<IridiumMsgTx> itTx = source.getLsfIndex().getIterator(IridiumMsgTx.class); while (itTx.hasNext()) { try {//w w w . j a v a 2 s . c o m tableModel.addTransmission(itTx.next()); } catch (Exception e) { NeptusLog.pub().error(e); } } LsfIterator<IridiumMsgRx> itRx = source.getLsfIndex().getIterator(IridiumMsgRx.class); while (itRx.hasNext()) { try { tableModel.addReception(itRx.next()); } catch (Exception e) { NeptusLog.pub().error(e); } } final JXTable table = new JXTable(tableModel); table.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { try { IridiumMessage msg = IridiumMessage.deserialize( Hex.decodeHex(tableModel.getMessageData(table.getSelectedRow()).toCharArray())); mraPanel.loadVisualization(new IridiumHtmlVisualization(msg), true); } catch (Exception ex) { GuiUtils.errorMessage(mraPanel, ex); } } } }); table.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent event) { if (event.getClickCount() == 2) { String data = tableModel.getMessageData(table.getSelectedRow()); try { IridiumMessage.deserialize(Hex.decodeHex(data.toCharArray())); } catch (Exception e) { NeptusLog.pub().error(e); } } } }); return new JScrollPane(table); }
From source file:secureemailclient.applet.MessageListPanel.java
private void jTableMessagesMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableMessagesMouseClicked if (evt.getClickCount() == 2) { int row = jTableMessages.getSelectedRow(); String messageId = jTableMessages.getModel().getValueAt(row, 3).toString(); loadMessage(messageId);/*from w w w .j a va 2s .com*/ } }
From source file:org.jcurl.demo.smack.RosterSimpleSwingBean.java
public RosterSimpleSwingBean() { setLayout(new BorderLayout()); l = new JList(data); // see//from ww w . java2s .c o m // http://java.sun.com/products/jfc/tsc/tech_topics/jlist_1/jlist.html: final MouseListener mouseListener = new MouseAdapter() { @Override public void mouseClicked(MouseEvent e) { if (e.getClickCount() == 2) { final int index = l.locationToIndex(e.getPoint()); final Object o = l.getModel().getElementAt(index); if (o != null && getChatManager() != null) getChatManager().createChat(s2a.get(o).toString(), null); } } }; l.addMouseListener(mouseListener); add(l, BorderLayout.CENTER); }
From source file:jmupen.MyListSelectionListener.java
@Override public void mouseClicked(MouseEvent e) { int index = list.locationToIndex(e.getPoint()); if (e.getClickCount() == 2) { if (list.getSelectedIndex() != -1) { System.out.println("INDEX: " + index + " Total:" + JMupenUtils.getGames().size()); System.out.println("Games: " + JMupenUtils.getGames().get(index)); System.out.println("Recents file: " + JMupenUtils.getRecents().toString()); gamePathToBeOpened = JMupenUtils.getGames().get(index).split("\\|")[1]; File file = new File(gamePathToBeOpened); System.out.println("os: " + System.getProperty("os.name")); JMupenGUI.getInstance().showProgress(); if (JMupenUtils.getOs().equals("lin")) { CoreLin c = new CoreLin(file); Thread t = new Thread(c); t.start();/* w ww .j av a2s.c om*/ } else if (JMupenUtils.getOs().equals("mac")) { CoreMac c = new CoreMac(file); Thread t = new Thread(c); t.start(); } else { CoreWin c = new CoreWin(file); Thread t = new Thread(c); t.start(); } } } }