Java Code Examples for javafx.beans.property.SimpleBooleanProperty

The following are top voted examples for showing how to use javafx.beans.property.SimpleBooleanProperty. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: hygene   File: SequenceVisualizer.java   View source code 6 votes vote down vote up
/**
 * Create instance of {@link SequenceVisualizer}.
 */
public SequenceVisualizer() {
    sequenceProperty = new SimpleStringProperty();
    offsetProperty = new SimpleIntegerProperty();
    onScreenBasesProperty = new SimpleIntegerProperty();
    hoveredBaseIdProperty = new SimpleIntegerProperty(-1);

    sequenceProperty.addListener((observable, oldValue, newValue) -> {
        if (offsetProperty.get() == 0) {
            draw(); // force redraw if offset remains unchanged.
        }
        offsetProperty.set(0);
    });
    offsetProperty.addListener((observable, oldValue, newValue) -> draw());
    hoveredBaseIdProperty.addListener((observable, oldValue, newValue) -> draw());

    visibleProperty = new SimpleBooleanProperty(false);
}
 
Example 2
Project: stvs   File: GlobalConfig.java   View source code 6 votes vote down vote up
/**
 * Creates a default configuration. Paths are set to <tt>[Path to ... Executable]</tt>.
 */
public GlobalConfig() {
  verificationTimeout = new SimpleIntegerProperty(3600);
  simulationTimeout = new SimpleIntegerProperty(60);
  windowMaximized = new SimpleBooleanProperty(true);
  windowHeight = new SimpleIntegerProperty(600);
  windowWidth = new SimpleIntegerProperty(800);
  editorFontSize = new SimpleIntegerProperty(12);
  maxLineRollout = new SimpleIntegerProperty(50);
  editorFontFamily = new SimpleStringProperty("DejaVu Sans Mono");
  showLineNumbers = new SimpleBooleanProperty(true);
  uiLanguage = new SimpleStringProperty("EN");
  nuxmvFilename = new SimpleStringProperty(
      ExecutableLocator.findExecutableFileAsString("nuXmv")
          .orElse("[Path to nuXmv Executable]"));
  z3Path = new SimpleStringProperty(
      ExecutableLocator.findExecutableFileAsString("z3")
      .orElse("[Path to Z3 Executable]"));
  getetaCommand =
      new SimpleStringProperty("java -jar /path/to/geteta.jar -c ${code} -t ${spec} -x");
}
 
Example 3
Project: MineIDE   File: WizardStepBuilder.java   View source code 6 votes vote down vote up
/**
 * Add a yes/no choice to a wizard step.
 *
 * @param fieldName
 * @param defaultValue
 *            of the choice.
 * @param prompt
 *            the tooltip to show
 * @return
 */
@SuppressWarnings("unchecked")
public WizardStepBuilder addBoolean(final String fieldName, final boolean defaultValue, final String prompt)
{
    final JFXCheckBox box = new JFXCheckBox();
    box.setTooltip(new Tooltip(prompt));
    box.setSelected(defaultValue);

    this.current.getData().put(fieldName, new SimpleBooleanProperty());
    this.current.getData().get(fieldName).bind(box.selectedProperty());

    final Label label = new Label(fieldName);
    GridPane.setHalignment(label, HPos.RIGHT);
    GridPane.setHalignment(box, HPos.LEFT);
    this.current.add(label, 0, this.current.getData().size() - 1);
    this.current.add(box, 1, this.current.getData().size() - 1);
    return this;
}
 
Example 4
Project: CORNETTO   File: MyGraphView.java   View source code 6 votes vote down vote up
public MyGraphView(MyGraph<MyVertex, MyEdge> graph) {
    this.graph = graph;
    this.myVertexViewGroup = new Group();
    this.myEdgeViewGroup = new Group();
    this.animationService = new SpringAnimationService(graph);

    this.pausedProperty = new SimpleBooleanProperty(false);

    drawNodes();
    drawEdges();

    getChildren().add(myEdgeViewGroup);
    getChildren().add(myVertexViewGroup);

    // Add all Vertex to the selection Model and add Listener
    selectionModel = new VertexSelectionModel(graph.getVertices().toArray());
    addSelectionListener();
    addPausedListener();

    startLayout();
}
 
