diff --git a/protege-editor-core/src/main/java/org/protege/editor/core/ui/list/MList.java b/protege-editor-core/src/main/java/org/protege/editor/core/ui/list/MList.java index dbf47529d..697ba051e 100644 --- a/protege-editor-core/src/main/java/org/protege/editor/core/ui/list/MList.java +++ b/protege-editor-core/src/main/java/org/protege/editor/core/ui/list/MList.java @@ -68,7 +68,6 @@ public String getName() { private MListCellRenderer ren; - private boolean mouseDown; private List editAndDeleteButtonList = Arrays.asList(editButton, deleteButton); @@ -77,6 +76,8 @@ public String getName() { private List deleteButtonList = Arrays.asList(deleteButton); + private Point lastMousePosition; + public int lastMousePositionCellIndex = -1; @@ -154,9 +155,9 @@ private void handleMouseMoved() { if (dirty != null) { repaint(dirty); } - Point pt = MList.this.getMousePosition(); - if (pt != null) { - lastMousePositionCellIndex = MList.this.locationToIndex(pt); + lastMousePosition = super.getMousePosition(); + if (lastMousePosition != null) { + lastMousePositionCellIndex = MList.this.locationToIndex(lastMousePosition); } else { lastMousePositionCellIndex = -1; @@ -168,6 +169,12 @@ private void handleMouseMoved() { } } + @Override + public Point getMousePosition() { + // use the cache mouse position to avoid performance problems, see #723 + return lastMousePosition; + } + protected String getRowName(Object rowObject) { return null; } diff --git a/protege-editor-owl/src/main/java/org/protege/editor/owl/ui/renderer/OWLCellRenderer.java b/protege-editor-owl/src/main/java/org/protege/editor/owl/ui/renderer/OWLCellRenderer.java index c46043f0c..a51f647b1 100644 --- a/protege-editor-owl/src/main/java/org/protege/editor/owl/ui/renderer/OWLCellRenderer.java +++ b/protege-editor-owl/src/main/java/org/protege/editor/owl/ui/renderer/OWLCellRenderer.java @@ -490,7 +490,7 @@ private void setupLinkedObjectComponent(JComponent component, Rectangle cellRect } if (component instanceof LinkedObjectComponent && OWLRendererPreferences.getInstance().isRenderHyperlinks()) { linkedObjectComponent = (LinkedObjectComponent) component; - Point mouseLoc = component.getMousePosition(true); + Point mouseLoc = component.getMousePosition(); if (mouseLoc == null) { linkedObjectComponent.setLinkedObject(null); return;