Author: yradtsevich
Date: 2010-04-30 10:29:10 -0400 (Fri, 30 Apr 2010)
New Revision: 21829
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaAfterPaintListener.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaScrollListener.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6203
Selection rectangle disappears when mouse cursor leaves the selected element.
- Resolved. Selection refresh is called now on mouse move.
https://jira.jboss.org/jira/browse/JBIDE-4022
Blue selection rectantle artefacts - if you select some big part in VPE and scroll with
the mouse wheel and move mouse over it.
- Resolved. Selection refresh is called now on scroll and mozafterpait events move.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-04-30
14:14:04 UTC (rev 21828)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2010-04-30
14:29:10 UTC (rev 21829)
@@ -97,10 +97,12 @@
import org.jboss.tools.vpe.editor.menu.VpeMenuCreator;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.mozilla.MozillaEventAdapter;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaAfterPaintListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaContextMenuListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaKeyListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaMouseListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaResizeListener;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaScrollListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaSelectionListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaTooltipListener;
import org.jboss.tools.vpe.editor.selection.VpeSelectionController;
@@ -147,7 +149,8 @@
ResourceReferenceListListener, ISelectionChangedListener,
IVisualController, MozillaMouseListener, MozillaKeyListener,
MozillaTooltipListener, MozillaSelectionListener,
- MozillaContextMenuListener, MozillaResizeListener {
+ MozillaContextMenuListener, MozillaResizeListener,
+ MozillaAfterPaintListener, MozillaScrollListener {
private boolean visualEditorVisible = true;
private boolean synced = true;
@@ -458,6 +461,8 @@
mozillaEventAdapter.addKeyListener(this);
mozillaEventAdapter.addMouseListener(this);
mozillaEventAdapter.addSelectionListener(this);
+ mozillaEventAdapter.addAfterPaintListener(this);
+ mozillaEventAdapter.addScrollListener(this);
}
}
}
@@ -475,6 +480,8 @@
mozillaEventAdapter.removeKeyListener(this);
mozillaEventAdapter.removeMouseListener(this);
mozillaEventAdapter.removeSelectionListener(this);
+ mozillaEventAdapter.removeAfterPaintListener(this);
+ mozillaEventAdapter.removeScrollListener(this);
}
}
}
@@ -1277,6 +1284,7 @@
}
public void mouseMove(nsIDOMMouseEvent mouseEvent) {
+ onRefresh();
// nsIDOMNode visualNode = VisualDomUtil.getTargetNode(mouseEvent);
// if (visualNode != null) {
// if (VpeDebug.PRINT_VISUAL_MOUSE_EVENT) {
@@ -1431,6 +1439,14 @@
visualBuilder.resize(element, constrains, top, left, width, height);
sourceSelectionChanged();
}
+
+ public void afterPaint(nsIDOMEvent domEvent) {
+ onRefresh();
+ }
+
+ public void editorScrolled(nsIDOMEvent domEvent) {
+ onRefresh();
+ }
/**
* Calls when on when browser receive context menu event.
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-04-30
14:14:04 UTC (rev 21828)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEventAdapter.java 2010-04-30
14:29:10 UTC (rev 21829)
@@ -12,10 +12,12 @@
import javax.swing.event.EventListenerList;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaAfterPaintListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaContextMenuListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaDndListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaKeyListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaMouseListener;
+import org.jboss.tools.vpe.editor.mozilla.listener.MozillaScrollListener;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaSelectionListener;
import org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser;
import org.mozilla.interfaces.nsIDOMDocument;
@@ -202,6 +204,23 @@
public void removeSelectionListener(MozillaSelectionListener listener) {
listeners.remove(MozillaSelectionListener.class, listener);
}
+
+ public void addAfterPaintListener(MozillaAfterPaintListener listener) {
+ listeners.add(MozillaAfterPaintListener.class, listener);
+ }
+
+ public void removeAfterPaintListener(MozillaAfterPaintListener listener) {
+ listeners.remove(MozillaAfterPaintListener.class, listener);
+ }
+
+ public void addScrollListener(MozillaScrollListener listener) {
+ listeners.add(MozillaScrollListener.class, listener);
+ }
+
+ public void removeScrollListener(MozillaScrollListener listener) {
+ listeners.remove(MozillaScrollListener.class, listener);
+ }
+
/**
* {@inheritDoc}
*/
@@ -293,6 +312,16 @@
MozillaDndListener.class)) {
listener.dragOver(domEvent);
}
+ } else if (SCROLL.equals(eventType)) {
+ for (MozillaScrollListener listener : listeners.getListeners(
+ MozillaScrollListener.class)) {
+ listener.editorScrolled(domEvent);
+ }
+ } else if (MOZAFTERPAINT.equals(eventType)) {
+ for (MozillaAfterPaintListener listener : listeners.getListeners(
+ MozillaAfterPaintListener.class)) {
+ listener.afterPaint(domEvent);
+ }
}
}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaAfterPaintListener.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaAfterPaintListener.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaAfterPaintListener.java 2010-04-30
14:29:10 UTC (rev 21829)
@@ -0,0 +1,15 @@
+package org.jboss.tools.vpe.editor.mozilla.listener;
+
+import java.util.EventListener;
+
+import org.mozilla.interfaces.nsIDOMEvent;
+
+/**
+ * Listener for MozAfterPaint events.
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ *
+ */
+public interface MozillaAfterPaintListener extends EventListener {
+ void afterPaint(nsIDOMEvent domEvent);
+}
Added:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaScrollListener.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaScrollListener.java
(rev 0)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/listener/MozillaScrollListener.java 2010-04-30
14:29:10 UTC (rev 21829)
@@ -0,0 +1,15 @@
+package org.jboss.tools.vpe.editor.mozilla.listener;
+
+import java.util.EventListener;
+
+import org.mozilla.interfaces.nsIDOMEvent;
+
+/**
+ * Listener for scrolling events,
+ *
+ * @author Yahor Radtsevich (yradtsevich)
+ *
+ */
+public interface MozillaScrollListener extends EventListener {
+ void editorScrolled(nsIDOMEvent domEvent);
+}