public TagsModel() {
TAG_TYPES_PROPERTY = new ReadOnlyMapWrapper<>(FXCollections.observableHashMap());
PREDEFINED_TAGS_PROPERTY = new ReadOnlyMapWrapper<>(FXCollections.observableHashMap());
CUSTOM_TAGS_PROPERTY = new ReadOnlyListWrapper<>(FXCollections.observableArrayList());
//
for (PredefinedTagType predefinedTag : PredefinedTagType.values()) {
final TagType tagType = predefinedTag.get();
final int tagId = tagType.getId();
if (null != TAG_TYPES_PROPERTY.putIfAbsent(tagId, tagType)) {
System.out.println(String.format("%s already exists (id=%d)", TagType.class.getSimpleName(), tagId));
}
if (null != PREDEFINED_TAGS_PROPERTY.put(tagId, new TagModel(tagType.getName(), StringType.empty()))) {
System.out.println(String.format("%s already exists (id=%d)", PredefinedTagType.class.getSimpleName(), tagId));
}
}
}
java类javafx.beans.property.ReadOnlyListWrapper的实例源码
TagsModel.java 文件源码
项目:core-domain-tags
阅读 33
收藏 0
点赞 0
评论 0
CloudLinkService.java 文件源码
项目:javaone2016
阅读 39
收藏 0
点赞 0
评论 0
private void loadData() {
GluonObservableList<Exhibitor> localExhibitors = loadEntities("exhibitors", Exhibitor.class, ServiceUtils::mapJsonToExhibitor);
exhibitors = new ReadOnlyListWrapper<>(localExhibitors);
GluonObservableList<Session> localSessions = loadEntities("sessions", Session.class, ServiceUtils::mapJsonToSession);
sessions = new ReadOnlyListWrapper<>(localSessions);
localSessions.initializedProperty().addListener(new InvalidationListener() {
@Override
public void invalidated(javafx.beans.Observable observable) {
if (localSessions.isInitialized()) {
// now that we have started retrieving the list of sessions we can
// call retrieveAuthenticatedUser as sessions won't be empty
localSessions.initializedProperty().removeListener(this);
retrieveAuthenticatedUser();
}
}
});
GluonObservableList<Speaker> localSpeakers = loadEntities("speakers", Speaker.class, ServiceUtils::mapJsonToSpeaker);
speakers = new ReadOnlyListWrapper<>(localSpeakers);
GluonObservableList<Sponsor> localSponsors = loadEntities("sponsors", Sponsor.class, ServiceUtils::mapJsonToSponsor);
sponsors = new ReadOnlyListWrapper<>(localSponsors);
GluonObservableList<Venue> localVenues = loadEntities("venues", Venue.class, ServiceUtils::mapJsonToVenue);
venues = new ReadOnlyListWrapper<>(localVenues);
}
DummyService.java 文件源码
项目:javaone2016
阅读 44
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<News> retrieveNews() {
if (news == null) {
news = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readNews()));
}
return news.getReadOnlyProperty();
}
DummyService.java 文件源码
项目:javaone2016
阅读 30
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<Session> retrieveSessions() {
if (sessions == null) {
sessions = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readSessions()));
}
return sessions.getReadOnlyProperty();
}
DummyService.java 文件源码
项目:javaone2016
阅读 36
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<Speaker> retrieveSpeakers() {
if (speakers == null) {
speakers = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readSpeakers()));
}
return speakers.getReadOnlyProperty();
}
DummyService.java 文件源码
项目:javaone2016
阅读 35
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<Exhibitor> retrieveExhibitors() {
if (exhibitors == null) {
exhibitors = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readExhibitors()));
}
return exhibitors.getReadOnlyProperty();
}
DummyService.java 文件源码
项目:javaone2016
阅读 36
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<Sponsor> retrieveSponsors() {
if (sponsors == null) {
sponsors = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readSponsors()));
}
return sponsors.getReadOnlyProperty();
}
DummyService.java 文件源码
项目:javaone2016
阅读 42
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<Venue> retrieveVenues() {
if (venues == null) {
venues = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readVenues()));
}
return venues.getReadOnlyProperty();
}
DummyService.java 文件源码
项目:javaone2016
阅读 36
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<OTNCoffee> retrieveOTNCoffees() {
if (otnCoffees == null) {
List<OTNCoffee> coffees = new LinkedList<>();
coffees.add(new OTNCoffee("1", "Brazilian Coffee"));
coffees.add(new OTNCoffee("2", "Ethiopian Coffee"));
coffees.add(new OTNCoffee("3", "Taiwan Tea"));
otnCoffees = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(coffees));
}
return otnCoffees;
}
DummyService.java 文件源码
项目:javaone2016
阅读 38
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<OTNGame> retrieveOTNGames() {
if (otnGames == null) {
List<OTNGame> games = new LinkedList<>();
games.add(new OTNGame("Tetris", "http://javahub.com/game/id1", "http://lorempixel.com/400/200"));
games.add(new OTNGame("PacMan", "http://javahub.com/game/id2", "http://lorempixel.com/400/200"));
games.add(new OTNGame("Brick Breaker", "http://javahub.com/game/id3", "http://lorempixel.com/400/200"));
otnGames = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(games));
}
return otnGames;
}
DummyService.java 文件源码
项目:javaone2016
阅读 33
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<OTNEmbroidery> retrieveOTNEmbroideries() {
if (otnEmbroideries == null) {
List<OTNEmbroidery> embroideries = new LinkedList<>();
embroideries.add(new OTNEmbroidery("OTNEmbroidery 1", "http://javahub.com/embroidery/id1", "http://lorempixel.com/400/200"));
embroideries.add(new OTNEmbroidery("OTNEmbroidery 2", "http://javahub.com/embroidery/id2", "http://lorempixel.com/400/200"));
embroideries.add(new OTNEmbroidery("OTNEmbroidery 3", "http://javahub.com/embroidery/id3", "http://lorempixel.com/400/200"));
otnEmbroideries = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(embroideries));
}
return otnEmbroideries;
}
DummyService.java 文件源码
项目:javaone2016
阅读 30
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<OTN3DModel> retrieveOTN3DModels() {
if (otn3DModels == null) {
List<OTN3DModel> models = new LinkedList<>();
models.add(new OTN3DModel("1", "Model 1", "http://lorempixel.com/400/200", true, 0));
models.add(new OTN3DModel("2", "Model 2", "http://lorempixel.com/400/200", false, 4));
models.add(new OTN3DModel("3", "Model 3", "http://lorempixel.com/400/200", false, 7));
models.add(new OTN3DModel("4", "Model 4", "http://lorempixel.com/400/200", false, 19));
otn3DModels = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(models));
}
return otn3DModels;
}
CloudLinkService.java 文件源码
项目:javaone2016
阅读 41
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<News> retrieveNews() {
if (news == null) {
GluonObservableList<News> gluonNews = DataProvider.retrieveList(cloudGluonClient.createListDataReader("activityFeed", News.class, SyncFlag.LIST_READ_THROUGH));
SortedList<News> sortedNews = new SortedList<>(gluonNews);
sortedNews.setComparator((n1, n2) -> n1.getCreationDate() == n2.getCreationDate() ? n1.getUuid().compareTo(n2.getUuid()) : Long.compare(n1.getCreationDate(), n2.getCreationDate()) * -1);
news = new ReadOnlyListWrapper<>(sortedNews);
}
return news.getReadOnlyProperty();
}
CloudLinkService.java 文件源码
项目:javaone2016
阅读 35
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<OTNCoffee> retrieveOTNCoffees() {
if (otnCoffees == null) {
GluonObservableList<OTNCoffee> gluonCoffees = DataProvider.retrieveList(cloudGluonClient.createListDataReader("otncoffees", OTNCoffee.class, SyncFlag.LIST_READ_THROUGH));
otnCoffees = new ReadOnlyListWrapper<>(gluonCoffees);
}
return otnCoffees.getReadOnlyProperty();
}
CloudLinkService.java 文件源码
项目:javaone2016
阅读 35
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<OTNGame> retrieveOTNGames() {
if (otnGames == null) {
GluonObservableList<OTNGame> gluonGames = DataProvider.retrieveList(cloudGluonClient.createListDataReader("otngames", OTNGame.class, SyncFlag.LIST_READ_THROUGH));
otnGames = new ReadOnlyListWrapper<>(gluonGames);
}
return otnGames.getReadOnlyProperty();
}
CloudLinkService.java 文件源码
项目:javaone2016
阅读 32
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<OTNEmbroidery> retrieveOTNEmbroideries() {
if (otnEmbroideries == null) {
GluonObservableList<OTNEmbroidery> gluonEmbroideries = DataProvider.retrieveList(cloudGluonClient.createListDataReader("otnembroideries", OTNEmbroidery.class, SyncFlag.LIST_READ_THROUGH));
otnEmbroideries = new ReadOnlyListWrapper<>(gluonEmbroideries);
}
return otnEmbroideries.getReadOnlyProperty();
}
CloudLinkService.java 文件源码
项目:javaone2016
阅读 34
收藏 0
点赞 0
评论 0
@Override
public ReadOnlyListProperty<OTN3DModel> retrieveOTN3DModels() {
if (otn3DModels == null) {
ObservableList<OTN3DModel> localList = FXCollections.observableArrayList();
otn3DModels = new ReadOnlyListWrapper<>(localList);
GluonObservableList<OTN3DModel> gluon3DModels = DataProvider.retrieveList(cloudGluonClient.createListDataReader("otn3dmodels", OTN3DModel.class, SyncFlag.LIST_READ_THROUGH, SyncFlag.OBJECT_READ_THROUGH, SyncFlag.OBJECT_WRITE_THROUGH));
gluon3DModels.initializedProperty().addListener((obs, ov, nv) -> {
if (nv) {
Bindings.bindContent(localList, gluon3DModels);
}
});
}
return otn3DModels.getReadOnlyProperty();
}
LocaleHandler.java 文件源码
项目:AlloyDCS-GUI
阅读 35
收藏 0
点赞 0
评论 0
public LocaleHandler() {
this.currentLocale = new SimpleObjectProperty<Locale>(
this, "currentLocale");
this.supportedLocales = new ReadOnlyListWrapper<Locale>(
this, "availableLocales");
this.updateSupportedLocales();
this.setCurrentLocale(Locale.getDefault());
}
LocaleHandler.java 文件源码
项目:AlloyDCS-GUI
阅读 30
收藏 0
点赞 0
评论 0
public LocaleHandler(Locale initialLocale) {
this.currentLocale = new SimpleObjectProperty<Locale>(
this, "currentLocale");
this.supportedLocales = new ReadOnlyListWrapper<Locale>(
this, "availableLocales");
this.updateSupportedLocales();
this.setCurrentLocale(initialLocale);
}
LocaleHandler.java 文件源码
项目:AlloyDCS-GUI
阅读 38
收藏 0
点赞 0
评论 0
public LocaleHandler() {
this.currentLocale = new SimpleObjectProperty<Locale>(
this, "currentLocale");
this.supportedLocales = new ReadOnlyListWrapper<Locale>(
this, "availableLocales");
this.updateSupportedLocales();
this.setCurrentLocale(Locale.getDefault());
}
LocaleHandler.java 文件源码
项目:AlloyDCS-GUI
阅读 31
收藏 0
点赞 0
评论 0
public LocaleHandler(Locale initialLocale) {
this.currentLocale = new SimpleObjectProperty<Locale>(
this, "currentLocale");
this.supportedLocales = new ReadOnlyListWrapper<Locale>(
this, "availableLocales");
this.updateSupportedLocales();
this.setCurrentLocale(initialLocale);
}
ErrorConsoleViewModel.java 文件源码
项目:jabref
阅读 29
收藏 0
点赞 0
评论 0
public ErrorConsoleViewModel(DialogService dialogService, ClipBoardManager clipBoardManager, BuildInfo buildInfo) {
this.dialogService = Objects.requireNonNull(dialogService);
this.clipBoardManager = Objects.requireNonNull(clipBoardManager);
this.buildInfo = Objects.requireNonNull(buildInfo);
ObservableList<LogEventViewModel> eventViewModels = EasyBind.map(LogMessages.getInstance().getMessages(), LogEventViewModel::new);
allMessagesData = new ReadOnlyListWrapper<>(eventViewModels);
}
Path2ifx.java 文件源码
项目:afc
阅读 39
收藏 0
点赞 0
评论 0
@Override
public void lineTo(int x, int y) {
ensureMoveTo();
innerTypesProperty().add(PathElementType.LINE_TO);
final ReadOnlyListWrapper<Point2ifx> coords = innerPointsProperty();
coords.add(getGeomFactory().newPoint(x, y));
}
Path2ifx.java 文件源码
项目:afc
阅读 65
收藏 0
点赞 0
评论 0
@Override
public void quadTo(int x1, int y1, int x2, int y2) {
ensureMoveTo();
innerTypesProperty().add(PathElementType.QUAD_TO);
final ReadOnlyListWrapper<Point2ifx> coords = innerPointsProperty();
coords.add(getGeomFactory().newPoint(x1, y1));
coords.add(getGeomFactory().newPoint(x2, y2));
}
Path2ifx.java 文件源码
项目:afc
阅读 31
收藏 0
点赞 0
评论 0
@Override
public void curveTo(int x1, int y1, int x2, int y2, int x3, int y3) {
ensureMoveTo();
innerTypesProperty().add(PathElementType.CURVE_TO);
final ReadOnlyListWrapper<Point2ifx> coords = innerPointsProperty();
coords.add(getGeomFactory().newPoint(x1, y1));
coords.add(getGeomFactory().newPoint(x2, y2));
coords.add(getGeomFactory().newPoint(x3, y3));
}
Path2ifx.java 文件源码
项目:afc
阅读 36
收藏 0
点赞 0
评论 0
/** Replies the private coordinates property.
*
* @return the private coordinates property.
*/
protected ReadOnlyListWrapper<Point2ifx> innerPointsProperty() {
if (this.coords == null) {
this.coords = new ReadOnlyListWrapper<>(this, MathFXAttributeNames.COORDINATES,
FXCollections.observableList(new ArrayList<>()));
}
return this.coords;
}
Path2ifx.java 文件源码
项目:afc
阅读 66
收藏 0
点赞 0
评论 0
/** Replies the private types property.
*
* @return the private types property.
*/
protected ReadOnlyListWrapper<PathElementType> innerTypesProperty() {
if (this.types == null) {
this.types = new ReadOnlyListWrapper<>(this, MathFXAttributeNames.TYPES,
FXCollections.observableList(new ArrayList<>()));
}
return this.types;
}
Path2dfx.java 文件源码
项目:afc
阅读 38
收藏 0
点赞 0
评论 0
@Override
public void lineTo(double x, double y) {
ensureMoveTo();
innerTypesProperty().add(PathElementType.LINE_TO);
final ReadOnlyListWrapper<Point2dfx> coords = innerCoordinatesProperty();
coords.add(getGeomFactory().newPoint(x, y));
}
Path2dfx.java 文件源码
项目:afc
阅读 51
收藏 0
点赞 0
评论 0
@Override
public void quadTo(double x1, double y1, double x2, double y2) {
ensureMoveTo();
innerTypesProperty().add(PathElementType.QUAD_TO);
final ReadOnlyListWrapper<Point2dfx> coords = innerCoordinatesProperty();
coords.add(getGeomFactory().newPoint(x1, y1));
coords.add(getGeomFactory().newPoint(x2, y2));
}
Path2dfx.java 文件源码
项目:afc
阅读 40
收藏 0
点赞 0
评论 0
@Override
public void curveTo(double x1, double y1, double x2, double y2, double x3, double y3) {
ensureMoveTo();
innerTypesProperty().add(PathElementType.CURVE_TO);
final ReadOnlyListWrapper<Point2dfx> coords = innerCoordinatesProperty();
coords.add(getGeomFactory().newPoint(x1, y1));
coords.add(getGeomFactory().newPoint(x2, y2));
coords.add(getGeomFactory().newPoint(x3, y3));
}