本文整理汇总了Java中javafx.beans.property.SimpleListProperty类的典型用法代码示例。如果您正苦于以下问题:Java SimpleListProperty类的具体用法?Java SimpleListProperty怎么用?Java SimpleListProperty使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SimpleListProperty类属于javafx.beans.property包,在下文中一共展示了SimpleListProperty类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initialize
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public void initialize(URL location, ResourceBundle resources) {
// Initializes test base, tester and test map to access and modify the algorithm base
testBase = TestBase.INSTANCE; // Gets a reference to the test base
tester = new Tester(); //
testMap = tester.getTestMap();
// Binds the list view with a list of algorithms (list items)
listItems = FXCollections.observableList(new ArrayList<>(testMap.keySet()));
list.itemsProperty().bindBidirectional(new SimpleListProperty<>(listItems));
list.getSelectionModel().setSelectionMode(SelectionMode.SINGLE);
list.getSelectionModel().selectedItemProperty().addListener((((observable, oldValue, newValue) -> {
if(newValue != null) {
textArea.setText(testMap.get(newValue).getContent());
} else {
textArea.clear();
}
})));
list.getSelectionModel().select(0);
// Initializes the trie that stores all algorithm names
algorithmNameTrie = new Trie();
for(String algorithmName : testMap.keySet()) {
algorithmNameTrie.addWord(algorithmName);
}
// Binds search field with the list view (displays search result)
searchField.textProperty().addListener((observable, oldValue, newValue) -> {
listItems.setAll(algorithmNameTrie.getWords(newValue.toLowerCase()));
if(!listItems.isEmpty()) {
list.getSelectionModel().select(0);
}
});
// For unknown reasons, this style does not work on css, so I put it in here
textArea.setStyle("-fx-focus-color: transparent; -fx-text-box-border: transparent;");
textArea.setFocusTraversable(false);
}
示例2: createCollection
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
@Override
protected Object createCollection(Class type) {
if (type == ObservableListWrapper.class) {
return FXCollections.observableArrayList();
}
if (type.getName().indexOf("$") > 0) {
if (type.getName().equals("javafx.collections.FXCollections$SynchronizedObservableList")) {
return FXCollections.synchronizedObservableList(FXCollections.observableArrayList());
}
}
return new SimpleListProperty<>(FXCollections.observableArrayList());
}
示例3: ParticipantPacket
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public ParticipantPacket(ByteBuffer data) {
super(data);
this.carName = new SimpleStringProperty(ReadString(data, 64).trim());
this.carClass = new SimpleStringProperty(ReadString(data, 64).trim());
this.trackLocation = new SimpleStringProperty(ReadString(data, 64).trim());
this.trackVariation = new SimpleStringProperty(ReadString(data, 64).trim());
this.names = new SimpleListProperty<>(FXCollections.observableArrayList());
for (int i = 0; i < 16 ; i++) {
this.names.add(new SimpleStringProperty(ReadString(data, 64).split("\u0000", 2)[0]));
}
this.fastestLapTimes = new SimpleListProperty<>(FXCollections.observableList(new ArrayList<>()));
for (int i = 0; i < 16; i++) {
this.fastestLapTimes.add(new SimpleFloatProperty(ReadFloat(data)));
}
}
示例4: nestListProp
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public static <F, T> ListProperty<T> nestListProp(ObservableValue<F> pf, Function<F, ListProperty<T>> func) {
ListProperty<T> current = func.apply(pf.getValue());
ListProperty<T> nestProp = new SimpleListProperty<>();
CacheUtil.set(BeanUtil.class, nestProp, current);
nestProp.bindBidirectional(current);
pf.addListener((ob, o, n) -> {
CacheUtil.<ListProperty<T>> remove(BeanUtil.class, nestProp).ifPresent(p -> nestProp.unbindContentBidirectional(p));
ListProperty<T> pt = func.apply(n);
CacheUtil.set(BeanUtil.class, nestProp, pt);
nestProp.bindContentBidirectional(pt);
});
return nestProp;
}
示例5: nestListValue
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public static <F, T> ObservableList<T> nestListValue(ObservableValue<F> pf, Function<F, ObservableList<T>> func) {
ObservableList<T> current = func.apply(pf.getValue());
ListProperty<T> nestProp = new SimpleListProperty<>();
CacheUtil.set(BeanUtil.class, nestProp, current);
nestProp.bindContent(current);
pf.addListener((ob, o, n) -> {
CacheUtil.<ListProperty<T>> remove(BeanUtil.class, nestProp).ifPresent(p -> nestProp.unbindContent(p));
ObservableList<T> pt = func.apply(n);
CacheUtil.set(BeanUtil.class, nestProp, pt);
nestProp.bindContent(pt);
});
return nestProp;
}
示例6: AdditionalParticipantPacket
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public AdditionalParticipantPacket(ByteBuffer data) {
super(data);
this.offset = new SimpleIntegerProperty(ReadChar(data));
this.names = new SimpleListProperty<>(FXCollections.observableArrayList());
for (int i = 0; i < 16 ; i++) {
this.names.add(new SimpleStringProperty(ReadString(data, 64).split("\u0000", 2)[0]));
}
}
示例7: ZRow
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public ZRow(int n) {
super();
List<String> lst = new ArrayList<>();
for(int i=0; i<n; i++) {
lst.add(" - ");
}
ObservableList<String> observableList = FXCollections.observableArrayList(lst);
this.row = new SimpleListProperty<>(observableList);
}
示例8: DownloadTaskGroupItemInfoView
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public DownloadTaskGroupItemInfoView(DownloadTaskGroup group) {
timer = new Timer(true);
updateTask = new TimerTask() {
@Override
public void run() {
Platform.runLater(DownloadTaskGroupItemInfoView.this::updateStatus);
}
};
taskGroup = group;
entries = new SimpleListProperty<>(FXCollections.observableArrayList());
FXMLLoader loader = new FXMLLoader(BundleUtils.getResourceFromBundle(getClass(), FXML_LOCATION));
loader.setRoot(this);
loader.setController(this);
try {
loader.load();
} catch (IOException e) {
throw new UncheckedIOException(e);
}
itemContainer.setCellFactory(view -> new ListCell<DownloadTaskEntry>() {
@Override
public void updateItem(DownloadTaskEntry entry, boolean empty) {
super.updateItem(entry, empty);
setGraphic(makePaneForEntry(entry));
}
});
cancelButton.textProperty().bind(I18N.localize("org.to2mbn.lolixl.ui.impl.component.view.downloads.item.cancelbutton.text"));
cancelButton.setOnAction(event -> group.cancel(true));
startUpdateCycle();
}
示例9: MainManager
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
MainManager() {
roomProvider = new RoomProvider();
guestProvider = new GuestProvider();
cleaningProvider = new CleaningProvider();
bookingOriginProvider = new BookingOriginProvider();
bookings = new ArrayList<>();
cleaningEntries = ArrayListMultimap.create();
bookingEntries = ArrayListMultimap.create();
uiData = new SimpleListProperty<>(FXCollections.observableArrayList(DateBean.extractor()));
uiDataMap = new LinkedHashMap<>();
}
示例10: MainWindowModel
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public MainWindowModel(List<Profile> profiles) {
this.profileTabs = new SimpleListProperty<ProfileTab>(FXCollections.observableArrayList());
for (Profile profile : profiles) {
ProfileTab tab = new ProfileTab(profile);
tab.setOnClosed(e -> {
disconnectTab(tab);
});
this.addTab(tab);
}
}
示例11: visit
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
@Override
public TreeItem<StatisticsViewModel.IEntry<StringProperty, ? extends Property>> visit(FilterPropertiesComponent component) {
final TreeItem<StatisticsViewModel.IEntry<StringProperty, ? extends Property>> root = new TreeItem<>(new StatisticsViewModel.StringEntry<>(component.name(), ""));
root.getChildren().add(new TreeItem<>(new StatisticsViewModel.StringEntry<>("Status", new SimpleListProperty<>(FXCollections.observableArrayList(component.getFilterColors().values())))));
return root;
}
示例12: History
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
/**
* Private constructor used for deserialization purposes.
*
* @param history
* the <code>ObservableList</code> to use as the history
*/
private History(ObservableList<State> history) {
this.index = new SimpleIntegerProperty(0);
this.history = new SimpleListProperty<>(history);
this.inProgress = State.defaultState();
BooleanProperty prevProperty = new SimpleBooleanProperty();
prevProperty.bind(this.history.emptyProperty().or(index.isEqualTo(0)).not());
BooleanProperty nextProperty = new SimpleBooleanProperty();
nextProperty.bind(this.history.emptyProperty().or(index.greaterThanOrEqualTo(this.history.sizeProperty())).not());
this.hasPrevious = prevProperty;
this.hasNext = nextProperty;
}
示例13: EloModel
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public EloModel(GuiModel model) {
this.model = model;
teamMap = new TreeMap<String, EloObject>();
playerMap = new TreeMap<String, EloObject>();
teamElo = new SimpleListProperty<EloObject>(
FXCollections.observableArrayList());
playerElo = new SimpleListProperty<EloObject>(
FXCollections.observableArrayList());
}
示例14: CourseGroup
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
/**
* Builds a new, non-empty course group.
*
* @param courseList non-empty list of courses
* @throws IllegalArgumentException if any parameter is null or any list is empty
*/
public CourseGroup(Collection<Course> courseList) throws IllegalArgumentException {
if (courseList == null || courseList.isEmpty()) {
throw new IllegalArgumentException("The parameters cannot be null and the lists cannot be empty.");
}
this.courseList = new SimpleListProperty<>(FXCollections.observableArrayList(courseList));
}
示例15: LedBargraph
import javafx.beans.property.SimpleListProperty; //导入依赖的package包/类
public LedBargraph() {
getStyleClass().add("bargraph");
ledColors = new SimpleListProperty(this, "ledColors", FXCollections.<Color>observableArrayList());
value = new SimpleDoubleProperty(this, "value", 0);
for (int i = 0 ; i < getNoOfLeds() ; i++) {
if (i < 11) {
ledColors.get().add(Color.LIME);
} else if (i > 10 && i < 13) {
ledColors.get().add(Color.YELLOW);
} else {
ledColors.get().add(Color.RED);
}
}
}