Example 5
Project: CORNETTO   File: MyEdge.java   View source code 6 votes vote down vote up
private void setupListeners() {
    correlationAndPValueInRange = new SimpleBooleanProperty(true);
    frequencyInRange = new SimpleBooleanProperty(true);
    //Add listeners for the two range properties - if both are false, set hidden to true
    correlationAndPValueInRange.addListener(observable -> {
        if (correlationAndPValueInRange.get() && frequencyInRange.get()) {
            showEdge();
        } else {
            hideEdge();
        }
    });

    frequencyInRange.addListener(observable -> {
        if (correlationAndPValueInRange.get() && frequencyInRange.get()) {
            showEdge();
        } else {
            hideEdge();
        }
    });
}
 
Example 6
Project: hygene   File: Query.java   View source code 5 votes vote down vote up
/**
 * Creates instance of {@link Query}.
 *
 * @param graphStore the {@link GraphStore} used to retrieve the most up to date graph
 */
@Inject
public Query(final GraphStore graphStore) {
    visibleProperty = new SimpleBooleanProperty();
    queryingProperty = new SimpleBooleanProperty();
    queriedNodeIds = FXCollections.observableArrayList();

    graphStore.getGfaFileProperty().addListener((observable, oldValue, newValue) ->
            setSearchQuery(new SearchQuery(newValue)));
}
 
Example 7
Project: ABC-List   File: Topic.java   View source code 5 votes vote down vote up
private void init(long id, long parentId, String title) {
    this.setId(id);
    this.setParentId(parentId);
    this.setTitle(title);
    
    markAsChangedProperty = new SimpleBooleanProperty(Boolean.FALSE);
}
 
Example 8
Project: stvs   File: ConstraintSpecificationValidator.java   View source code 5 votes vote down vote up
/**
 * <p>
 * Creates a validator with given observable models as context information.
 * </p>
 *
 * <p>
 * The validator observes changes in any of the given context models. It automatically updates the
 * validated specification (see {@link #validSpecificationProperty()}) and/or the problems with
 * the constraint specification (see {@link #problemsProperty()}).
 * </p>
 *
 * @param typeContext the extracted types (esp. enums) from the code area
 * @param codeIoVariables the extracted {@link CodeIoVariable}s from the code area
 * @param validFreeVariables the most latest validated free variables from the
 *        {@link FreeVariableList}.
 * @param specification the specification to be validated
 */
public ConstraintSpecificationValidator(ObjectProperty<List<Type>> typeContext,
    ObjectProperty<List<CodeIoVariable>> codeIoVariables,
    ReadOnlyObjectProperty<List<ValidFreeVariable>> validFreeVariables,
    ConstraintSpecification specification) {
  this.typeContext = typeContext;
  this.codeIoVariables = codeIoVariables;
  this.validFreeVariables = validFreeVariables;
  this.specification = specification;

  this.problems = new SimpleObjectProperty<>(new ArrayList<>());
  this.validSpecification = new NullableProperty<>();
  this.valid = new SimpleBooleanProperty(false);

  // All these ObservableLists invoke the InvalidationListeners on deep updates
  // So if only a cell in the Specification changes, the change listener on the ObservableList
  // two layers above gets notified.
  specification.getRows().addListener(listenToSpecUpdate);
  specification.getDurations().addListener(listenToSpecUpdate);
  specification.getColumnHeaders().addListener(listenToSpecUpdate);

  typeContext.addListener(listenToSpecUpdate);
  codeIoVariables.addListener(listenToSpecUpdate);
  validFreeVariables.addListener(listenToSpecUpdate);

  recalculateSpecProblems();
}
 
