Author: ayukhovich
Date: 2007-08-29 06:48:41 -0400 (Wed, 29 Aug 2007)
New Revision: 3398
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/VpeResizerMouseMotionListener.java
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerVpeResizer.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-742
Restoring functionality of resizing
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/VpeResizerMouseMotionListener.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/VpeResizerMouseMotionListener.java 2007-08-29
10:44:48 UTC (rev 3397)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/VpeResizerMouseMotionListener.java 2007-08-29
10:48:41 UTC (rev 3398)
@@ -42,7 +42,6 @@
if ( mouseEvent == null ) {
return;
}
- System.out.println("VpeResizerMouseMoti: mouseMove");
vpeResizer.mouseMove(mouseEvent);
}
@@ -51,7 +50,7 @@
}
public void handleEvent(nsIDOMEvent event) {
- if ("mousemove".equals(event.getType())) {
+ if (XulRunnerConstants.EVENT_NAME_MOUSEMOVE.equals(event.getType())) {
mouseMove(event);
}
}
Modified:
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerVpeResizer.java
===================================================================
---
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerVpeResizer.java 2007-08-29
10:44:48 UTC (rev 3397)
+++
branches/jbosstools_xulrunner/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerVpeResizer.java 2007-08-29
10:48:41 UTC (rev 3398)
@@ -138,7 +138,15 @@
* @see
org.jboss.vpe.mozilla.resizer.IVpeResizer#show(org.mozilla.interfaces.nsIDOMElement,
int)
*/
public void show(nsIDOMElement domElement, int resizers) {
+
+ if ( resizingObject != null ) {
+ System.out.println("XulRunnerVpeResizer.show before hide for element: " +
resizingObject.getNodeName() );
+ hide();
+ }
+
resizingObject = domElement;
+
+ System.out.println("XulRunnerVpeResizer.show for element: " +
resizingObject.getNodeName() );
elementPositionAndDimention =
DOMElementUtils.getElementPositionAndDimention(domElement);
@@ -218,8 +226,11 @@
/* (non-Javadoc)
* @see org.jboss.vpe.mozilla.resizer.IVpeResizer#hide()
*/
- public void hide()
- {
+ public void hide() {
+ if ( resizingObject != null ) {
+ System.out.println("XulRunnerVpeResizer.hide for element: " +
resizingObject.getNodeName() );
+ }
+
nsIDOMElement bodyElement;
bodyElement = getRootElement();
@@ -527,8 +538,7 @@
* @param aY
* @return
*/
- private int getNewResizingX(int aX, int aY)
- {
+ private int getNewResizingX(int aX, int aY) {
int resized = elementPositionAndDimention.getLeft() + getNewResizingIncrement(aX, aY,
COEFFICIENT_TYPE.X) * incrementFactorX;
int max = elementPositionAndDimention.getLeft() +
elementPositionAndDimention.getWidth();
return Math.min(resized, max);
@@ -540,8 +550,7 @@
* @param aY
* @return
*/
- private int getNewResizingY(int aX, int aY)
- {
+ private int getNewResizingY(int aX, int aY) {
int resized = elementPositionAndDimention.getTop() + getNewResizingIncrement(aX, aY,
COEFFICIENT_TYPE.Y) * incrementFactorY;
int max = elementPositionAndDimention.getTop() +
elementPositionAndDimention.getHeight();
return Math.min(resized, max);
@@ -553,8 +562,7 @@
* @param aY
* @return
*/
- private int getNewResizingWidth(int aX, int aY)
- {
+ private int getNewResizingWidth(int aX, int aY) {
int resized = elementPositionAndDimention.getWidth() + getNewResizingIncrement(aX, aY,
COEFFICIENT_TYPE.WIDTH) * incrementFactorWidth;
return Math.max(resized, 1);
}
@@ -565,8 +573,7 @@
* @param aY
* @return
*/
- private int getNewResizingHeight(int aX, int aY)
- {
+ private int getNewResizingHeight(int aX, int aY) {
int resized = elementPositionAndDimention.getHeight() + getNewResizingIncrement(aX, aY,
COEFFICIENT_TYPE.HEIGHT) * incrementFactorHeight;
return Math.max(resized, 1);
}
@@ -578,8 +585,7 @@
* @param coefficient_type
* @return
*/
- private int getNewResizingIncrement(int aX, int aY, COEFFICIENT_TYPE coefficient_type)
- {
+ private int getNewResizingIncrement(int aX, int aY, COEFFICIENT_TYPE
coefficient_type) {
int result = 0;
switch (coefficient_type) {