List of usage examples for java.awt.event MouseEvent BUTTON3
int BUTTON3
To view the source code for java.awt.event MouseEvent BUTTON3.
Click Source Link
From source file:ru.goodfil.catalog.ui.forms.CarsPanel.java
private void manufactorsListMouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { if (manufactors.size() > 0) { listsPopupMenu.show(manufactorsList, e.getX(), e.getY()); }/*from w w w . j a v a 2 s .c o m*/ } }
From source file:ru.goodfil.catalog.ui.forms.CarsPanel.java
private void seriesListMouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { if (series.size() > 0) { listsPopupMenu.show(seriesList, e.getX(), e.getY()); }/*from w w w . java 2s . c o m*/ } }
From source file:ru.goodfil.catalog.ui.forms.CarsPanel.java
private void motorsTableMouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { if (motors.size() > 0) { listsPopupMenu.show(motorsTable, e.getX(), e.getY()); }//from ww w . j a va 2s . com } }
From source file:ru.goodfil.catalog.ui.forms.CarsPanel.java
private void filtersTableMouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { if (filters.size() > 0) { listsPopupMenu.show(filtersTable, e.getX(), e.getY()); }// w w w .j a v a 2 s . c om } }
From source file:ru.goodfil.catalog.ui.forms.CarsPanel.java
private void allFiltersTableMouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { if (allFilters.size() > 0) { listsPopupMenu.show(allFiltersTable, e.getX(), e.getY()); }// w w w. j a v a2s.c o m } }
From source file:org.jas.gui.MainWindow.java
public JTable getDescriptionTable() { if (descriptionTable == null) { descriptionTable = new DescriptionTable(); descriptionTable.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { MetadataDialog metadataDialog = new MetadataDialog(MainWindow.this, controlEngineConfigurator, "Alter ALL rows"); metadataDialog.setVisible(true); }//from w w w. j av a 2 s . c o m } }); descriptionTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { public void valueChanged(ListSelectionEvent e) { if (tableLoaded) { selectedRow = descriptionTable.getSelectedRow(); log.info("SETTING SELECTED ROW to : " + selectedRow); updateImage(selectedRow); } } }); descriptionTable.getModel().addTableModelListener(new TableModelListener() { public void tableChanged(TableModelEvent e) { if (e.getType() == TableModelEvent.UPDATE && tableLoaded && e.getColumn() != ApplicationState.STATUS_COLUMN) { int column = e.getColumn(); int row = e.getFirstRow(); String value = getDescriptionTable().getModel().getValueAt(row, column).toString(); log.info("value changed: " + value); List<Metadata> metadataList = viewEngineConfigurator.getViewEngine().get(Model.METADATA); Metadata metadata = metadataList.get(row); metadataAdapter.update(metadata, column, value); metadataWithAlbum.add(metadata); getDescriptionTable().getModel().setValueAt(ActionResult.New, row, ApplicationState.STATUS_COLUMN); controlEngineConfigurator.getControlEngine().set(Model.METADATA_ARTIST, metadataWithAlbum, null); getApplyButton().setEnabled(!working); log.info("setting applyButton to : " + !working); } } }); } return descriptionTable; }
From source file:corelyzer.ui.CorelyzerGLCanvas.java
public void mouseClicked(final MouseEvent e) { Point prePos = e.getPoint();/* ww w . java 2s. c o m*/ float sp[] = { 0.0f, 0.0f }; this.convertMousePointToSceneSpace(prePos, scenePos); switch (e.getButton()) { case MouseEvent.BUTTON1: if (e.getClickCount() > 1) { // doubleclick zoom in/out Point mousePos = e.getPoint(); float[] cp = { 0.0f, 0.0f }; float[] sc = { 0.0f, 0.0f }; canvasLock.lock(); convertMousePointToSceneSpace(mousePos, cp); sc[0] = SceneGraph.getSceneCenterX(); sc[1] = SceneGraph.getSceneCenterY(); // alt down for zoom out?! float base; if (e.isAltDown()) { // zoom out base = 1.05f; } else { // zoom out base = 0.95f; } float scale = (float) Math.pow(base, 3); SceneGraph.scaleScene(scale); float ncp[] = { 0.0f, 0.0f }; this.convertMousePointToSceneSpace(mousePos, ncp); ncp[0] = ncp[0] - cp[0]; ncp[1] = ncp[1] - cp[1]; SceneGraph.panScene(-ncp[0], -ncp[1]); canvasLock.unlock(); CorelyzerApp.getApp().updateGLWindows(); return; } // measuring mode if (canvasMode == CorelyzerApp.APP_MEASURE_MODE) { int nPoint = SceneGraph.addMeasurePoint(scenePos[0], scenePos[1]); this.convertScenePointToAbsolute(scenePos, sp); if (nPoint == 1) { CorelyzerApp.getApp().getToolFrame().addMeasure(sp, 1); } else if (nPoint == 2) { CorelyzerApp.getApp().getToolFrame().addMeasure(sp, 2); } PAN_MODE = 0; return; } if (selectedFreeDraw > -1) { CorelyzerApp.getApp().getPluginManager().broadcastEventToPlugin( SceneGraph.getFreeDrawPluginID(selectedFreeDraw), CorelyzerPluginEvent.FREE_DRAW_SELECTED, "" + selectedFreeDraw); return; } selectedMarker = SceneGraph.accessPickedMarker(); if (selectedMarker < 0) { if (canvasMode == CorelyzerApp.APP_MARKER_MODE) { SceneGraph.setCoreSectionMarkerFocus(false); CorelyzerApp.getApp().updateGLWindows(); } return; } else { if (canvasMode == CorelyzerApp.APP_NORMAL_MODE) { AnnotationUtils.openAnnotation(getCanvas(), selectedTrack, selectedTrackSection, selectedMarker); } else { // marker mode // TODO do something if want to allow user adjust the // selected // TODO block, like sync to ClastInfo hash... if (selectedMarker != SceneGraph.focusedMarker || selectedTrackSection != SceneGraph.focusedTrackSection || selectedTrack != SceneGraph.focusedTrack) { SceneGraph.setCoreSectionMarkerFocus(false); SceneGraph.focusedTrack = selectedTrack; SceneGraph.focusedTrackSection = selectedTrackSection; SceneGraph.focusedMarker = selectedMarker; SceneGraph.setCoreSectionMarkerFocus(true); } } } break; case MouseEvent.BUTTON2: /* * System.out.println("---- Middle button clicked at: " + * prePos.x + ", " + prePos.y); * System.out.println("Converted to Scene Space: " + scenePos[0] * + ", " + scenePos[1]); */ break; case MouseEvent.BUTTON3: /* * System.out.println("---- Right button clicked at: " + * prePos.x + ", " + prePos.y); * System.out.println("Converted to Scene Space: " + scenePos[0] * + ", " + scenePos[1]); */ this.handleRightMouseClick(e); break; default: if (e.isPopupTrigger()) { this.handleRightMouseClick(e); } } }
From source file:oct.analysis.application.OCTAnalysisUI.java
private void octAnalysisPanelMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_octAnalysisPanelMouseClicked octAnalysisPanel.requestFocus();//from ww w . j a v a 2 s. co m //only perform actions when mouse click occurs over image area if (analysisMngr.getAnalysisMode() != null && octAnalysisPanel.coordinateOverlapsOCT(evt.getX(), evt.getY())) { switch (evt.getButton()) { case MouseEvent.BUTTON1: switch (analysisMngr.getAnalysisMode()) { case SINGLE: switch (toolMode) { case SELECT_SINGLE: //clear out any current analysis selection selectionLRPManager.removeSelections(false); octAnalysisPanel.repaint(); //add new selections and redraw panel selectionLRPManager.addOrUpdateSelection(selectionLRPManager.getSelection( octAnalysisPanel.translatePanelPointToOctPoint(evt.getPoint()).x, "Selection", SelectionType.NONFOVEAL, true)); octAnalysisPanel.repaint(); break; case SCREEN_SELECT: selectSelection(evt.getPoint()); break; } break; case MIRROR: switch (toolMode) { case SELECT_SINGLE: //clear out any current analysis selection selectionLRPManager.removeNonfovealSelections(false); octAnalysisPanel.repaint(); //add new selections and redraw panel int distFromFovea = Math.abs(analysisMngr.getFoveaCenterXPosition() - octAnalysisPanel.translatePanelPointToOctPoint(evt.getPoint()).x); selectionLRPManager.addOrUpdateSelection(selectionLRPManager.getSelection( analysisMngr.getFoveaCenterXPosition() - distFromFovea, "Left", SelectionType.NONFOVEAL, true)); selectionLRPManager.addOrUpdateSelection(selectionLRPManager.getSelection( analysisMngr.getFoveaCenterXPosition() + distFromFovea, "Right", SelectionType.NONFOVEAL, true)); octAnalysisPanel.repaint(); break; case SCREEN_SELECT: selectSelection(evt.getPoint()); break; } break; case EZ: //allow user to select and change position of the EZ edge selections after the fact switch (toolMode) { case SCREEN_SELECT: selectSelection(evt.getPoint()); default: break; } break; case EQUIDISTANT: //allow user to change placement of fovea after the fact if (toolMode == ToolMode.SELECT_FOVEA) { //clear out any current analysis information selectionLRPManager.removeSelections(true); octAnalysisPanel.repaint(); //add new selections and redraw panel selectionLRPManager.addOrUpdateEquidistantSelections(evt.getX(), analysisMngr.getMicronsBetweenSelections()); octAnalysisPanel.repaint(); } break; default: break; } break; case MouseEvent.BUTTON3: selectionLRPManager.removeSelections(true); octAnalysisPanel.repaint(); break; default: break; } } }
From source file:simMPLS.ui.simulator.JVentanaHija.java
/** Action when the mouse button is pressed and released * @since 1.0/*from ww w .j av a 2 s. c o m*/ */ private void ratonPulsadoYSoltadoEnPanelSimulacion(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_ratonPulsadoYSoltadoEnPanelSimulacion if (evt.getButton() == MouseEvent.BUTTON1) { TTopologyElement et = escenario.getTopology().obtenerElementoEnPosicion(evt.getPoint()); if (et != null) { if (et.getElementType() == TTopologyElement.NODO) { TNode nt = (TNode) et; nt.toCongest(); } else if (et.getElementType() == TTopologyElement.LINK) { // TLink ent = (TLink) et; // if (ent.isBroken()) { // ent.ponerEnlaceCaido(false); // } else { // ent.ponerEnlaceCaido(true); // } } } else { if (this.panelSimulacion.obtenerMostrarLeyenda()) { this.panelSimulacion.ponerMostrarLeyenda(false); } else { this.panelSimulacion.ponerMostrarLeyenda(true); } } } else if (evt.getButton() == MouseEvent.BUTTON3) { TTopologyElement et = escenario.getTopology().obtenerElementoEnPosicion(evt.getPoint()); if (et != null) { if (et.getElementType() == TTopologyElement.LINK) { TLink ent = (TLink) et; if (!ent.isBroken()) { JWindowLinkDump linkWindow = new JWindowLinkDump(VentanaPadre, true, ent); linkWindow.setVisible(true); } } } } else { elementoDisenioClicDerecho = null; panelDisenio.repaint(); } }
From source file:GUI.MainWindow.java
private void VulnTreeMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_VulnTreeMouseClicked // Do nothing Object obj = VulnTree.getLastSelectedPathComponent(); if (obj == null) // No vulns selected so no interaction required {// ww w . j a v a2 s.co m return; } if (evt.getButton() == MouseEvent.BUTTON3) { // At least one vuln was selected so we need to see how many and modify the context menu if (VulnTree.getSelectionCount() == 1) { // User cannot merge because they don't have two selected MergeButton.setEnabled(false); } else { MergeButton.setEnabled(true); } VulnTreeContextMenu.show(VulnTree, evt.getX(), evt.getY()); } else if (evt.getButton() == MouseEvent.BUTTON1 && evt.getClickCount() == 2) { showNotes(); } }