changeset 1853:365a3a5249c5 8.0-b64

Automated merge with ssh://jpgodine@jfxsrc.us.oracle.com//javafx/8.0/MASTER/jfx//rt
author jpgodine@JPGODINE-LAP.st-users.us.oracle.com
date Tue, 06 Nov 2012 09:39:13 -0800
parents 0f2f18efc353 e13317e2a91f
children 54bb3abd41fe 744a754668fa f5e438202f2d
files javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVKSkin.java
diffstat 51 files changed, 1656 insertions(+), 972 deletions(-) [+]
line wrap: on
line diff
--- a/javafx-ui-common/src/com/sun/javafx/scene/EnteredExitedHandler.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/EnteredExitedHandler.java	Tue Nov 06 09:39:13 2012 -0800
@@ -30,6 +30,7 @@
 import javafx.scene.input.MouseEvent;
 
 import com.sun.javafx.event.BasicEventDispatcher;
+import javafx.event.EventType;
 import javafx.scene.input.MouseDragEvent;
 
 /**
@@ -49,45 +50,41 @@
         if (eventSource == event.getTarget()) {
             if (event.getEventType() == MouseEvent.MOUSE_ENTERED_TARGET) {
                 eventTypeModified = true;
-                return MouseEvent.impl_copy(eventSource, event.getTarget(),
-                                            (MouseEvent) event,
-                                            MouseEvent.MOUSE_ENTERED);
+                return((MouseEvent)event).copyFor(eventSource, event.getTarget(),
+                        MouseEvent.MOUSE_ENTERED);
             }
 
             if (event.getEventType() == MouseEvent.MOUSE_EXITED_TARGET) {
                 eventTypeModified = true;
-                return MouseEvent.impl_copy(eventSource, event.getTarget(),
-                                            (MouseEvent) event,
-                                            MouseEvent.MOUSE_EXITED);
+                return ((MouseEvent)event).copyFor(eventSource, event.getTarget(),
+                        MouseEvent.MOUSE_EXITED);
             }
 
             if (event.getEventType() == MouseDragEvent.MOUSE_DRAG_ENTERED_TARGET) {
                 eventTypeModified = true;
-                return MouseDragEvent.impl_copy(eventSource, event.getTarget(),
-                                ((MouseDragEvent) event).getGestureSource(),
-                                (MouseDragEvent) event,
-                                MouseDragEvent.MOUSE_DRAG_ENTERED);
+                return MouseEvent.copyForMouseDragEvent((MouseDragEvent) event,
+                                eventSource, event.getTarget(),
+                                MouseDragEvent.MOUSE_DRAG_ENTERED,
+                                ((MouseDragEvent) event).getGestureSource());
             }
 
             if (event.getEventType() == MouseDragEvent.MOUSE_DRAG_EXITED_TARGET) {
                 eventTypeModified = true;
-                return MouseDragEvent.impl_copy(eventSource, event.getTarget(),
-                                ((MouseDragEvent) event).getGestureSource(),
-                                (MouseDragEvent) event,
-                                MouseDragEvent.MOUSE_DRAG_EXITED);
+                return MouseEvent.copyForMouseDragEvent((MouseDragEvent) event,
+                                eventSource, event.getTarget(),
+                                MouseDragEvent.MOUSE_DRAG_EXITED,
+                                ((MouseDragEvent) event).getGestureSource());
             }
 
             if (event.getEventType() == DragEvent.DRAG_ENTERED_TARGET) {
                 eventTypeModified = true;
-                return DragEvent.impl_copy(eventSource, event.getTarget(),
-                                           (DragEvent) event,
+                return ((DragEvent) event).copyFor(eventSource, event.getTarget(),
                                            DragEvent.DRAG_ENTERED);
             }
 
             if (event.getEventType() == DragEvent.DRAG_EXITED_TARGET) {
                 eventTypeModified = true;
-                return DragEvent.impl_copy(eventSource, event.getTarget(),
-                                           (DragEvent) event,
+                return ((DragEvent) event).copyFor(eventSource, event.getTarget(),
                                            DragEvent.DRAG_EXITED);
             }
         }
@@ -100,42 +97,38 @@
     public final Event dispatchBubblingEvent(Event event) {
         if (eventTypeModified && (eventSource == event.getTarget())) {
             if (event.getEventType() == MouseEvent.MOUSE_ENTERED) {
-                return MouseEvent.impl_copy(eventSource, event.getTarget(),
-                                            (MouseEvent) event,
+                return ((MouseEvent)event).copyFor(eventSource, event.getTarget(),
                                             MouseEvent.MOUSE_ENTERED_TARGET);
             }
 
             if (event.getEventType() == MouseEvent.MOUSE_EXITED) {
-                return MouseEvent.impl_copy(eventSource, event.getTarget(),
-                                            (MouseEvent) event,
+                return ((MouseEvent)event).copyFor(eventSource, event.getTarget(),
                                             MouseEvent.MOUSE_EXITED_TARGET);
             }
 
             if (event.getEventType() == MouseDragEvent.MOUSE_DRAG_ENTERED) {
                 eventTypeModified = true;
-                return MouseDragEvent.impl_copy(eventSource, event.getTarget(),
-                                ((MouseDragEvent) event).getGestureSource(),
-                                (MouseDragEvent) event,
-                                MouseDragEvent.MOUSE_DRAG_ENTERED_TARGET);
+                return MouseEvent.copyForMouseDragEvent((MouseDragEvent) event,
+                                eventSource, event.getTarget(),
+                                MouseDragEvent.MOUSE_DRAG_ENTERED_TARGET,
+                                ((MouseDragEvent) event).getGestureSource());
             }
 
             if (event.getEventType() == MouseDragEvent.MOUSE_DRAG_EXITED) {
                 eventTypeModified = true;
-                return MouseDragEvent.impl_copy(eventSource, event.getTarget(),
-                                ((MouseDragEvent) event).getGestureSource(),
-                                (MouseDragEvent) event,
-                                MouseDragEvent.MOUSE_DRAG_EXITED_TARGET);
+                return MouseEvent.copyForMouseDragEvent((MouseDragEvent) event,
+                                eventSource, event.getTarget(),
+                                MouseDragEvent.MOUSE_DRAG_EXITED_TARGET,
+                                ((MouseDragEvent) event).getGestureSource());
             }
 
             if (event.getEventType() == DragEvent.DRAG_ENTERED) {
-                return DragEvent.impl_copy(eventSource, event.getTarget(),
-                                           (DragEvent) event,
+                return ((DragEvent) event).copyFor(eventSource, event.getTarget(),
                                            DragEvent.DRAG_ENTERED_TARGET);
             }
 
             if (event.getEventType() == DragEvent.DRAG_EXITED) {
-                return DragEvent.impl_copy(eventSource, event.getTarget(),
-                                           (DragEvent) event,
+                return ((DragEvent) event).copyFor(eventSource, event.getTarget(),
                                            DragEvent.DRAG_EXITED_TARGET);
             }
         }
--- a/javafx-ui-common/src/com/sun/javafx/scene/KeyboardShortcutsHandler.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/KeyboardShortcutsHandler.java	Tue Nov 06 09:39:13 2012 -0800
@@ -224,15 +224,14 @@
                     ** we act as is the alt key is being held down.
                     */
 
