Java 类javafx.beans.property.ReadOnlyListWrapper 实例源码

项目:core-domain-tags    文件:TagsModel.java   
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));
        }
    }
}
项目:javaone2016    文件:CloudLinkService.java   
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);
}
项目:javaone2016    文件:DummyService.java   
@Override
public ReadOnlyListProperty<News> retrieveNews() {
    if (news == null) {
        news = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readNews()));
    }
    return news.getReadOnlyProperty();
}
项目:javaone2016    文件:DummyService.java   
@Override
public ReadOnlyListProperty<Session> retrieveSessions() {
    if (sessions == null) {
        sessions = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readSessions()));
    }
    return sessions.getReadOnlyProperty();
}
项目:javaone2016    文件:DummyService.java   
@Override
public ReadOnlyListProperty<Speaker> retrieveSpeakers() {
    if (speakers == null) {
        speakers = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readSpeakers()));
    }
    return speakers.getReadOnlyProperty();
}
项目:javaone2016    文件:DummyService.java   
@Override
public ReadOnlyListProperty<Exhibitor> retrieveExhibitors() {
    if (exhibitors == null) {
        exhibitors = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readExhibitors()));
    }
    return exhibitors.getReadOnlyProperty();
}
项目:javaone2016    文件:DummyService.java   
@Override
public ReadOnlyListProperty<Sponsor> retrieveSponsors() {
    if (sponsors == null) {
        sponsors = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readSponsors()));
    }
    return sponsors.getReadOnlyProperty();
}
项目:javaone2016    文件:DummyService.java   
@Override
public ReadOnlyListProperty<Venue> retrieveVenues() {
    if (venues == null) {
        venues = new ReadOnlyListWrapper<>(FXCollections.observableArrayList(readVenues()));
    }
    return venues.getReadOnlyProperty();
}
项目:javaone2016    文件:DummyService.java   
@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;
}
项目:javaone2016    文件:DummyService.java   
@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;
}
项目:javaone2016    文件:DummyService.java   
@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;
}
项目:javaone2016    文件:DummyService.java   
@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;
}
项目:javaone2016    文件:CloudLinkService.java   
@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();
}
项目:javaone2016    文件:CloudLinkService.java   
@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();
}
项目:javaone2016    文件:CloudLinkService.java   
@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();
}
项目:javaone2016    文件:CloudLinkService.java   
@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();
}
项目:javaone2016    文件:CloudLinkService.java   
@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();
}
项目:AlloyDCS-GUI    文件:LocaleHandler.java   
public LocaleHandler() {
    this.currentLocale      = new SimpleObjectProperty<Locale>(
            this, "currentLocale");
    this.supportedLocales   = new ReadOnlyListWrapper<Locale>(
            this, "availableLocales");
    this.updateSupportedLocales();
    this.setCurrentLocale(Locale.getDefault());
}
项目:AlloyDCS-GUI    文件:LocaleHandler.java   
public LocaleHandler(Locale initialLocale) {
    this.currentLocale      = new SimpleObjectProperty<Locale>(
            this, "currentLocale");
    this.supportedLocales   = new ReadOnlyListWrapper<Locale>(
            this, "availableLocales");
    this.updateSupportedLocales();
    this.setCurrentLocale(initialLocale);
}
项目:AlloyDCS-GUI    文件:LocaleHandler.java   
public LocaleHandler() {
    this.currentLocale      = new SimpleObjectProperty<Locale>(
            this, "currentLocale");
    this.supportedLocales   = new ReadOnlyListWrapper<Locale>(
            this, "availableLocales");
    this.updateSupportedLocales();
    this.setCurrentLocale(Locale.getDefault());
}
项目:AlloyDCS-GUI    文件:LocaleHandler.java   
public LocaleHandler(Locale initialLocale) {
    this.currentLocale      = new SimpleObjectProperty<Locale>(
            this, "currentLocale");
    this.supportedLocales   = new ReadOnlyListWrapper<Locale>(
            this, "availableLocales");
    this.updateSupportedLocales();
    this.setCurrentLocale(initialLocale);
}
项目:jabref    文件:ErrorConsoleViewModel.java   
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);
}
项目:afc    文件:Path2ifx.java   
@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));
}
项目:afc    文件:Path2ifx.java   
@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));
}
项目:afc    文件:Path2ifx.java   
@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));
}
项目:afc    文件:Path2ifx.java   
/** 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;
}
项目:afc    文件:Path2ifx.java   
/** 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;
}
项目:afc    文件:Path2dfx.java   
@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));
}
项目:afc    文件:Path2dfx.java   
@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));
}
项目:afc    文件:Path2dfx.java   
@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));
}
项目:afc    文件:Path2dfx.java   
/** Replies the private coordinates property.
 *
 * @return the private coordinates property.
 */
