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:maltcms.ui.fileHandles.csv.CSVTableView.java
private void createAndShowPopupMenu(MouseEvent me) { if (me.getButton() == MouseEvent.BUTTON3 && this.jTable1.getSelectedRowCount() > 0 && this.jfctc != null) { JPopupMenu jpm = new JPopupMenu(); //more than one column selected if (jTable1.getSelectedColumnCount() > 0) { jpm.add(new AbstractAction("Add as y-values") { @Override/*w w w . jav a 2 s . co m*/ public void actionPerformed(ActionEvent ae) { for (int col : jTable1.getSelectedColumns()) { columnsToPlot.add(col); jTable1.getColumnModel().getColumn(col).setCellRenderer(new ColorColumnRenderer( new Color(238, 187, 0, 255), jTable1.getSelectedRows())); } jfctc.setChart( buildChart(labelColumn, domainColumn, columnsToPlot, jTable1.getSelectedRows())); } }); //selected rows for (final int col : jTable1.getSelectedColumns()) { if (columnsToPlot.contains(col)) { jpm.add(new AbstractAction("Remove y-values from chart") { @Override public void actionPerformed(ActionEvent ae) { jTable1.getColumnModel().getColumn(col).setCellRenderer( new ColorColumnRenderer(Color.WHITE, jTable1.getSelectedRows())); columnsToPlot.remove(col); jfctc.setChart(buildChart(labelColumn, domainColumn, columnsToPlot, jTable1.getSelectedRows())); } }); break; } } jpm.add(new JPopupMenu.Separator()); jpm.add(new AbstractAction("Log10 transform") { @Override public void actionPerformed(ActionEvent ae) { final int[] cols = jTable1.getSelectedColumns(); for (int i = 0; i < jTable1.getSelectedColumnCount(); i++) { logTransformColumn(cols[i], 10.0d); } } }); jpm.add(new AbstractAction("Inverse Log10 transform") { @Override public void actionPerformed(ActionEvent ae) { final int[] cols = jTable1.getSelectedColumns(); for (int i = 0; i < jTable1.getSelectedColumnCount(); i++) { inverseLogTransformColumn(cols[i], 10.0d); } } }); } jpm.add(new JPopupMenu.Separator()); //exactly one selected column, no domain column if (jTable1.getSelectedColumnCount() == 1 && domainColumn == -1) { jpm.add(new AbstractAction("Set as x-values") { @Override public void actionPerformed(ActionEvent ae) { domainColumn = jTable1.getSelectedColumn(); jTable1.getColumnModel().getColumn(domainColumn).setCellRenderer( new ColorColumnRenderer(new Color(255, 0, 0, 255), jTable1.getSelectedRows())); jfctc.setChart( buildChart(labelColumn, domainColumn, columnsToPlot, jTable1.getSelectedRows())); } }); } //one domainColumn if (domainColumn != -1) { jpm.add(new AbstractAction("Reset x-axis values") { @Override public void actionPerformed(ActionEvent ae) { jTable1.getColumnModel().getColumn(domainColumn).setCellRenderer( new ColorColumnRenderer(new Color(255, 255, 255, 255), jTable1.getSelectedRows())); domainColumn = -1; jfctc.setChart( buildChart(labelColumn, domainColumn, columnsToPlot, jTable1.getSelectedRows())); } }); } jpm.add(new JPopupMenu.Separator()); if (jTable1.getSelectedColumnCount() == 1 && labelColumn == -1) { jpm.add(new AbstractAction("Set as series labels") { @Override public void actionPerformed(ActionEvent ae) { labelColumn = jTable1.getSelectedColumn(); jTable1.getColumnModel().getColumn(labelColumn).setCellRenderer( new ColorColumnRenderer(new Color(255, 255, 0, 255), jTable1.getSelectedRows())); jfctc.setChart( buildChart(labelColumn, domainColumn, columnsToPlot, jTable1.getSelectedRows())); } }); } if (jTable1.getSelectedColumnCount() == 1 && labelColumn != -1) { jpm.add(new AbstractAction("Reset series labels") { @Override public void actionPerformed(ActionEvent ae) { jTable1.getColumnModel().getColumn(labelColumn).setCellRenderer( new ColorColumnRenderer(new Color(255, 255, 255, 255), jTable1.getSelectedRows())); labelColumn = -1; jfctc.setChart( buildChart(labelColumn, domainColumn, columnsToPlot, jTable1.getSelectedRows())); } }); } jpm.show(me.getComponent(), me.getX(), me.getY()); } }
From source file:org.squidy.nodes.MouseIO.java
protected void setSingleMousePress(int button) { if (button == MouseEvent.BUTTON1) { robot.mousePress(InputEvent.BUTTON1_MASK); robot.mouseRelease(InputEvent.BUTTON1_MASK); } else if (button == MouseEvent.BUTTON2) { robot.mousePress(InputEvent.BUTTON2_MASK); robot.mouseRelease(InputEvent.BUTTON2_MASK); } else if (button == MouseEvent.BUTTON3) { robot.mousePress(InputEvent.BUTTON3_MASK); robot.mouseRelease(InputEvent.BUTTON3_MASK); }/*from w ww . ja v a2s . c om*/ }
From source file:org.openmrs.module.muzimabiometrics.panels.EnrollFromScanner.java
@Override protected void initGUI() { panelMain = new JPanel(); panelScanners = new JPanel(); scrollPaneList = new JScrollPane(); scannerList = new JList(); panelButtons = new JPanel(); btnRefresh = new JButton(); btnScan = new JButton(); btnCancel = new JButton(); btnForce = new JButton(); cbAutomatic = new JCheckBox(); scrollPane = new JScrollPane(); panelSouth = new JPanel(); panelInfo = new JPanel(); lblInfo = new JLabel(); panelSave = new JPanel(); btnIdentifyPatient = new JButton(); btnRegisterPatient = new JButton(); cbShowProcessed = new JCheckBox(); setLayout(new BorderLayout()); panelMain.setLayout(new BorderLayout()); panelScanners.setBorder(BorderFactory.createTitledBorder("Scanners list")); panelScanners.setLayout(new BorderLayout()); scrollPaneList.setPreferredSize(new Dimension(0, 90)); scannerList.setModel(new DefaultListModel()); scannerList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); scannerList.setBorder(LineBorder.createBlackLineBorder()); scrollPaneList.setViewportView(scannerList); panelScanners.add(scrollPaneList, BorderLayout.CENTER); panelButtons.setLayout(new FlowLayout(FlowLayout.LEADING)); btnRefresh.setText("Refresh list"); panelButtons.add(btnRefresh);/*from w w w.j a va 2 s. co m*/ btnScan.setText("Scan"); panelButtons.add(btnScan); btnCancel.setText("Cancel"); btnCancel.setEnabled(false); panelButtons.add(btnCancel); btnForce.setText("Force"); panelButtons.add(btnForce); cbAutomatic.setSelected(true); cbAutomatic.setText("Scan automatically"); panelButtons.add(cbAutomatic); panelScanners.add(panelButtons, BorderLayout.SOUTH); panelMain.add(panelScanners, BorderLayout.NORTH); panelMain.add(scrollPane, BorderLayout.CENTER); panelSouth.setLayout(new BorderLayout()); panelInfo.setBorder(new SoftBevelBorder(BevelBorder.LOWERED)); panelInfo.setLayout(new GridLayout(1, 1)); lblInfo.setText(" "); panelInfo.add(lblInfo); panelSouth.add(panelInfo, BorderLayout.NORTH); panelSave.setLayout(new FlowLayout(FlowLayout.LEADING)); btnIdentifyPatient.setText("Scan fingerprint"); btnIdentifyPatient.setEnabled(true); panelSave.add(btnIdentifyPatient); btnRegisterPatient.setText("Register Patient"); btnRegisterPatient.setEnabled(true); panelSave.add(btnRegisterPatient); cbShowProcessed.setSelected(true); cbShowProcessed.setText("Show processed image"); panelSave.add(cbShowProcessed); panelSouth.add(panelSave, BorderLayout.SOUTH); panelMain.add(panelSouth, BorderLayout.SOUTH); add(panelMain, BorderLayout.CENTER); panelLicensing = new LicensingPanel(requiredLicenses, optionalLicenses); add(panelLicensing, java.awt.BorderLayout.NORTH); fcImage = new JFileChooser(); fcImage.setFileFilter(new Utils.ImageFileFilter(NImages.getSaveFileFilter())); fcTemplate = new JFileChooser(); view = new NFingerView(); view.setShownImage(ShownImage.RESULT); view.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent ev) { super.mouseClicked(ev); if (ev.getButton() == MouseEvent.BUTTON3) { cbShowProcessed.doClick(); } } }); scrollPane.setViewportView(view); btnRefresh.addActionListener(this); btnScan.addActionListener(this); btnCancel.addActionListener(this); btnForce.addActionListener(this); btnIdentifyPatient.addActionListener(this); btnRegisterPatient.addActionListener(this); cbShowProcessed.addActionListener(this); scannerList.addListSelectionListener(new ScannerSelectionListener()); }
From source file:ru.goodfil.catalog.ui.forms.OePanel.java
private void lstBrandsMouseClicked(MouseEvent e) { if (e.getButton() == MouseEvent.BUTTON3) { if (brands.isOneSelected()) { popupMenu2.show(lstBrands, e.getX(), e.getY()); }//from w w w .j a va 2 s. c o m } }
From source file:pl.edu.icm.visnow.geometries.viewer3d.Display3DPanel.java
/** * Creates new form Display3DPanel//from w w w . ja va2 s . com */ public Display3DPanel() { initComponents(); effectiveHeight = getHeight(); effectiveWidth = getWidth(); logger.debug("creating Display3DPanel"); this.setMinimumSize(new Dimension(200, 200)); this.setPreferredSize(new Dimension(800, 600)); GraphicsConfigTemplate3D template = new GraphicsConfigTemplate3D(); template.setStereo(GraphicsConfigTemplate3D.PREFERRED); // Get the GraphicsConfiguration that best fits our needs. logger.debug("getting config"); GraphicsConfiguration gcfg = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice() .getBestConfiguration(template); logger.debug("creating canvas"); canvas = new Canvas3D(gcfg) { @Override public void postRender() { vGraphics = super.getGraphics2D(); vGraphics.setFont(new Font("sans-serif", Font.PLAIN, 10)); vGraphics.setColor(Color.YELLOW); locToWin.update(); fireProjectionChanged(new ProjectionEvent(this, locToWin)); draw2D(vGraphics, locToWin, effectiveWidth, effectiveHeight); vGraphics.flush(false); } @Override public void postSwap() { if (postRenderSilent || waitForExternalTrigger) { return; } if (!(storingJPEG || storingPNG || storingFrames)) { fireFrameRendered(); } if (storingFrames) { if (storingJPEG) { writeImage(new File(controlsPanel.getMovieCreationPanel().getCurrentFrameFileName())); } else { writeYUV(controlsPanel.getMovieCreationPanel().getGenericFrameFileName()); } } } }; canvas.setStereoEnable(false); add("Center", canvas); pickObject = new PickObject(canvas, objScene, rootObject.getGeometryObj(), objRotate); canvas.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent evt) { if (evt.isShiftDown()) { // if (e.isShiftDown()) // System.out.println(""+e.getX() + " " + e.getY()); } if (evt.getButton() == MouseEvent.BUTTON1) { if (evt.getClickCount() > 1) { reset(); } else if (pickObject.consumeEmulated3DPick(evt.getX(), evt.getY())) { /* Nothing must be done - everything was done in consumeEmulated3DPick() */ } else { pickObject.consume2DSelectModule(evt.getX(), evt.getY()); } rootObject.firePickChanged(evt, locToWin); } if (evt.getButton() == MouseEvent.BUTTON3) { if (getControlsFrame() != null) { getControlsFrame().setBounds(evt.getXOnScreen() - 130, evt.getYOnScreen(), 240, 500); getControlsFrame().setVisible(true); } else if (getTransientControlsFrame() != null) { getTransientControlsFrame().setBounds(evt.getXOnScreen() - 130, evt.getYOnScreen(), 240, 500); getTransientControlsFrame().setVisible(true); } else if (application != null) { application.getFrames().getGuiPanel().selectModule(name); } } if (evt.getButton() == MouseEvent.BUTTON2) { reset(); } } @Override public void mouseEntered(java.awt.event.MouseEvent evt) { mouseOn = true; mouseObserverThread = new Thread(new MouseObserver()); mouseObserverThread.start(); } @Override public void mouseExited(java.awt.event.MouseEvent evt) { mouseObserverThread = null; mouseOn = false; } }); canvas.addMouseMotionListener(new java.awt.event.MouseMotionListener() { @Override public void mouseDragged(MouseEvent e) { // if (e.isShiftDown()) // System.out.println(""+e.getX() + " " + e.getY()); } @Override public void mouseMoved(MouseEvent e) { } }); canvas.addMouseWheelListener(new java.awt.event.MouseWheelListener() { @Override public void mouseWheelMoved(java.awt.event.MouseWheelEvent evt) { rescaleFromMouseWheel(evt); } }); canvas.addKeyListener(new java.awt.event.KeyAdapter() { @Override public void keyTyped(KeyEvent evt) { formKeyTyped(evt); } @Override public void keyPressed(KeyEvent evt) { formKeyPressed(evt); } @Override public void keyReleased(KeyEvent evt) { formKeyReleased(evt); } }); ToolTipManager.sharedInstance().setLightWeightPopupEnabled(true); universe = new SimpleUniverse(canvas); view = canvas.getView(); view.setProjectionPolicy(View.PERSPECTIVE_PROJECTION); view.setTransparencySortingPolicy(View.TRANSPARENCY_SORT_GEOMETRY); objScene.addChild(rootObject.getGeometryObj()); rootObject.setRenderingWindow(this); rootObject.getGeometryObj().setUserData(null); bg.setCapability(Background.ALLOW_COLOR_WRITE); bg.setCapability(Background.ALLOW_COLOR_READ); bg.setCapability(Background.ALLOW_IMAGE_WRITE); bg.setCapability(Background.ALLOW_IMAGE_READ); bg.setCapability(Background.ALLOW_IMAGE_SCALE_MODE_READ); bg.setCapability(Background.ALLOW_IMAGE_SCALE_MODE_WRITE); bg.setImageScaleMode(Background.SCALE_FIT_ALL); bg.setApplicationBounds(bounds); myFog.setCapability(LinearFog.ALLOW_DISTANCE_WRITE); myFog.setCapability(LinearFog.ALLOW_COLOR_WRITE); myFog.setInfluencingBounds(bounds); myFog.setFrontDistance(1.); myFog.setBackDistance(4.); myFogGroup.addChild(myFog); mouseRotate.setTransformGroup(objRotate); mouseRotate.setSchedulingBounds(bounds); mouseRotate.setFactor(mouseRotateSensitivity); mouseTranslate.setTransformGroup(objRotate); mouseTranslate.setSchedulingBounds(bounds); mouseTranslate.setFactor(mouseTranslateSensitivity); mouseZoom.setTransformGroup(objRotate); mouseZoom.setSchedulingBounds(bounds); windowRootObject.addChild(mouseRotate); windowRootObject.addChild(mouseTranslate); windowRootObject.addChild(mouseZoom); objTranslate.addChild(objScene); objScale.addChild(objTranslate); objRotate.addChild(bg); objRotate.addChild(objScale); windowRootObject.addChild(objRotate); ambientLight = new EditableAmbientLight(new Color3f(.25f, .25f, .25f), bounds, "ambient light", true); windowRootObject.addChild(ambientLight.getLight()); directionalLights.add(new EditableDirectionalLight(new Color3f(0.4f, 0.4f, 0.4f), new Vector3f(.1f, .08f, -.5f), bounds, "light 1", true, true)); directionalLights.add(new EditableDirectionalLight(new Color3f(0.2f, 0.15f, 0.1f), new Vector3f(-1.f, -0.4f, -.5f), bounds, "light 2", true, false)); directionalLights.add(new EditableDirectionalLight(new Color3f(0.1f, 0.1f, 0.15f), new Vector3f(0.f, 0.6f, -1.f), bounds, "light 3", true, false)); directionalLights.add(new EditableDirectionalLight(new Color3f(0.1f, 0.1f, 0.15f), new Vector3f(0.f, -0.6f, -1.f), bounds, "light 3", false, false)); for (int i = 0; i < directionalLights.size(); i++) { TransformGroup lightTransform = new TransformGroup(); lightTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); lightTransform.setName("light" + i + "Transform"); directionalLightTransforms.add(lightTransform); OpenBranchGroup lightGroup = new OpenBranchGroup(); EditableDirectionalLight light = directionalLights.get(i); lightGroup.addChild(light.getLight()); lightGroup.addChild(light.getBackLight()); lightTransform.addChild(lightGroup); windowRootObject.addChild(lightTransform); } modelClip.setCapability(ModelClip.ALLOW_ENABLE_READ); modelClip.setCapability(ModelClip.ALLOW_ENABLE_WRITE); modelClip.setCapability(ModelClip.ALLOW_PLANE_READ); modelClip.setCapability(ModelClip.ALLOW_PLANE_WRITE); modelClip.setInfluencingBounds(bounds); objScene.addChild(modelClip); pointLights .add(new EditablePointLight(new Color3f(0.4f, 0.4f, 0.4f), bounds, null, null, "light 1", false)); pointLights .add(new EditablePointLight(new Color3f(0.4f, 0.4f, 0.4f), bounds, null, null, "light 1", false)); pointLights .add(new EditablePointLight(new Color3f(0.4f, 0.4f, 0.4f), bounds, null, null, "light 1", false)); for (int i = 0; i < pointLights.size(); i++) { TransformGroup lightTransform = new TransformGroup(); lightTransform.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); lightTransform.setName("light" + i + "Transform"); pointLightTransforms.add(lightTransform); OpenBranchGroup lightGroup = new OpenBranchGroup(); EditablePointLight light = pointLights.get(i); lightGroup.addChild(light.getLight()); lightTransform.addChild(lightGroup); windowRootObject.addChild(lightTransform); } alternateTransformObj.addChild(alternateRootObj); alternateTransormBranch.addChild(alternateTransformObj); windowRootObject.addChild(alternateTransormBranch); universe.getViewingPlatform().setNominalViewingTransform(); universe.addBranchGraph(windowRootObject); view.getPhysicalBody().getLeftEyePosition(defaultLeftEye); view.getPhysicalBody().getRightEyePosition(defaultRightEye); controlsFrame = new Display3DControlsFrame(this); controlsPanel = controlsFrame.getControlPanel(); universe.getViewingPlatform().getViewPlatformTransform().getTransform(initialCameraTransform); objReper.addChild(reper.getGeometryObj()); positionedReper.addChild(objReper); positionedReper.setTransform( new Transform3D(new float[] { .15f, 0, 0, -.8f, 0, .15f, 0, .76f, 0, 0, .15f, 0, 0, 0, 0, 1 })); reperGroup.addChild(positionedReper); OpenBranchGroup reperLightGroup = new OpenBranchGroup(); reperLightGroup.addChild(new AmbientLight(new Color3f(.6f, .6f, .6f))); reperLightGroup.addChild(new EditableDirectionalLight(new Color3f(0.4f, 0.4f, 0.4f), new Vector3f(.1f, .08f, -1f), bounds, "light 1", true, true).getLight()); reperGroup.addChild(reperLightGroup); universe.addBranchGraph(reperGroup); locToWin = new LocalToWindow(rootObject.getGeometryObj(), canvas); /** * The line below binds reper with scene rotation when using any method that calls * objRotate.setTransform(), so: keyboard (explicitly calling), mouse (Java3D is calling * setTransform) and some custom ways (e.g. in haptic pointer) */ objRotate.addTransformListener(objReper); // mouseRotate.setupCallback(objReper); // it is not needed, because Java3D calls objRotate.setTranform which fires callback to the reper }
From source file:org.squidy.nodes.MouseIO.java
protected void setMouseStatus(int button, boolean status) { if (button == MouseEvent.BUTTON1) { if (status) { robot.mousePress(InputEvent.BUTTON1_MASK); } else {//from w w w .ja v a 2s .co m robot.mouseRelease(InputEvent.BUTTON1_MASK); } } else if (button == MouseEvent.BUTTON2) { if (status) { robot.mousePress(InputEvent.BUTTON2_MASK); } else { robot.mouseRelease(InputEvent.BUTTON2_MASK); } } else if (button == MouseEvent.BUTTON3) { if (status) { robot.mousePress(InputEvent.BUTTON3_MASK); } else { robot.mouseRelease(InputEvent.BUTTON3_MASK); } } }
From source file:pt.lsts.neptus.plugins.sunfish.awareness.SituationAwareness.java
@Override public void mouseClicked(MouseEvent event, final StateRenderer2D source) { if (event.getButton() == MouseEvent.BUTTON3) { final LinkedHashMap<String, Vector<AssetPosition>> positions = positionsByType(); JPopupMenu popup = new JPopupMenu(); for (String type : positions.keySet()) { JMenu menu = new JMenu(type + "s"); for (final AssetPosition p : positions.get(type)) { if (p.getTimestamp() < oldestTimestampSelection || p.getTimestamp() > newestTimestampSelection) continue; Color c = cmap.getColor(1 - (p.getAge() / (7200000.0))); String htmlColor = String.format("#%02X%02X%02X", c.getRed(), c.getGreen(), c.getBlue()); menu.add("<html><b>" + p.getAssetName() + "</b> <font color=" + htmlColor + ">" + getAge(p) + "</font>").addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { source.focusLocation(p.getLoc()); }//from ww w . j a v a2 s . c o m }); } popup.add(menu); } popup.addSeparator(); popup.add("Settings").addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { PluginUtils.editPluginProperties(SituationAwareness.this, true); } }); popup.add("Fetch asset properties").addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { // for (AssetTrack track : assets.values()) { // track.setColor(new Color(random.nextInt(255), random.nextInt(255), random.nextInt(255))); // } fetchAssetProperties(); } }); popup.add("Select location sources").addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS)); for (ILocationProvider l : localizers) { JCheckBox check = new JCheckBox(l.getName()); check.setSelected(true); p.add(check); check.setSelected(updateMethodNames.contains(l.getName())); } int op = JOptionPane.showConfirmDialog(getConsole(), p, "Location update sources", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (op == JOptionPane.CANCEL_OPTION) return; Vector<String> methods = new Vector<String>(); for (int i = 0; i < p.getComponentCount(); i++) { if (p.getComponent(i) instanceof JCheckBox) { JCheckBox sel = (JCheckBox) p.getComponent(i); if (sel.isSelected()) methods.add(sel.getText()); } } updateMethods = StringUtils.join(methods, ", "); propertiesChanged(); } }); popup.add("Select hidden positions types").addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { JPanel p = new JPanel(); p.setLayout(new BoxLayout(p, BoxLayout.PAGE_AXIS)); for (String type : positions.keySet()) { JCheckBox check = new JCheckBox(type); check.setSelected(true); p.add(check); check.setSelected(hiddenPosTypes.contains(type)); } int op = JOptionPane.showConfirmDialog(getConsole(), p, "Position types to be hidden", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE); if (op == JOptionPane.CANCEL_OPTION) return; Vector<String> types = new Vector<String>(); for (int i = 0; i < p.getComponentCount(); i++) { if (p.getComponent(i) instanceof JCheckBox) { JCheckBox sel = (JCheckBox) p.getComponent(i); if (sel.isSelected()) types.add(sel.getText()); } } hiddenTypes = StringUtils.join(types, ", "); propertiesChanged(); } }); popup.addSeparator(); popup.add("Decision Support").addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (dialogDecisionSupport == null) { dialogDecisionSupport = new JDialog(getConsole()); dialogDecisionSupport.setModal(false); dialogDecisionSupport.setAlwaysOnTop(true); dialogDecisionSupport.setDefaultCloseOperation(JDialog.HIDE_ON_CLOSE); } ArrayList<AssetPosition> tags = new ArrayList<AssetPosition>(); LinkedHashMap<String, Vector<AssetPosition>> positions = positionsByType(); Vector<AssetPosition> spots = positions.get("SPOT Tag"); Vector<AssetPosition> argos = positions.get("Argos Tag"); if (spots != null) tags.addAll(spots); if (argos != null) tags.addAll(argos); if (!assets.containsKey(getConsole().getMainSystem())) { GuiUtils.errorMessage(getConsole(), "Decision Support", "UUV asset position is unknown"); return; } supportTable.setAssets(assets.get(getConsole().getMainSystem()).getLatest(), tags); JXTable table = new JXTable(supportTable); dialogDecisionSupport.setContentPane(new JScrollPane(table)); dialogDecisionSupport.invalidate(); dialogDecisionSupport.validate(); dialogDecisionSupport.setSize(600, 300); dialogDecisionSupport.setTitle("Decision Support Table"); dialogDecisionSupport.setVisible(true); dialogDecisionSupport.toFront(); GuiUtils.centerOnScreen(dialogDecisionSupport); } }); popup.show(source, event.getX(), event.getY()); } super.mouseClicked(event, source); }
From source file:richtercloud.document.scanner.gui.OCRPanel.java
private void oCRResultTextAreaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_oCRResultTextAreaMouseClicked if (evt.getButton() == MouseEvent.BUTTON3) { //right click this.oCRResultPopup.show(this.oCRResultTextArea, evt.getX(), evt.getY()); }/*w w w . j a v a2s .c om*/ }
From source file:org.eurocarbdb.application.glycoworkbench.plugin.PeakAnnotationCalibrationPanel.java
public void onMouseClicked(MouseEvent e) { // find peak under mouse if (e.getButton() == MouseEvent.BUTTON3 && e.getClickCount() == 1 && (e.getModifiers() & MOD_MASK) == e.BUTTON3_MASK) { // open popup createPopupMenu().show(theChartPanel, e.getX(), e.getY()); }/*w w w.ja v a 2 s . c o m*/ }
From source file:streamme.visuals.Main.java
private void tree_filesMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tree_filesMousePressed PlaylistManager.get().clearSelection(); switch (evt.getButton()) { case java.awt.event.MouseEvent.BUTTON1: // Left click if (evt.getClickCount() == 2) { playNodes();/* w w w . j a v a2 s .c om*/ } break; case java.awt.event.MouseEvent.BUTTON3: // Right click TreePath pathForLocation = tree_files.getPathForLocation(evt.getX(), evt.getY()); tree_files.setSelectionPath(pathForLocation); treeMenu.show(tree_files, evt.getX(), evt.getY()); break; } }