List of usage examples for java.awt.event MouseEvent getY
public int getY()
From source file:org.forester.archaeopteryx.TreePanel.java
final boolean inOv(final MouseEvent e) { return ((e.getX() > getVisibleRect().x + getOvXPosition() + 1) && (e.getX() < getVisibleRect().x + getOvXPosition() + getOvMaxWidth() - 1) && (e.getY() > getVisibleRect().y + getOvYPosition() + 1) && (e.getY() < getVisibleRect().y + getOvYPosition() + getOvMaxHeight() - 1)); }
From source file:org.forester.archaeopteryx.TreePanel.java
final void mouseDragInBrowserPanel(final MouseEvent e) { setCursor(MOVE_CURSOR);/*from ww w .ja va2 s. c o m*/ final Point scroll_position = getMainPanel().getCurrentScrollPane().getViewport().getViewPosition(); scroll_position.x -= (e.getX() - getLastDragPointX()); scroll_position.y -= (e.getY() - getLastDragPointY()); if (scroll_position.x < 0) { scroll_position.x = 0; } else { final int max_x = getMainPanel().getCurrentScrollPane().getHorizontalScrollBar().getMaximum() - getMainPanel().getCurrentScrollPane().getHorizontalScrollBar().getVisibleAmount(); if (scroll_position.x > max_x) { scroll_position.x = max_x; } } if (scroll_position.y < 0) { scroll_position.y = 0; } else { final int max_y = getMainPanel().getCurrentScrollPane().getVerticalScrollBar().getMaximum() - getMainPanel().getCurrentScrollPane().getVerticalScrollBar().getVisibleAmount(); if (scroll_position.y > max_y) { scroll_position.y = max_y; } } if (isOvOn() || getOptions().isShowScale()) { repaint(); } getMainPanel().getCurrentScrollPane().getViewport().setViewPosition(scroll_position); }
From source file:org.forester.archaeopteryx.TreePanel.java
final void mouseDragInOvRectangle(final MouseEvent e) { setCursor(HAND_CURSOR);/*from w ww . j a v a 2s . c o m*/ final double w_ratio = getVisibleRect().width / getOvRectangle().getWidth(); final double h_ratio = getVisibleRect().height / getOvRectangle().getHeight(); final Point scroll_position = getMainPanel().getCurrentScrollPane().getViewport().getViewPosition(); double dx = (w_ratio * e.getX() - w_ratio * getLastDragPointX()); double dy = (h_ratio * e.getY() - h_ratio * getLastDragPointY()); scroll_position.x = ForesterUtil.roundToInt(scroll_position.x + dx); scroll_position.y = ForesterUtil.roundToInt(scroll_position.y + dy); if (scroll_position.x <= 0) { scroll_position.x = 0; dx = 0; } else { final int max_x = getMainPanel().getCurrentScrollPane().getHorizontalScrollBar().getMaximum() - getMainPanel().getCurrentScrollPane().getHorizontalScrollBar().getVisibleAmount(); if (scroll_position.x >= max_x) { dx = 0; scroll_position.x = max_x; } } if (scroll_position.y <= 0) { dy = 0; scroll_position.y = 0; } else { final int max_y = getMainPanel().getCurrentScrollPane().getVerticalScrollBar().getMaximum() - getMainPanel().getCurrentScrollPane().getVerticalScrollBar().getVisibleAmount(); if (scroll_position.y >= max_y) { dy = 0; scroll_position.y = max_y; } } repaint(); getMainPanel().getCurrentScrollPane().getViewport().setViewPosition(scroll_position); setLastMouseDragPointX((float) (e.getX() + dx)); setLastMouseDragPointY((float) (e.getY() + dy)); }
From source file:jp.massbank.spectrumsearch.SearchPage.java
/** * ?/* ww w . j a v a2 s .co m*/ * @param e */ private void recListPopup(MouseEvent e) { JTable tbl = null; JScrollPane pane = null; try { tbl = (JTable) e.getSource(); } catch (ClassCastException cce) { pane = (JScrollPane) e.getSource(); if (pane.equals(queryDbPane)) { tbl = queryDbTable; } else if (pane.equals(resultPane)) { tbl = resultTable; } if (pane.equals(queryFilePane)) { tbl = queryFileTable; } } int rowCnt = tbl.getSelectedRows().length; JMenuItem item1 = new JMenuItem("Show Record"); item1.addActionListener(new PopupShowRecordListener(tbl)); JMenuItem item2 = new JMenuItem("Multiple Display"); item2.addActionListener(new PopupMultipleDisplayListener(tbl)); // ? if (tbl.equals(queryFileTable)) { item1.setEnabled(false); item2.setEnabled(false); } else if (rowCnt == 0) { item1.setEnabled(false); item2.setEnabled(false); } else if (rowCnt == 1) { item1.setEnabled(true); item2.setEnabled(false); } else if (rowCnt > 1) { item1.setEnabled(false); item2.setEnabled(true); } // ? JPopupMenu popup = new JPopupMenu(); popup.add(item1); if (tbl.equals(resultTable)) { popup.add(item2); } popup.show(e.getComponent(), e.getX(), e.getY()); }
From source file:org.forester.archaeopteryx.TreePanel.java
final void mouseClicked(final MouseEvent e) { if (getOptions().isShowOverview() && isOvOn() && isInOv()) { final double w_ratio = getVisibleRect().width / getOvRectangle().getWidth(); final double h_ratio = getVisibleRect().height / getOvRectangle().getHeight(); double x = (e.getX() - getVisibleRect().x - getOvXPosition() - getOvRectangle().getWidth() / 2.0) * w_ratio;// ww w. jav a 2s .c o m double y = (e.getY() - getVisibleRect().y - getOvYPosition() - getOvRectangle().getHeight() / 2.0) * h_ratio; if (x < 0) { x = 0; } if (y < 0) { y = 0; } final double max_x = getWidth() - getVisibleRect().width; final double max_y = getHeight() - getVisibleRect().height; if (x > max_x) { x = max_x; } if (y > max_y) { y = max_y; } getMainPanel().getCurrentScrollPane().getViewport() .setViewPosition(new Point(ForesterUtil.roundToInt(x), ForesterUtil.roundToInt(y))); setInOvRect(true); repaint(); } else if (findNode(e.getX(), e.getY()) != null) { if ((_control_panel.getActionWhenNodeClicked() == NodeClickAction.SHOW_BRANCH_DATA) || (_control_panel.getActionWhenNodeClicked() == NodeClickAction.SHOW_DATA)) { _control_panel.setActionWhenNodeClicked(NodeClickAction.SHOW_DATA); } //System.out.println(_control_panel.getActionWhenNodeClicked()); final PhylogenyNode node = findNode(e.getX(), e.getY()); if (node != null) { if (!node.isRoot() && node.getParent().isCollapse()) { return; } _highlight_node = node; // Check if shift key is down if ((e.getModifiers() & InputEvent.SHIFT_MASK) != 0) { // Yes, so add to _found_nodes if (getFoundNodes() == null) { setFoundNodes(new HashSet<PhylogenyNode>()); } getFoundNodes().add(node); // Check if control key is down } else if ((e.getModifiers() & InputEvent.CTRL_MASK) != 0) { // Yes, so pop-up menu displayNodePopupMenu(node, e.getX(), e.getY()); // Handle unadorned click } else { // Check for right mouse button if (e.getModifiers() == 4) { displayNodePopupMenu(node, e.getX(), e.getY()); } else { // if not in _found_nodes, clear _found_nodes if (_control_panel.getActionWhenNodeClicked().equals(NodeClickAction.REROOT)) { // no rerooting for nodes anymore } else { handleClickToAction(_control_panel.getActionWhenNodeClicked(), node); } } } } } else if (findBranch(e.getX(), e.getY()) != null) { final PhylogenyNode node = findBranch(e.getX(), e.getY()); // Check for right mouse button if (e.getModifiers() == 4) { displayBranchPopupMenu(node, e.getX(), e.getY()); } else { if ((_control_panel.getActionWhenNodeClicked() == NodeClickAction.SHOW_BRANCH_DATA) || (_control_panel.getActionWhenNodeClicked() == NodeClickAction.SHOW_DATA)) { _control_panel.setActionWhenNodeClicked(NodeClickAction.SHOW_BRANCH_DATA); } handleClickToAction(_control_panel.getActionWhenNodeClicked(), node); } } else { // no node was clicked _highlight_node = null; } repaint(); }
From source file:net.sf.firemox.clickable.target.card.MCard.java
@Override public void mouseClicked(MouseEvent e) { if (!(getParent() instanceof MZone) && !(getParent() instanceof MCard)) { return;// w w w. j a va 2 s . com } StackManager.noReplayToken.take(); MZone container = getContainer(); try { TargetFactory.triggerTargetable = this; if (ConnectionManager.isConnected() && e.getButton() == MouseEvent.BUTTON1) { // only if left button is pressed if (!StackManager.actionManager.clickOn(this)) { // this card is activated and you control it if (!(StackManager.actionManager.currentAction instanceof WaitingAbility)) { // we are not waiting ability if (container instanceof ExpandableZone) { ((ExpandableZone) container).toggle(); } return; } final List<Ability> abilities = ((WaitingAbility) StackManager.actionManager.currentAction) .abilitiesOf(this); final List<Ability> advAbilities = ((WaitingAbility) StackManager.actionManager.currentAction) .advancedAbilitiesOf(this); // is there any playable ability with this card ? if ((abilities == null || abilities.isEmpty()) && (advAbilities == null || advAbilities.isEmpty())) { // no playable ability, and this card is not wait for -> toggle if (container instanceof ExpandableZone) { ((ExpandableZone) container).toggle(); } return; } // a choice has to be made if (advAbilities != null && !advAbilities.isEmpty() || abilities != null && abilities.size() > 1) { /* * several abilities for this card, we fill the popup ability menu */ TargetFactory.abilitiesMenu.removeAll(); if (abilities != null) { for (Ability ability : abilities) { final JMenuItem item = new JMenuItem( "<html>" + ability.toHtmlString(null) + "</html>"); item.addActionListener(this); TargetFactory.abilitiesMenu.add(item); } } if (advAbilities != null && !advAbilities.isEmpty()) { TargetFactory.abilitiesMenu.add(new JSeparator()); for (Ability ability : advAbilities) { final JMenuItem item = new JMenuItem( "<html>" + ability.toHtmlString(null) + "</html>", WARNING_PICTURE); item.addActionListener(this); TargetFactory.abilitiesMenu.add(item); } } // show the option popup menu TargetFactory.abilitiesMenu.show(e.getComponent(), e.getX(), e.getY()); return; } else if (abilities != null && abilities.size() == 1 && (advAbilities == null || advAbilities.isEmpty())) { // only one playable ability, we select it automatically ((UserAbility) abilities.get(0)).mouseClicked(0); } } else if (StackManager.idHandedPlayer != 0) { if (container instanceof ExpandableZone) { ((ExpandableZone) container).toggle(); } } else { // Since this click has been handled, the opponent will be informed on sendClickToOpponent(); StackManager.actionManager.succeedClickOn(this); } } else if (ConnectionManager.isConnected()) { // only if not left button is pressed CardFactory.contextMenu.removeAll(); TargetFactory.triggerTargetable = this; // add counter item CardFactory.countItem.setText(LanguageManager.getString("countcard", container.toString(), String.valueOf(container.getCardCount()))); CardFactory.contextMenu.add(CardFactory.countItem); // add refresh picture item CardFactory.contextMenu.add(CardFactory.reloadPictureItem); // add expand/gather item if (container instanceof ExpandableZone) { if (container == ZoneManager.expandedZone) { CardFactory.contextMenu.add(CardFactory.gatherItem); } else { CardFactory.contextMenu.add(CardFactory.expandItem); } } CardFactory.contextMenu.add(new JSeparator()); // add the "database" item --> activate the tabbed panel CardFactory.contextMenu.add(CardFactory.databaseCardInfoItem); // TODO add "java properties" item --> show an inspect popup. // CardFactory.contextMenu.add(CardFactory.javaDebugItem); // TODO add "show id" option // show the option popup menu CardFactory.contextMenu.show(e.getComponent(), e.getX(), e.getY()); } } catch (Throwable t) { t.printStackTrace(); } finally { StackManager.noReplayToken.release(); } }
From source file:me.mayo.telnetkek.MainPanel.java
public final void setupTablePopup() { this.tblPlayers.addMouseListener(new MouseAdapter() { @Override/*from w w w .j a v a 2 s.co m*/ public void mouseReleased(final MouseEvent mouseEvent) { final JTable table = MainPanel.this.tblPlayers; final int r = table.rowAtPoint(mouseEvent.getPoint()); if (r >= 0 && r < table.getRowCount()) { table.setRowSelectionInterval(r, r); } else { table.clearSelection(); } final int rowindex = table.getSelectedRow(); if (rowindex < 0) { return; } if ((SwingUtilities.isRightMouseButton(mouseEvent) || mouseEvent.isControlDown()) && mouseEvent.getComponent() instanceof JTable) { final PlayerInfo player = getSelectedPlayer(); if (player != null) { final JPopupMenu popup = new JPopupMenu(player.getName()); final JMenuItem header = new JMenuItem("Apply action to " + player.getName() + ":"); header.setEnabled(false); popup.add(header); popup.addSeparator(); final ActionListener popupAction = (ActionEvent actionEvent) -> { Object _source = actionEvent.getSource(); if (_source instanceof PlayerListPopupItem_Command) { final PlayerListPopupItem_Command source = (PlayerListPopupItem_Command) _source; final String output = source.getCommand().buildOutput(source.getPlayer(), true); MainPanel.this.getConnectionManager().sendDelayedCommand(output, true, 100); } else if (_source instanceof PlayerListPopupItem) { final PlayerListPopupItem source = (PlayerListPopupItem) _source; final PlayerInfo _player = source.getPlayer(); switch (actionEvent.getActionCommand()) { case "Copy IP": { copyToClipboard(_player.getIp()); MainPanel.this.writeToConsole( new ConsoleMessage("Copied IP to clipboard: " + _player.getIp())); break; } case "Copy Name": { copyToClipboard(_player.getName()); MainPanel.this.writeToConsole( new ConsoleMessage("Copied name to clipboard: " + _player.getName())); break; } case "Copy UUID": { copyToClipboard(_player.getUuid()); MainPanel.this.writeToConsole( new ConsoleMessage("Copied UUID to clipboard: " + _player.getUuid())); break; } } } }; TelnetKek.config.getCommands().stream().map( (command) -> new PlayerListPopupItem_Command(command.getName(), player, command)) .map((item) -> { item.addActionListener(popupAction); return item; }).forEach((item) -> { popup.add(item); }); popup.addSeparator(); JMenuItem item; item = new PlayerListPopupItem("Copy Name", player); item.addActionListener(popupAction); popup.add(item); item = new PlayerListPopupItem("Copy IP", player); item.addActionListener(popupAction); popup.add(item); item = new PlayerListPopupItem("Copy UUID", player); item.addActionListener(popupAction); popup.add(item); popup.show(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY()); } } } }); }
From source file:de.whiledo.iliasdownloader2.swing.service.MainController.java
public void fileTableClicked(FileObjectTableModel fileObjectTableModel, JTableX<FileObject> table, MouseEvent e) { int row = table.convertRowIndexToModel(table.rowAtPoint(e.getPoint())); //int column = table.convertColumnIndexToModel(table.columnAtPoint(e.getPoint())); final Collection<FileObject> selectedFileObjects = table.getSelectedObjects(); final FileObject f = fileObjectTableModel.getRowObjects().get(row); if (SwingUtilities.isRightMouseButton(e)) { JPopupMenu m = new JPopupMenu(); {/*w w w . ja va2 s . c o m*/ JMenuItem menuitem = new JMenuItem("ffnen"); menuitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { openFile(f); } }); m.add(menuitem); } { JMenuItem menuitem = new JMenuItem("Ordner ffnen"); menuitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { openFolder(f); } }); m.add(menuitem); } { JMenuItem menuitem = new JMenuItem("Herunterladen (ber SOAP)"); menuitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { downloadFiles(selectedFileObjects, DownloadMethod.WEBSERVICE); } }); m.add(menuitem); } { JMenuItem menuitem = new JMenuItem("Herunterladen (ber WEBDAV)"); menuitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (!syncService.getIliasSoapService().isWebdavAuthenticationActive()) { syncService.getIliasSoapService().enableWebdavAuthentication( mainFrame.getFieldLogin().getText(), mainFrame.getFieldPassword().getPassword()); } downloadFiles(selectedFileObjects, DownloadMethod.WEBDAV); } }); m.add(menuitem); } { JMenuItem menuitem = new JMenuItem("In Ilias ffnen"); menuitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { openInIlias(f); } }); m.add(menuitem); } { m.add(new JSeparator()); } { JCheckBoxMenuItem menuitem = new JCheckBoxMenuItem("Ignorieren"); menuitem.setSelected(iliasProperties.getBlockedFiles().contains(f.getRefId())); menuitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { switchIgnoreState(selectedFileObjects); } }); m.add(menuitem); } { m.add(new JSeparator()); } { JMenuItem menuitem = new JMenuItem("Fehler anzeigen"); menuitem.setEnabled(f.getException() != null); menuitem.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { showError("Fehler bei " + f.getTargetFile().getAbsolutePath(), f.getException()); } }); m.add(menuitem); } m.show(table, e.getX(), e.getY()); } if (SwingUtilities.isLeftMouseButton(e) && e.getClickCount() > 1) { openFile(f); } }
From source file:com.mirth.connect.client.ui.codetemplate.CodeTemplateLibrariesPanel.java
private void initComponents(Channel channel) { setBackground(UIConstants.BACKGROUND_COLOR); selectAllLabel = new JLabel("<html><u>Select All</u></html>"); selectAllLabel.setForeground(Color.BLUE); selectAllLabel.addMouseListener(new MouseAdapter() { @Override/*from www . ja v a 2 s.c om*/ public void mouseReleased(MouseEvent evt) { for (Enumeration<? extends MutableTreeTableNode> libraryNodes = ((MutableTreeTableNode) libraryTreeTable .getTreeTableModel().getRoot()).children(); libraryNodes.hasMoreElements();) { MutableTreeTableNode libraryNode = libraryNodes.nextElement(); Triple<String, String, Boolean> triple = (Triple<String, String, Boolean>) libraryNode .getUserObject(); libraryTreeTable.getTreeTableModel().setValueAt( new MutableTriple<String, String, Boolean>(triple.getLeft(), triple.getMiddle(), true), libraryNode, libraryTreeTable.getHierarchicalColumn()); } libraryTreeTable.updateUI(); } }); selectSeparatorLabel = new JLabel("|"); deselectAllLabel = new JLabel("<html><u>Deselect All</u></html>"); deselectAllLabel.setForeground(Color.BLUE); deselectAllLabel.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent evt) { for (Enumeration<? extends MutableTreeTableNode> libraryNodes = ((MutableTreeTableNode) libraryTreeTable .getTreeTableModel().getRoot()).children(); libraryNodes.hasMoreElements();) { MutableTreeTableNode libraryNode = libraryNodes.nextElement(); Triple<String, String, Boolean> triple = (Triple<String, String, Boolean>) libraryNode .getUserObject(); libraryTreeTable.getTreeTableModel().setValueAt( new MutableTriple<String, String, Boolean>(triple.getLeft(), triple.getMiddle(), false), libraryNode, libraryTreeTable.getHierarchicalColumn()); } libraryTreeTable.updateUI(); } }); expandAllLabel = new JLabel("<html><u>Expand All</u></html>"); expandAllLabel.setForeground(Color.BLUE); expandAllLabel.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent evt) { libraryTreeTable.expandAll(); } }); expandSeparatorLabel = new JLabel("|"); collapseAllLabel = new JLabel("<html><u>Collapse All</u></html>"); collapseAllLabel.setForeground(Color.BLUE); collapseAllLabel.addMouseListener(new MouseAdapter() { @Override public void mouseReleased(MouseEvent evt) { libraryTreeTable.collapseAll(); } }); final TableCellEditor libraryCellEditor = new LibraryTreeCellEditor(); libraryTreeTable = new MirthTreeTable() { @Override public TableCellEditor getCellEditor(int row, int column) { if (isHierarchical(column)) { return libraryCellEditor; } else { return super.getCellEditor(row, column); } } }; DefaultTreeTableModel model = new SortableTreeTableModel(); DefaultMutableTreeTableNode rootNode = new DefaultMutableTreeTableNode(); model.setRoot(rootNode); libraryTreeTable.setLargeModel(true); libraryTreeTable.setTreeTableModel(model); libraryTreeTable.setOpenIcon(null); libraryTreeTable.setClosedIcon(null); libraryTreeTable.setLeafIcon(null); libraryTreeTable.setRootVisible(false); libraryTreeTable.setDoubleBuffered(true); libraryTreeTable.setDragEnabled(false); libraryTreeTable.setRowSelectionAllowed(true); libraryTreeTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); libraryTreeTable.setRowHeight(UIConstants.ROW_HEIGHT); libraryTreeTable.setFocusable(true); libraryTreeTable.setOpaque(true); libraryTreeTable.setEditable(true); libraryTreeTable.setSortable(false); libraryTreeTable.setAutoCreateColumnsFromModel(false); libraryTreeTable.setShowGrid(true, true); libraryTreeTable.setTableHeader(null); if (Preferences.userNodeForPackage(Mirth.class).getBoolean("highlightRows", true)) { libraryTreeTable.setHighlighters(HighlighterFactory .createAlternateStriping(UIConstants.HIGHLIGHTER_COLOR, UIConstants.BACKGROUND_COLOR)); } libraryTreeTable.setTreeCellRenderer(new LibraryTreeCellRenderer()); libraryTreeTable.addMouseListener(new MouseAdapter() { @Override public void mousePressed(MouseEvent evt) { checkSelection(evt); } @Override public void mouseReleased(MouseEvent evt) { checkSelection(evt); } private void checkSelection(MouseEvent evt) { if (libraryTreeTable.rowAtPoint(new Point(evt.getX(), evt.getY())) < 0) { libraryTreeTable.clearSelection(); } } }); libraryTreeTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent evt) { if (!evt.getValueIsAdjusting()) { boolean visible = false; int selectedRow = libraryTreeTable.getSelectedRow(); if (selectedRow >= 0) { TreePath selectedPath = libraryTreeTable.getPathForRow(selectedRow); if (selectedPath != null) { visible = true; Triple<String, String, Boolean> triple = (Triple<String, String, Boolean>) ((MutableTreeTableNode) selectedPath .getLastPathComponent()).getUserObject(); String description = ""; if (selectedPath.getPathCount() == 2) { description = libraryMap.get(triple.getLeft()).getDescription(); } else if (selectedPath.getPathCount() == 3) { description = PlatformUI.MIRTH_FRAME.codeTemplatePanel.getCachedCodeTemplates() .get(triple.getLeft()).getDescription(); } if (StringUtils.isBlank(description) || StringUtils.equals(description, CodeTemplateUtil .getDocumentation(CodeTemplate.DEFAULT_CODE).getDescription())) { descriptionTextPane.setText( "<html><body class=\"code-template-libraries-panel\"><i>No description.</i></body></html>"); } else { descriptionTextPane.setText("<html><body class=\"code-template-libraries-panel\">" + MirthXmlUtil.encode(description) + "</body></html>"); } } } descriptionScrollPane.setVisible(visible); updateUI(); } } }); libraryTreeTableScrollPane = new JScrollPane(libraryTreeTable); descriptionTextPane = new JTextPane(); descriptionTextPane.setContentType("text/html"); HTMLEditorKit editorKit = new HTMLEditorKit(); StyleSheet styleSheet = editorKit.getStyleSheet(); styleSheet.addRule(".code-template-libraries-panel {font-family:\"Tahoma\";font-size:11;text-align:top}"); descriptionTextPane.setEditorKit(editorKit); descriptionTextPane.setEditable(false); descriptionScrollPane = new JScrollPane(descriptionTextPane); descriptionScrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); descriptionScrollPane.setVisible(false); }
From source file:org.forester.archaeopteryx.TreePanel.java
final void mouseMoved(final MouseEvent e) { //System.out.printf( "mouse move: %d %d\n", e.getPoint().x, e.getPoint().y); requestFocusInWindow();//w w w. j a va 2s . c om if (getControlPanel().isNodeDescPopup()) { if (_node_desc_popup != null) { _node_desc_popup.hide(); _node_desc_popup = null; } } if (getOptions().isShowOverview() && isOvOn()) { if (inOvVirtualRectangle(e)) { if (!isInOvRect()) { setInOvRect(true); repaint(); } } else { if (isInOvRect()) { setInOvRect(false); repaint(); } } } if (inOv(e) && getOptions().isShowOverview() && isOvOn()) { if (!isInOv()) { setInOv(true); } } else { if (isInOv()) { setInOv(false); } final PhylogenyNode node = findNode(e.getX(), e.getY()); final PhylogenyNode branch = findBranch(e.getX(), e.getY()); if ((node != null) && (node.isRoot() || !node.getParent().isCollapse())) { // cursor is over a tree node if ((getControlPanel().getActionWhenNodeClicked() == NodeClickAction.CUT_SUBTREE) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.COPY_SUBTREE) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.PASTE_SUBTREE) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.DELETE_NODE_OR_SUBTREE) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.REROOT) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.ADD_NEW_NODE)) { setCursor(CUT_CURSOR); } else { setCursor(HAND_CURSOR); if (getControlPanel().isNodeDescPopup()) { showNodeDataPopup(e, node); } } } else if ((branch != null) && (branch.isRoot() || !branch.getParent().isCollapse())) { // cursor is over a tree node if ((getControlPanel().getActionWhenNodeClicked() == NodeClickAction.CUT_SUBTREE) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.COPY_SUBTREE) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.PASTE_SUBTREE) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.DELETE_NODE_OR_SUBTREE) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.REROOT) || (getControlPanel().getActionWhenNodeClicked() == NodeClickAction.ADD_NEW_NODE)) { setCursor(CUT_CURSOR); } else { setCursor(HAND_CURSOR); if (getControlPanel().isNodeDescPopup()) { showBranchDataPopup(e, branch); } } } else { setCursor(ARROW_CURSOR); } } }