Skip to content

Commit

Permalink
touchup
Browse files Browse the repository at this point in the history
  • Loading branch information
mfansler committed Apr 28, 2015
1 parent 4508d8e commit 0310681
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/edu/millersville/cs/bitsplease/view/PropertiesPane.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

package edu.millersville.cs.bitsplease.view;


import javafx.beans.binding.Bindings;
import javafx.beans.property.DoubleProperty;
import javafx.beans.property.ObjectProperty;
Expand All @@ -24,6 +23,7 @@
import edu.millersville.cs.bitsplease.model.UMLRelationSymbol;
import edu.millersville.cs.bitsplease.model.UMLRelationType;
import edu.millersville.cs.bitsplease.model.UMLSymbol;

/**
* Properties Pane GUI Component
* This component provides a field editing interface the fields of the
Expand Down Expand Up @@ -66,12 +66,12 @@ public void changed(ObservableValue<? extends UMLSymbol> observable,
}
if (newValue != null) {
newValue.getFields().forEach(p -> {
TextField tf = new TextField();
if (p instanceof StringProperty) {
TextField tf = new TextField();
Bindings.bindBidirectional(tf.textProperty(), (StringProperty) p);
this.getChildren().add(tf);

} else if (p instanceof DoubleProperty) {
TextField tf = new TextField();
Bindings.bindBidirectional(tf.textProperty(), (DoubleProperty) p, new NumberStringConverter());
tf.setTextFormatter(new TextFormatter<String>(c -> {
c.setText(c.getText().replaceAll("[^\\d]", ""));
Expand All @@ -80,7 +80,7 @@ public void changed(ObservableValue<? extends UMLSymbol> observable,

this.getChildren().add(tf);
}else if(p instanceof ObjectProperty<?>){

Bindings.bindBidirectional(relDropDown.valueProperty(), (ObjectProperty<UMLRelationType>)p);
}
});
Expand Down

0 comments on commit 0310681

Please sign in to comment.