FX Experience Has Gone Read-Only

I've been maintaining FX Experience for a really long time now, and I love hearing from people who enjoy my weekly links roundup. One thing I've noticed recently is that maintaining two sites (FX Experience and JonathanGiles.net) takes more time than ideal, and splits the audience up. Therefore, FX Experience will become read-only for new blog posts, but weekly posts will continue to be published on JonathanGiles.net. If you follow @FXExperience on Twitter, I suggest you also follow @JonathanGiles. This is not the end - just a consolidation of my online presence to make my life a little easier!

tl;dr: Follow me on Twitter and check for the latest news on JonathanGiles.net.

JavaFX links of the week, May 6

Hi all. Welcome to another weeks worth of links. There is, as is becoming all too frequent, a great number of links this week, spanning new downloads, 3D investigations, embedded discussions and interesting new tools and libraries being developed by people in the community. Keep up the great work! 🙂

See – I told you it was a great list of links! 🙂 Catch you all next week, and keep up the great work.

3D SpaceNavigator with JavaFX

I just got a 3D Connexion SpaceNavigator which is a kind of 3D input device(mouse/stick). It is cool to use when 3D modeling content for JavaFX but I thought it would be even better if I could navigate my JavaFX 3D scenes using it. I managed to hack some quick code to get it working in JavaFX. Many thanks to the JInput project, they made it super easy. Its super fun so I recoded a little video to share with you.

SpaceNavigator with JavaFX from Jasper Potts on Vimeo.

The code really is very simple, I just have a AnimationTimer that every frame checks to get the current inputs from device and applies them to the camera transforms. The device via jinput provides 6 floats for each axis and 2 booleans for the buttons, so could not be easier to connect to your app. Below is complete 3D app with a simple cube. I will be working on getting the object importers out in open source for you to use very soon 🙂

public class InputTestBlog extends Application {
    private ControllerEnvironment controllerEnvironment;
    private Controller spaceNavigator;
    private Component[] components;
    private Translate translate;
    private Rotate rotateX,rotateY,rotateZ;

    @Override public void start(Stage stage) throws Exception {
        controllerEnvironment = ControllerEnvironment.getDefaultEnvironment();
        Controller[] controllers = controllerEnvironment.getControllers();
        for(Controller controller: controllers){
            if ("SpaceNavigator".equalsIgnoreCase(controller.getName())){
                spaceNavigator = controller;
                System.out.println("USING Device ["+controller.getName()+"] of type ["+controller.getType().toString()+"]");
                components = spaceNavigator.getComponents();
            }
        }

        Group root = new Group();
        Scene scene = new Scene(root, 1024, 768, true);
        stage.setScene(scene);
        scene.setFill(Color.GRAY);
        // CAMERA
        final PerspectiveCamera camera = new PerspectiveCamera(true);
        scene.setCamera(camera);
        root.getChildren().add(camera);
        // BOX
        Box testBox = new Box(5,5,5);
        testBox.setMaterial(new PhongMaterial(Color.RED));
        testBox.setDrawMode(DrawMode.LINE);
        root.getChildren().add(testBox);
        // MOVE CAMERA
        camera.getTransforms().addAll(
                rotateY = new Rotate(-20, Rotate.Y_AXIS),
                rotateX = new Rotate(-20, Rotate.X_AXIS),
                rotateZ = new Rotate(0, Rotate.Z_AXIS),
                translate = new Translate(5, -5, -15)
        );
        // SHOW STAGE
        stage.show();
        // CHECK FOR INPUT
        if (spaceNavigator != null) {
            new AnimationTimer() {
                @Override public void handle(long l) {
                    if (spaceNavigator.poll()) {
                        for(Component component: components) {
                            switch(component.getName()) {
                                case "x":
                                    translate.setX(translate.getX() + component.getPollData());
                                    break;
                                case "y":
                                    translate.setY(translate.getY()+component.getPollData());
                                    break;
                                case "z":
                                    translate.setZ(translate.getZ()+component.getPollData());
                                    break;
                                case "rx":
                                    rotateX.setAngle(rotateX.getAngle()+component.getPollData());
                                    break;
                                case "ry":
                                    rotateY.setAngle(rotateY.getAngle()+component.getPollData());
                                    break;
                                case "rz":
                                    rotateZ.setAngle(rotateZ.getAngle()+component.getPollData());
                                    break;
                            }
                        }
                    }
                }
            }.start();
        }
    }

    public static void main(String[] args) {
        System.setProperty("net.java.games.input.librarypath", new File("lib").getAbsolutePath());
        launch(args);
    }
}

JavaFX links of the week, April 29

Hi all, a bunch of good links this week! The community really are putting a lot of effort into blogging about their JavaFX projects, which is great. Keep up the good work! 🙂

  • Coming up this week is a presentation by Richard Bair at the Silicon Valley JavaFX Users Group on the topic of OpenJFX. The talk is on Wednesday, 1st May, starting at 6:15pm (PDT). As per usual, it will also be broadcast live over the internet for those of you not in the Bay Area (such as myself). The streaming starts at 7:00pm, and I recommend you sign up for a ustream account so that you may join the discussion. The stream is at the usual place.
  • Canoo have two recent blog posts that may be of interest to you. Firstly, they have posted on using Dolphin to display a train station schedule. In a second post, they cover their CanooNow project, which is an embedded room allocation dashboard with JavaFx and OpenDolphin, running on a Raspberry Pi.
  • Claudine Zillmann continues making excellent progress on developing a Mac OS X aqua theme for JavaFX. She has just posted another blog post which shows a JavaFX application side-by-side with a native Mac OS X dialog, and the differences are negligible.
  • There appears to be a battle being waged between Sean Phillips and Geertjan Wielenga over JavaFX integration into the NetBeans platform. There are now five such articles that I’m aware of, all titled along the lines of “How to Integrate JavaFX into the NetBeans Platform X”, where X has so far included Visual Library Scene, MenuBar, ToolBar, Wizard, and Explorer View. Keep up the great work guys – lets see how far you can push NetBeans 🙂
  • The Helsinki Scala Club recently had a presentation on ScalaFX, which is now posted online (in PDF form).
  • Mirko Sertic has created a desktop search engine with a JavaFX frontend. Very nice stuff! 🙂
  • August Lammersdorf has updated his JavaFX 3D model importers to take advantage of the new JavaFX 3D APIs that appeared in JavaFX 8.0 b87.
  • William Antonio has posted a blog detailing the Afterburner.fx library developed by Adam Bien. Afterburner.fx is a “minimalistic (2 classes) JavaFX MVP framework based on Convention over Configuration.”
  • Jörn Hameister has blogged about how to use and extend the JFXtras library.
  • Robin Leo Söderström has a post about creating a Windows 7 screen saver using JavaFX.
  • Anton Epple has a short post on how to dynamically populate a JavaFX tooltip just prior to displaying it on screen.

That’s all for this week, and again, keep up the great work folks! 🙂

JavaFX links of the week, April 22

A good selection of links this week. Enjoy 🙂

Catch you all next week. In the mean time, keep up the great work folks! 🙂

JavaFX links of the week, April 15

Hi all, here’s your links for another week. Enjoy! 🙂

Catch you all in a weeks time! 🙂