Example 9
Project: marathonv5   File: TableCellFactorySample.java   View source code 5 votes vote down vote up
private Person(boolean invited, String fName, String lName, String email) {
    this.invited = new SimpleBooleanProperty(invited);
    this.firstName = new SimpleStringProperty(fName);
    this.lastName = new SimpleStringProperty(lName);
    this.email = new SimpleStringProperty(email);
    this.invited = new SimpleBooleanProperty(invited);
    
    this.invited.addListener(new ChangeListener<Boolean>() {
        public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
            System.out.println(firstNameProperty().get() + " invited: " + t1);
        }
    });            
}
 
Example 10
Project: marathonv5   File: ComboBoxTableViewSample.java   View source code 5 votes vote down vote up
private Person(boolean invited, String fName, String lName, String email) {
    this.invited = new SimpleBooleanProperty(invited);
    this.firstName = new SimpleStringProperty(fName);
    this.lastName = new SimpleStringProperty(lName);
    this.email = new SimpleStringProperty(email);
    this.invited = new SimpleBooleanProperty(invited);
    
    this.invited.addListener(new ChangeListener<Boolean>() {
        public void changed(ObservableValue<? extends Boolean> ov, Boolean t, Boolean t1) {
            System.out.println(firstNameProperty().get() + " invited: " + t1);
        }
    });            
}
 
Example 11
Project: GameAuthoringEnvironment   File: Profile.java   View source code 5 votes vote down vote up
private void init (String name, String description, ImageGraphic graphic) {
    myName = new SimpleStringProperty(name);
    myDescription = new SimpleStringProperty(description);
    myImage = graphic;
    myImageWidth = graphic.getWidth();
    myImageHeight = graphic.getHeight();
    imageChange = new SimpleBooleanProperty(false);
}
 
Example 12
Project: GameAuthoringEnvironment   File: Check.java   View source code 5 votes vote down vote up
public Check (IAttributeManager attributeManager, AttributeType type, double cost) {
    System.out.println("making");
    myManager = attributeManager;
    myType = type;
    myCost = cost;
    myStatus = new SimpleBooleanProperty(false);
}
 
Example 13
Project: ABC-List   File: Term.java   View source code 5 votes vote down vote up
private void init(long id, long generationTime, String title) {
    this.setId(id);
    this.setGenerationTime(generationTime);
    this.setTitle(title);
    
    markAsChangedProperty = new SimpleBooleanProperty(Boolean.FALSE);
}
 
Example 14
Project: Hive_Game   File: GameScreenController.java   View source code 5 votes vote down vote up
public void initGame(Main mainApp, Core c) {
    setMainApp(mainApp);
    setCore(c);
    pieceChosenInInventory = -1;
    highlighted = new Highlighter();
    traductor = new TraducteurBoard();
    lastCoord = new CoordGene<Double>(0.0,0.0);
    animationPlaying = new SimpleBooleanProperty();
    animationPlaying.setValue(false);
    nbMessage = 0;
    nbChatRow = 2;
    inventoryGroup = new ToggleGroup();
    if (!core.hasPreviousState()) {
        undo.setDisable(true);
    }
    if (!core.hasNextState()) {
        redo.setDisable(true);
    }
    initButtonByInventory();
    animation = new AnimationTile(panCanvas,traductor);
    refreshor = new RefreshJavaFX(core, gameCanvas, highlighted, traductor, this);
    initGameCanvas();
    core.setGameScreen(this);
    
    if (core.getMode() == Consts.AIVP && core.getTurn() == 0){
        core.playAI();
    }

    if(core.getMode() != Consts.PVEX && core.getMode() != Consts.EXVP){
        inputChat.setVisible(false);
        textChat.setVisible(false);
        scrollChat.setVisible(false);
    }else{
        hideButtonsForNetwork();
    }
    
    refreshor.start();
}
 