-                    KeyEvent fakeEvent = KeyEvent.impl_keyEvent(event.getTarget(), 
+                    KeyEvent fakeEvent = new KeyEvent(null, event.getTarget(), KeyEvent.KEY_PRESSED,
                                                                 event.getCharacter(),
                                                                 event.getText(),
                                                                 ((KeyCode)event.getCode()).impl_getCode(),
                                                                 event.isShiftDown(),
                                                                 event.isControlDown(),
                                                                 true,
-                                                                event.isMetaDown(),
-                                                                KeyEvent.KEY_PRESSED);
+                                                                event.isMetaDown());
 
 
                     if (mnemonic.getKey().match(fakeEvent)) {
--- a/javafx-ui-common/src/com/sun/javafx/scene/paint/GradientUtils.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/com/sun/javafx/scene/paint/GradientUtils.java	Tue Nov 06 09:39:13 2012 -0800
@@ -24,6 +24,8 @@
  */
 package com.sun.javafx.scene.paint;
 
+import java.util.LinkedList;
+import java.util.List;
 import javafx.scene.paint.Color;
 import javafx.scene.paint.Stop;
 
@@ -65,8 +67,51 @@
         private boolean proportional;
         private boolean proportionalSet = false;
 
+        private interface Delimiter {
+            public boolean isDelimiter(char value);
+        }
+
+        private String[] splitString(String string, Delimiter delimiter, boolean canRepeat) {
+            List<String> tokenList = new LinkedList<String>();
+            StringBuilder token = new StringBuilder();
+            int i = 0;
+            char[] input = string.toCharArray();
+            while (i < input.length) {
+                char currentChar = input[i];
+
+                if (delimiter.isDelimiter(currentChar)) {
+                    if (!canRepeat || token.length() > 0) {
+                        tokenList.add(token.toString());
+                    }
+                    token.setLength(0);
+                } else if (currentChar == '(') {
+                    while (i < input.length) {
+                        token.append(input[i]);
+                        if (input[i] == ')') {
+                            break;
+                        }
+                        i++;
+                    }
+                } else {
+                    token.append(input[i]);
+                }
+                i++;
+            }
+            if (!canRepeat || token.length() > 0) {
+                tokenList.add(token.toString());
+            }
+
+            return tokenList.toArray(new String[tokenList.size()]);
+        }
+
         public Parser(String content) {
-            tokens = content.split(",");
+            tokens = splitString(content, new Delimiter() {
+                @Override
+                public boolean isDelimiter(char value) {
+                    return (value == ',');
+                }
+            }, false);
+
             index = 0;
         }
 
@@ -79,11 +124,16 @@
         }
 
         public String getCurrentToken() {
-            return tokens[index].trim();
+            String currentToken = tokens[index].trim();
+            if (currentToken.isEmpty()) {
+                throw new IllegalArgumentException("Invalid gradient specification: "
+                        + "found empty token.");
+            }
+            return currentToken;
         }
 
         public String[] splitCurrentToken() {
-            return tokens[index].trim().split("\\s");
+            return getCurrentToken().split("\\s");
         }
 
         public static void checkNumberOfArguments(String[] tokens, int count) {
@@ -163,7 +213,19 @@
             Stop[] stops = new Stop[stopsCount];
 
             for (int i = 0; i < stopsCount; i++) {
-                String[] stopTokens = tokens[i + index].trim().split("\\s+");
+                String stopString = tokens[i + index].trim();
+                String[] stopTokens = splitString(stopString, new Delimiter() {
+                    @Override
+                    public boolean isDelimiter(char value) {
+                        return Character.isWhitespace(value);
+                    }
+                }, true);
+
+                if (stopTokens.length == 0) {
+                    throw new IllegalArgumentException("Invalid gradient specification, "
+                                + "empty stop found");
+                }
+
                 String currentToken = stopTokens[0];
                 double offset = -1;
 
--- a/javafx-ui-common/src/javafx/animation/ParallelTransition.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/animation/ParallelTransition.java	Tue Nov 06 09:39:13 2012 -0800
@@ -38,6 +38,8 @@
 import javafx.util.Duration;
 
 import com.sun.javafx.collections.TrackableObservableList;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
 
 /**
  * This {@link Transition} plays a list of {@link javafx.animation.Animation
@@ -102,6 +104,7 @@
     private boolean[] forceChildSync;
     private long oldTicks;
     private boolean childrenChanged = true;
+    private boolean toggledRate;
     
     private final InvalidationListener childrenListener = new InvalidationListener() {
         @Override
@@ -112,7 +115,21 @@
             }
         }
     };
+    
+    private final ChangeListener<Number> rateListener = new ChangeListener<Number>() {
 
+        @Override
+        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
+            if (oldValue.doubleValue() * newValue.doubleValue() < 0) {
+                for (int i = 0; i < cachedChildren.length; ++i) {
+                    Animation child = cachedChildren[i];
+                    child.setRate(rates[i] * Math.signum(newValue.doubleValue()));
+                }
+                toggledRate = true;
+            }
+        }
+
+    };
     /**
      * This {@link javafx.scene.Node} is used in all child {@link Transition
      * Transitions}, that do not define a target {@code Node} themselves. This
@@ -331,6 +348,13 @@
     }
 
     @Override
+    void impl_start(boolean forceSync) {
+        super.impl_start(forceSync);
+        toggledRate = false;
+        currentRateProperty().addListener(rateListener);
+    }
+
+    @Override
     void impl_stop() {
         super.impl_stop();
         for (final Animation animation : cachedChildren) {
@@ -341,8 +365,10 @@
         if (childrenChanged) {
             setCycleDuration(computeCycleDuration());
         }
+        currentRateProperty().removeListener(rateListener);
     }
 
+
     /**
      * @treatAsPrivate implementation detail
      * @deprecated This is an internal API that is not intended for use and will be removed in the next version
@@ -352,6 +378,14 @@
         impl_setCurrentTicks(currentTicks);
         final double frac = calculateFraction(currentTicks, cycleTicks);
         final long newTicks = Math.max(0, Math.min(getCachedInterpolator().interpolate(0, cycleTicks, frac), cycleTicks));
+        if (toggledRate) {
+            for (int i = 0; i < cachedChildren.length; ++i) {
+                if (cachedChildren[i].getStatus() == Status.RUNNING) {
+                    offsetTicks[i] -= Math.signum(getCurrentRate()) * (durations[i] - 2 * (oldTicks - delays[i]));
+                }
+            }
+            toggledRate = false;
+        }
         if (getCurrentRate() > 0) {
             int i = 0;
             for (final Animation animation : cachedChildren) {
@@ -440,7 +474,7 @@
             } else {
                 // TODO: This does probably not work if animation is paused (getCurrentRate() == 0)
                 // TODO: Do I have to use newTicks or currentTicks?
-                offsetTicks[i] = (getCurrentRate() < 0)? sub(add(durations[i], delays[i]), newTicks) : sub(newTicks, delays[i]);
+                offsetTicks[i] += (getCurrentRate() < 0)? sub(add(durations[i], delays[i]), newTicks) : sub(newTicks, delays[i]);
                 animation.jumpTo(toDuration(sub(newTicks, delays[i]), rates[i]));
             }
             i++;
@@ -457,6 +491,7 @@
     }
     
     private long calcTimePulse(long ticks, int index) {
-        return sub(Math.round(ticks * Math.abs(rates[index])), offsetTicks[index]);
+        long r =  Math.round(ticks * Math.abs(rates[index])) -  offsetTicks[index];
+        return r > 0 ? r : 0;
     }
 }
--- a/javafx-ui-common/src/javafx/animation/SequentialTransition.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/animation/SequentialTransition.java	Tue Nov 06 09:39:13 2012 -0800
@@ -40,6 +40,8 @@
 import javafx.util.Duration;
 
 import com.sun.javafx.collections.TrackableObservableList;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
 
 /**
  * This {@link Transition} plays a list of {@link javafx.animation.Animation
@@ -109,6 +111,7 @@
     private long oldTicks = -1L;
     private long offsetTicks;
     private boolean childrenChanged = true;
+    private boolean toggledRate;
 
     private final InvalidationListener childrenListener = new InvalidationListener() {
         @Override
@@ -119,6 +122,21 @@
             }
         }
     };
+
+    private final ChangeListener<Number> rateListener = new ChangeListener<Number>() {
+
+        @Override
+        public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) {
+            if (oldValue.doubleValue() * newValue.doubleValue() < 0) {
+                for (int i = 0; i < cachedChildren.length; ++i) {
+                    Animation child = cachedChildren[i];
+                    child.setRate(rates[i] * Math.signum(newValue.doubleValue()));
+                }
+                toggledRate = true;
+            }
+        }
+
+    };
     
     /**
      * This {@link javafx.scene.Node} is used in all child {@link Transition
@@ -327,6 +345,8 @@
     @Override
     void impl_start(boolean forceSync) {
         super.impl_start(forceSync);
+        toggledRate = false;
+        currentRateProperty().addListener(rateListener);
         curIndex = (getCurrentRate() > 0) ? BEFORE : end;
         offsetTicks = 0L;
     }
@@ -365,6 +385,7 @@
         if (childrenChanged) {
             setCycleDuration(computeCycleDuration());
         }
+        currentRateProperty().removeListener(rateListener);
     }
 
     private boolean startChild(Animation child, int index) {
@@ -389,6 +410,12 @@
         final long newTicks = Math.max(0, Math.min(getCachedInterpolator().interpolate(0, cycleTicks, frac), cycleTicks));
         final int newIndex = findNewIndex(newTicks);
         final Animation current = ((curIndex == BEFORE) || (curIndex == end)) ? null : cachedChildren[curIndex];
+        if (toggledRate) {
+            if (current.getStatus() == Status.RUNNING) {
+                offsetTicks -= Math.signum(getCurrentRate()) * (durations[curIndex] - 2 * (oldTicks - delays[curIndex] - startTimes[curIndex]));
+            }
+            toggledRate = false;
+        }
         if (curIndex == newIndex) {
             if (getCurrentRate() > 0) {
                 final long currentDelay = add(startTimes[curIndex], delays[curIndex]);
@@ -605,6 +632,7 @@
     }
 
     private long calcTimePulse(long ticks) {
-        return sub(Math.round(ticks * Math.abs(rates[curIndex])), offsetTicks);
+         long r =  Math.round(ticks * Math.abs(rates[curIndex])) -  offsetTicks;
+        return r > 0 ? r : 0;
     }
 }
--- a/javafx-ui-common/src/javafx/scene/Node.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/Node.java	Tue Nov 06 09:39:13 2012 -0800
@@ -746,6 +746,9 @@
                 if (_scene != null && !impl_isDirtyEmpty()) {
                     _scene.addToDirtyList(Node.this);
                 }
+                if (_scene == null && peer != null) {
+                    peer.release();
+                }
             }
             oldScene = _scene;
         }
--- a/javafx-ui-common/src/javafx/scene/Scene.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/Scene.java	Tue Nov 06 09:39:13 2012 -0800
@@ -1598,8 +1598,8 @@
             eventTarget = pick(x2, y2);
         }
         if (eventTarget != null) {
-            ContextMenuEvent context = ContextMenuEvent.impl_contextEvent(
-                    x2, y2, xAbs, yAbs, isKeyboardTrigger, ContextMenuEvent.CONTEXT_MENU_REQUESTED);
+            ContextMenuEvent context = new ContextMenuEvent(ContextMenuEvent.CONTEXT_MENU_REQUESTED,
+                    x2, y2, xAbs, yAbs, isKeyboardTrigger);
             Event.fireEvent(eventTarget, context);
         }
         if (!isKeyboardTrigger) Scene.inMousePick = false;
@@ -1697,9 +1697,9 @@
                     t.impl_reset();
                 }
 
-                TouchEvent te = TouchEvent.impl_touchEvent(type, tp, touchList,
+                TouchEvent te = new TouchEvent(type, tp, touchList,
                         touchEventSetId, e.isShiftDown(), e.isControlDown(),
-                        e.isAltDown(), e.isMetaDown());
+                        e.isAltDown(), e.isMetaDown(), e.isDirect());
 
                 Event.fireEvent(tp.getTarget(), te);
             }
@@ -2321,8 +2321,8 @@
         {
             String chars = new String(cs);
             String text = chars; // TODO: this must be a text like "HOME", "F1", or "A"
-            KeyEvent keyEvent = KeyEvent.impl_keyEvent(Scene.this, chars, text, key,
-                    shiftDown, controlDown, altDown, metaDown, type);
+            KeyEvent keyEvent = new KeyEvent(type, chars, text, key,
+                    shiftDown, controlDown, altDown, metaDown);
             impl_processKeyEvent(keyEvent);
         }
 
@@ -2331,8 +2331,8 @@
                                      ObservableList<InputMethodTextRun> composed, String committed,
                                      int caretPosition)
         {
-            InputMethodEvent inputMethodEvent = InputMethodEvent.impl_inputMethodEvent(
-                Scene.this, composed, committed, caretPosition, type);
+            InputMethodEvent inputMethodEvent = new InputMethodEvent(
+               type, composed, committed, caretPosition);
             processInputMethodEvent(inputMethodEvent);
         }
 
@@ -2393,16 +2393,14 @@
                 screenY = cursorScreenPos.getY();
             } 
 
-            Scene.this.processGestureEvent(ScrollEvent.impl_scrollEvent(
+            Scene.this.processGestureEvent(new ScrollEvent(
                     eventType,
+                    x, y, screenX, screenY, 
+                    _shiftDown, _controlDown, _altDown, _metaDown, 
+                    _direct, _inertia,
                     scrollX * xMultiplier, scrollY * yMultiplier,
                     totalScrollX * xMultiplier, totalScrollY * yMultiplier,
-                    xUnits, xText, yUnits, yText,
-                    touchCount,
-                    x, y, screenX, screenY, 
-                    _shiftDown, _controlDown, _altDown, _metaDown, 
-                    _direct, _inertia),
-                    scrollGesture);
+                    xUnits, xText, yUnits, yText, touchCount), scrollGesture);
         }
 
         @Override
@@ -2430,11 +2428,11 @@
                 screenY = cursorScreenPos.getY();
             }
 
-            Scene.this.processGestureEvent(ZoomEvent.impl_zoomEvent(
-                    eventType, zoomFactor, totalZoomFactor,
+            Scene.this.processGestureEvent(new ZoomEvent(eventType,
                     x, y, screenX, screenY,
                     _shiftDown, _controlDown, _altDown, _metaDown, 
-                    _direct, _inertia),
+                    _direct, _inertia,
+                    zoomFactor, totalZoomFactor),
                     zoomGesture);
         }
 
@@ -2462,10 +2460,10 @@
                 screenY = cursorScreenPos.getY();
             }
 
-            Scene.this.processGestureEvent(RotateEvent.impl_rotateEvent(
-                    eventType, angle, totalAngle, x, y, screenX, screenY,
+            Scene.this.processGestureEvent(new RotateEvent(
+                    eventType, x, y, screenX, screenY,
                     _shiftDown, _controlDown, _altDown, _metaDown, 
-                    _direct, _inertia),
+                    _direct, _inertia, angle, totalAngle),
                     rotateGesture);
 
         }
@@ -2488,9 +2486,9 @@
                 screenY = cursorScreenPos.getY();
             }
 
-            Scene.this.processGestureEvent(SwipeEvent.impl_swipeEvent(
-                    eventType, touchCount, x, y, screenX, screenY,
-                    _shiftDown, _controlDown, _altDown, _metaDown, _direct), 
+            Scene.this.processGestureEvent(new SwipeEvent(
+                    eventType, x, y, screenX, screenY,
+                    _shiftDown, _controlDown, _altDown, _metaDown, _direct, touchCount),
                     swipeGesture);
         }
 
@@ -2500,10 +2498,9 @@
                 boolean _shiftDown, boolean _controlDown,
                 boolean _altDown, boolean _metaDown) {
 
-            nextTouchEvent = TouchEvent.impl_touchEvent(
+            nextTouchEvent = new TouchEvent(
                     TouchEvent.ANY, null, null, 0,
-                    _shiftDown, _controlDown, _altDown, _metaDown);
-            nextTouchEvent.impl_setDirect(isDirect);
+                    _shiftDown, _controlDown, _altDown, _metaDown, isDirect);
             if (touchPoints == null || touchPoints.length != touchCount) {
                 touchPoints = new TouchPoint[touchCount];
             }
@@ -2538,7 +2535,7 @@
             }
 
             // for now we don't want to process indirect touch events
-            if (nextTouchEvent.impl_isDirect()) {
+            if (nextTouchEvent.isDirect()) {
                 Scene.this.processTouchEvent(nextTouchEvent, touchPoints);
             }
 
@@ -2580,7 +2577,7 @@
                 dndGesture = new DnDGesture();
             }
             DragEvent dragEvent =
-                    DragEvent.impl_create(x, y, screenX, screenY, transferMode, dragboard);
+                    new DragEvent(DragEvent.ANY, dragboard, x, y, screenX, screenY, transferMode, null, null);
             return dndGesture.processTargetEnterOver(dragEvent);
         }
 
@@ -2593,7 +2590,7 @@
                 return null;
             } else {
                 DragEvent dragEvent =
-                        DragEvent.impl_create(x, y, screenX, screenY, transferMode, dragboard);
+                        new DragEvent(DragEvent.ANY, dragboard, x, y, screenX, screenY, transferMode, null, null);
                 return dndGesture.processTargetEnterOver(dragEvent);
             }
         }
@@ -2604,7 +2601,7 @@
                 System.err.println("GOT A dragExit when dndGesture is null!");
             } else {
                 DragEvent dragEvent =
-                        DragEvent.impl_create(x, y, screenX, screenY, null, dragboard);
+                        new DragEvent(DragEvent.ANY, dragboard, x, y, screenX, screenY, null, null, null);
                 dndGesture.processTargetExit(dragEvent);
                 if (dndGesture.source == null) {
                     dndGesture = null;
@@ -2622,7 +2619,7 @@
                 return null;
             } else {
                 DragEvent dragEvent =
-                        DragEvent.impl_create(x, y, screenX, screenY, null, dragboard);
+                        new DragEvent(DragEvent.ANY, dragboard, x, y, screenX, screenY, null, null, null);
                 TransferMode tm = dndGesture.processTargetDrop(dragEvent);
                 if (dndGesture.source == null) {
                     dndGesture = null;
@@ -2640,7 +2637,7 @@
            dndGesture = new DnDGesture();
            dndGesture.dragboard = dragboard;
            // TODO: support mouse buttons in DragEvent
-           DragEvent dragEvent = DragEvent.impl_create(x, y, screenX, screenY, null, dragboard);
+           DragEvent dragEvent = new DragEvent(DragEvent.ANY, dragboard, x, y, screenX, screenY, null, null, null);
            final EventTarget pickedNode = pick(dragEvent.getX(), dragEvent.getY());
            dndGesture.processRecognized(pickedNode, dragEvent);
            dndGesture = null;
@@ -2750,8 +2747,8 @@
                     processingDragDetected();
 
                     if (target != null) {
-                        final MouseEvent detectedEvent = MouseEvent.impl_copy(
-                                mouseEvent.getSource(), target, mouseEvent,
+                        final MouseEvent detectedEvent = mouseEvent.copyFor(
+                                mouseEvent.getSource(), target,
                                 MouseEvent.DRAG_DETECTED);
 
                         fireEvent(target, detectedEvent);
@@ -2773,10 +2770,10 @@
          * the Node.onDragSourceRecognized function.
          */
         private boolean processRecognized(EventTarget target, DragEvent de) {
-            MouseEvent me = MouseEvent.impl_mouseEvent(de.getX(), de.getY(),
+            MouseEvent me = new MouseEvent(
+                    MouseEvent.DRAG_DETECTED, de.getX(), de.getY(),
                     de.getSceneX(), de.getScreenY(), MouseButton.PRIMARY, 1,
-                    false, false, false, false, false, true, false, false, false,
-                    MouseEvent.DRAG_DETECTED);
+                    false, false, false, false, false, true, false, false, false);
 
             processingDragDetected();
 
@@ -2795,7 +2792,7 @@
                 return;
             }
 
-            de = DragEvent.impl_copy(de.getSource(), source, source, target, de,
+            de = de.copyFor(de.getSource(), source, source, target,
                     DragEvent.DRAG_DONE);
 
             Event.fireEvent(source, de);
@@ -2816,17 +2813,17 @@
                 dragboard = createDragboard(de);
             }
 
-            de = DragEvent.impl_copy(de.getSource(), pickedTarget, source,
-                    potentialTarget, dragboard, de);
+            de = de.copyFor(de.getSource(), pickedTarget, source,
+                    potentialTarget, dragboard);
 
             handleExitEnter(de, tmpTargetWrapper);
 
-            de = DragEvent.impl_copy(de.getSource(), pickedTarget, source,
-                    potentialTarget, de, DragEvent.DRAG_OVER);
+            de = de.copyFor(de.getSource(), pickedTarget, source,
+                    potentialTarget, DragEvent.DRAG_OVER);
 
             fireEvent(pickedTarget, de);
 
-            Object acceptingObject = de.impl_getAcceptingObject();
+            Object acceptingObject = de.getAcceptingObject();
             potentialTarget = acceptingObject instanceof EventTarget
                     ? (EventTarget) acceptingObject : null;
             acceptedTransferMode = de.getAcceptedTransferMode();
@@ -2861,8 +2858,8 @@
             pick(tmpTargetWrapper, de.getX(), de.getY());
             final EventTarget pickedTarget = tmpTargetWrapper.getEventTarget();
 
-            de = DragEvent.impl_copy(de.getSource(), pickedTarget, source,
-                    potentialTarget, acceptedTransferMode, de,
+            de = de.copyFor(de.getSource(), pickedTarget, source,
+                    potentialTarget, acceptedTransferMode,
                     DragEvent.DRAG_DROPPED);
 
             if (dragboard == null) {
@@ -2873,7 +2870,7 @@
 
             fireEvent(pickedTarget, de);
 
-            Object acceptingObject = de.impl_getAcceptingObject();
+            Object acceptingObject = de.getAcceptingObject();
             potentialTarget = acceptingObject instanceof EventTarget
                     ? (EventTarget) acceptingObject : null;
             target = potentialTarget;
@@ -2908,17 +2905,17 @@
                     if (potentialTarget == t) {
                         potentialTarget = null;
                     }
-                    e = DragEvent.impl_copy(e.getSource(), t, source,
-                            potentialTarget, e, DragEvent.DRAG_EXITED_TARGET);
+                    e = e.copyFor(e.getSource(), t, source,
+                            potentialTarget, DragEvent.DRAG_EXITED_TARGET);
                     Event.fireEvent(t, e);
                 }
 
                 potentialTarget = null;
                 for (; j >= 0; j--) {
                     EventTarget t = newTargets.get(j);
-                    e = DragEvent.impl_copy(e.getSource(), t, source,
-                            potentialTarget, e, DragEvent.DRAG_ENTERED_TARGET);
-                    Object acceptingObject = e.impl_getAcceptingObject();
+                    e = e.copyFor(e.getSource(), t, source,
+                            potentialTarget, DragEvent.DRAG_ENTERED_TARGET);
+                    Object acceptingObject = e.getAcceptingObject();
                     if (acceptingObject instanceof EventTarget) {
                         potentialTarget = (EventTarget) acceptingObject;
                     }
@@ -2944,9 +2941,8 @@
             if ((e.getEventType() == KeyEvent.KEY_PRESSED) && (e.getCode() == KeyCode.ESCAPE)) {
 
                 // cancel drag and drop
-                DragEvent de = DragEvent.impl_create(DragEvent.DRAG_DONE,
-                        source, source, source, null, 0, 0, 0, 0, null, dragboard);
-
+                DragEvent de = new DragEvent(
+                        source, source, DragEvent.DRAG_DONE, dragboard, 0, 0, 0, 0, null, source, null);
                 if (source != null) {
                     Event.fireEvent(source, de);
                 }
@@ -3016,7 +3012,7 @@
         {
             if (dndGesture != null) {
                 DragEvent dragEvent =
-                        DragEvent.impl_create(x, y, screenX, screenY, transferMode, dragboard);
+                        new DragEvent(DragEvent.ANY, dragboard, x, y, screenX, screenY, transferMode, null, null);
                 dndGesture.processDropEnd(dragEvent);
                 dndGesture = null;
             }
@@ -3111,7 +3107,7 @@
             }
         }
 
-        private void preProcess(MouseEvent e) {
+        private MouseEvent preProcess(MouseEvent e) {
             for (ClickCounter cc : counters.values()) {
                 cc.moved(e.getSceneX(), e.getSceneY());
             }
@@ -3131,9 +3127,12 @@
                 lastPress = cc;
             }
 
-            e.impl_setClickParams(
+            return new MouseEvent(e.getEventType(), e.getX(), e.getY(),
+                    e.getScreenX(), e.getScreenY(), e.getButton(),
                     cc != null && e.getEventType() != MouseEvent.MOUSE_MOVED ? cc.get() : 0,
-                    still);
+                    e.isShiftDown(), e.isControlDown(), e.isAltDown(), e.isMetaDown(),
+                    e.isPrimaryButtonDown(), e.isMiddleButtonDown(), e.isSecondaryButtonDown(),
+                    e.isSynthesized(), e.isPopupTrigger(), still);
         }
 
         private void postProcess(MouseEvent e, TargetWrapper target, TargetWrapper pickedTarget) {
@@ -3154,9 +3153,13 @@
                 }
 
                 if (clickedTarget != null) {
-                    MouseEvent click = MouseEvent.impl_copy(null, clickedTarget, e,
-                            MouseEvent.MOUSE_CLICKED);
-                    click.impl_setClickParams(cc.get(), lastPress.isStill());
+                    MouseEvent click = new MouseEvent(null, clickedTarget,
+                            MouseEvent.MOUSE_CLICKED, e.getX(), e.getY(),
+                            e.getScreenX(), e.getScreenY(), e.getButton(),
+                            cc.get(),
+                            e.isShiftDown(), e.isControlDown(), e.isAltDown(), e.isMetaDown(),
+                            e.isPrimaryButtonDown(), e.isMiddleButtonDown(), e.isSecondaryButtonDown(),
+                            e.isSynthesized(), e.isPopupTrigger(), lastPress.isStill());
                     Event.fireEvent(clickedTarget, click);
                 }
             }
@@ -3235,9 +3238,10 @@
             fullPDREntered = false;
             for (int i = fullPDRCurrentEventTargets.size() - 1; i >= 0; i--) {
                 EventTarget entered = fullPDRCurrentEventTargets.get(i);
-                Event.fireEvent(entered, MouseDragEvent.impl_copy(
-                        entered, entered, fullPDRSource, e,
-                        MouseDragEvent.MOUSE_DRAG_EXITED_TARGET));
+                Event.fireEvent(entered, MouseEvent.copyForMouseDragEvent(e,
+                        entered, entered,
+                        MouseDragEvent.MOUSE_DRAG_EXITED_TARGET,
+                        fullPDRSource));
             }
             fullPDRSource = null;
             fullPDRCurrentEventTargets.clear();
@@ -3272,8 +3276,8 @@
                             (k < 0 || exitedEventTarget != pdrEventTargets.get(k))) {
                          break;
                     }
-                    queue.postEvent(MouseEvent.impl_copy(
-                            exitedEventTarget, exitedEventTarget, e,
+                    queue.postEvent(e.copyFor(
+                            exitedEventTarget, exitedEventTarget,
                             MouseEvent.MOUSE_EXITED_TARGET));
                 }
 
@@ -3284,8 +3288,8 @@
                             (k < 0 || enteredEventTarget != pdrEventTargets.get(k))) {
                         break;
                     }
-                    queue.postEvent(MouseEvent.impl_copy(
-                            enteredEventTarget, enteredEventTarget, e,
+                    queue.postEvent(e.copyFor(
+                            enteredEventTarget, enteredEventTarget,
                             MouseEvent.MOUSE_ENTERED_TARGET));
                 }
 
@@ -3349,7 +3353,7 @@
             }
 
             if (!onPulse) {
-                clickGenerator.preProcess(e);
+                e = clickGenerator.preProcess(e);
             }
 
             // enter/exit handling
@@ -3439,16 +3443,18 @@
 
                 for (; i >= 0; i--) {
                     final EventTarget exitedEventTarget = fullPDRCurrentEventTargets.get(i);
-                    Event.fireEvent(exitedEventTarget, MouseDragEvent.impl_copy(
-                            exitedEventTarget, exitedEventTarget, fullPDRSource, e,
-                            MouseDragEvent.MOUSE_DRAG_EXITED_TARGET));
+                    Event.fireEvent(exitedEventTarget, MouseEvent.copyForMouseDragEvent(e,
+                            exitedEventTarget, exitedEventTarget,
+                            MouseDragEvent.MOUSE_DRAG_EXITED_TARGET,
+                            fullPDRSource));
                 }
 
                 for (; j >= 0; j--) {
                     final EventTarget enteredEventTarget = fullPDRNewEventTargets.get(j);
-                    Event.fireEvent(enteredEventTarget, MouseDragEvent.impl_copy(
-                            enteredEventTarget, enteredEventTarget, fullPDRSource, e,
-                            MouseDragEvent.MOUSE_DRAG_ENTERED_TARGET));
+                    Event.fireEvent(enteredEventTarget, MouseEvent.copyForMouseDragEvent(e,
+                            enteredEventTarget, enteredEventTarget,
+                            MouseDragEvent.MOUSE_DRAG_ENTERED_TARGET,
+                            fullPDRSource));
                 }
 
                 fullPDRCurrentTarget = eventTarget;
@@ -3460,14 +3466,16 @@
             // event delivery
             if (eventTarget != null && !onPulse) {
                 if (e.getEventType() == MouseEvent.MOUSE_DRAGGED) {
-                    Event.fireEvent(eventTarget, MouseDragEvent.impl_copy(
-                            eventTarget, eventTarget, fullPDRSource, e,
-                            MouseDragEvent.MOUSE_DRAG_OVER));
+                    Event.fireEvent(eventTarget, MouseEvent.copyForMouseDragEvent(e,
+                            eventTarget, eventTarget,
+                            MouseDragEvent.MOUSE_DRAG_OVER,
+                            fullPDRSource));
                 }
                 if (e.getEventType() == MouseEvent.MOUSE_RELEASED) {
-                    Event.fireEvent(eventTarget, MouseDragEvent.impl_copy(
-                            eventTarget, eventTarget, fullPDRSource, e,
-                            MouseDragEvent.MOUSE_DRAG_RELEASED));
+                    Event.fireEvent(eventTarget, MouseEvent.copyForMouseDragEvent(e,
+                            eventTarget, eventTarget,
+                            MouseDragEvent.MOUSE_DRAG_RELEASED,
+                            fullPDRSource));
                 }
             }
         }
--- a/javafx-ui-common/src/javafx/scene/input/ContextMenuEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/ContextMenuEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -28,10 +28,10 @@
 
 import com.sun.javafx.scene.input.InputEventUtils;
 import java.io.IOException;
-import javafx.event.Event;
 import javafx.event.EventTarget;
 import javafx.event.EventType;
 import javafx.geometry.Point2D;
+import javafx.scene.Node;
 
 // PENDING_DOC_REVIEW
 /**
@@ -52,31 +52,50 @@
      * This event occurs when a context menu is requested.
      */
     public static final EventType<ContextMenuEvent> CONTEXT_MENU_REQUESTED =
-            new EventType<ContextMenuEvent>(ContextMenuEvent.ANY, "CONTEXT_MENU_REQUESTED");
-
-    private ContextMenuEvent(final EventType<? extends ContextMenuEvent> eventType) {
-        super(eventType);
-    }
+            new EventType<ContextMenuEvent>(ContextMenuEvent.ANY, "CONTEXTMENUREQUESTED");
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated
+     * Constructs new ContextMenu event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param keyboardTrigger true if this event was triggered by keyboard.
      */
-    @Deprecated
-    public static ContextMenuEvent impl_contextEvent(double _x, double _y,
-          double _screenX, double _screenY, boolean _keyboardTrigger,
-          EventType<? extends ContextMenuEvent> _eventType
-          )
-    {
-        ContextMenuEvent e = new ContextMenuEvent(_eventType);
-        e.x = _x;
-        e.y = _y;
-        e.screenX = _screenX;
-        e.screenY = _screenY;
-        e.sceneX = _x;
-        e.sceneY = _y;
-        e.keyboardTrigger = _keyboardTrigger;
-        return e;
+    public ContextMenuEvent(Object source, EventTarget target, EventType<ContextMenuEvent> eventType, double x, double y,
+            double screenX, double screenY, boolean keyboardTrigger) {
+        super(source, target, eventType);
+        this.x = x;
+        this.y = y;
+        if (source != null && source instanceof Node) {
+            Node sourceNode = (Node) source;
+            Point2D localToScene = sourceNode.localToScene(x, y);
+            this.sceneX = localToScene.getX();
+            this.sceneY = localToScene.getY();
+        } else {
+            this.sceneX = x;
+            this.sceneY = y;
+        }
+        this.screenX = screenX;
+        this.screenY = screenY;
+        this.keyboardTrigger = keyboardTrigger;
+     }
+
+    /**
+     * Constructs new ContextMenu event with empty source and target.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the screen.
+     * @param y The y with respect to the screen.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param keyboardTrigger true if this event was triggered by keyboard.
+     */
+    public ContextMenuEvent(EventType<ContextMenuEvent> eventType, double x, double y,
+            double screenX, double screenY, boolean keyboardTrigger) {
+        this(null, null, eventType, x, y, screenX, screenY, keyboardTrigger);
     }
 
     /**
@@ -95,16 +114,21 @@
     }
 
     @Override
-    public Event copyFor(Object newSource, EventTarget newTarget) {
+    public ContextMenuEvent copyFor(Object newSource, EventTarget newTarget) {
         ContextMenuEvent e = (ContextMenuEvent) super.copyFor(newSource, newTarget);
         recomputeCoordinatesToSource(e, newSource);
         return e;
     }
+
+    @Override
+    public EventType<ContextMenuEvent> getEventType() {
+        return (EventType<ContextMenuEvent>) super.getEventType();
+    }
     
     /**
      * The boolean that indicates the event was triggered by a keyboard gesture.
      */
-    private boolean keyboardTrigger;
+    private final boolean keyboardTrigger;
     
     /**
      * Determines whether this event originated from the keyboard.
@@ -156,7 +180,7 @@
     /**
      * Absolute horizontal x position of the event.
      */
-    private double screenX;
+    private final double screenX;
 
     /**
      * Returns absolute horizontal position of the event.
@@ -171,7 +195,7 @@
     /**
      * Absolute vertical y position of the event.
      */
-    private double screenY;
+    private final double screenY;
 
     /**
      * Returns absolute vertical position of the event.
@@ -189,7 +213,7 @@
      * If the node is not in a {@code Scene}, then the value is relative to
      * the boundsInParent of the root-most parent of the ContextMenuEvent's node.
      */
-    private double sceneX;
+    private final double sceneX;
 
     /**
      * Returns horizontal position of the event relative to the
@@ -212,7 +236,7 @@
      * If the node is not in a {@code Scene}, then the value is relative to
      * the boundsInParent of the root-most parent of the ContextMenuEvent's node.
      */
-    private double sceneY;
+    private final double sceneY;
 
     /**
      * Returns vertical position of the event relative to the
--- a/javafx-ui-common/src/javafx/scene/input/DragEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/DragEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -33,6 +33,7 @@
 import javafx.geometry.Point2D;
 
 import com.sun.javafx.scene.input.InputEventUtils;
+import java.io.IOException;
 
 // PENDING_DOC_REVIEW
 /**
@@ -198,7 +199,7 @@
  * the gesture target reporting an unsuccessful data transfer.
  * </p>
  */
-public class DragEvent extends InputEvent {
+public final class DragEvent extends InputEvent {
 
     /**
      * Common supertype for all drag event types.
@@ -294,102 +295,117 @@
     public static final EventType<DragEvent> DRAG_DONE =
             new EventType<DragEvent>(DragEvent.ANY, "DRAG_DONE");
 
-    private DragEvent(final EventType<? extends DragEvent> eventType) {
-        super(eventType);
-    }
-
-    private DragEvent(Object source, EventTarget target,
-            final EventType<? extends DragEvent> eventType) {
-        super(source, target, eventType);
-    }
-
     /**
      * Creates a copy of the given drag event with the given fields substituted.
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param gestureSource the new gesture source.
+     * @param gestureTarget the new gesture target.
+     * @param dragboard the new dragboard
+     * @return the event copy with the fields
      */
-    @Deprecated
-    public static DragEvent impl_copy(Object source, EventTarget target,
-            Object gestureSource, Object gestureTarget, Dragboard dragboard,
-            DragEvent evt) {
-        DragEvent e = impl_copy(source, target, gestureSource, gestureTarget,
-                evt, null);
+    public DragEvent copyFor(Object source, EventTarget target,
+            Object gestureSource, Object gestureTarget, Dragboard dragboard) {
+        DragEvent e = copyFor(source, target, gestureSource, gestureTarget,
+                (EventType) null);
         e.dragboard = dragboard;
         return e;
     }
 
     /**
      * Creates a copy of the given drag event with the given fields substituted.
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param gestureSource the new gesture source.
+     * @param gestureTarget the new gesture target.
+     * @param eventType the new eventType
+     * @return the event copy with the fields
      */
-    @Deprecated
-    public static DragEvent impl_copy(Object source, EventTarget target,
-            DragEvent evt, EventType<DragEvent> eventType) {
-        return impl_copy(source, target, evt.getGestureSource(),
-                evt.getGestureTarget(), evt, eventType);
+    public DragEvent copyFor(Object source, EventTarget target,
+            Object gestureSource, Object gestureTarget,
+            EventType<DragEvent> eventType) {
+
+        return copyFor(source, target, gestureSource, gestureTarget, getTransferMode(), eventType);
     }
 
     /**
      * Creates a copy of the given drag event with the given fields substituted.
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param gestureSource the new gesture source of the copied event.
+     * @param gestureTarget the new gesture target of the copied event.
+     * @param transferMode the new transfer mde
+     * @param eventType the new eventType
+     * @return the event copy with the fields
      */
-    @Deprecated
-    public static DragEvent impl_copy(Object source, EventTarget target,
-            Object gestureSource, Object gestureTarget, DragEvent evt,
+    public DragEvent copyFor(Object source, EventTarget target,
+            Object gestureSource, Object gestureTarget, TransferMode transferMode,
             EventType<DragEvent> eventType) {
 
-        return impl_copy(source, target, gestureSource, gestureTarget,
-                evt.getTransferMode(), evt, eventType);
-    }
-
-    /**
-     * Creates a copy of the given drag event with the given fields substituted.
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public static DragEvent impl_copy(Object source, EventTarget target,
-            Object gestureSource, Object gestureTarget, TransferMode transferMode,
-            DragEvent evt, EventType<DragEvent> eventType) {
-
-        DragEvent copyEvent = impl_dragEvent(source, target, gestureSource,
-                gestureTarget, evt.x, evt.y, evt.screenX,
-                evt.screenY, evt.transferMode,
-                (eventType != null
-                        ? eventType
-                        : (EventType<? extends DragEvent>)
-                                evt.getEventType()), evt.dragboard);
-
-        evt.recomputeCoordinatesToSource(copyEvent, source);
-        copyEvent.transferMode = transferMode;
-        if (eventType == DragEvent.DRAG_DROPPED ||
-                eventType == DragEvent.DRAG_DONE) {
+        DragEvent copyEvent = copyFor(source, target, eventType);
+        recomputeCoordinatesToSource(copyEvent, source);
+        if (transferMode != null) {
+            copyEvent.transferMode = transferMode;
+        }
+        copyEvent.gestureSource = gestureSource;
+        copyEvent.gestureTarget = gestureTarget;
+        if (eventType == DragEvent.DRAG_DROPPED
+                || eventType == DragEvent.DRAG_DONE) {
             copyEvent.state.accepted = transferMode != null;
             copyEvent.state.acceptedTrasferMode = transferMode;
         }
         return copyEvent;
     }
 
-    private static DragEvent impl_dragEvent(Object _source, EventTarget _target,
-            Object _gestureSource, Object _gestureTarget,
-            double _x, double _y,
-            double _screenX, double _screenY, TransferMode _transferMode,
-            EventType<? extends DragEvent> _eventType, Dragboard _dragboard)
-    {
-        DragEvent e = new DragEvent(_source, _target, _eventType);
-        e.gestureSource = _gestureSource;
-        e.gestureTarget = _gestureTarget;
-        e.x = _x;
-        e.y = _y;
-        e.screenX = _screenX;
-        e.screenY = _screenY;
-        e.sceneX = _x;
-        e.sceneY = _y;
-        e.transferMode = _transferMode;
-        e.dragboard = _dragboard;
-        return e;
+    /**
+     * Constructs new DragEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param dragboard the dragboard of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param transferMode the transfer mode of the event.
+     * @param gestureSource the source of the DnD gesture of the event.
+     * @param gestureTarget the target of the DnD gesture of the event.
+     */
+    public DragEvent(Object source, EventTarget target, EventType<DragEvent> eventType, Dragboard dragboard,
+            double x, double y,
+            double screenX, double screenY, TransferMode transferMode,
+            Object gestureSource, Object gestureTarget) {
+        super(source, target, eventType);
+        this.gestureSource = gestureSource;
+        this.gestureTarget = gestureTarget;
+        this.x = x;
+        this.y = y;
+        this.screenX = screenX;
+        this.screenY = screenY;
+        this.sceneX = x;
+        this.sceneY = y;
+        this.transferMode = transferMode;
+        this.dragboard = dragboard;
+    }
+
+    /**
+     * Constructs new DragEvent event with empty source and target.
+     * @param eventType The type of the event.
+     * @param dragboard the dragboard of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param transferMode the transfer mode of the event.
+     * @param gestureSource the source of the DnD gesture of the event.
+     * @param gestureTarget the target of the DnD gesture of the event.
+     */
+    public DragEvent(EventType<DragEvent> eventType, Dragboard dragboard,
+            double x, double y,
+            double screenX, double screenY, TransferMode transferMode,
+            Object gestureSource, Object gestureTarget) {
+        this(null, null, eventType, dragboard, x, y, screenX, screenY, transferMode,
+                gestureSource, gestureTarget);
     }
 
     /**
@@ -413,17 +429,35 @@
     }
     
     @Override
-    public Event copyFor(Object newSource, EventTarget newTarget) {
+    public DragEvent copyFor(Object newSource, EventTarget newTarget) {
         DragEvent e = (DragEvent) super.copyFor(newSource, newTarget);
         recomputeCoordinatesToSource(e, newSource);
         return e;
     }
 
     /**
+     * Creates a copy of the given drag event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param eventType the new eventType
+     * @return the event copy with the fields
+     */
+    public DragEvent copyFor(Object source, EventTarget target, EventType<DragEvent> type) {
+        DragEvent e = (DragEvent) copyFor(source, target);
+        e.eventType = type;
+        return e;
+    }
+
+    @Override
+    public EventType<DragEvent> getEventType() {
+        return (EventType<DragEvent>) super.getEventType();
+    }
+
+    /**
      * Horizontal x position of the event relative to the
      * origin of the MouseEvent's node.
      */
-    private double x;
+    private transient double x;
 
     /**
      * Horizontal position of the event relative to the
@@ -440,7 +474,7 @@
      * Vertical y position of the event relative to the
      * origin of the MouseEvent's node.
      */
-    private double y;
+    private transient double y;
 
     /**
      * Vertical position of the event relative to the
@@ -456,7 +490,7 @@
     /**
      * Absolute horizontal x position of the event.
      */
-    private double screenX;
+    private final double screenX;
 
     /**
      * Returns absolute horizontal position of the event.
@@ -469,7 +503,7 @@
     /**
      * Absolute vertical y position of the event.
      */
-    private double screenY;
+    private final double screenY;
 
     /**
      * Returns absolute vertical position of the event.
@@ -485,7 +519,7 @@
      * If the node is not in a {@code Scene}, then the value is relative to
      * the boundsInParent of the root-most parent of the DragEvent's node.
      */
-    private double sceneX;
+    private final double sceneX;
 
     /**
      * Returns horizontal position of the event relative to the
@@ -506,7 +540,7 @@
      * If the node is not in a {@code Scene}, then the value is relative to
      * the boundsInParent of the root-most parent of the DragEvent's node.
      */
-    private double sceneY;
+    private final double sceneY;
 
     /**
      * Returns vertical position of the event relative to the
@@ -552,7 +586,7 @@
     public final TransferMode getTransferMode() { return transferMode; }
     private TransferMode transferMode;
 
-    private State state = new State();
+    private final State state = new State();
 
     /**
      * Indicates if this event has been accepted.
@@ -570,11 +604,10 @@
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * The object that accepted the drag.
+     * @return the object that accepted the drag.
      */
-    @Deprecated
-    public Object impl_getAcceptingObject() {
+    public final Object getAcceptingObject() {
         return state.acceptingObject;
     }
 
@@ -681,52 +714,11 @@
         return state.dropCompleted;
     }
 
-    /**
-     * Used by toolkit
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public static DragEvent impl_create(double _x, double _y, double _screenX, double _screenY,
-                                        TransferMode _transferMode, Dragboard _dragboard)
-    {
-        DragEvent de = new DragEvent(DragEvent.ANY);
-
-        de.x = _x;
-        de.y = _y;
-        de.screenX = _screenX;
-        de.screenY = _screenY;
-        de.sceneX = _x;
-        de.sceneY = _y;
-        de.transferMode = _transferMode;
-        de.dragboard = _dragboard;
-        return de;
-    }
-
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public static DragEvent impl_create(EventType<DragEvent> _eventType,
-            Object _source, EventTarget _target, Object _gestureSource,
-            Object _gestureTarget, double _x, double _y,
-            double _screenX, double _screenY, TransferMode _transferMode,
-            Dragboard _dragboard)
-    {
-        DragEvent de = new DragEvent(_source, _target, _eventType);
-
-        de.gestureSource = _gestureSource;
-        de.gestureTarget = _gestureTarget;
-        de.x = _x;
-        de.y = _y;
-        de.screenX = _screenX;
-        de.screenY = _screenY;
-        de.sceneX = _x;
-        de.sceneY = _y;
-        de.transferMode = _transferMode;
-        de.dragboard = _dragboard;
-        return de;
+    private void readObject(java.io.ObjectInputStream in)
+            throws IOException, ClassNotFoundException {
+        in.defaultReadObject();
+        x = sceneX;
+        y = sceneY;
     }
 
     /**
--- a/javafx-ui-common/src/javafx/scene/input/GestureEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/GestureEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -55,9 +55,11 @@
     /**
      * Creates a new instance of {@code GestureEvent}.
      * @param eventType Type of the event
+     * @deprecated Do not use this constructor. Constructs empty event.
      */
+    @Deprecated
     protected GestureEvent(final EventType<? extends GestureEvent> eventType) {
-        super(eventType);
+        this(eventType, 0, 0, 0, 0, false, false, false, false, false, false);
     }
 
     /**
@@ -65,17 +67,37 @@
      * @param source Event source
      * @param target Event target
      * @param eventType Type of the event
+     * @deprecated Do not use this constructor. Constructs empty event.
      */
+    @Deprecated
     protected GestureEvent(Object source, EventTarget target,
             final EventType<? extends GestureEvent> eventType) {
         super(source, target, eventType);
+        x = y = screenX = screenY = sceneX = sceneY = 0;
+        shiftDown = controlDown = altDown = metaDown = direct = inertia = false;
     }
 
-    GestureEvent(final EventType<? extends GestureEvent> eventType,
+    /**
+     * Constructs new GestureEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param inertia if represents inertia of an already finished gesture.
+     */
+    protected GestureEvent(Object source, EventTarget target, final EventType<? extends GestureEvent> eventType,
             double x, double y, double screenX, double screenY,
             boolean shiftDown, boolean controlDown, boolean altDown,
             boolean metaDown, boolean direct, boolean inertia) {
-        super(eventType);
+        super(source, target, eventType);
         this.x = x;
         this.y = y;
         this.screenX = screenX;
@@ -91,6 +113,27 @@
     }
 
     /**
+     * Constructs new GestureEvent event with empty source and target
+     * @param eventType The type of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param inertia if represents inertia of an already finished gesture.
+     */
+    protected GestureEvent(final EventType<? extends GestureEvent> eventType,
+            double x, double y, double screenX, double screenY,
+            boolean shiftDown, boolean controlDown, boolean altDown,
+            boolean metaDown, boolean direct, boolean inertia) {
+        this(null, null, eventType, x, y, screenX, screenY, shiftDown, controlDown, altDown, metaDown, direct, inertia);
+    }
+
+    /**
      * Fills the given event by this event's coordinates recomputed to the given
      * source object.
      * @param newEvent Event whose coordinates are to be filled
@@ -109,34 +152,12 @@
      * @inheritDoc
      */
     @Override
-    public Event copyFor(Object newSource, EventTarget newTarget) {
+    public GestureEvent copyFor(Object newSource, EventTarget newTarget) {
         GestureEvent e = (GestureEvent) super.copyFor(newSource, newTarget);
         recomputeCoordinatesToSource(e, newSource);
         return e;
     }
 
-    /**
-     * Copies all private fields (except of event type) from one event to
-     * another event. This is for implementing impl_copy in subclasses.
-     */
-    static void copyFields(GestureEvent from, GestureEvent to,
-            Object source, EventTarget target) {
-        to.x = from.x;
-        to.y = from.y;
-        to.screenX = from.screenX;
-        to.screenY = from.screenY;
-        to.sceneX = from.sceneX;
-        to.sceneY = from.sceneY;
-        to.shiftDown = from.shiftDown;
-        to.controlDown = from.controlDown;
-        to.altDown = from.altDown;
-        to.metaDown = from.metaDown;
-        to.source = source;
-        to.target = target;
-
-        from.recomputeCoordinatesToSource(to, source);
-    }
-
     private transient double x;
 
     /**
@@ -167,7 +188,7 @@
         return y;
     }
 
-    private double screenX;
+    private final double screenX;
 
     /**
      * Gets the absolute horizontal position of the event.
@@ -179,7 +200,7 @@
         return screenX;
     }
 
-    private double screenY;
+    private final double screenY;
 
     /**
      * Gets the absolute vertical position of the event.
@@ -191,7 +212,7 @@
         return screenY;
     }
 
-    private double sceneX;
+    private final double sceneX;
 
     /**
      * Gets the horizontal position of the event relative to the
@@ -208,7 +229,7 @@
         return sceneX;
     }
 
-    private double sceneY;
+    private final double sceneY;
 
     /**
      * Gets the vertical position of the event relative to the
@@ -225,7 +246,7 @@
         return sceneY;
     }
 
-    private boolean shiftDown;
+    private final boolean shiftDown;
 
     /**
      * Indicates whether or not the Shift modifier is down on this event.
@@ -235,7 +256,7 @@
         return shiftDown;
     }
 
-    private boolean controlDown;
+    private final boolean controlDown;
 
     /**
      * Indicates whether or not the Control modifier is down on this event.
@@ -245,7 +266,7 @@
         return controlDown;
     }
 
-    private boolean altDown;
+    private final boolean altDown;
 
     /**
      * Indicates whether or not the Alt modifier is down on this event.
@@ -255,7 +276,7 @@
         return altDown;
     }
 
-    private boolean metaDown;
+    private final boolean metaDown;
 
     /**
      * Indicates whether or not the Meta modifier is down on this event.
@@ -265,7 +286,7 @@
         return metaDown;
     }
 
-    private boolean direct;
+    private final boolean direct;
 
     /**
      * Indicates whether this gesture is caused by a direct or indirect input
@@ -280,7 +301,7 @@
         return direct;
     }
 
-    private boolean inertia;
+    private final boolean inertia;
 
     /**
      * Indicates if this event represents an inertia of an already finished
@@ -363,4 +384,9 @@
         x = sceneX;
         y = sceneY;
     }
+
+    @Override
+    public EventType<? extends GestureEvent> getEventType() {
+        return (EventType<? extends GestureEvent>) super.getEventType();
+    }
 }
--- a/javafx-ui-common/src/javafx/scene/input/InputEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/InputEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -58,4 +58,10 @@
                       final EventType<? extends InputEvent> eventType) {
         super(source, target, eventType);
     }
+
+    @Override
+    public EventType<? extends InputEvent> getEventType() {
+        return (EventType<? extends InputEvent>) super.getEventType();
+    }
+    
 }
--- a/javafx-ui-common/src/javafx/scene/input/InputMethodEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/InputMethodEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -25,6 +25,7 @@
 
 package javafx.scene.input;
 
+import java.util.List;
 import javafx.collections.FXCollections;
 import javafx.collections.ObservableList;
 import javafx.event.EventTarget;
@@ -47,47 +48,44 @@
  * {@link javafx.application.ConditionalFeature#INPUT_METHOD ConditionalFeature.INPUT_METHOD}
  * for more information.
  */
-public class InputMethodEvent extends InputEvent {
+public final class InputMethodEvent extends InputEvent{
     /**
      * The only valid EventType for the InputMethodEvent.
      */
     public static final EventType<InputMethodEvent> INPUT_METHOD_TEXT_CHANGED =
             new EventType<InputMethodEvent>(InputEvent.ANY, "INPUT_METHOD_TEXT_CHANGED");
 
-    private InputMethodEvent(final EventType<? extends InputMethodEvent> eventType) {
-        super(eventType);
-    }
-
-    private InputMethodEvent(final Object source,
-                             final EventTarget target,
-                             final EventType<? extends InputMethodEvent> eventType) {
+    /**
+     * Constructs new InputMethodEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param composed the text under composition
+     * @param committed the text that is committed as a result of composition
+     * @param caretPosition the current position of the caret.
+     */
+    public InputMethodEvent(Object source, EventTarget target, EventType<InputMethodEvent> eventType,
+            List<InputMethodTextRun> composed, String committed,
+            int caretPosition) {
         super(source, target, eventType);
+        this.composed = FXCollections.unmodifiableObservableList(FXCollections.observableArrayList(composed));
+        this.committed = committed;
+        this.caretPosition = caretPosition;
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new InputMethodEvent event with empty source and target.
+     * @param eventType The type of the event.
+     * @param composed the text under composition
+     * @param committed the text that is committed as a result of composition
+     * @param caretPosition the current position of the caret.
      */
-    @Deprecated
-    public static InputMethodEvent impl_copy(EventTarget target,
-                                             InputMethodEvent evt) {
-        return (InputMethodEvent) evt.copyFor(evt.source, target);
+    public InputMethodEvent(EventType<InputMethodEvent> eventType,
+            List<InputMethodTextRun> composed, String committed,
+            int caretPosition) {
+        this(null, null, eventType, composed, committed, caretPosition);
     }
-
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public static InputMethodEvent impl_inputMethodEvent(EventTarget target,
-            ObservableList<InputMethodTextRun> composed, String committed,
-            int caretPosition, EventType<? extends InputMethodEvent> eventType) {
-        InputMethodEvent e = new InputMethodEvent(null, target, eventType);
-        e.getComposed().addAll(composed);
-        e.committed = committed;
-        e.caretPosition = caretPosition;
-        return e;
-    }
+    
 
     /**
      * The text under composition.  This text should be displayed with the
@@ -96,7 +94,7 @@
      *
      * @defaultValue null
      */
-    private ObservableList<InputMethodTextRun> composed;
+    private final ObservableList<InputMethodTextRun> composed;
 
     /**
      * Gets the text under composition.  This text should be displayed with the
@@ -106,9 +104,6 @@
      * @return The text under composition
      */
     public final ObservableList<InputMethodTextRun> getComposed() {
-        if (composed == null) {
-            composed = FXCollections.observableArrayList();
-        }
         return composed;
     }
 
@@ -118,7 +113,7 @@
      *
      * @defaultValue empty string
      */
-    private String committed = "";
+    private final String committed;
 
     /**
      * Gets the text that is committed by the input method as the result of the
@@ -136,7 +131,7 @@
      *
      * @defaultValue 0
      */
-    private int caretPosition;
+    private final int caretPosition;
 
     /**
      * The input method caret position within the composed text.
@@ -167,4 +162,16 @@
         return sb.append("]").toString();
     }
 
+    @Override
+    public InputMethodEvent copyFor(Object newSource, EventTarget newTarget) {
+        return (InputMethodEvent) super.copyFor(newSource, newTarget);
+    }
+
+    @Override
+    public EventType<InputMethodEvent> getEventType() {
+        return (EventType<InputMethodEvent>) super.getEventType();
+    }
+    
+    
+
 }
--- a/javafx-ui-common/src/javafx/scene/input/InputMethodTextRun.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/InputMethodTextRun.java	Tue Nov 06 09:39:13 2012 -0800
@@ -35,25 +35,24 @@
  * {@link javafx.application.ConditionalFeature#INPUT_METHOD ConditionalFeature.INPUT_METHOD}
  * for more information.
  */
-public class InputMethodTextRun implements Serializable{
+public class InputMethodTextRun implements Serializable {
+
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs a single text run of an input method.
+     * @param text the text in the text run
+     * @param highlight the highlighting of the text
      */
-    @Deprecated
-    public static InputMethodTextRun impl_inputMethodTextRun(String text,
+    public InputMethodTextRun(String text,
             InputMethodHighlight highlight) {
-        InputMethodTextRun run = new InputMethodTextRun();
-        run.text = text;
-        run.highlight = highlight;
-        return run;
+        this.text = text;
+        this.highlight = highlight;
     }
     /**
      * The text in this run.
      *
      * @defaultValue empty string
      */
-    private String text = "";
+    private final String text;
 
     /**
      * Gets the text in this run.
@@ -67,7 +66,7 @@
      *
      * @defaultValue null
      */
-    private InputMethodHighlight highlight;
+    private final InputMethodHighlight highlight;
 
     /**
      * Gets the highlight used for displaying this text.
--- a/javafx-ui-common/src/javafx/scene/input/KeyCode.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/KeyCode.java	Tue Nov 06 09:39:13 2012 -0800
@@ -1323,16 +1323,7 @@
         }
     }
 
-    /**
-     * Returns KeyCode object for the given numeric code
-     * @param code Numeric code of the key
-     * @return KeyCode object for the given numeric code, null if no such key
-     *                 code exists
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    static KeyCode impl_valueOf(int code) {
+    static KeyCode valueOf(int code) {
         return charMap.get(code);
     }
 
--- a/javafx-ui-common/src/javafx/scene/input/KeyEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/KeyEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -32,6 +32,7 @@
 
 import com.sun.javafx.robot.impl.FXRobotHelper;
 import com.sun.javafx.robot.impl.FXRobotHelper.FXRobotInputAccessor;
+import javafx.event.Event;
 import javafx.scene.input.ScrollEvent.HorizontalTextScrollUnits;
 import javafx.scene.input.ScrollEvent.VerticalTextScrollUnits;
 
@@ -80,7 +81,7 @@
  * <p>
  * For triggering context menus see the {@link ContextMenuEvent}.
  */
-public class KeyEvent extends InputEvent {
+public final class KeyEvent extends InputEvent {
     /**
      * Common supertype for all key event types.
      */
@@ -107,23 +108,13 @@
     public static final EventType<KeyEvent> KEY_TYPED =
             new EventType<KeyEvent>(KeyEvent.ANY, "KEY_TYPED");
 
-    private KeyEvent(final EventType<? extends KeyEvent> eventType) {
-        super(eventType);
-    }
-
-    private KeyEvent(final Object source,
-                     final EventTarget target,
-                     final EventType<? extends KeyEvent> eventType) {
-        super(source, target, eventType);
-    }
-
     static {
         FXRobotInputAccessor a = new FXRobotInputAccessor() {
             @Override public int getCodeForKeyCode(KeyCode keyCode) {
                 return keyCode.code;
             }
             @Override public KeyCode getKeyCodeForCode(int code) {
-                return KeyCode.impl_valueOf(code);
+                return KeyCode.valueOf(code);
             }
             @Override public KeyEvent createKeyEvent(
                 EventType<? extends KeyEvent> eventType,
@@ -131,15 +122,8 @@
                 boolean shiftDown, boolean controlDown,
                 boolean altDown, boolean metaDown)
             {
-                KeyEvent e = new KeyEvent(eventType);
-                e.character = character;
-                e.code = code;
-                e.text = text;
-                e.shiftDown = shiftDown;
-                e.controlDown = controlDown;
-                e.altDown = altDown;
-                e.metaDown = metaDown;
-                return e;
+                return new KeyEvent((EventType<KeyEvent>)eventType, character, text, code,
+                        shiftDown, controlDown, altDown, metaDown);
             }
             @Override public MouseEvent createMouseEvent(
                 EventType<? extends MouseEvent> eventType,
@@ -149,19 +133,19 @@
                 boolean popupTrigger, boolean primaryButtonDown,
                 boolean middleButtonDown, boolean secondaryButtonDown)
             {
-                return MouseEvent.impl_mouseEvent(x, y,
+                return new MouseEvent(eventType, x, y,
                                            screenX, screenY,
                                            button, clickCount,
                                            shiftDown,
                                            controlDown,
                                            altDown,
                                            metaDown,
-                                           popupTrigger,
                                            primaryButtonDown,
                                            middleButtonDown,
                                            secondaryButtonDown,
                                            false,
-                                           eventType);
+                                           popupTrigger
+                                           );
             }
 
             @Override
@@ -173,46 +157,87 @@
                     int x, int y, int screenX, int screenY, 
                     boolean shiftDown, boolean controlDown, 
                     boolean altDown, boolean metaDown) {
-                return ScrollEvent.impl_scrollEvent(ScrollEvent.SCROLL, 
+                return new ScrollEvent(ScrollEvent.SCROLL,
+                        x, y, screenX, screenY, 
+                        shiftDown, controlDown, altDown, metaDown, false, false,
                         scrollX, scrollY, 0, 0,
                         xTextUnits, xText, yTextUnits, yText,
-                        0,
-                        x, y, screenX, screenY, 
-                        shiftDown, controlDown, altDown, metaDown, false, false);
+                        0);
             }
         };
         FXRobotHelper.setInputAccessor(a);
     }
 
+
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new KeyEvent event with null source and target.
+     * @param eventType The type of the event.
+     * @param character The character or sequence of characters associated with the event
+     * @param text A String describing the key code
+     * @param code The integer key code
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
      */
-    @Deprecated
-    public static KeyEvent impl_copy(EventTarget target, KeyEvent evt) {
-        return (KeyEvent) evt.copyFor(evt.source, target);
+    public KeyEvent(EventType<KeyEvent> eventType, String character,
+            String text, int code, boolean shiftDown, boolean controlDown,
+            boolean altDown, boolean metaDown) {
+        this(null, null, eventType, character, text, code, shiftDown, controlDown, altDown, metaDown);
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new KeyEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param character The character or sequence of characters associated with the event
+     * @param text A String describing the key code
+     * @param code The integer key code
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
      */
-    @Deprecated
-    public static KeyEvent impl_keyEvent(EventTarget target, String character,
+    public KeyEvent(Object source, EventTarget target, EventType<KeyEvent> eventType, String character,
             String text, int code, boolean shiftDown, boolean controlDown,
-            boolean altDown, boolean metaDown, 
-            EventType<? extends KeyEvent> eventType) {
+            boolean altDown, boolean metaDown) {
+        super(source, target, eventType);
         boolean isKeyTyped = eventType == KEY_TYPED;
 
-        KeyEvent e = new KeyEvent(null, target, eventType);
-        e.character = isKeyTyped ? character : KeyEvent.CHAR_UNDEFINED;
-        e.text = isKeyTyped ? "" : text;
-        e.code = isKeyTyped ? KeyCode.UNDEFINED : KeyCode.impl_valueOf(code);
-        e.shiftDown = shiftDown;
-        e.controlDown = controlDown;
-        e.altDown = altDown;
-        e.metaDown = metaDown;
-        return e;
+        this.character = isKeyTyped ? character : KeyEvent.CHAR_UNDEFINED;
+        this.text = isKeyTyped ? "" : text;
+        this.code = isKeyTyped ? KeyCode.UNDEFINED : KeyCode.valueOf(code);
+        this.shiftDown = shiftDown;
+        this.controlDown = controlDown;
+        this.altDown = altDown;
+        this.metaDown = metaDown;
+    }
+
+    /**
+     * Constructs new KeyEvent event with null source and target and KeyCode object directly specified.
+     * @param eventType The type of the event.
+     * @param character The character or sequence of characters associated with the event
+     * @param text A String describing the key code
+     * @param code The integer key code
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     */
+    public KeyEvent(EventType<KeyEvent> eventType, String character,
+            String text, KeyCode code, boolean shiftDown, boolean controlDown,
+            boolean altDown, boolean metaDown) {
+        super(eventType);
+        boolean isKeyTyped = eventType == KEY_TYPED;
+
+        this.character = isKeyTyped ? character : KeyEvent.CHAR_UNDEFINED;
+        this.text = isKeyTyped ? "" : text;
+        this.code = isKeyTyped ? KeyCode.UNDEFINED : code;
+        this.shiftDown = shiftDown;
+        this.controlDown = controlDown;
+        this.altDown = altDown;
+        this.metaDown = metaDown;
     }
 
     /**
@@ -220,25 +245,7 @@
      * character use this for the keyChar value.
      */
     public static final String CHAR_UNDEFINED = KeyCode.UNDEFINED.ch;
-
-    /**
-     * For use by unit testing
-     * @treatAsPrivate implementation detail
-     */
-    static KeyEvent testKeyEvent(EventTarget target, String character,
-            KeyCode code, boolean shiftDown, boolean controlDown,
-            boolean altDown, boolean metaDown)
-    {
-        KeyEvent e = new KeyEvent(null, target, KEY_PRESSED);
-        e.character = character;
-        e.code = code;
-        e.shiftDown = shiftDown;
-        e.controlDown = controlDown;
-        e.altDown = altDown;
-        e.metaDown = metaDown;
-        return e;
-    }
-
+    
     /**
      * The Unicode character or sequence of characters associated with the key
      * typed event. Contains multiple elements if the key produced a single
@@ -251,7 +258,7 @@
      * For key pressed and key released events, {@code character} is always
      * {@code CHAR_UNDEFINED}.
      */
-    private String character;
+    private final String character;
 
     /**
      * The Unicode character or sequence of characters associated with the key
@@ -276,7 +283,7 @@
      * for key pressed and key released events.
      * For key typed events, {@code text} is always the empty string.
      */
-    private String text;
+    private final String text;
 
     /**
      * A String describing the key code, such as "HOME", "F1" or "A",
@@ -294,7 +301,7 @@
      * pressed or key released event.
      * For key typed events, {@code code} is always {@code KeyCode.UNDEFINED}.
      */
-    private KeyCode code;
+    private final KeyCode code;
 
     /**
      * The key code associated with the key in this key pressed or key released 
@@ -310,7 +317,7 @@
     /**
      * Returns whether or not the Shift modifier is down on this event.
      */
-    private boolean shiftDown;
+    private final boolean shiftDown;
 
     /**
      * Returns whether or not the Shift modifier is down on this event.
@@ -323,7 +330,7 @@
     /**
      * Returns whether or not the Control modifier is down on this event.
      */
-    private boolean controlDown;
+    private final boolean controlDown;
 
     /**
      * Returns whether or not the Control modifier is down on this event.
@@ -336,7 +343,7 @@
     /**
      * Returns whether or not the Alt modifier is down on this event.
      */
-    private boolean altDown;
+    private final boolean altDown;
 
     /**
      * Returns whether or not the Alt modifier is down on this event.
@@ -349,7 +356,7 @@
     /**
      * Returns whether or not the Meta modifier is down on this event.
      */
-    private boolean metaDown;
+    private final boolean metaDown;
 
     /**
      * Returns whether or not the Meta modifier is down on this event.
@@ -423,4 +430,29 @@
         return sb.append("]").toString();
     }
 
+    @Override
+    public KeyEvent copyFor(Object newSource, EventTarget newTarget) {
+        return (KeyEvent) super.copyFor(newSource, newTarget);
+    }
+
+    /**
+     * Creates a copy of the given event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param type the new event type.
+     * @return the event copy with the fields substituted
+     */
+    public KeyEvent copyFor(Object source, EventTarget target, EventType<KeyEvent> type) {
+        KeyEvent e = copyFor(source, target);
+        e.eventType = type;
+        return e;
+    }
+
+    @Override
+    public EventType<KeyEvent> getEventType() {
+        return (EventType<KeyEvent>) super.getEventType();
+    }
+    
+    
+
 }
--- a/javafx-ui-common/src/javafx/scene/input/MouseDragEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/MouseDragEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -52,7 +52,7 @@
  * The entered/exited events behave similarly to mouse entered/exited
  * events, please see {@link MouseEvent} overview.
  */
-public class MouseDragEvent extends MouseEvent {
+public final class MouseDragEvent extends MouseEvent{
 
     /**
      * Common supertype for all mouse event types.
@@ -123,28 +123,77 @@
             new EventType<MouseDragEvent>(MouseDragEvent.MOUSE_DRAG_EXITED_TARGET,
                     "MOUSE-DRAG_EXITED");
 
-    private MouseDragEvent(Object source, EventTarget target,
-            EventType<? extends MouseEvent> eventType) {
-        super(source, target, eventType);
+    /**
+     * Constructs new MouseDragEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param button the mouse button used
+     * @param clickCount number of click counts
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param primaryButtonDown true if primary button was pressed.
+     * @param middleButtonDown true if middle button was pressed.
+     * @param secondaryButtonDown true if secondary button was pressed.
+     * @param synthesized if this event was synthesized
+     * @param popupTrigger whether this event denotes a popup trigger for current platform
+     * @param gestureSource source object of the ongoing gesture.
+     */
+    public MouseDragEvent(Object source, EventTarget target, EventType<MouseDragEvent> eventType,
+            double x, double y, double screenX, double screenY,
+            MouseButton button, int clickCount,
+            boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown,
+            boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown,
+            boolean synthesized, boolean popupTrigger,
+            Object gestureSource) {
+        super(source, target, eventType, x, y, screenX, screenY, button,
+                clickCount, shiftDown, controlDown, altDown, metaDown,
+                primaryButtonDown, middleButtonDown, secondaryButtonDown,
+                synthesized, popupTrigger, false);
+        this.gestureSource = gestureSource;
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new MouseDragEvent event with null source and target.
+     *
+     * @param eventType The type of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param button the mouse button used
+     * @param clickCount number of click counts
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param primaryButtonDown true if primary button was pressed.
+     * @param middleButtonDown true if middle button was pressed.
+     * @param secondaryButtonDown true if secondary button was pressed.
+     * @param synthesized if this event was synthesized
+     * @param popupTrigger whether this event denotes a popup trigger for current platform
+     * @param gestureSource source object of the ongoing gesture.
      */
-    @Deprecated
-    public static MouseEvent impl_copy(Object source, EventTarget target,
-            Object gestureSource, MouseEvent evt,
-            EventType<? extends MouseEvent> eventType) {
+    public MouseDragEvent(EventType<MouseDragEvent> eventType,
+            double x, double y, double screenX, double screenY,
+            MouseButton button, int clickCount,
+            boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown,
+            boolean primaryButtonDown, boolean middleButtonDown, boolean secondaryButtonDown,
+            boolean synthesized, boolean popupTrigger,
+            Object gestureSource) {
+        this(null, null, eventType, x, y, screenX, screenY, button, clickCount,
+                shiftDown, controlDown, altDown, metaDown, primaryButtonDown,
+                middleButtonDown, secondaryButtonDown, synthesized, popupTrigger, gestureSource);
+     }
 
-        MouseDragEvent copyEvent = new MouseDragEvent(source, target, eventType);
-        MouseEvent.copyFields(evt, copyEvent, source, target);
-        copyEvent.gestureSource = gestureSource;
-
-        return copyEvent;
-    }
-
-    private transient Object gestureSource;
+   
+    private final transient Object gestureSource;
 
     /**
      * Returns the source object of the ongoing gesture.
@@ -207,4 +256,19 @@
 
         return sb.append("]").toString();
     }
+
+    @Override
+    public MouseDragEvent copyFor(Object newSource, EventTarget newTarget) {
+        return (MouseDragEvent) super.copyFor(newSource, newTarget);
+    }
+
+    @Override
+    public MouseDragEvent copyFor(Object newSource, EventTarget newTarget, EventType<? extends MouseEvent> type) {
+        return (MouseDragEvent) super.copyFor(newSource, newTarget, type);
+    }
+
+    @Override
+    public EventType<MouseDragEvent> getEventType() {
+        return (EventType<MouseDragEvent>) super.getEventType();
+    }
 }
--- a/javafx-ui-common/src/javafx/scene/input/MouseEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/MouseEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -241,42 +241,24 @@
     public static final EventType<MouseEvent> DRAG_DETECTED =
             new EventType<MouseEvent>(MouseEvent.ANY, "DRAG_DETECTED");
 
-    MouseEvent(final EventType<? extends MouseEvent> eventType) {
-        super(eventType);
-    }
-
-    MouseEvent(Object source, EventTarget target,
-            final EventType<? extends MouseEvent> eventType) {
-        super(source, target, eventType);
-    }
-
-    /**
-     * Creates a copy of the given mouse event, substituting the given node for
-     * the one in the original event. This function will also adjust the location
-     * properties (x, y, screenX, screenY, etc) such that the event is in values
-     * relative to the new source.
-     *
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public static MouseEvent impl_copy(Node source, Node target, MouseEvent evt) {
-         return impl_copy(source, target, evt, null);
-    }
-
     /**
      * Fills the given event by this event's coordinates recomputed to the given
      * source object
      * @param newEvent Event whose coordinates are to be filled
      * @param newSource Source object to compute coordinates for
      */
-    private void recomputeCoordinatesToSource(MouseEvent newEvent, Object newSource) {
+    void recomputeCoordinatesToSource(MouseEvent oldEvent, Object newSource) {
 
         final Point2D newCoordinates = InputEventUtils.recomputeCoordinates(
-                new Point2D(sceneX, sceneY), null, newSource);
+                new Point2D(oldEvent.x, oldEvent.y), oldEvent.source, newSource);
 
-        newEvent.x = newCoordinates.getX();
-        newEvent.y = newCoordinates.getY();
+        x = newCoordinates.getX();
+        y = newCoordinates.getY();
+    }
+
+    @Override
+    public EventType<? extends MouseEvent> getEventType() {
+        return (EventType<? extends MouseEvent>) super.getEventType();
     }
 
     /**
@@ -288,76 +270,26 @@
      * @return copy of this event for a different source and target
      */
     @Override
-    public Event copyFor(Object newSource, EventTarget newTarget) {
+    public MouseEvent copyFor(Object newSource, EventTarget newTarget) {
         MouseEvent e = (MouseEvent) super.copyFor(newSource, newTarget);
-        recomputeCoordinatesToSource(e, newSource);
+        e.recomputeCoordinatesToSource(this, newSource);
         return e;
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Creates a copy of the given event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param eventType the new eventType
+     * @return the event copy with the fields substituted
      */
-    @Deprecated
-    public void impl_setClickParams(int clickCount, boolean stillSincePress) {
-        this.clickCount = clickCount;
-        this.stillSincePress = stillSincePress;
+    public MouseEvent copyFor(Object newSource, EventTarget newTarget, EventType<? extends MouseEvent> eventType) {
+        MouseEvent e = copyFor(newSource, newTarget);
+        e.eventType = eventType;
+        return e;
     }
 
-    /**
-     * Copies all private fields (except of event type) from one event to
-     * another event. This is for implementing impl_copy in subclasses.
-     */
-    static void copyFields(MouseEvent from, MouseEvent to,
-            Object source, EventTarget target) {
-        to.x = from.x;
-        to.y = from.y;
-        to.screenX = from.screenX;
-        to.screenY = from.screenY;
-        to.sceneX = from.sceneX;
-        to.sceneY = from.sceneY;
-        to.button = from.button;
-        to.clickCount = from.clickCount;
-        to.stillSincePress = from.stillSincePress;
-        to.shiftDown = from.shiftDown;
-        to.controlDown = from.controlDown;
-        to.altDown = from.altDown;
-        to.metaDown = from.metaDown;
-        to.popupTrigger = from.popupTrigger;
-        to.primaryButtonDown = from.primaryButtonDown;
-        to.secondaryButtonDown = from.secondaryButtonDown;
-        to.middleButtonDown = from.middleButtonDown;
-        to.synthesized = from.synthesized;
-        to.source = source;
-        to.target = target;
-
-        from.recomputeCoordinatesToSource(to, source);
-    }
-
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public static MouseEvent impl_copy(Object source, EventTarget target, MouseEvent evt,
-            EventType<? extends MouseEvent> impl_EventType) {
-        MouseEvent copyEvent = impl_mouseEvent(source, target, evt.x, evt.y, evt.screenX,
-                evt.screenY, evt.button, evt.clickCount, evt.stillSincePress,
-                evt.shiftDown, evt.controlDown, evt.altDown, evt.metaDown,
-                evt.popupTrigger, evt.primaryButtonDown, evt.middleButtonDown,
-                evt.secondaryButtonDown, evt.synthesized,
-                (impl_EventType != null
-                        ? impl_EventType
-                        : (EventType<? extends MouseEvent>)
-                                evt.getEventType()));
-
-        copyEvent.sceneX = evt.sceneX;
-        copyEvent.sceneY = evt.sceneY;
-
-        evt.recomputeCoordinatesToSource(copyEvent, source);
-        return copyEvent;
-    }
-
+    //SB-dependency: RT-21224. Need to be sure that SB does use new API before removing this.
     /**
      * @treatAsPrivate implementation detail
      * @deprecated This is an internal API that is not intended for use and will be removed in the next version
@@ -377,87 +309,180 @@
           boolean _secondaryButtonDown,
           boolean _synthesized,
           EventType<? extends MouseEvent> _eventType
-          )
-    {
-        MouseEvent e = new MouseEvent(_eventType);
-        e.x = _x;
-        e.y = _y;
-        e.screenX = _screenX;
-        e.screenY = _screenY;
-        e.sceneX = _x;
-        e.sceneY = _y;
-        e.button = _button;
-        e.clickCount = _clickCount;
-        e.stillSincePress = false;
-        e.shiftDown = _shiftDown;
-        e.controlDown = _controlDown;
-        e.altDown = _altDown;
-        e.metaDown = _metaDown;
-        e.popupTrigger = _popupTrigger;
-        e.primaryButtonDown = _primaryButtonDown;
-        e.middleButtonDown = _middleButtonDown;
-        e.secondaryButtonDown = _secondaryButtonDown;
-        e.synthesized = _synthesized;
-        return e;
+          ) {
+        return new MouseEvent(
+                _eventType, _x, _y, _screenX, _screenY,
+                _button, _clickCount,
+                _shiftDown, _controlDown, _altDown, _metaDown,
+                _primaryButtonDown, _middleButtonDown, _secondaryButtonDown, _popupTrigger,
+                _synthesized);
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new MouseEvent event with null source and target.
+     * Still since press is set to false.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param button the mouse button used
+     * @param clickCount number of click counts
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param primaryButtonDown true if primary button was pressed.
+     * @param middleButtonDown true if middle button was pressed.
+     * @param secondaryButtonDown true if secondary button was pressed.
+     * @param synthesized if this event was synthesized
+     * @param popupTrigger whether this event denotes a popup trigger for current platform
      */
-    // SB-dependency: RT-21224 has been filed to track this
-    @Deprecated
-    private static MouseEvent impl_mouseEvent(Object _source, EventTarget _target,
-          double _x, double _y,
-          double _screenX, double _screenY,
-          MouseButton _button,
-          int _clickCount,
-          boolean _stillSincePress,
-          boolean _shiftDown,
-          boolean _controlDown,
-          boolean _altDown,
-          boolean _metaDown,
-          boolean _popupTrigger,
-          boolean _primaryButtonDown,
-          boolean _middleButtonDown,
-          boolean _secondaryButtonDown,
-          boolean _synthesized,
-          EventType<? extends MouseEvent> _eventType
-          )
-    {
-        MouseEvent e = new MouseEvent(_source, _target, _eventType);
-        e.x = _x;
-        e.y = _y;
-        e.screenX = _screenX;
-        e.screenY = _screenY;
-        e.sceneX = _x;
-        e.sceneY = _y;
-        e.button = _button;
-        e.clickCount = _clickCount;
-        e.stillSincePress = _stillSincePress;
-        e.shiftDown = _shiftDown;
-        e.controlDown = _controlDown;
-        e.altDown = _altDown;
-        e.metaDown = _metaDown;
-        e.popupTrigger = _popupTrigger;
-        e.primaryButtonDown = _primaryButtonDown;
-        e.middleButtonDown = _middleButtonDown;
-        e.secondaryButtonDown = _secondaryButtonDown;
-        e.synthesized = _synthesized;
-        return e;
+    public MouseEvent(
+            EventType<? extends MouseEvent> eventType,
+            double x, double y,
+            double screenX, double screenY,
+            MouseButton button,
+            int clickCount,
+            boolean shiftDown,
+            boolean controlDown,
+            boolean altDown,
+            boolean metaDown,
+            boolean primaryButtonDown,
+            boolean middleButtonDown,
+            boolean secondaryButtonDown,
+            boolean synthesized,
+            boolean popupTrigger) {
+        this(eventType, x, y, screenX, screenY, button, clickCount,
+                shiftDown, controlDown, altDown, metaDown,
+                primaryButtonDown, middleButtonDown, secondaryButtonDown,
+                synthesized, popupTrigger, false);
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new MouseEvent event with null source and target.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param button the mouse button used
+     * @param clickCount number of click counts
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param primaryButtonDown true if primary button was pressed.
+     * @param middleButtonDown true if middle button was pressed.
+     * @param secondaryButtonDown true if secondary button was pressed.
+     * @param synthesized if this event was synthesized
+     * @param popupTrigger whether this event denotes a popup trigger for current platform
+     * @param stillSincePress see {@link #isStillSincePress() }
      */
-    @Deprecated
-    public static boolean impl_getPopupTrigger(
-            final MouseEvent mouseEvent) {
-        return mouseEvent.popupTrigger;
+    public MouseEvent(
+            EventType<? extends MouseEvent> eventType,
+            double x, double y,
+            double screenX, double screenY,
+            MouseButton button,
+            int clickCount,
+            boolean shiftDown,
+            boolean controlDown,
+            boolean altDown,
+            boolean metaDown,
+            boolean primaryButtonDown,
+            boolean middleButtonDown,
+            boolean secondaryButtonDown,
+            boolean synthesized,
+            boolean popupTrigger,
+            boolean stillSincePress) {
+        this(null, null, eventType, x, y, screenX, screenY, button, clickCount,
+                shiftDown, controlDown, altDown, metaDown,
+                primaryButtonDown, middleButtonDown, secondaryButtonDown,
+                synthesized, popupTrigger, stillSincePress);
     }
 
-    private Flags flags = new Flags();
+    /**
+     * Constructs new MouseEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param button the mouse button used
+     * @param clickCount number of click counts
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param primaryButtonDown true if primary button was pressed.
+     * @param middleButtonDown true if middle button was pressed.
+     * @param secondaryButtonDown true if secondary button was pressed.
+     * @param synthesized if this event was synthesized
+     * @param popupTrigger whether this event denotes a popup trigger for current platform
+     * @param stillSincePress see {@link #isStillSincePress() }
+     */
+    public MouseEvent(Object source, EventTarget target,
+            EventType<? extends MouseEvent> eventType,
+            double x, double y,
+            double screenX, double screenY,
+            MouseButton button,
+            int clickCount,
+            boolean shiftDown,
+            boolean controlDown,
+            boolean altDown,
+            boolean metaDown,
+            boolean primaryButtonDown,
+            boolean middleButtonDown,
+            boolean secondaryButtonDown,
+            boolean synthesized,
+            boolean popupTrigger,
+            boolean stillSincePress) {
+        super(source, target, eventType);
+        this.x = x;
+        this.y = y;
+        this.screenX = screenX;
+        this.screenY = screenY;
+        this.sceneX = x;
+        this.sceneY = y;
+        this.button = button;
+        this.clickCount = clickCount;
+        this.shiftDown = shiftDown;
+        this.controlDown = controlDown;
+        this.altDown = altDown;
+        this.metaDown = metaDown;
+        this.primaryButtonDown = primaryButtonDown;
+        this.middleButtonDown = middleButtonDown;
+        this.secondaryButtonDown = secondaryButtonDown;
+        this.synthesized = synthesized;
+        this.stillSincePress = stillSincePress;
+        this.popupTrigger = popupTrigger;
+    }
+
+    /**
+     * Creates a copy of this mouse event of MouseDragEvent type
+     * @param e the mouse event to copy
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param type the new MouseDragEvent type
+     * @param gestureSource the new source of the gesture
+     * @return new MouseDragEvent that was created from MouseEvent
+     */
+    public static MouseDragEvent copyForMouseDragEvent(
+            MouseEvent e,
+            Object source, EventTarget target,
+            EventType<MouseDragEvent> type,
+            Object gestureSource) {
+        MouseDragEvent ev = new MouseDragEvent(source, target,
+                type, e.x, e.y, e.screenX, e.screenY,
+                e.button, e.clickCount, e.shiftDown, e.controlDown,
+                e.altDown, e.metaDown, e.primaryButtonDown, e.middleButtonDown,
+                e.secondaryButtonDown, e.synthesized, e.popupTrigger, gestureSource);
+        ev.recomputeCoordinatesToSource(e, source);
+        return ev;
+    }
+    private final Flags flags = new Flags();
 
     /**
      * Determines whether this event will be followed by {@code DRAG_DETECTED}
@@ -518,7 +543,7 @@
     /**
      * Absolute horizontal x position of the event.
      */
-    private double screenX;
+    private final double screenX;
 
     /**
      * Returns absolute horizontal position of the event.
@@ -531,7 +556,7 @@
     /**
      * Absolute vertical y position of the event.
      */
-    private double screenY;
+    private final double screenY;
 
     /**
      * Returns absolute vertical position of the event.
@@ -547,7 +572,7 @@
      * If the node is not in a {@code Scene}, then the value is relative to
      * the boundsInParent of the root-most parent of the MouseEvent's node.
      */
-    private double sceneX;
+    private final double sceneX;
 
     /**
      * Returns horizontal position of the event relative to the
@@ -568,7 +593,7 @@
      * If the node is not in a {@code Scene}, then the value is relative to
      * the boundsInParent of the root-most parent of the MouseEvent's node.
      */
-    private double sceneY;
+    private final double sceneY;
 
     /**
      * Returns vertical position of the event relative to the
@@ -586,7 +611,7 @@
     /**
      * Which, if any, of the mouse buttons is responsible for this event.
      */
-    private MouseButton button;
+    private final MouseButton button;
 
     /**
      * Which, if any, of the mouse buttons is responsible for this event.
@@ -607,7 +632,7 @@
      * presses happen on a small region and in a small time (according 
      * to native operating system configuration).
      */
-    private int clickCount;
+    private final int clickCount;
 
     /**
      * Returns number of mouse clicks associated with this event.
@@ -629,7 +654,7 @@
      * Whether the mouse cursor left the hysteresis region since the previous 
      * press.
      */
-    private boolean stillSincePress;
+    private final boolean stillSincePress;
     
     /**
      * Indicates whether the mouse cursor stayed in the system-provided 
@@ -655,7 +680,7 @@
     /**
      * Whether or not the Shift modifier is down on this event.
      */
-    private boolean shiftDown;
+    private final boolean shiftDown;
 
     /**
      * Whether or not the Shift modifier is down on this event.
@@ -668,7 +693,7 @@
     /**
      * Whether or not the Control modifier is down on this event.
      */
-    private boolean controlDown;
+    private final boolean controlDown;
 
     /**
      * Whether or not the Control modifier is down on this event.
@@ -681,7 +706,7 @@
     /**
      * Whether or not the Alt modifier is down on this event.
      */
-    private boolean altDown;
+    private final boolean altDown;
 
     /**
      * Whether or not the Alt modifier is down on this event.
@@ -694,7 +719,7 @@
     /**
      * Whether or not the Meta modifier is down on this event.
      */
-    private boolean metaDown;
+    private final boolean metaDown;
 
     /**
      * Whether or not the Meta modifier is down on this event.
@@ -704,7 +729,7 @@
         return metaDown;
     }
 
-    private boolean synthesized;
+    private final boolean synthesized;
 
     /**
      * Indicates whether this event is synthesized from using a touch screen
@@ -756,7 +781,11 @@
      * should be checked in both {@code onMousePressed}
      * and {@code mouseReleased} for proper cross-platform functionality.
      */
-    private boolean popupTrigger;
+    private final boolean popupTrigger;
+
+    public final boolean isPopupTrigger() {
+        return popupTrigger;
+    }
 
     /**
      * {@code true} if primary button (button 1, usually the left) is currently
@@ -765,7 +794,7 @@
      * responsible for this event while this variable indicates whether the
      * primary button is depressed.
      */
-    private boolean primaryButtonDown;
+    private final boolean primaryButtonDown;
 
     /**
      * Returns {@code true} if primary button (button 1, usually the left) 
@@ -788,7 +817,7 @@
      * responsible for this event while this variable indicates whether the
      * primary button is depressed.
      */
-    private boolean secondaryButtonDown;
+    private final boolean secondaryButtonDown;
 
     /**
      * Returns {@code true} if secondary button (button 1, usually the right) 
@@ -811,7 +840,7 @@
      * responsible for this event while this variable indicates whether the
      * middle button is depressed.
      */
-    private boolean middleButtonDown;
+    private final boolean middleButtonDown;
 
     /**
      * Returns {@code true} if middle button (button 2) 
--- a/javafx-ui-common/src/javafx/scene/input/RotateEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/RotateEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -56,7 +56,7 @@
  *
  * @since 2.2
  */
-public class RotateEvent extends GestureEvent {
+public final class RotateEvent extends GestureEvent {
 
     /**
      * Common supertype for all rotate event types.
@@ -83,17 +83,26 @@
     public static final EventType<RotateEvent> ROTATION_FINISHED =
             new EventType<RotateEvent>(RotateEvent.ANY, "ROTATION_FINISHED");
 
-    private RotateEvent(final EventType<? extends RotateEvent> eventType) {
-        super(eventType);
-    }
-
-    private RotateEvent(Object source, EventTarget target,
-            final EventType<? extends RotateEvent> eventType) {
-        super(source, target, eventType);
-    }
-
-    private RotateEvent(final EventType<? extends RotateEvent> eventType,
-            double angle, double totalAngle,
+    /**
+     * Constructs new RotateEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param inertia if represents inertia of an already finished gesture.
+     * @param angle the rotational angle
+     * @param totalAngle the cumulative rotational angle
+     */
+    public RotateEvent(Object source, EventTarget target,
+            final EventType<RotateEvent> eventType,
             double x, double y,
             double screenX, double screenY,
             boolean shiftDown,
@@ -101,20 +110,31 @@
             boolean altDown,
             boolean metaDown,
             boolean direct,
-            boolean inertia) {
+            boolean inertia, double angle, double totalAngle) {
 
-        super(eventType, x, y, screenX, screenY,
+        super(source, target, eventType, x, y, screenX, screenY,
                 shiftDown, controlDown, altDown, metaDown, direct, inertia);
         this.angle = angle;
         this.totalAngle = totalAngle;
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new RotateEvent event with null source and target
+     * @param eventType The type of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param inertia if represents inertia of an already finished gesture.
+     * @param angle the rotational angle
+     * @param totalAngle the cumulative rotational angle
      */
-    public static RotateEvent impl_rotateEvent(final EventType<? extends RotateEvent> eventType,
-            double angle, double totalAngle,
+    public RotateEvent(final EventType<RotateEvent> eventType,
             double x, double y,
             double screenX, double screenY,
             boolean shiftDown,
@@ -122,13 +142,12 @@
             boolean altDown,
             boolean metaDown,
             boolean direct,
-            boolean inertia) {
-        return new RotateEvent(eventType, angle, totalAngle,
-                x, y, screenX, screenY,
-                shiftDown, controlDown, altDown, metaDown, direct, inertia);
+            boolean inertia, double angle, double totalAngle) {
+        this(null, null, eventType, x, y, screenX, screenY, shiftDown, controlDown,
+                altDown, metaDown, direct, inertia, angle, totalAngle);
     }
 
-    private double angle;
+    private final double angle;
 
     /**
      * Gets the rotation angle of this event.
@@ -140,7 +159,7 @@
         return angle;
     }
 
-    private double totalAngle;
+    private final double totalAngle;
 
     /**
      * Gets the cumulative rotation angle of this gesture.
@@ -191,4 +210,29 @@
 
         return sb.append("]").toString();
     }
+
+    @Override
+    public RotateEvent copyFor(Object newSource, EventTarget newTarget) {
+        return (RotateEvent) super.copyFor(newSource, newTarget);
+    }
+
+    /**
+     * Creates a copy of the given event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param eventType the new eventType
+     * @return the event copy with the fields substituted
+     */
+    public RotateEvent copyFor(Object newSource, EventTarget newTarget, EventType<RotateEvent> type) {
+        RotateEvent e = copyFor(newSource, newTarget);
+        e.eventType = type;
+        return e;
+    }
+    
+    @Override
+    public EventType<RotateEvent> getEventType() {
+        return (EventType<RotateEvent>) super.getEventType();
+    }
+    
+    
 }
--- a/javafx-ui-common/src/javafx/scene/input/ScrollEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/ScrollEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -96,7 +96,7 @@
  *
  * @since 2.2
  */
-public class ScrollEvent extends GestureEvent {
+public final class ScrollEvent extends GestureEvent {
 
     /**
      * Common supertype for all scroll event types.
@@ -125,22 +125,33 @@
     public static final EventType<ScrollEvent> SCROLL_FINISHED =
             new EventType<ScrollEvent> (ScrollEvent.ANY, "SCROLL_FINISHED");
 
-    
-    private ScrollEvent(final EventType<? extends ScrollEvent> eventType) {
-        super(eventType);
-    }
-
-    private ScrollEvent(Object source, EventTarget target,
-            final EventType<? extends ScrollEvent> eventType) {
-        super(source, target, eventType);
-    }
-
-    private ScrollEvent(final EventType<? extends ScrollEvent> eventType,
-            double deltaX, double deltaY,
-            double gestureDeltaX, double gestureDeltaY,
-            HorizontalTextScrollUnits textDeltaXUnits, double textDeltaX,
-            VerticalTextScrollUnits textDeltaYUnits, double textDeltaY,
-            int touchCount,
+    /**
+     * Constructs new ScrollEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param inertia if represents inertia of an already finished gesture.
+     * @param deltaX horizontal scroll amount
+     * @param deltaY vertical scroll amount
+     * @param totalDeltaX cumulative horizontal scroll amount
+     * @param totalDeltaY cumulative vertical scroll amount
+     * @param textDeltaXUnits units for horizontal text-based scroll amount
+     * @param textDeltaX horizontal text-based scroll amount
+     * @param textDeltaYUnits units for vertical text-based scroll amount
+     * @param textDeltaY vertical text-based scroll amount
+     * @param touchCount number of touch points
+     */
+    public ScrollEvent(Object source, EventTarget target,
+            final EventType<ScrollEvent> eventType,
             double x, double y,
             double screenX, double screenY,
             boolean shiftDown,
@@ -148,22 +159,70 @@
             boolean altDown,
             boolean metaDown,
             boolean direct,
-            boolean inertia) {
+            boolean inertia,
+            double deltaX, double deltaY,
+            double totalDeltaX, double totalDeltaY,
+            HorizontalTextScrollUnits textDeltaXUnits, double textDeltaX,
+            VerticalTextScrollUnits textDeltaYUnits, double textDeltaY,
+            int touchCount) {
 
-        super(eventType, x, y, screenX, screenY,
+        super(source, target, eventType, x, y, screenX, screenY,
                 shiftDown, controlDown, altDown, metaDown, direct, inertia);
         this.deltaX = deltaX;
         this.deltaY = deltaY;
-        this.totalDeltaX = gestureDeltaX;
-        this.totalDeltaY = gestureDeltaY;
+        this.totalDeltaX = totalDeltaX;
+        this.totalDeltaY = totalDeltaY;
         this.textDeltaXUnits = textDeltaXUnits;
         this.textDeltaX = textDeltaX;
         this.textDeltaYUnits = textDeltaYUnits;
         this.textDeltaY = textDeltaY;
         this.touchCount = touchCount;
     }
+
+    /**
+     * Constructs new ScrollEvent event with null source and target
+     * @param eventType The type of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param inertia if represents inertia of an already finished gesture.
+     * @param deltaX horizontal scroll amount
+     * @param deltaY vertical scroll amount
+     * @param totalDeltaX cumulative horizontal scroll amount
+     * @param totalDeltaY cumulative vertical scroll amount
+     * @param textDeltaXUnits units for horizontal text-based scroll amount
+     * @param textDeltaX horizontal text-based scroll amount
+     * @param textDeltaYUnits units for vertical text-based scroll amount
+     * @param textDeltaY vertical text-based scroll amount
+     * @param touchCount number of touch points
+     */
+    public ScrollEvent(final EventType<ScrollEvent> eventType,
+            double x, double y,
+            double screenX, double screenY,
+            boolean shiftDown,
+            boolean controlDown,
+            boolean altDown,
+            boolean metaDown,
+            boolean direct,
+            boolean inertia,
+            double deltaX, double deltaY,
+            double gestureDeltaX, double gestureDeltaY,
+            HorizontalTextScrollUnits textDeltaXUnits, double textDeltaX,
+            VerticalTextScrollUnits textDeltaYUnits, double textDeltaY,
+            int touchCount) {
+        this(null, null, eventType, x, y, screenX, screenY, shiftDown, controlDown,
+                altDown, metaDown, direct, inertia, deltaX, deltaY, gestureDeltaX,
+                gestureDeltaY, textDeltaXUnits, textDeltaX, textDeltaYUnits, textDeltaY, touchCount);
+    }
     
-    private double deltaX;
+    
+    private final double deltaX;
 
     /**
      * Gets the horizontal scroll amount. This value should be interpreted
@@ -182,7 +241,7 @@
         return deltaX;
     }
 
-    private double deltaY;
+    private final double deltaY;
 
     /**
      * Gets the vertical scroll amount. This value should be interpreted
@@ -220,7 +279,7 @@
         return totalDeltaX;
     }
 
-    private double totalDeltaY;
+    private final double totalDeltaY;
 
     /**
      * Gets the cumulative vertical scroll amount for the whole gesture.
@@ -239,7 +298,7 @@
         return totalDeltaY;
     }
 
-    private HorizontalTextScrollUnits textDeltaXUnits;
+    private final HorizontalTextScrollUnits textDeltaXUnits;
 
     /**
      * Gets the horizontal scrolling units for text-based scrolling.
@@ -254,7 +313,7 @@
         return textDeltaXUnits;
     }
 
-    private VerticalTextScrollUnits textDeltaYUnits;
+    private final VerticalTextScrollUnits textDeltaYUnits;
 
     /**
      * Gets the vertical scrolling units for text-based scrolling.
@@ -269,7 +328,7 @@
         return textDeltaYUnits;
     }
     
-    private double textDeltaX;
+    private final double textDeltaX;
 
     /**
      * Gets the horizontal text-based scroll amount. This value should be 
@@ -283,7 +342,7 @@
         return textDeltaX;
     }
     
-    private double textDeltaY;
+    private final double textDeltaY;
 
     /**
      * Gets the vertical text-based scroll amount. This value should be 
@@ -297,7 +356,7 @@
         return textDeltaY;
     }
 
-    private int touchCount;
+    private final int touchCount;
 
     /**
      * Gets number of touch points that caused this event. For non-touch source
@@ -310,37 +369,6 @@
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public static ScrollEvent impl_scrollEvent(EventType<ScrollEvent> eventType,
-            double _scrollX, double _scrollY,
-            double _totalScrollX, double _totalScrollY,
-            HorizontalTextScrollUnits _scrollTextXUnits, double _scrollTextX,
-            VerticalTextScrollUnits _scrollTextYUnits, double _scrollTextY,
-            int _touchPoints,
-            double _x, double _y,
-            double _screenX, double _screenY,
-            boolean _shiftDown,
-            boolean _controlDown,
-            boolean _altDown,
-            boolean _metaDown,
-            boolean _direct,
-            boolean _inertia
-          )
-    {
-        return new ScrollEvent(eventType, _scrollX, _scrollY,
-                _totalScrollX, _totalScrollY,
-                _scrollTextXUnits, _scrollTextX,
-                _scrollTextYUnits, _scrollTextY,
-                _touchPoints,
-                _x, _y, _screenX, _screenY,
-                _shiftDown, _controlDown, _altDown, _metaDown, 
-                _direct, _inertia);
-    }
-    
-    /**
      * Returns a string representation of this {@code ScrollEvent} object.
      * @return a string representation of this {@code ScrollEvent} object.
      */ 
@@ -386,6 +414,29 @@
 
         return sb.append("]").toString();
     }
+
+    @Override
+    public ScrollEvent copyFor(Object newSource, EventTarget newTarget) {
+        return (ScrollEvent) super.copyFor(newSource, newTarget);
+    }
+
+    /**
+     * Creates a copy of the given event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param eventType the new eventType
+     * @return the event copy with the fields substituted
+     */
+    public ScrollEvent copyFor(Object newSource, EventTarget newTarget, EventType<ScrollEvent> type) {
+        ScrollEvent e = copyFor(newSource, newTarget);
+        e.eventType = type;
+        return e;
+    }
+
+    @Override
+    public EventType<ScrollEvent> getEventType() {
+        return (EventType<ScrollEvent>) super.getEventType();
+    }
     
     /**
      * Horizontal text-based scrolling units.
--- a/javafx-ui-common/src/javafx/scene/input/SwipeEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/SwipeEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -55,7 +55,7 @@
  *
  * @since 2.2
  */
-public class SwipeEvent extends GestureEvent {
+public final class SwipeEvent extends GestureEvent {
 
     /**
      * Common supertype for all swipe event types.
@@ -87,50 +87,66 @@
     public static final EventType<SwipeEvent> SWIPE_DOWN =
             new EventType<SwipeEvent>(SwipeEvent.ANY, "SWIPE_DOWN");
 
-    private SwipeEvent(final EventType<? extends SwipeEvent> eventType) {
-        super(eventType);
-    }
-
-    private SwipeEvent(Object source, EventTarget target,
-            final EventType<? extends SwipeEvent> eventType) {
-        super(source, target, eventType);
-    }
-
-    private SwipeEvent(final EventType<? extends SwipeEvent> eventType,
-            int touchCount,
+    /**
+     * Constructs new SwipeEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param touchCount number of touch points
+     */
+    public SwipeEvent(Object source, EventTarget target,
+            final EventType<SwipeEvent> eventType,
             double x, double y,
             double screenX, double screenY,
             boolean shiftDown,
             boolean controlDown,
             boolean altDown,
             boolean metaDown,
-            boolean direct) {
+            boolean direct,
+            int touchCount) {
 
-        super(eventType, x, y, screenX, screenY,
+        super(source, target, eventType, x, y, screenX, screenY,
                 shiftDown, controlDown, altDown, metaDown, direct, false);
         this.touchCount = touchCount;
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new SwipeEvent event with null source and target.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param touchCount number of touch points
      */
-    public static SwipeEvent impl_swipeEvent(final EventType<? extends SwipeEvent> eventType,
-            int touchCount,
+    public SwipeEvent(final EventType<SwipeEvent> eventType,
             double x, double y,
             double screenX, double screenY,
             boolean shiftDown,
             boolean controlDown,
             boolean altDown,
             boolean metaDown,
-            boolean direct) {
-        return new SwipeEvent(eventType, touchCount,
-                x, y, screenX, screenY,
-                shiftDown, controlDown, altDown, metaDown, direct);
+            boolean direct,
+            int touchCount) {
+        this(null, null, eventType, x, y, screenX, screenY, shiftDown, controlDown,
+                altDown, metaDown, direct, touchCount);
     }
 
-
-    private int touchCount;
+    private final int touchCount;
 
     /**
      * Gets number of touch points that caused this event.
@@ -174,4 +190,29 @@
 
         return sb.append("]").toString();
     }
+
+    @Override
+    public SwipeEvent copyFor(Object newSource, EventTarget newTarget) {
+        return (SwipeEvent) super.copyFor(newSource, newTarget);
+    }
+    
+    /**
+     * Creates a copy of the given event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param eventType the new eventType
+     * @return the event copy with the fields substituted
+     */
+    public SwipeEvent copyFor(Object newSource, EventTarget newTarget, EventType<SwipeEvent> type) {
+        SwipeEvent e = copyFor(newSource, newTarget);
+        e.eventType = type;
+        return e;
+    }
+
+    @Override
+    public EventType<SwipeEvent> getEventType() {
+        return (EventType<SwipeEvent>) super.getEventType();
+    }
+    
+    
 }
--- a/javafx-ui-common/src/javafx/scene/input/TouchEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/TouchEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -90,24 +90,53 @@
     public static final EventType<TouchEvent> TOUCH_STATIONARY =
             new EventType<TouchEvent>(ANY, "TOUCH_STATIONARY");
 
-    private TouchEvent(EventType<? extends TouchEvent> eventType) {
-        super(eventType);
-    }
-
-    private TouchEvent(EventType<? extends TouchEvent> eventType,
+    /**
+     * Constructs new TouchEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param touchPoint the touch point of this event
+     * @param touchPoints set of touch points for the multi-touch action
+     * @param eventSetId set id of the multi-touch action
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     */
+    public TouchEvent(Object source, EventTarget target, EventType<TouchEvent> eventType,
             TouchPoint touchPoint, List<TouchPoint> touchPoints, int eventSetId,
             boolean shiftDown, boolean controlDown, boolean altDown,
-            boolean metaDown) {
-        super(eventType);
-        if (touchPoints != null) {
-            this.touchPoints = Collections.unmodifiableList(touchPoints);
-        }
+            boolean metaDown, boolean direct) {
+        super(source, target, eventType);
+        this.touchPoints = touchPoints != null ? Collections.unmodifiableList(touchPoints) : null;
         this.eventSetId = eventSetId;
         this.shiftDown = shiftDown;
         this.controlDown = controlDown;
         this.altDown = altDown;
         this.metaDown = metaDown;
         this.touchPoint = touchPoint;
+        this.isDirect = direct;
+    }
+
+    /**
+     * Constructs new TouchEvent event with null source and target.
+     * @param eventType The type of the event.
+     * @param touchPoint the touch point of this event
+     * @param touchPoints set of touch points for the multi-touch action
+     * @param eventSetId set id of the multi-touch action
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     */
+    public TouchEvent(EventType<TouchEvent> eventType,
+            TouchPoint touchPoint, List<TouchPoint> touchPoints, int eventSetId,
+            boolean shiftDown, boolean controlDown, boolean altDown,
+            boolean metaDown, boolean direct) {
+        this(null, null, eventType, touchPoint, touchPoints, eventSetId,
+                shiftDown, controlDown, altDown, metaDown, direct);
     }
 
     /**
@@ -138,37 +167,42 @@
      * @inheritDoc
      */
     @Override
-    public Event copyFor(Object newSource, EventTarget newTarget) {
+    public TouchEvent copyFor(Object newSource, EventTarget newTarget) {
         TouchEvent e = (TouchEvent) super.copyFor(newSource, newTarget);
         recomputeToSource(e, getSource(), newSource);
-
         return e;
     }
+    
+    /**
+     * Creates a copy of the given event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param eventType the new eventType
+     * @return the event copy with the fields substituted
+     */
+    public TouchEvent copyFor(Object newSource, EventTarget newTarget, EventType<TouchEvent> type) {
+        TouchEvent e = copyFor(newSource, newTarget);
+        e.eventType = type;
+        return e;
+    }
+
+    @Override
+    public EventType<TouchEvent> getEventType() {
+        return (EventType<TouchEvent>) super.getEventType();
+    }
+    
+    
 
     // isDirect doesn't currently have public getter because we are currently
     // ignoring indirect touch events and claim that touch events always
     // represent a direct touch-screen action
-    private boolean isDirect;
+    private final boolean isDirect;
 
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public boolean impl_isDirect() {
+    public boolean isDirect() {
         return isDirect;
     }
 
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public void impl_setDirect(boolean direct) {
-        isDirect = direct;
-    }
-
-    private int eventSetId;
+    private final int eventSetId;
 
     /**
      * Gets sequential number of the set of touch events representing the same
@@ -190,7 +224,7 @@
     /**
      * Whether or not the Shift modifier is down on this event.
      */
-    private boolean shiftDown;
+    private final boolean shiftDown;
 
     /**
      * Whether or not the Shift modifier is down on this event.
@@ -203,7 +237,7 @@
     /**
      * Whether or not the Control modifier is down on this event.
      */
-    private boolean controlDown;
+    private final boolean controlDown;
 
     /**
      * Whether or not the Control modifier is down on this event.
@@ -216,7 +250,7 @@
     /**
      * Whether or not the Alt modifier is down on this event.
      */
-    private boolean altDown;
+    private final boolean altDown;
 
     /**
      * Whether or not the Alt modifier is down on this event.
@@ -229,7 +263,7 @@
     /**
      * Whether or not the Meta modifier is down on this event.
      */
-    private boolean metaDown;
+    private final boolean metaDown;
 
     /**
      * Whether or not the Meta modifier is down on this event.
@@ -239,7 +273,7 @@
         return metaDown;
     }
 
-    private TouchPoint touchPoint;
+    private final TouchPoint touchPoint;
 
     /**
      * Gets the touch point of this event.
@@ -249,7 +283,7 @@
         return touchPoint;
     }
 
-    private List<TouchPoint> touchPoints;
+    private final List<TouchPoint> touchPoints;
 
     /**
      * Gets all the touch points represented by this set of touch events,
@@ -284,17 +318,4 @@
         return sb.append("]").toString();
     }
 
-    /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
-     */
-    @Deprecated
-    public static TouchEvent impl_touchEvent(EventType<? extends TouchEvent> eventType,
-            TouchPoint touchPoint, List<TouchPoint> touchPoints, int eventSetId,
-            boolean shiftDown, boolean controlDown, boolean altDown,
-            boolean metaDown) {
-        return new TouchEvent(eventType, touchPoint, touchPoints, eventSetId,
-                shiftDown, controlDown, altDown, metaDown);
-    }
-
 }
--- a/javafx-ui-common/src/javafx/scene/input/TransferMode.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/TransferMode.java	Tue Nov 06 09:39:13 2012 -0800
@@ -54,7 +54,7 @@
      * {@code DragEvent.acceptTransferModes()} calls.
      */
     public static final TransferMode[] ANY = { COPY, MOVE, LINK };
-
+    
     /**
      * Array containing transfer modes COPY and MOVE. This is a convenience
      * constant intended to be used in {@code startDragAndDrop} and
--- a/javafx-ui-common/src/javafx/scene/input/ZoomEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/input/ZoomEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -56,7 +56,7 @@
  *
  * @since 2.2
  */
-public class ZoomEvent extends GestureEvent {
+public final class ZoomEvent extends GestureEvent {
 
     /**
      * Common supertype for all zoom event types.
@@ -83,18 +83,26 @@
     public static final EventType<ZoomEvent> ZOOM_FINISHED =
             new EventType<ZoomEvent>(ZoomEvent.ANY, "ZOOM_FINISHED");
 
-    private ZoomEvent(final EventType<? extends ZoomEvent> eventType) {
-        super(eventType);
-    }
-
-    private ZoomEvent(Object source, EventTarget target,
-            final EventType<? extends ZoomEvent> eventType) {
-        super(source, target, eventType);
-    }
-
-    private ZoomEvent(final EventType<? extends ZoomEvent> eventType,
-            double zoomFactor,
-            double totalZoomFactor,
+    /**
+     * Constructs new ZoomEvent event.
+     * @param source the source of the event. Can be null.
+     * @param target the target of the event. Can be null.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param y The y with respect to the source. Should be in scene coordinates if source == null or source is not a Node.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param touchCount number of touch points
+     * @param inertia if represents inertia of an already finished gesture.
+     * @param zoomFactor zoom amount
+     * @param totalZoomFactor cumulative zoom amount
+     */
+    public ZoomEvent(Object source, EventTarget target, final EventType<ZoomEvent> eventType,
             double x, double y,
             double screenX, double screenY,
             boolean shiftDown,
@@ -102,21 +110,34 @@
             boolean altDown,
             boolean metaDown,
             boolean direct,
-            boolean inertia) {
+            boolean inertia,
+            double zoomFactor,
+            double totalZoomFactor) {
 
-        super(eventType, x, y, screenX, screenY,
+        super(source, target, eventType, x, y, screenX, screenY,
                 shiftDown, controlDown, altDown, metaDown, direct, inertia);
         this.zoomFactor = zoomFactor;
         this.totalZoomFactor = totalZoomFactor;
     }
 
     /**
-     * @treatAsPrivate implementation detail
-     * @deprecated This is an internal API that is not intended for use and will be removed in the next version
+     * Constructs new ZoomEvent event with null source and target.
+     * @param eventType The type of the event.
+     * @param x The x with respect to the scene.
+     * @param y The y with respect to the scene.
+     * @param screenX The x coordinate relative to screen.
+     * @param screenY The y coordinate relative to screen.
+     * @param shiftDown true if shift modifier was pressed.
+     * @param controlDown true if control modifier was pressed.
+     * @param altDown true if alt modifier was pressed.
+     * @param metaDown true if meta modifier was pressed.
+     * @param direct true if the event was caused by direct input device. See {@link #isDirect() }
+     * @param touchCount number of touch points
+     * @param inertia if represents inertia of an already finished gesture.
+     * @param zoomFactor zoom amount
+     * @param totalZoomFactor cumulative zoom amount
      */
-    public static ZoomEvent impl_zoomEvent(final EventType<? extends ZoomEvent> eventType,
-            double zoomFactor,
-            double totalZoomFactor,
+    public ZoomEvent(final EventType<ZoomEvent> eventType,
             double x, double y,
             double screenX, double screenY,
             boolean shiftDown,
@@ -124,14 +145,14 @@
             boolean altDown,
             boolean metaDown,
             boolean direct,
-            boolean inertia) {
-        return new ZoomEvent(eventType, zoomFactor, totalZoomFactor,
-                x, y, screenX, screenY,
-                shiftDown, controlDown, altDown, metaDown, direct, inertia);
+            boolean inertia,
+            double zoomFactor,
+            double totalZoomFactor) {
+        this(null, null, eventType, x, y, screenX, screenY, shiftDown, controlDown,
+                altDown, metaDown, direct, inertia, zoomFactor, totalZoomFactor);
     }
 
-
-    private double zoomFactor;
+    private final double zoomFactor;
 
     /**
      * Gets the zooming amount of this event. The factor value works well when
@@ -144,7 +165,7 @@
         return zoomFactor;
     }
 
-    private double totalZoomFactor;
+    private final double totalZoomFactor;
 
     /**
      * Gets the zooming amount of this gesture. The factor value works well when
@@ -196,4 +217,29 @@
 
         return sb.append("]").toString();
     }
+
+    @Override
+    public ZoomEvent copyFor(Object newSource, EventTarget newTarget) {
+        return (ZoomEvent) super.copyFor(newSource, newTarget);
+    }
+
+    /**
+     * Creates a copy of the given event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param eventType the new eventType
+     * @return the event copy with the fields substituted
+     */
+    public ZoomEvent copyFor(Object newSource, EventTarget newTarget, EventType<ZoomEvent> type) {
+        ZoomEvent e = copyFor(newSource, newTarget);
+        e.eventType = type;
+        return e;
+    }
+
+    @Override
+    public EventType<ZoomEvent> getEventType() {
+        return (EventType<ZoomEvent>) super.getEventType();
+    }
+    
+    
 }
--- a/javafx-ui-common/src/javafx/scene/layout/Region.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/scene/layout/Region.java	Tue Nov 06 09:39:13 2012 -0800
@@ -1347,7 +1347,7 @@
         double top = margin != null? snapSpace(margin.getTop(), snap) : 0;
         double bottom = margin != null? snapSpace(margin.getBottom(), snap) : 0;
         double alt = -1;
-        if (child.getContentBias() == Orientation.HORIZONTAL) { // width depends on height
+        if (child.getContentBias() == Orientation.HORIZONTAL) { // height depends on width
             alt = snapSize(width != -1? boundedSize(child.minWidth(-1), width, child.maxWidth(-1)) :
                                         child.minWidth(-1));
         }
@@ -1384,7 +1384,7 @@
         double left = margin != null? snapSpace(margin.getLeft(), snap) : 0;
         double right = margin != null? snapSpace(margin.getRight(), snap) : 0;
         double alt = -1;
-        if (child.getContentBias() == Orientation.HORIZONTAL) { // width depends on height
+        if (child.getContentBias() == Orientation.HORIZONTAL) { // height depends on width
             alt = snapSize(boundedSize(
                     child.minWidth(-1), width != -1? width - left - right :
                            child.prefWidth(-1), child.maxWidth(-1)));
@@ -1420,7 +1420,7 @@
         double top = margin != null? snapSpace(margin.getTop(), snap) : 0;
         double bottom = margin != null? snapSpace(margin.getBottom(), snap) : 0;
         double alt = -1;
-        if (child.getContentBias() == Orientation.HORIZONTAL) { // width depends on height
+        if (child.getContentBias() == Orientation.HORIZONTAL) { // height depends on width
             alt = snapSize(width != -1? boundedSize(child.minWidth(-1), width, child.maxWidth(-1)) :
                 child.maxWidth(-1));
             max = child.maxHeight(alt);
--- a/javafx-ui-common/src/javafx/stage/Stage.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/stage/Stage.java	Tue Nov 06 09:39:13 2012 -0800
@@ -49,8 +49,10 @@
 import com.sun.javafx.tk.Toolkit;
 import javafx.beans.property.DoubleProperty;
 import javafx.beans.property.DoublePropertyBase;
+import javafx.beans.property.Property;
 import javafx.beans.property.ReadOnlyBooleanProperty;
 import javafx.beans.property.ReadOnlyBooleanWrapper;
+import javafx.beans.value.ObservableValue;
 
 /**
  * The JavaFX {@code Stage} class is the top level JavaFX container.
@@ -180,7 +182,7 @@
 
         @Override
         public void setResizable(Stage stage, boolean resizable) {
-            stage.resizableProperty().set(resizable);
+            ((ResizableProperty)stage.resizableProperty()).setNoInvalidate(resizable);
         }
 
         @Override
@@ -711,17 +713,18 @@
      * Programatically you may still change the size of the Stage. This is
      * a hint which allows the implementation to optionally make the Stage
      * resizable by the user.
-     *
+     * <p>
+     * <b>Warning:</b> Since 8.0 the property cannot be bound and will throw
+     * {@code RuntimeException} on an attempt to do so. This is because
+     * the setting of resizable is asynchronous on some systems or generally
+     * might be set by the system / window manager.
+     * 
      * @defaultValue true
      */
     private BooleanProperty resizable;
 
     public final void setResizable(boolean value) {
         resizableProperty().set(value);
-        if (impl_peer != null) {
-            applyBounds();
-            impl_peer.setResizable(value);
-        }
     }
 
     public final boolean isResizable() {
@@ -730,11 +733,49 @@
 
     public final BooleanProperty resizableProperty() {
         if (resizable == null) {
-            resizable = new SimpleBooleanProperty(Stage.this, "resizable", true);
+            resizable = new ResizableProperty();
         }
         return resizable;
     }
 
+    //We cannot return ReadOnlyProperty in resizable, as this would be
+    // backward incompatible. All we can do is to create this custom property
+    // implementation that disallows binds
+    private class ResizableProperty extends SimpleBooleanProperty {
+        private boolean noInvalidate;
+
+        public ResizableProperty() {
+            super(Stage.this, "resizable", true);
+        }
+
+        void setNoInvalidate(boolean value) {
+            noInvalidate = true;
+            set(value);
+            noInvalidate = false;
+        }
+
+        @Override
+        protected void invalidated() {
+            if (noInvalidate) {
+                return;
+            }
+            if (impl_peer != null) {
+                applyBounds();
+                impl_peer.setResizable(get());
+            }
+        }
+
+        @Override
+        public void bind(ObservableValue<? extends Boolean> rawObservable) {
+            throw new RuntimeException("Resizable property cannot be bound");
+        }
+
+        @Override
+        public void bindBidirectional(Property<Boolean> other) {
+            throw new RuntimeException("Resizable property cannot be bound");
+        }
+    }
+
     /**
      * Defines the minimum width of this {@code Stage}.
      *
--- a/javafx-ui-common/src/javafx/stage/WindowEvent.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/src/javafx/stage/WindowEvent.java	Tue Nov 06 09:39:13 2012 -0800
@@ -26,6 +26,7 @@
 package javafx.stage;
 
 import javafx.event.Event;
+import javafx.event.EventTarget;
 import javafx.event.EventType;
 
 /**
@@ -97,4 +98,29 @@
 
         return sb.append("]").toString();
     }
+
+    @Override
+    public WindowEvent copyFor(Object newSource, EventTarget newTarget) {
+        return (WindowEvent) super.copyFor(newSource, newTarget);
+    }
+
+    /**
+     * Creates a copy of the given event with the given fields substituted.
+     * @param source the new source of the copied event
+     * @param target the new target of the copied event
+     * @param eventType the new eventType
+     * @return the event copy with the fields substituted
+     */
+    public WindowEvent copyFor(Object newSource, EventTarget newTarget, EventType<WindowEvent> type) {
+        WindowEvent e = copyFor(newSource, newTarget);
+        e.eventType = type;
+        return e;
+    }
+
+    @Override
+    public EventType<WindowEvent> getEventType() {
+        return (EventType<WindowEvent>) super.getEventType();
+    }
+    
+    
 }
--- a/javafx-ui-common/test/unit/com/sun/javafx/test/MouseEventGenerator.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/com/sun/javafx/test/MouseEventGenerator.java	Tue Nov 06 09:39:13 2012 -0800
@@ -50,9 +50,9 @@
             primaryButtonDown = false;
         }
 
-        MouseEvent event = MouseEvent.impl_mouseEvent(x, y, x, y, button,
-                1, false, false, false, false, false, primaryButtonDown,
-                false, false, false, type);
+        MouseEvent event = new MouseEvent(type, x, y, x, y, button,
+                1, false, false, false, false, primaryButtonDown,
+                false, false, false, false);
 
         return event;
     }
--- a/javafx-ui-common/test/unit/javafx/scene/Scenegraph_eventHandlers_Test.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/Scenegraph_eventHandlers_Test.java	Tue Nov 06 09:39:13 2012 -0800
@@ -339,23 +339,21 @@
             keyCode = KeyCode.Q;
         }
 
-        return KeyEvent.impl_keyEvent(null, character, text,
+        return new KeyEvent(keyEventType, character, text,
                                       keyCode.impl_getCode(),
-                                      false, false, false, false,
-                                      keyEventType);
+                                      false, false, false, false);
     }
 
     private static Event createContextMenuEvent() {
-        return ContextMenuEvent.impl_contextEvent(10, 10,
-          10, 10, false, ContextMenuEvent.CONTEXT_MENU_REQUESTED);
+        return new ContextMenuEvent(ContextMenuEvent.CONTEXT_MENU_REQUESTED, 10, 10,
+          10, 10, false);
     }
 
     private static Event createSwipeEvent(final EventType<SwipeEvent> type) {
-        return SwipeEvent.impl_swipeEvent(
+        return new SwipeEvent(
                 type,
-                1,
                 100, 100, 100, 100,
-                false, false, false, false, true);
+                false, false, false, false, true, 1);
     }
 
     private static void setEventHandler(
--- a/javafx-ui-common/test/unit/javafx/scene/input/DragAndDropTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/DragAndDropTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -1271,8 +1271,8 @@
         @Override
         public DragEvent convertDragEventToFx(Object event, Dragboard dragboard) {
             DragEvent de = (DragEvent) event;
-            return DragEvent.impl_copy(de.getSource(), de.getTarget(), 
-                    de.getGestureSource(), de.getGestureTarget(), dragboard, de);
+            return de.copyFor(de.getSource(), de.getTarget(), 
+                    de.getGestureSource(), de.getGestureTarget(), dragboard);
         }
         
         public TransferMode dragTo(double x, double y, TransferMode tm) {
--- a/javafx-ui-common/test/unit/javafx/scene/input/InputMethodEventTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/InputMethodEventTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -41,8 +41,7 @@
     private final ObservableList<InputMethodTextRun> observableArrayList =
             javafx.collections.FXCollections.<InputMethodTextRun>observableArrayList();
     private final InputMethodEvent event =
-            InputMethodEvent.impl_inputMethodEvent(node1, observableArrayList, "Text", 2,
-            InputMethodEvent.INPUT_METHOD_TEXT_CHANGED);
+            new InputMethodEvent(null, node1, InputMethodEvent.INPUT_METHOD_TEXT_CHANGED, observableArrayList, "Text", 2);
 
     @Test
     public void shouldCreateInputMethodEvent() {
@@ -55,7 +54,7 @@
 
     @Test
     public void shouldCopyInputMethodEvent() {
-        InputMethodEvent copied = InputMethodEvent.impl_copy(node2, event);
+        InputMethodEvent copied = event.copyFor(null, node2);
 
         assertSame(node2, copied.getTarget());
         assertEquals(observableArrayList, copied.getComposed());
--- a/javafx-ui-common/test/unit/javafx/scene/input/InputMethodTextRunTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/InputMethodTextRunTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -35,7 +35,7 @@
 public class InputMethodTextRunTest {
 
     private final InputMethodTextRun imtr =
-            InputMethodTextRun.impl_inputMethodTextRun("Text",
+            new InputMethodTextRun("Text",
             InputMethodHighlight.SELECTED_RAW);
 
     @Test
--- a/javafx-ui-common/test/unit/javafx/scene/input/KeyCodeTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/KeyCodeTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -45,7 +45,7 @@
     @Test
     public void shouldFindCorrectCode() {
         for (KeyCode code : KeyCode.values()) {
-            assertSame(code, KeyCode.impl_valueOf(code.impl_getCode()));
+            assertSame(code, KeyCode.valueOf(code.impl_getCode()));
         }
     }
 }
--- a/javafx-ui-common/test/unit/javafx/scene/input/KeyCombinationTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/KeyCombinationTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -49,35 +49,35 @@
 
 
 public class KeyCombinationTest {
-    final KeyEvent ctrlAltQEvent = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET, 
-            "q", null, 0x51, false, true, true, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent ctrlAltQEvent = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "q", null, 0x51, false, true, true, false);
 
-    final KeyEvent ctrlAltQUpEvent = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "q", null, 0x51, false, true, true, false, KeyEvent.KEY_RELEASED);
+    final KeyEvent ctrlAltQUpEvent = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_RELEASED, 
+            "q", null, 0x51, false, true, true, false);
 
-    final KeyEvent ctrlShiftQEvent = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "Q", null, 0x51, true, true, false, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent ctrlShiftQEvent = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "Q", null, 0x51, true, true, false, false);
 
-    final KeyEvent ctrlAltShiftQEvent = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "Q", null, 0x51, true, true, true, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent ctrlAltShiftQEvent = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "Q", null, 0x51, true, true, true, false);
 
-    final KeyEvent alt2Event = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "2", null, 0x32, false, false, true, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent alt2Event = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "2", null, 0x32, false, false, true, false);
 
-    final KeyEvent altShift2Event = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "@", null, 0x32, true, false, true, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent altShift2Event = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "@", null, 0x32, true, false, true, false);
 
-    final KeyEvent altSoftkey0Event = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "~", null, 0x1000, false, false, true, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent altSoftkey0Event = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "~", null, 0x1000, false, false, true, false);
 
-    final KeyEvent altShiftSoftkey0Event = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "~", null, 0x1000, true, false, true, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent altShiftSoftkey0Event = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "~", null, 0x1000, true, false, true, false);
 
-    final KeyEvent altShiftPlusEvent = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "~", null, 0x209, true, false, true, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent altShiftPlusEvent = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "~", null, 0x209, true, false, true, false);
 
-    final KeyEvent altShiftQuoteEvent = KeyEvent.impl_keyEvent(Event.NULL_SOURCE_TARGET,
-            "~", null, 0xDE, true, false, true, false, KeyEvent.KEY_PRESSED);
+    final KeyEvent altShiftQuoteEvent = new KeyEvent(null, Event.NULL_SOURCE_TARGET, KeyEvent.KEY_PRESSED, 
+            "~", null, 0xDE, true, false, true, false);
 
     @BeforeClass
     public static void setUpCharToKeyCodeMap() {
@@ -313,18 +313,18 @@
 
     @Test
     public void testKeyCombinationWithShortcutModifier() {
-        final KeyEvent ctrlC = KeyEvent.impl_keyEvent(
-                                   null, "c", null, 0x43,
-                                   false, true, false, false,
-                                   KeyEvent.KEY_PRESSED);
-        final KeyEvent metaC = KeyEvent.impl_keyEvent(
-                                   null, "c", null, 0x43,
-                                   false, false, false, true,
-                                   KeyEvent.KEY_PRESSED);
-        final KeyEvent metaAltC = KeyEvent.impl_keyEvent(
-                                      null, "c", null, 0x43,
-                                      false, false, true, true,
-                                      KeyEvent.KEY_PRESSED);
+        final KeyEvent ctrlC = new KeyEvent(
+                                   KeyEvent.KEY_PRESSED,
+                                   "c", null, 0x43,
+                                   false, true, false, false);
+        final KeyEvent metaC = new KeyEvent(
+                                   KeyEvent.KEY_PRESSED,
+                                   "c", null, 0x43,
+                                   false, false, false, true);
+        final KeyEvent metaAltC = new KeyEvent(
+                                   KeyEvent.KEY_PRESSED,
+                                      "c", null, 0x43,
+                                      false, false, true, true);
 
         final KeyCombination shortcutC =
                 KeyCombination.keyCombination("Shortcut+C");
--- a/javafx-ui-common/test/unit/javafx/scene/input/KeyEventTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/KeyEventTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -31,6 +31,7 @@
 import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import javafx.scene.Node;
+import javafx.event.EventTarget;
 
 import org.junit.Test;
 
@@ -38,11 +39,15 @@
 
     private final Node node1 = new TestNode();
     private final Node node2 = new TestNode();
+    
+    public KeyEvent testKeyEvent(EventTarget target, String character, KeyCode code, boolean shiftDown, boolean controlDown, boolean altDown, boolean metaDown) {
+        return new KeyEvent(null, target, KeyEvent.KEY_PRESSED, character, null, code.impl_getCode(), shiftDown, controlDown, altDown, metaDown);
+    }
 
     @Test
     public void shouldCreateKeyTypedEvent() {
-        KeyEvent event = KeyEvent.impl_keyEvent(node1, "A", "A", 0x41, true,
-                false, false, false, KeyEvent.KEY_TYPED);
+        KeyEvent event = new KeyEvent(null, node1, KeyEvent.KEY_TYPED, "A", "A", 0x41, true,
+                false, false, false);
 
         assertSame(node1, event.getTarget());
         assertEquals("A", event.getCharacter());
@@ -57,8 +62,8 @@
 
     @Test
     public void shouldCreateKeyReleasedEvent() {
-        KeyEvent event = KeyEvent.impl_keyEvent(node1, "A", "A", 0x41, true,
-                false, false, false, KeyEvent.KEY_RELEASED);
+        KeyEvent event = new KeyEvent(null, node1, KeyEvent.KEY_RELEASED, "A", "A", 0x41, true,
+                false, false, false);
 
         assertSame(node1, event.getTarget());
         assertEquals(KeyEvent.CHAR_UNDEFINED, event.getCharacter());
@@ -73,9 +78,9 @@
 
     @Test
     public void shouldCopyKeyTypedEvent() {
-        KeyEvent original = KeyEvent.impl_keyEvent(node1, "A", "A", 0x41, true,
-                false, false, false, KeyEvent.KEY_TYPED);
-        KeyEvent event = KeyEvent.impl_copy(node2, original);
+        KeyEvent original = new KeyEvent(null, node1, KeyEvent.KEY_TYPED, "A", "A", 0x41, true,
+                false, false, false);
+        KeyEvent event = original.copyFor(null, node2);
 
         assertSame(node2, event.getTarget());
         assertEquals("A", event.getCharacter());
@@ -90,9 +95,9 @@
 
     @Test
     public void shouldGetNonEmptyDescription() {
-        KeyEvent event1 = KeyEvent.testKeyEvent(node1, "A", KeyCode.A,
+        KeyEvent event1 = testKeyEvent(node1, "A", KeyCode.A,
             false, false, false, false);
-        KeyEvent event2 = KeyEvent.testKeyEvent(node1, "", KeyCode.UNDEFINED,
+        KeyEvent event2 = testKeyEvent(node1, "", KeyCode.UNDEFINED,
             true, true, true, true);
 
         String s1 = event1.toString();
--- a/javafx-ui-common/test/unit/javafx/scene/input/MouseDragEventTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/MouseDragEventTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -534,10 +534,9 @@
 
     @Test
     public void shouldGetNonEmptyDescription() {
-        String s = MouseDragEvent.impl_copy(null, null,
-                MouseEvent.impl_mouseEvent(10, 20, 20, 30, MouseButton.NONE, 0,
-                true, true, true, true, true, true, true, true, true,
-                MouseEvent.MOUSE_MOVED)).toString();
+        String s = MouseEvent.copyForMouseDragEvent(new MouseEvent(MouseEvent.MOUSE_MOVED, 10, 20, 20, 30, MouseButton.NONE, 0,
+                true, true, true, true, true, true, true, true, true), null, null, MouseDragEvent.ANY, null)
+                .toString();
         assertNotNull(s);
         assertFalse(s.isEmpty());
     }
--- a/javafx-ui-common/test/unit/javafx/scene/input/MouseEventTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/MouseEventTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -39,10 +39,10 @@
 
     private final Node node1 = new TestNode(5);
     private final Node node2 = new TestNode(10);
-    private final MouseEvent doubleclick = MouseEvent.impl_mouseEvent(
+    private final MouseEvent doubleclick = new MouseEvent(
+            MouseEvent.MOUSE_CLICKED,
             11, 12, 13, 14, MouseButton.PRIMARY, 2,
-            true, false, true, false, true, false, true, false, false,
-            MouseEvent.MOUSE_CLICKED);
+            true, false, true, false, false, true, false, false, true);
 
     @Test
     public void shouldCreateDoubleClickMouseEvent() {
@@ -59,7 +59,7 @@
         assertFalse(doubleclick.isControlDown());
         assertTrue(doubleclick.isAltDown());
         assertFalse(doubleclick.isMetaDown());
-        assertTrue(MouseEvent.impl_getPopupTrigger(doubleclick));
+        assertTrue(doubleclick.isPopupTrigger());
         assertFalse(doubleclick.isPrimaryButtonDown());
         assertTrue(doubleclick.isMiddleButtonDown());
         assertFalse(doubleclick.isSecondaryButtonDown());
@@ -69,7 +69,7 @@
 
     @Test
     public void shouldCopyMouseEvent() {
-        MouseEvent copy = MouseEvent.impl_copy(node1, node2, doubleclick);
+        MouseEvent copy = doubleclick.copyFor(node1, node2);
 
         assertEquals(6f, copy.getX(), 0.0001);
         assertEquals(7f, copy.getY(), 0.0001);
@@ -83,8 +83,8 @@
         assertEquals(doubleclick.isControlDown(), copy.isControlDown());
         assertEquals(doubleclick.isAltDown(), copy.isAltDown());
         assertEquals(doubleclick.isMetaDown(), copy.isMetaDown());
-        assertEquals(MouseEvent.impl_getPopupTrigger(doubleclick),
-                     MouseEvent.impl_getPopupTrigger(copy));
+        assertEquals(doubleclick.isPopupTrigger(),
+                     copy.isPopupTrigger());
         assertEquals(doubleclick.isPrimaryButtonDown(), copy.isPrimaryButtonDown());
         assertEquals(doubleclick.isMiddleButtonDown(), copy.isMiddleButtonDown());
         assertEquals(doubleclick.isSecondaryButtonDown(), copy.isSecondaryButtonDown());
@@ -95,7 +95,7 @@
 
     @Test
     public void shouldCopyMouseEventWithEventId() {
-        MouseEvent copy = MouseEvent.impl_copy(node1, node2, doubleclick,
+        MouseEvent copy = doubleclick.copyFor(node1, node2,
                 MouseEvent.MOUSE_ENTERED);
 
         assertEquals(6f, copy.getX(), 0.0001);
@@ -110,8 +110,8 @@
         assertEquals(doubleclick.isControlDown(), copy.isControlDown());
         assertEquals(doubleclick.isAltDown(), copy.isAltDown());
         assertEquals(doubleclick.isMetaDown(), copy.isMetaDown());
-        assertEquals(MouseEvent.impl_getPopupTrigger(doubleclick),
-                     MouseEvent.impl_getPopupTrigger(copy));
+        assertEquals(doubleclick.isPopupTrigger(),
+                     copy.isPopupTrigger());
         assertEquals(doubleclick.isPrimaryButtonDown(), copy.isPrimaryButtonDown());
         assertEquals(doubleclick.isMiddleButtonDown(), copy.isMiddleButtonDown());
         assertEquals(doubleclick.isSecondaryButtonDown(), copy.isSecondaryButtonDown());
@@ -122,8 +122,8 @@
 
     @Test
     public void shouldCopyMouseEventWithNode() {
-        MouseEvent temp = MouseEvent.impl_copy(node1, node2, doubleclick);
-        MouseEvent copy = MouseEvent.impl_copy(node2, node1, temp);
+        MouseEvent temp = doubleclick.copyFor(node1, node2);
+        MouseEvent copy = temp.copyFor(node2, node1);
 
         assertEquals(1f, copy.getX(), 0.0001);
         assertEquals(2f, copy.getY(), 0.0001);
@@ -137,8 +137,8 @@
         assertEquals(doubleclick.isControlDown(), copy.isControlDown());
         assertEquals(doubleclick.isAltDown(), copy.isAltDown());
         assertEquals(doubleclick.isMetaDown(), copy.isMetaDown());
-        assertEquals(MouseEvent.impl_getPopupTrigger(doubleclick),
-                     MouseEvent.impl_getPopupTrigger(copy));
+        assertEquals(doubleclick.isPopupTrigger(),
+                     copy.isPopupTrigger());
         assertEquals(doubleclick.isPrimaryButtonDown(), copy.isPrimaryButtonDown());
         assertEquals(doubleclick.isMiddleButtonDown(), copy.isMiddleButtonDown());
         assertEquals(doubleclick.isSecondaryButtonDown(), copy.isSecondaryButtonDown());
@@ -149,7 +149,7 @@
 
     @Test
     public void shouldCopyMouseEventWithDrag() {
-        MouseEvent copy = MouseEvent.impl_copy(node1, node2, doubleclick);
+        MouseEvent copy = doubleclick.copyFor(node1, node2);
 
         assertEquals(6f, copy.getX(), 0.0001);
         assertEquals(7f, copy.getY(), 0.0001);
@@ -163,8 +163,8 @@
         assertEquals(doubleclick.isControlDown(), copy.isControlDown());
         assertEquals(doubleclick.isAltDown(), copy.isAltDown());
         assertEquals(doubleclick.isMetaDown(), copy.isMetaDown());
-        assertEquals(MouseEvent.impl_getPopupTrigger(doubleclick),
-                     MouseEvent.impl_getPopupTrigger(copy));
+        assertEquals(doubleclick.isPopupTrigger(),
+                     copy.isPopupTrigger());
         assertEquals(doubleclick.isPrimaryButtonDown(), copy.isPrimaryButtonDown());
         assertEquals(doubleclick.isMiddleButtonDown(), copy.isMiddleButtonDown());
         assertEquals(doubleclick.isSecondaryButtonDown(), copy.isSecondaryButtonDown());
--- a/javafx-ui-common/test/unit/javafx/scene/input/RotateEventTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/RotateEventTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -429,11 +429,10 @@
     }
 
     @Test public void testToString() {
-        RotateEvent e = RotateEvent.impl_rotateEvent(RotateEvent.ROTATE,
-            10, 20,
+        RotateEvent e = new RotateEvent(RotateEvent.ROTATE,
             100, 100, 200, 200,
             false, false, false, false,
-            true, false);
+            true, false, 10, 20);
 
         String s = e.toString();
 
--- a/javafx-ui-common/test/unit/javafx/scene/input/ScrollEventTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/ScrollEventTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -582,14 +582,12 @@
     }
 
     @Test public void testToString() {
-        ScrollEvent e = ScrollEvent.impl_scrollEvent(ScrollEvent.SCROLL,
-            10, 10, 20, 20,
-            ScrollEvent.HorizontalTextScrollUnits.NONE, 0,
-            ScrollEvent.VerticalTextScrollUnits.NONE, 0,
-            3,
+        ScrollEvent e = new ScrollEvent(ScrollEvent.SCROLL,
             100, 100, 200, 200,
             false, false, false, false,
-            true, false);
+            true, false, 10, 10, 20, 20,ScrollEvent.HorizontalTextScrollUnits.NONE, 0,
+            ScrollEvent.VerticalTextScrollUnits.NONE, 0,
+            3);
 
         String s = e.toString();
 
--- a/javafx-ui-common/test/unit/javafx/scene/input/SwipeEventTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/SwipeEventTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -215,11 +215,10 @@
     }
 
     @Test public void testToString() {
-        SwipeEvent e = SwipeEvent.impl_swipeEvent(SwipeEvent.SWIPE_RIGHT,
-            3,
+        SwipeEvent e = new SwipeEvent(SwipeEvent.SWIPE_RIGHT,
             100, 100, 200, 200,
             false, false, false, false,
-            true);
+            true, 3);
 
         String s = e.toString();
 
--- a/javafx-ui-common/test/unit/javafx/scene/input/ZoomEventTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/input/ZoomEventTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -430,11 +430,10 @@
     }
 
     @Test public void testToString() {
-        ZoomEvent e = ZoomEvent.impl_zoomEvent(ZoomEvent.ZOOM,
-            10, 20,
+        ZoomEvent e = new ZoomEvent(ZoomEvent.ZOOM,
             100, 100, 200, 200,
             false, false, false, false,
-            true, false);
+            true, false, 10, 20);
 
         String s = e.toString();
 
--- a/javafx-ui-common/test/unit/javafx/scene/paint/LinearGradientTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/paint/LinearGradientTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -206,6 +206,45 @@
         } catch (IllegalArgumentException iae) {
             // expected
         }
+
+        // rgb( must end with ')'
+        try {
+            LinearGradient.valueOf("linear-gradient(hsl(240,100%,100%), rgb(250, 0, 0)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+        
+        // stop can't be empty
+        try {
+            LinearGradient.valueOf("linear-gradient(from 0 100 to 100 100, red  0% ,,   black 100%)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+
+        try {
+            LinearGradient.valueOf("linear-gradient(from 0 100 to 100 100, red  0% ,black 100%,   )");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+        
+       // token can't be empty
+        try {
+            LinearGradient.valueOf("linear-gradient(, from 0 100 to 100 100, red  0% ,   black 100%)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+
+        try {
+            LinearGradient.valueOf("linear-gradient(from 0 100 to 100 100, ,repeat, red  0% ,   black 100%)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+
     }
     
     @Test
@@ -356,6 +395,19 @@
     }
     
     @Test
+    public void testValueOfColor() {
+        LinearGradient actual =
+                LinearGradient.valueOf("linear-gradient(rgb(0,0,255), rgb(255, 0, 0))");
+        LinearGradient expected =
+                LinearGradientBuilder.create().startX(0).startY(0).endX(0).endY(1)
+                .proportional(true)
+                .stops(new Stop(0, Color.BLUE),
+                       new Stop(1.0, Color.RED))
+                .build();
+        assertEquals(expected, actual);
+    }
+
+    @Test
     public void testValueOfDefaultsToBottom() {
         LinearGradient actual =
                 LinearGradient.valueOf("linear-gradient(red  0%, blue 30%, black 100%)");
--- a/javafx-ui-common/test/unit/javafx/scene/paint/RadialGradientTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/scene/paint/RadialGradientTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -243,6 +243,44 @@
         } catch (IllegalArgumentException iae) {
             // expected
         }
+        
+        // rgb( must end with ')'
+        try {
+            RadialGradient.valueOf("radial-gradient(radius 10, rgb(0,0,250), rgb(250, 0, 0)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+
+        // stop can't be empty
+        try {
+            RadialGradient.valueOf("radial-gradient(red 30%,,black 100%)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+
+        try {
+            RadialGradient.valueOf("radial-gradient(red 30%,black 100%,)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+        
+        // token can't be empty
+        try {
+            RadialGradient.valueOf("radial-gradient(,radius 100%, red  0% , blue 30%,  black 100%)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
+
+        try {
+            RadialGradient.valueOf("radial-gradient(radius 100%,,repeat, red  0% , blue 30%,  black 100%)");
+            fail("IllegalArgument should have been thrown.");
+        } catch (IllegalArgumentException iae) {
+            // expected
+        }
     }
 
     @Test
@@ -430,4 +468,17 @@
                 .build();
         assertEquals(expected, actual);
     }
+
+    @Test
+    public void testValueOfColor() {
+        RadialGradient actual =
+                RadialGradient.valueOf("radial-gradient(radius 10, rgb(0,0,255), rgb(255, 0,  0))");
+        RadialGradient expected =
+                RadialGradientBuilder.create().centerX(0).centerY(0).radius(10)
+                .proportional(false)
+                .stops(new Stop(0, Color.BLUE),
+                       new Stop(1.0, Color.RED))
+                .build();
+        assertEquals(expected, actual);
+    }
 }
--- a/javafx-ui-common/test/unit/javafx/stage/PopupTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/stage/PopupTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -445,12 +445,11 @@
 
             popup.show(stage);
             Event.fireEvent(stage,
-                            KeyEvent.impl_keyEvent(
-                                stage, KeyEvent.CHAR_UNDEFINED,
+                            new KeyEvent(null, stage,
+                                KeyEvent.KEY_PRESSED, KeyEvent.CHAR_UNDEFINED,
                                 KeyCode.ESCAPE.getName(),
                                 KeyCode.ESCAPE.impl_getCode(),
-                                false, false, false, false,
-                                KeyEvent.KEY_PRESSED));
+                                false, false, false, false));
             assertEquals(0, keyEventCounter.getValue());
 
             popup.setConsumeAutoHidingEvents(false);
@@ -463,12 +462,12 @@
 
             popup.show(stage);
             Event.fireEvent(stage,
-                            KeyEvent.impl_keyEvent(
-                                stage, KeyEvent.CHAR_UNDEFINED,
+                            new KeyEvent(null, stage,
+                                KeyEvent.KEY_PRESSED,
+                                KeyEvent.CHAR_UNDEFINED,
                                 KeyCode.ESCAPE.getName(),
                                 KeyCode.ESCAPE.impl_getCode(),
-                                false, false, false, false,
-                                KeyEvent.KEY_PRESSED));
+                                false, false, false, false));
             assertEquals(1, keyEventCounter.getValue());
             
         } finally {
--- a/javafx-ui-common/test/unit/javafx/stage/StageTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-common/test/unit/javafx/stage/StageTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -290,18 +290,18 @@
     public void testResizableNotLostForAsyncNotifications() {
         peer.holdNotifications();
 
+        s.setResizable(false);
+        assertFalse(s.isResizable());
+
         s.setResizable(true);
         assertTrue(s.isResizable());
 
-        s.setResizable(false);
+        peer.releaseSingleNotification();
         assertFalse(s.isResizable());
 
-        peer.releaseSingleNotification();
-        assertTrue(s.isResizable());
-
         peer.releaseNotifications();
 
-        assertFalse(s.isResizable());
+        assertTrue(s.isResizable());
     }
 
     @Test
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVKSkin.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/FXVKSkin.java	Tue Nov 06 09:39:13 2012 -0800
@@ -29,6 +29,8 @@
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.*;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 
 import javafx.animation.Interpolator;
 import javafx.animation.KeyFrame;
@@ -153,6 +155,12 @@
         });
     }
 
+    private static Boolean enableCaching = AccessController.doPrivileged(
+    new PrivilegedAction<Boolean>() {
+        @Override public Boolean run() {
+            return Boolean.getBoolean("com.sun.javafx.scene.control.skin.FXVK.cache");
+        }
+    });
 
 
     public FXVKSkin(final FXVK fxvk) {
@@ -407,6 +415,9 @@
             hbox.setAlignment((fxvk.chars != null) ? Pos.CENTER_LEFT : Pos.CENTER);
             vbox.getChildren().add(hbox);
             for (Control c : row) {
+                if (enableCaching) {
+                    c.setCache(true);
+                }
                 hbox.getChildren().add(c);
                 HBox.setHgrow(c, Priority.ALWAYS);
                 if (c instanceof Key) {
--- a/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-controls/src/com/sun/javafx/scene/control/skin/TableColumnHeader.java	Tue Nov 06 09:39:13 2012 -0800
@@ -196,7 +196,7 @@
     
     private static final EventHandler<MouseEvent> mouseReleasedHandler = new EventHandler<MouseEvent>() {
         @Override public void handle(MouseEvent me) {
-            if (MouseEvent.impl_getPopupTrigger(me)) return;
+            if (me.isPopupTrigger()) return;
             
             TableColumnHeader header = (TableColumnHeader) me.getSource(); 
             TableColumn tableColumn = header.getTableColumn();
--- a/javafx-ui-controls/test/com/sun/javafx/scene/control/skin/ScrollPaneSkinTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-controls/test/com/sun/javafx/scene/control/skin/ScrollPaneSkinTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -298,14 +298,14 @@
         stage.show();
  
         Event.fireEvent(rect, 
-              ScrollEvent.impl_scrollEvent(ScrollEvent.SCROLL,
+              new ScrollEvent(ScrollEvent.SCROLL,
+                          50, 50,
+                          50, 50,
+                          false, false, false, false, true, false, 
                           0.0, -50.0, 0.0, -50.0,
                           ScrollEvent.HorizontalTextScrollUnits.NONE, 10.0,
                           ScrollEvent.VerticalTextScrollUnits.NONE, 10.0,
-                          0,
-                          50, 50,
-                          50, 50,
-                          false, false, false, false, true, false));
+                          0));
 
         /*
         ** did it work?
@@ -666,15 +666,16 @@
         stage.show();
          
         Event.fireEvent(rect,      
-         SwipeEvent.impl_swipeEvent(SwipeEvent.SWIPE_DOWN,
-            1,
+         new SwipeEvent(SwipeEvent.SWIPE_DOWN,
             0.0, -50.0,
             0.0, -50.0,
             false,
             false,
             false,
             false,
-            false));
+            false,
+            1
+            ));
 
         /*
         ** did it work?
@@ -732,15 +733,16 @@
         stage.show();
          
         Event.fireEvent(rect,      
-            SwipeEvent.impl_swipeEvent(SwipeEvent.SWIPE_RIGHT,
-            1,
+            new SwipeEvent(SwipeEvent.SWIPE_RIGHT,
             0.0, -50.0,
             0.0, -50.0,
             false,
             false,
             false,
             false,
-            false));
+            false,
+            1
+            ));
 
          /*
          ** did it work?
--- a/javafx-ui-controls/test/com/sun/javafx/scene/control/skin/VirtualFlowTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-controls/test/com/sun/javafx/scene/control/skin/VirtualFlowTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -906,14 +906,14 @@
         double originalValue = flow.getPosition();
 
         Event.fireEvent(flow, 
-              ScrollEvent.impl_scrollEvent(ScrollEvent.SCROLL,
+              new ScrollEvent(ScrollEvent.SCROLL,
                           0.0, -10.0, 0.0, -10.0,
+                          false, false, false, false, true, false,
+                          0, 0,
+                          0, 0,
                           ScrollEvent.HorizontalTextScrollUnits.NONE, 0.0,
                           ScrollEvent.VerticalTextScrollUnits.LINES, -1.0,
-                          0,
-                          0, 0,
-                          0, 0,
-                          false, false, false, false, true, false));
+                          0));
 
         assertTrue(originalValue != flow.getPosition());
     }
--- a/javafx-ui-controls/test/javafx/scene/control/KeyEventFirer.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-controls/test/javafx/scene/control/KeyEventFirer.java	Tue Nov 06 09:39:13 2012 -0800
@@ -56,15 +56,16 @@
     private KeyEvent createEvent(KeyCode keyCode, EventType<KeyEvent> evtType, KeyModifier... modifiers) {
         List<KeyModifier> ml = Arrays.asList(modifiers);
 
-        return KeyEvent.impl_keyEvent(
+        return new KeyEvent( null,
                 target, // EventTarget
+                evtType,  // eventType
                 null,     // Character (unused unless KeyCode == KEY_TYPED
                 null,     // text
                 keyCode.impl_getCode(), // KeyCode
                 ml.contains(KeyModifier.SHIFT),                                   // shiftDown
                 ml.contains(KeyModifier.CTRL),                                    // ctrlDown
                 ml.contains(KeyModifier.ALT),                                     // altDown
-                ml.contains(KeyModifier.META) || ml.contains(KeyModifier.CMD),    // metaData
-                evtType);  // eventType
+                ml.contains(KeyModifier.META) || ml.contains(KeyModifier.CMD)    // metaData
+                ); 
     }
 }
--- a/javafx-ui-controls/test/javafx/scene/control/TabPaneTest.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/javafx-ui-controls/test/javafx/scene/control/TabPaneTest.java	Tue Nov 06 09:39:13 2012 -0800
@@ -816,9 +816,8 @@
         stage.show();
         stage.requestFocus();
 
-        final KeyEvent tabEvent = KeyEvent.impl_keyEvent(null, "", "", 0x09,
-                                                         false, false, false, false,
-                                                         KeyEvent.KEY_PRESSED);
+        final KeyEvent tabEvent = new KeyEvent(KeyEvent.KEY_PRESSED, "", "", 0x09,
+                                                         false, false, false, false);
         Platform.runLater(new Runnable() {
             @Override public void run() {
                 tabPane.requestFocus();
--- a/test-stub-toolkit/src/com/sun/javafx/pgstub/StubNode.java	Mon Nov 05 22:28:30 2012 +0000
+++ b/test-stub-toolkit/src/com/sun/javafx/pgstub/StubNode.java	Tue Nov 06 09:39:13 2012 -0800
@@ -107,4 +107,9 @@
     public void effectChanged() {
         // ignore
     }
+
+    @Override
+    public void release() {
+        
+    }
 }