當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。