Example 15
Project: JavaFX-EX   File: DragSupport.java   View source code 5 votes vote down vote up
public BaseDrag(T t) {
  super(t);
  this.minX = new SimpleDoubleProperty(0);
  this.minY = new SimpleDoubleProperty(0);
  this.maxX = new SimpleDoubleProperty(Double.MAX_VALUE);
  this.maxY = new SimpleDoubleProperty(Double.MAX_VALUE);
  this.borderWidth = new SimpleDoubleProperty(3);
  this.enable = new SimpleBooleanProperty(true);
}
 
Example 16
Project: MooProject   File: Tab.java   View source code 5 votes vote down vote up
public Tab(Button button, final Pane pane) {
    this.button = button;
    this.pane = pane;

    this.button.setOnAction(event
            -> EventExecutor.getInstance().execute(new ChangeTabEvent(Tab.this)));
    this.active = new SimpleBooleanProperty(false);
    this.active.addListener((observable, oldValue, newValue) -> {
        button.pseudoClassStateChanged(TAB_ACTIVE_CLASS, active.get());
        pane.pseudoClassStateChanged(TAB_ACTIVE_CLASS, active.get());
    });
}
 
Example 17
Project: CDN-FX-2.2   File: Ticket.java   View source code 5 votes vote down vote up
public Ticket(String name, String region, String serial, String titleid){
	this.name = new SimpleStringProperty(name);
	this.region = new SimpleStringProperty(region);
	this.type = new SimpleStringProperty("");
	this.serial = new SimpleStringProperty(serial);
	this.titleid = new SimpleStringProperty(titleid);
	this.consoleid = new SimpleStringProperty("");
	this.download = new SimpleBooleanProperty(false);
	this.titlekey = "";

}
 
Example 18
Project: TOA-DataSync   File: MatchGeneral.java   View source code 5 votes vote down vote up
public MatchGeneral(String matchName, int tournamentLevel, Date scheduledTime, int fieldNumber) {
    this.matchName = new SimpleStringProperty(matchName);
    this.isDone = new SimpleBooleanProperty(false);
    this.isUploaded = new SimpleBooleanProperty(false);
    this.tournamentLevel = tournamentLevel;
    this.scheduledTime = scheduledTime;
    this.fieldNumber = fieldNumber;
}
 
Example 19
Project: OpenVSP3Plugin   File: DesignVariable.java   View source code 5 votes vote down vote up
public DesignVariable(DesignVariable dv) {
	this.container = new SimpleStringProperty(dv.container.get());
	this.group = new SimpleStringProperty(dv.group.get());
	this.name = new SimpleStringProperty(dv.name.get());
	this.id = new SimpleStringProperty(dv.id.get());
	this.value = new SimpleStringProperty(dv.value.get());
	this.xpath = new SimpleStringProperty(dv.xpath.get());
	this.state = new SimpleStringProperty(dv.state.get());
	this.vspValue = new SimpleStringProperty(dv.vspValue.get());
	this.checked = new SimpleBooleanProperty(dv.checked.get());
	this.fullName = dv.fullName;
}
 
Example 20
Project: OpenVSP3Plugin   File: DesignVariable.java   View source code 5 votes vote down vote up
public DesignVariable(String container, String group, String name, String id, String value) {
	this.container = new SimpleStringProperty(container);
	this.group = new SimpleStringProperty(group);
	this.name = new SimpleStringProperty(name);
	this.id = new SimpleStringProperty(id);
	this.value = new SimpleStringProperty(value);
	this.xpath = new SimpleStringProperty("");
	this.state = new SimpleStringProperty("Input");
	this.vspValue = new SimpleStringProperty();
	this.checked = new SimpleBooleanProperty(false);
	this.fullName = container + ":" + group + ":" + name;
}
 
Example 21
Project: shuffleboard   File: FxUtils.java   View source code 5 votes vote down vote up
/**
 * A more general version of {@link Bindings#when(ObservableBooleanValue)}
 * that can accept general boolean properties as conditions.
 *
 * @param condition the condition to bind to
 *
 * @see Bindings#when(ObservableBooleanValue)
 */
