Java Code Examples for javafx.beans.binding.Bindings#selectInteger()

The following examples show how to use javafx.beans.binding.Bindings#selectInteger() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PointingHeroIcon.java    From clarity-analyzer with BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
public PointingHeroIcon(ObservableEntity oe) {
    super(oe);

    shape = new Polygon(
        0, -200, -120, 200, 120, 200
    );

    shape.fillProperty().bind(getPlayerColor());

    ObjectBinding<Vector> angRotVector = oe.getPropertyBinding(Vector.class, "CBodyComponent.m_angRotation", null);
    DoubleBinding angRot = Bindings.createDoubleBinding(() -> (double) angRotVector.get().getElement(1), angRotVector);

    IntegerBinding angDiff = Bindings.selectInteger(oe.getPropertyBinding(Integer.class, "m_anglediff", 0));

    shape.translateXProperty().bind(getMapX());
    shape.translateYProperty().bind(getMapY());
    shape.rotateProperty().bind(getBaseAngle().add(angRot).add(angDiff));
}
 
Example 2
Source File: EntityIcon.java    From clarity-analyzer with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected IntegerBinding getCellX() {
    return Bindings.selectInteger(oe.getPropertyBinding(Integer.class, "CBodyComponent.m_cellX", 0));
}
 
Example 3
Source File: EntityIcon.java    From clarity-analyzer with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected IntegerBinding getCellY() {
    return Bindings.selectInteger(oe.getPropertyBinding(Integer.class, "CBodyComponent.m_cellY", 0));
}
 
Example 4
Source File: EntityIcon.java    From clarity-analyzer with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected IntegerBinding getPlayerId() {
    return Bindings.selectInteger(oe.getPropertyBinding(Integer.class, "m_iPlayerID", -1));
}
 
Example 5
Source File: EntityIcon.java    From clarity-analyzer with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
protected IntegerBinding getTeamNum() {
    return Bindings.selectInteger(oe.getPropertyBinding(Integer.class, "m_iTeamNum", 0));
}