当前位置: 首页>>代码示例>>Java>>正文


Java SimpleListProperty类代码示例

本文整理汇总了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);
}
 
开发者ID:kinmanlui,项目名称:code-tracker,代码行数:40,代码来源:MainController.java

示例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());
}
 
开发者ID:tomrom95,项目名称:GameAuthoringEnvironment,代码行数:13,代码来源:ObservableListConverter.java

示例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)));
    }
}
 
开发者ID:SenorPez,项目名称:project-cars-replay-enhancer-ui,代码行数:20,代码来源:ParticipantPacket.java

示例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;
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:14,代码来源:BeanUtil.java

示例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;
}
 
开发者ID:XDean,项目名称:JavaFX-EX,代码行数:14,代码来源:BeanUtil.java

示例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]));
    }
}
 
开发者ID:SenorPez,项目名称:project-cars-replay-enhancer-ui,代码行数:11,代码来源:AdditionalParticipantPacket.java

示例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);

}
 
开发者ID:firm1,项目名称:zest-writer,代码行数:11,代码来源:TableController.java

示例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();
}
 
开发者ID:to2mbn,项目名称:LoliXL,代码行数:30,代码来源:DownloadTaskGroupItemInfoView.java

示例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<>();

}
 
开发者ID:DrBookings,项目名称:drbookings,代码行数:13,代码来源:MainManager.java

示例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);
    }
}
 
开发者ID:abueide,项目名称:null-client,代码行数:11,代码来源:MainWindowModel.java

示例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;
}
 
开发者ID:truffle-hog,项目名称:truffle-hog,代码行数:8,代码来源:ComponentInfoVisitor.java

示例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;
}
 
开发者ID:se-passau,项目名称:jdime,代码行数:21,代码来源:History.java

示例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());
}
 
开发者ID:talpalaru,项目名称:polTool,代码行数:10,代码来源:EloModel.java

示例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));
}
 
开发者ID:oskopek,项目名称:StudyGuide,代码行数:13,代码来源:CourseGroup.java

示例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);
        }
    }
}
 
开发者ID:Simego,项目名称:FXImgurUploader,代码行数:16,代码来源:LedBargraph.java


注:本文中的javafx.beans.property.SimpleListProperty类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。