public static When when(Property<Boolean> condition) {
  if (condition instanceof ObservableBooleanValue) {
    return Bindings.when((ObservableBooleanValue) condition);
  }
  SimpleBooleanProperty realCondition = new SimpleBooleanProperty();
  realCondition.bind(condition);
  return Bindings.when(realCondition);
}
 
Example 22
Project: stvs   File: PositiveIntegerInputField.java   View source code 5 votes vote down vote up
/**
 * Creates an instances of this positive integer only field.
 */
public PositiveIntegerInputField() {
  this.textProperty().addListener(this::onInputChange);
  valid = new SimpleBooleanProperty();
  valid.addListener(this::onValidStateChange);
  this.alignmentProperty().setValue(Pos.CENTER_RIGHT);
  ViewUtils.setupClass(this);
}
 
Example 23
Project: CDN-FX-2.2   File: Ticket.java   View source code 5 votes vote down vote up
public Ticket(){
	this.name = new SimpleStringProperty("");
	this.region = new SimpleStringProperty("");
	this.serial = new SimpleStringProperty("");
	this.type = new SimpleStringProperty("");
	this.titleid = new SimpleStringProperty("");
	this.consoleid = new SimpleStringProperty("");
	this.data = null;
	this.commonKeyIndex = 0;
	this.download = new SimpleBooleanProperty(false);
	this.titlekey = "";
}
 
Example 24
Project: jmonkeybuilder   File: AbstractFileEditor.java   View source code 5 votes vote down vote up
/**
 * Instantiates a new Abstract file editor.
 */
protected AbstractFileEditor() {
    this.showedTime = LocalTime.now();
    this.editorStates = ArrayFactory.newArray(Editor3DState.class);
    this.dirtyProperty = new SimpleBooleanProperty(this, "dirty", false);
    this.fileChangedHandler = event -> processChangedFile((FileChangedEvent) event);
    createContent();
}
 
Example 25
Project: H-Uppaal   File: ComponentPresentation.java   View source code 5 votes vote down vote up
private void initializeName() {
    final Component component = controller.getComponent();
    final BooleanProperty initialized = new SimpleBooleanProperty(false);

    controller.name.focusedProperty().addListener((observable, oldValue, newValue) -> {
        if (newValue && !initialized.get()) {
            controller.root.requestFocus();
            initialized.setValue(true);
        }
    });

    // Set the text field to the name in the model, and bind the model to the text field
    controller.name.setText(component.getName());
    controller.name.textProperty().addListener((obs, oldName, newName) -> {
        component.nameProperty().unbind();
        component.setName(newName);
    });

    final Runnable updateColor = () -> {
        final Color color = component.getColor();
        final Color.Intensity colorIntensity = component.getColorIntensity();

        // Set the text color for the label
        controller.name.setStyle("-fx-text-fill: " + color.getTextColorRgbaString(colorIntensity) + ";");
        controller.name.setFocusColor(color.getTextColor(colorIntensity));
        controller.name.setUnFocusColor(javafx.scene.paint.Color.TRANSPARENT);
    };

    controller.getComponent().colorProperty().addListener(observable -> updateColor.run());
    updateColor.run();

    // Center the text vertically and aff a left padding of CORNER_SIZE
    controller.name.setPadding(new Insets(2, 0, 0, CORNER_SIZE));
    controller.name.setOnKeyPressed(CanvasController.getLeaveTextAreaKeyHandler());
}
 
Example 26
Project: can4eve   File: CANPropertyManager.java   View source code 5 votes vote down vote up
/**
 * add a boolean Value property
 * 
 * @param canValue
 * @param property
 */
private void addCanProperty(BooleanValue canValue,
    SimpleBooleanProperty property) {
  CANProperty<BooleanValue, Boolean> canProperty = new CANProperty<BooleanValue, Boolean>(
      canValue, property);
  getCanProperties().put(canValue.canInfo.getName(), canProperty);
}
 
Example 27
Project: hygene   File: ViewMenuController.java   View source code 4 votes vote down vote up
/**
 * Creates a new {@link ViewMenuController} instance.
 */
