本文整理匯總了Java中javafx.beans.property.SimpleStringProperty類的典型用法代碼示例。如果您正苦於以下問題:Java SimpleStringProperty類的具體用法?Java SimpleStringProperty怎麽用?Java SimpleStringProperty使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SimpleStringProperty類屬於javafx.beans.property包,在下文中一共展示了SimpleStringProperty類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: UpdateDialog
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
@SuppressWarnings("unchecked")
public UpdateDialog(List<CurseFullProject.CurseFile> files) {
super(files);
TableColumn<CurseFullProject.CurseFile, String> columnName = new TableColumn<>("Files");
columnName.setCellValueFactory(cell -> new SimpleStringProperty(cell.getValue().getFileName()));
TableColumn<CurseFullProject.CurseFile, String> columnVersion = new TableColumn<>("Version");
columnVersion.setCellValueFactory(cell -> new SimpleStringProperty(cell.getValue().getGameVersion().stream().collect(Collectors.joining(", "))));
TableColumn<CurseFullProject.CurseFile, Date> columnDate = new TableColumn<>("Release Date");
columnDate.setCellValueFactory(cell -> new SimpleObjectProperty<>(cell.getValue().getDate()));
table.getColumns().addAll(columnName, columnVersion, columnDate);
setTitle("File Update Dialog");
dialogPane.setHeaderText("Please Choose a File Version");
dialogPane.getStyleClass().add("pack-update-dialog");
dialogPane.getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
}
示例2: GlobalConfig
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
/**
* 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");
}
示例3: Medicine
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
public Medicine(int code, String name, String salt, String company, String type, String hsn, String batch, String expiry, int quantity, float mrp, float cost, int sgst, int cgst, int igst) {
this.code = new SimpleIntegerProperty(code);
this.name = new SimpleStringProperty(name);
this.salt = new SimpleStringProperty(salt);
this.company = new SimpleStringProperty(company);
this.type = new SimpleStringProperty(type);
this.hsn = new SimpleStringProperty(hsn);
this.batch = new SimpleStringProperty(batch);
this.expiry = new SimpleStringProperty(expiry);
this.quantity = new SimpleIntegerProperty(quantity);
this.mrp = new SimpleFloatProperty(mrp);
this.cost = new SimpleFloatProperty(cost);
this.sgst = new SimpleIntegerProperty(sgst);
this.cgst = new SimpleIntegerProperty(cgst);
this.igst = new SimpleIntegerProperty(igst);
}
示例4: Music
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
public Music(File f)
{
file = f;
String path = StringUtil.convertToFileURL(file.toURI().getRawPath());
String url = StringUtil.convertToFileURL(file.getAbsolutePath());
String[] split = url.split("/");
String uri = url.split("/")[split.length - 1];
String[] sp = uri.split("\\.");
format = new SimpleStringProperty(sp[sp.length - 1]);
sp[sp.length - 1] = "";
name = new SimpleStringProperty(String.join(".", sp));
media = new MediaPlayer(new Media(path));
duration = new SimpleStringProperty("");
}
示例5: JavaDialog
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
public JavaDialog() {
super(JavaUtil.getAvailableInstalls());
TableColumn<JavaUtil.JavaInstall, String> paths = new TableColumn<>("Paths");
paths.setCellValueFactory(cell -> new SimpleStringProperty(cell.getValue().path));
table.getColumns().addAll(paths);
setTitle("Java Detection");
dialogPane.setHeaderText("Please Choose a Java Version");
dialogPane.getStyleClass().add("java-dialog");
dialogPane.getButtonTypes().addAll(ButtonType.OK, ButtonType.CANCEL);
}
示例6: Data
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
public Data(String name, String lastName, String regNr, String dateFound, String timeFound, String brand, String lugType, String arrivedFlight, String locFound, String mainCol, String size, String weight, String otherChar, String lugTag) {
this.name = new SimpleStringProperty(name);
this.lastName = new SimpleStringProperty(lastName);
this.regNr = new SimpleStringProperty(regNr);
this.dateFound = new SimpleStringProperty(dateFound);
this.timeFound = new SimpleStringProperty(timeFound);
this.brand = new SimpleStringProperty(brand);
this.lugType = new SimpleStringProperty(lugType);
this.arrivedFlight = new SimpleStringProperty(arrivedFlight);
this.locFound = new SimpleStringProperty(locFound);
this.mainCol = new SimpleStringProperty(mainCol);
this.size = new SimpleStringProperty(size);
this.weight = new SimpleStringProperty(weight);
this.otherChar = new SimpleStringProperty(otherChar);
this.lugTag = new SimpleStringProperty(lugTag);
}
示例7: addBigString
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
/**
* Add a large String to a wizard step. A TextArea will be used to represent
* it.
*
* @param fieldName
* @param defaultValue
* the default String the textfield will contains.
* @param prompt
* the text to show on the textfield prompt String.
* @return
*/
@SuppressWarnings("unchecked")
public WizardStepBuilder addBigString(final String fieldName, final String defaultValue, final String prompt)
{
final JFXTextArea text = new JFXTextArea();
text.setPromptText(prompt);
text.setText(defaultValue);
this.current.getData().put(fieldName, new SimpleStringProperty());
this.current.getData().get(fieldName).bind(text.textProperty());
text.setMaxWidth(400);
final Label label = new Label(fieldName);
GridPane.setHalignment(label, HPos.RIGHT);
GridPane.setHalignment(text, HPos.LEFT);
this.current.add(label, 0, this.current.getData().size() - 1);
this.current.add(text, 1, this.current.getData().size() - 1);
return this;
}
示例8: SpecificationRow
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
/**
* Create a SpecificationRow from a given number of cells and an extractor. The extractor is
* required for "deep observing", i.e. the registering of change listeners on the contents of an
* observable collection (here, the collection of cells - to fire change events not only when
* cells are added or removed, but also when properties in the cells change). For more information
* on extractors, see https://docs.oracle
* .com/javase/8/javafx/api/javafx/collections/FXCollections.html.
*
* @param cells The initial cells of the row
* @param extractor The extractor to be used for deep observing on the cells
*/
public SpecificationRow(Map<String, C> cells, Callback<C, Observable[]> extractor) {
this.cells = FXCollections.observableMap(cells);
this.cells.addListener(this::cellsMapChanged);
this.listeners = new ArrayList<>();
this.comment = new SimpleStringProperty("");
this.extractor = extractor;
this.cells.addListener(this::listenRowInvalidation);
comment.addListener(this::listenRowInvalidation);
cells.values().forEach(this::subscribeToCell);
}
示例9: testBindBidirectionalWithConverter
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
@Test
public void testBindBidirectionalWithConverter() {
// given
Property<String> str = new SimpleStringProperty("-42");
Property<Number> num = new SimpleDoubleProperty(1.23);
// when
PropertyUtils.bindBidirectionalWithConverter(str, num, Double::parseDouble, Object::toString);
// then (initial conditions)
assertAll(
() -> assertEquals("1.23", str.getValue(), "String was not set correctly"),
() -> assertEquals(1.23, num.getValue().doubleValue(), "Binding target should not have changed")
);
// when changing one value
str.setValue("89");
// then
assertEquals(89, num.getValue().doubleValue(), "Number was not set correctly");
// when changing the other value
num.setValue(10.01);
// then
assertEquals("10.01", str.getValue(), "String was not set correctly");
}
示例10: DesignVariable
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
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;
}
示例11: initKey
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
private void initKey() {
commandColumn.setCellValueFactory(cdf -> new SimpleStringProperty(cdf.getValue().getDescribe()));
bindingColumn.setCellValueFactory(cdf -> CacheUtil.cache(OptionsController.this,
cdf.getValue(), () -> new SimpleObjectProperty<>(cdf.getValue().get())));
// bindingColumn.setCellValueFactory(cdf -> new SimpleObjectProperty<>(cdf.getValue().get()));
bindingColumn.setEditable(true);
bindingColumn.setCellFactory(column -> new KeyEditField());
keyTable.getItems().setAll(Options.KEY.getChildren(KeyCombination.class));
onSubmit.add(() -> keyTable.getItems().forEach(key -> key.set(bindingColumn.getCellData(key))));
}
示例12: Entry
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
public Entry(String entry, String username, String password) throws Exception {
this.entryTitle = new SimpleStringProperty(entry);
this.entryUsername = new SimpleStringProperty(username);
this.entryPassword = new SimpleStringProperty(password);
this.originalPassword = Crypt.encrypt(password);
LocalDateTime date = LocalDateTime.now();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yy-MM-dd HH:mm");
String formattedDate = date.format(formatter);
this.entryDate = new SimpleStringProperty(formattedDate);
}
示例13: Code
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
/**
* Creates a codefile which is invalidated.
*
* @param filename name of the codefile
* @param sourcecode content of the codefile
*/
public Code(String filename, String sourcecode) {
this.filename = new SimpleStringProperty(filename);
this.sourceCodeProperty = new SimpleStringProperty(sourcecode);
this.parsedCode = new NullableProperty<>();
this.tokens = FXCollections.observableArrayList();
this.syntaxErrors = FXCollections.observableArrayList();
invalidate();
}
示例14: CourseTableDataType
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
/**
* Data type used in the TreeTableview for
*/
public CourseTableDataType(String title, String id, int time, int stars) {
this.title = new SimpleStringProperty(title);
this.id = new SimpleStringProperty(id);
this.time = new SimpleIntegerProperty(time);
this.stars = new SimpleIntegerProperty(stars);
}
示例15: SimpleBookmark
import javafx.beans.property.SimpleStringProperty; //導入依賴的package包/類
/**
* Constructs a new {@link SimpleBookmark} instance.
*
* @param bookmark bookmark associated with this {@link SimpleBookmark}
* @param onClick {@link Runnable} that can be retrieved by calling {@link #getOnClick()}
* @throws GfaParseException if unable to get the sequence of the node in the bookmark
*/
public SimpleBookmark(final Bookmark bookmark, final Runnable onClick) throws GfaParseException {
this.bookmark = bookmark;
this.onClick = onClick;
nodeIdProperty = new SimpleIntegerProperty(bookmark.getNodeId());
baseOffsetProperty = new SimpleIntegerProperty(bookmark.getBaseOffset());
descriptionProperty = new SimpleStringProperty(bookmark.getDescription());
radiusProperty = new SimpleIntegerProperty(bookmark.getRadius());
}