Commits

shemnon committed 9e77be3

Make schedulebuilder work with b76

Comments (0)

Files changed (7)

samples/ConferenceScheduleApp/build.gradle

-apply from: 'http://dl.bintray.com/content/shemnon/javafx-gradle/javafx.plugin'
+apply from: 'https://repository-javafx-gradle-plugin.forge.cloudbees.com/snapshot/javafx.plugin'
 
 if (!System.getProperty("java.version").matches(/^(1\.)?8.*/)) { //FIXME not the best way, but cloudbees is on an old version of gradle
     throw new GradleException("Java 8 required, ${System.getProperty("java.version")} found")
 
 javafx {
     mainClass = 'com.javafx.experiments.scheduleapp.ConferenceScheduleApp'
-}
+}

samples/ConferenceScheduleApp/src/main/java/com/javafx/experiments/scheduleapp/TouchScrollEventSynthesizer.java

                 }
                 if (clickThresholdBroken) {
                     // TODO
-                    Event.fireEvent(e.getTarget(), ScrollEvent.impl_scrollEvent(
+                    Event.fireEvent(e.getTarget(), new ScrollEvent(
                             ScrollEvent.SCROLL,
                             scrollDistX, scrollDistY,
                             scrollDistX, scrollDistY,
-                            ScrollEvent.HorizontalTextScrollUnits.NONE, 0,
-                            ScrollEvent.VerticalTextScrollUnits.NONE, 0,
-                            0,
+                            me.isShiftDown(), me.isControlDown(), me.isAltDown(), me.isMetaDown(),
+                            true, false,
                             me.getX(), me.getY(),
                             me.getSceneX(), me.getSceneY(),
-                            me.isShiftDown(), me.isControlDown(), me.isAltDown(), me.isMetaDown(),
-                            true, false));
+                            ScrollEvent.HorizontalTextScrollUnits.NONE, 0,
+                            ScrollEvent.VerticalTextScrollUnits.NONE, 0,
+                            0));
                 }
             } else if (e.getEventType() == MouseEvent.MOUSE_RELEASED) {
                 handleRelease(me);
                     final double dragStepY = mouseY - lastMouseY;
 
                     if (Math.abs(dragStepX) >= 1.0 || Math.abs(dragStepY) >= 1.0) {
-                        Event.fireEvent(me.getTarget(), ScrollEvent.impl_scrollEvent(
+                        Event.fireEvent(me.getTarget(), new ScrollEvent(
                                 ScrollEvent.SCROLL,
                                 dragStepX, dragStepY,
                                 (distanceX * get()), (distanceY * get()),
-                                ScrollEvent.HorizontalTextScrollUnits.NONE, 0,
-                                ScrollEvent.VerticalTextScrollUnits.NONE, 0,
-                                0,
+                                me.isShiftDown(), me.isControlDown(), me.isAltDown(), me.isMetaDown(),
+                                true, true,
                                 me.getX(), me.getY(),
                                 me.getSceneX(), me.getSceneY(),
-                                me.isShiftDown(), me.isControlDown(), me.isAltDown(), me.isMetaDown(),
-                                true, true));
+                                ScrollEvent.HorizontalTextScrollUnits.NONE, 0,
+                                ScrollEvent.VerticalTextScrollUnits.NONE, 0,
+                                0));
                     }
                     lastMouseX = mouseX;
                     lastMouseY = mouseY;

samples/ConferenceScheduleApp/src/main/java/com/javafx/experiments/scheduleapp/control/LoginProgressBarSkin.java

  */
 package com.javafx.experiments.scheduleapp.control;
 
-import com.sun.javafx.scene.control.behavior.ProgressBarBehavior;
 import javafx.animation.Interpolator;
 import javafx.animation.KeyFrame;
 import javafx.animation.KeyValue;
 import javafx.scene.layout.Region;
 import javafx.util.Duration;
 
-public class LoginProgressBarSkin extends SkinBase<ProgressBar, ProgressBarBehavior<ProgressBar>> {
+public class LoginProgressBarSkin extends SkinBase<ProgressBar> {
     /**
      * The track is rendered by the control itself, the bar though is provided by this skin.
      */
     private Timeline widthTimeline = null;
     private DoubleProperty barWidth = new SimpleDoubleProperty(this, "barWidth", 0) {
         @Override protected void invalidated() {
-            requestLayout();
+            getSkinnable().requestLayout();
         }
     }; // between 0 and 1
 
      **************************************************************************/
 
     public LoginProgressBarSkin(final ProgressBar control) {
-        super(control, new ProgressBarBehavior<ProgressBar>(control));
+        super(control);
         InvalidationListener listener = new InvalidationListener() {
             @Override public void invalidated(Observable valueModel) {
                 if (widthTimeline != null) widthTimeline.stop();
         bar = new Region();
         bar.getStyleClass().setAll("bar");
         getChildren().setAll( bar);
-        requestLayout();
+        getSkinnable().requestLayout();
     }
 
     @Override
     public double getBaselineOffset() {
         double height = getSkinnable().getHeight();
-        return getInsets().getTop() + height;
+        return getSkinnable().getInsets().getTop() + height;
     }
 
     /***************************************************************************
      **************************************************************************/
 
     @Override protected double computePrefWidth(double height) {
-        return Math.max(100, getInsets().getLeft() + bar.prefWidth(getWidth()) + getInsets().getRight());
+        return Math.max(100, getSkinnable().getInsets().getLeft() + bar.prefWidth(getSkinnable().getWidth()) + getSkinnable().getInsets().getRight());
     }
 
     @Override protected double computePrefHeight(double width) {
-        return getInsets().getTop() + bar.prefHeight(width) + getInsets().getBottom();
+        return getSkinnable().getInsets().getTop() + bar.prefHeight(width) + getSkinnable().getInsets().getBottom();
     }
 
     @Override protected void layoutChildren(final double x, final double y, final double w, final double h) {
             final Insets barInsets = bar.getInsets();
             bw = Math.max(barInsets.getLeft() + barInsets.getRight(), bw);
         }
-        final Insets insets = getInsets();
-        bar.resizeRelocate(x, y, bw, getHeight() - (insets.getTop() + insets.getBottom()));
+        final Insets insets = getSkinnable().getInsets();
+        bar.resizeRelocate(x, y, bw, getSkinnable().getHeight() - (insets.getTop() + insets.getBottom()));
     }
 }

samples/ConferenceScheduleApp/src/main/java/com/javafx/experiments/scheduleapp/control/VirtualKeyboardSkin.java

  * Where you place the keyboard relative to the screen, how it is displayed, etc is
  * completely up to you.
  */
-public class VirtualKeyboardSkin extends SkinBase<VirtualKeyboard, BehaviorBase<VirtualKeyboard>> {
+public class VirtualKeyboardSkin
+        extends SkinBase<VirtualKeyboard> {
     private static final int GAP = 6;
 
     private List<List<Key>> board;
      * @param behavior
      */
     public VirtualKeyboardSkin(VirtualKeyboard keyboard) {
-        super(keyboard, new BehaviorBase<VirtualKeyboard>(keyboard));
+        super(keyboard);
 
-        registerChangeListener(keyboard.typeProperty(), "type");
+        //registerChangeListener(keyboard.typeProperty(), "type");
+        keyboard.typeProperty().addListener(changeEvent -> rebuild());
         rebuild();
     }
 
-    @Override protected void handleControlPropertyChanged(String propertyReference) {
-        // With Java 8 (or is it 7?) I can do switch on strings instead
-        if (propertyReference == "type") {
-            // The type has changed, so we will need to rebuild the entire keyboard.
-            // This happens whenever the user switches from one keyboard layout to
-            // another, such as by pressing the "ABC" key on a numeric layout.
-            rebuild();
-        }
-    }
-
     /**
      * Replaces all children of this VirtualKeyboardSkin based on the keyboard
      * type set on the VirtualKeyboard.
     // the pref width is just some hard-coded value (although I could have maybe
     // done it based on the pref width of a text node with the right font).
     @Override protected double computePrefWidth(double height) {
-        final Insets insets = getInsets();
+        final Insets insets = getSkinnable().getInsets();
         return insets.getLeft() + (56 * numCols) + insets.getRight();
     }
 
     // Pref height is just some value. This isn't overly important.
     @Override protected double computePrefHeight(double width) {
-        final Insets insets = getInsets();
+        final Insets insets = getSkinnable().getInsets();
         return insets.getTop() + (80 * 5) + insets.getBottom();
     }
 
         }
 
         protected KeyEvent event(EventType<KeyEvent> type) {
-            return KeyEvent.impl_keyEvent(getSkinnable(), chars, "", 0,
-                                          shiftDown, false, false, false, type);
+            return new KeyEvent(getSkinnable(), null, type, chars, "", KeyCode.UNDEFINED,
+                                          shiftDown, false, false, false);
         }
     }
 
 
         protected KeyEvent event(EventType<KeyEvent> type) {
             if (type == KeyEvent.KEY_PRESSED || type == KeyEvent.KEY_RELEASED) {
-                return KeyEvent.impl_keyEvent(getSkinnable(), chars, chars, code.impl_getCode(),
-                                              shiftDown, false, false, false, type);
+                return new KeyEvent(getSkinnable(), null, type, chars, chars, code,
+                                              shiftDown, false, false, false);
             } else {
                 return super.event(type);
             }

samples/ConferenceScheduleApp/src/main/java/com/javafx/experiments/scheduleapp/data/JSONParserJP.java

                         state = QUOTE;
                         continue;
                     case QUOTE_UNICODE:
-                        if (unicode.length() < 3) {
-                            unicode += c;
-                        } else {
+                        unicode += c;
+                        if (unicode.length() == 4) {
                             c = (char) Integer.parseInt(unicode, 16);
                             if(charBufferLength == charBuffer.length) {
                                 char[] newCharBuffer = new char[charBuffer.length*2];

samples/ConferenceScheduleApp/src/main/resources/com/javafx/experiments/scheduleapp/SchedulerStyleSheet.css

     -fx-font-size: 12px;
     -fx-font-weight: bold;
     -fx-padding: 2;
-    -fx-alignment: top-left
+    -fx-alignment: top-left;
 }
 .catalog-session-speaker {
     -fx-font-size: 12px;
 .scroll-pane {
     -fx-background-color: null;
     -fx-background-insets: 0;
-    -fx-skin: "com.javafx.experiments.scheduleapp.control.ScrollPaneSkin3"
+    -fx-skin: "com.javafx.experiments.scheduleapp.control.ScrollPaneSkin3";
 }
 
 /* ****** SESSION FILTER *************************************************************************** */

samples/Modena/build.gradle

-apply from: 'http://dl.bintray.com/content/shemnon/javafx-gradle/javafx.plugin'
+apply from: 'https://repository-javafx-gradle-plugin.forge.cloudbees.com/snapshot/javafx.plugin'
 
 if (!JavaVersion.current().isJava8Compatible()) {
     throw new GradleException("Java 8 required, ${System.getProperty("java.version")} found")
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.