public ViewMenuController() {
    aggregationProperty = new SimpleBooleanProperty(true);
}
 
Example 28
Project: charts   File: ChartItemSeriesBuilder.java   View source code 4 votes vote down vote up
public final B symbolsVisible(final boolean VISIBLE) {
    properties.put("symbolsVisible", new SimpleBooleanProperty(VISIBLE));
    return (B)this;
}
 
Example 29
Project: charts   File: AxisBuilder.java   View source code 4 votes vote down vote up
public final B tickLabelsVisible(final boolean VISIBLE) {
    properties.put("tickLabelsVisible", new SimpleBooleanProperty(VISIBLE));
    return (B)this;
}
 
Example 30
Project: SunburstChart   File: SunburstChartBuilder.java   View source code 4 votes vote down vote up
public final B useColorFromParent(final boolean USE) {
    properties.put("useColorFromParent", new SimpleBooleanProperty(USE));
    return (B)this;
}
 
Example 31
Project: charts   File: AreaHeatMapBuilder.java   View source code 4 votes vote down vote up
public final B smoothedHull(final boolean SMOOTHED) {
    properties.put("smoothedHull", new SimpleBooleanProperty(SMOOTHED));
    return (B)this;
}
 
Example 32
Project: charts   File: CircularPlotBuilder.java   View source code 4 votes vote down vote up
public final B onlyFirstAndLastTickLabelVisible(final boolean VISIBLE) {
    properties.put("onlyFirstAndLastTickLabelVisible", new SimpleBooleanProperty(VISIBLE));
    return (B)this;
}
 
Example 33
Project: SunburstChart   File: ChartDataBuilder.java   View source code 4 votes vote down vote up
public final B animated(final boolean ANIMATED) {
    properties.put("animated", new SimpleBooleanProperty(ANIMATED));
    return (B)this;
}
 
Example 34
Project: JHosts   File: HostController.java   View source code 4 votes vote down vote up
FXHost(String id, Boolean enable, String ipAddress, String domainName) {
    this.id = id;
    this.enable = new SimpleBooleanProperty(enable);
    this.ipAddress = new SimpleStringProperty(ipAddress);
    this.domainName = new SimpleStringProperty(domainName);
}
 
Example 35
Project: charts   File: MatrixItemSeriesBuilder.java   View source code 4 votes vote down vote up
public final B symbolsVisible(final boolean VISIBLE) {
    properties.put("symbolsVisible", new SimpleBooleanProperty(VISIBLE));
    return (B)this;
}
 
Example 36
Project: charts   File: CircularPlotBuilder.java   View source code 4 votes vote down vote up
public final B showFlowDirection(final boolean SHOW) {
    properties.put("showFlowDirection", new SimpleBooleanProperty(SHOW));
    return (B)this;
}
 
Example 37
Project: circularplot   File: CircularPlotBuilder.java   View source code 4 votes vote down vote up
public final B showFlowDirection(final boolean SHOW) {
    properties.put("showFlowDirection", new SimpleBooleanProperty(SHOW));
    return (B)this;
}
 
Example 38
Project: charts   File: XYSeriesBuilder.java   View source code 4 votes vote down vote up
public final B symbolsVisible(final boolean VISIBLE) {
    properties.put("symbolsVisible", new SimpleBooleanProperty(VISIBLE));
    return (B)this;
}
 
Example 39
Project: circularplot   File: CircularPlotBuilder.java   View source code 4 votes vote down vote up
public final B mediumTickMarksVisible(final boolean VISIBLE) {
    properties.put("mediumTickMarksVisible", new SimpleBooleanProperty(VISIBLE));
    return (B)this;
}
 
Example 40
Project: charts   File: SunburstChartBuilder.java   View source code 4 votes vote down vote up
public final B useColorFromParent(final boolean USE) {
    properties.put("useColorFromParent", new SimpleBooleanProperty(USE));
    return (B)this;
}