Example usage for javafx.geometry Side LEFT

List of usage examples for javafx.geometry Side LEFT

Introduction

In this page you can find the example usage for javafx.geometry Side LEFT.

Prototype

Side LEFT

To view the source code for javafx.geometry Side LEFT.

Click Source Link

Document

Represents left side of a rectangle.

Usage

From source file:org.noroomattheinn.visibletesla.LocationController.java

@Override
protected void initializeState() {
    useMiles = vtVehicle.unitType() == Utils.UnitType.Imperial;
    blipAnimation = animateBlip();/*from  ww  w . j  a  v a  2  s  .  c  om*/
    vtData.produceStream(false);
    vtVehicle.streamState.addTracker(new Runnable() {
        @Override
        public void run() {
            doUpdateLater(vtVehicle.streamState.get());
        }
    });

    StreamState ss = vtVehicle.streamState.get();
    if (ss != null) {
        doUpdateLater(ss);
    }

    if (!useMiles) {
        multigauge.setRange(Side.LEFT, 0, 160);
    }
}

From source file:org.noroomattheinn.visibletesla.LocationController.java

private void reflectInternal(StreamState ss) {
    String latitude = String.valueOf(ss.estLat);
    String longitude = String.valueOf(ss.estLng);
    String heading = String.valueOf(ss.estHeading);

    if (mapIsLoaded) {
        try {/*from  w  w  w.j a va2s .  c o m*/
            engine.executeScript(String.format("moveMarker(%s, %s, %s)", latitude, longitude, heading));
        } catch (Exception e) {
            logger.warning(e.toString());
        }
    } else {
        String mapHTML = getMapFromTemplate(latitude, longitude, heading);
        engine.getLoadWorker().stateProperty().addListener(new ChangeListener<State>() {
            @Override
            public void changed(ObservableValue ov, State old, State cur) {
                if (cur == State.SUCCEEDED) {
                    mapIsLoaded = true;
                    stopBlip(blipAnimation);
                    loadingImage.setVisible(false);
                    loadingImageLabel.setVisible(false);
                }
            }
        });
        engine.loadContent(mapHTML);

        //            This code can be used to communicate events back from javascript in
        //            the html code to this Java code. The javascript code would do something
        //            like: window.status = "load complete"; and that message would be passed
        //            to this onStatusChanged handler.
        //            engine.setOnStatusChanged(new EventHandler<WebEvent<java.lang.String>>() {
        //                @Override public void handle(WebEvent<String> t) {
        //                    logger.log(Level.INFO, "Status Change: " + t.getData());
        //                }
        //            });

    }
    multigauge.setVal(Side.LEFT, useMiles ? ss.speed : Utils.milesToKm(ss.speed));
    multigauge.setVal(Side.RIGHT, ss.power);
}