protected ReadOnlyListWrapper<Point2dfx> innerCoordinatesProperty() {
    if (this.coords == null) {
        this.coords = new ReadOnlyListWrapper<>(this, MathFXAttributeNames.COORDINATES,
                FXCollections.observableList(new ArrayList<>()));
    }
    return this.coords;
}
项目:afc    文件:Path2dfx.java   
/** 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;
}
项目:afc    文件:Path3ifx.java   
@Override
public void lineTo(int x, int y, int z) {
    ensureMoveTo();
    innerTypesProperty().add(PathElementType.LINE_TO);
    final ReadOnlyListWrapper<Point3ifx> coords = innerCoordinatesProperty();
    coords.add(getGeomFactory().newPoint(x, y, z));
}
项目:afc    文件:Path3ifx.java   
@Override
public void quadTo(int x1, int y1, int z1, int x2, int y2, int z2) {
    ensureMoveTo();
    innerTypesProperty().add(PathElementType.QUAD_TO);
    final ReadOnlyListWrapper<Point3ifx> coords = innerCoordinatesProperty();
    coords.add(getGeomFactory().newPoint(x1, y1, z1));
    coords.add(getGeomFactory().newPoint(x2, y2, z2));
}
项目:afc    文件:Path3ifx.java   
@Override
@SuppressWarnings("checkstyle:parameternumber")
public void curveTo(int x1, int y1, int z1, int x2, int y2, int z2, int x3, int y3, int z3) {
    ensureMoveTo();
    innerTypesProperty().add(PathElementType.CURVE_TO);
    final ReadOnlyListWrapper<Point3ifx> coords = innerCoordinatesProperty();
    coords.add(getGeomFactory().newPoint(x1, y1, z1));
    coords.add(getGeomFactory().newPoint(x2, y2, z2));
    coords.add(getGeomFactory().newPoint(x3, y3, z3));
}
项目:afc    文件:Path3ifx.java   
/** Replies the private coordinates property.
 *
 * @return the private coordinates property.
 */
protected ReadOnlyListWrapper<Point3ifx> innerCoordinatesProperty() {
    if (this.coords == null) {
        this.coords = new ReadOnlyListWrapper<>(this, MathFXAttributeNames.COORDINATES,
                FXCollections.observableList(new ArrayList<>()));
    }
    return this.coords;
}
项目:afc    文件:Path3ifx.java   
/** 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;
}
项目:afc    文件:Path3dfx.java   
@Override
public void lineTo(double x, double y, double z) {
    ensureMoveTo();
    innerTypesProperty().add(PathElementType.LINE_TO);
    final ReadOnlyListWrapper<Point3dfx> coords = innerCoordinatesProperty();
    coords.add(getGeomFactory().newPoint(x, y, z));
}
项目:afc    文件:Path3dfx.java   
@Override
public void quadTo(double x1, double y1, double z1, double x2, double y2, double z2) {
    ensureMoveTo();
    innerTypesProperty().add(PathElementType.QUAD_TO);
    final ReadOnlyListWrapper<Point3dfx> coords = innerCoordinatesProperty();
    coords.add(getGeomFactory().newPoint(x1, y1, z1));
    coords.add(getGeomFactory().newPoint(x2, y2, z2));
}
项目:afc    文件:Path3dfx.java   
@Override
@SuppressWarnings("checkstyle:parameternumber")
public void curveTo(double x1, double y1, double z1, double x2, double y2, double z2, double x3, double y3, double z3) {
    ensureMoveTo();
    innerTypesProperty().add(PathElementType.CURVE_TO);
    final ReadOnlyListWrapper<Point3dfx> coords = innerCoordinatesProperty();
    coords.add(getGeomFactory().newPoint(x1, y1, z1));
    coords.add(getGeomFactory().newPoint(x2, y2, z2));
    coords.add(getGeomFactory().newPoint(x3, y3, z3));
}