本文整理了Java中javafx.collections.ObservableList.set()
方法的一些代码示例,展示了ObservableList.set()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObservableList.set()
方法的具体详情如下:
包路径:javafx.collections.ObservableList
类名称:ObservableList
方法名:set
暂无
代码示例来源:origin: jfoenixadmin/JFoenix
public void setContent(Node content) {
if (contentContainer.getChildren().size() == 2) {
contentContainer.getChildren().set(1, content);
} else if (contentContainer.getChildren().size() == 1) {
contentContainer.getChildren().add(content);
} else {
contentContainer.getChildren().setAll(headerSpace, content);
}
VBox.setVgrow(content, Priority.ALWAYS);
}
代码示例来源:origin: jfoenixadmin/JFoenix
StackPane container = new StackPane(child);
container.setPickOnBounds(false);
getChildren().set(i, container);
代码示例来源:origin: com.jfoenix/jfoenix
public void setContent(Node content) {
if (contentContainer.getChildren().size() == 2) {
contentContainer.getChildren().set(1, content);
} else if (contentContainer.getChildren().size() == 1) {
contentContainer.getChildren().add(content);
} else {
contentContainer.getChildren().setAll(headerSpace, content);
}
VBox.setVgrow(content, Priority.ALWAYS);
}
代码示例来源:origin: com.google.code.validationframework/validationframework-experimental
@Override
public void valuesChanged(ReadableListProperty<R> p, int i, List<R> o, List<R> n) {
int offset = 0;
for (R item : n) {
fxObservableList.set(i + offset++, item);
}
}
代码示例来源:origin: org.reactfx/reactfx
@Override
public E set(int index, E element) {
return delegate.set(index, element);
}
代码示例来源:origin: com.gluonhq/connect
/**
* Sets the {@code element} in the List at the position of {@code index}.
*
* <p>For the description of possible exceptions, please refer to the documentation
* of {@link #set(int, java.lang.Object) } method.
*
* @param index the position where to set the element
* @param element the element that will be set at the specified position
* @return the old element at the specified position
*
* @throws ClassCastException
* @throws NullPointerException
* @throws IllegalArgumentException
* @throws IndexOutOfBoundsException if the index is out of range
* (<tt>index < 0 || index >= size()</tt>)
*/
@Override
protected E doSet(int index, E element) {
return backing.set(index, element);
}
代码示例来源:origin: com.github.almasb/fxgl-extra
@Override
protected void switchMenuContentTo(Node content) {
contentRoot.getChildren().set(0, content);
}
代码示例来源:origin: com.github.almasb/fxgl-extra
@Override
protected void switchMenuContentTo(Node content) {
contentRoot.getChildren().set(0, content);
}
代码示例来源:origin: com.github.almasb/fxgl-base
@Override
protected void switchMenuContentTo(Node content) {
contentRoot.getChildren().set(0, content);
}
代码示例来源:origin: org.codehaus.griffon/griffon-javafx
public E set(int index, E element) {
return getDelegate().set(index, element);
}
代码示例来源:origin: com.github.almasb/fxgl-extra
@Override
protected void switchMenuTo(Node menuBox) {
vbox.getChildren().set(1, menuBox);
}
代码示例来源:origin: us.ihmc/robot-environment-awareness
public void render()
{
MeshView newScanMeshView = scanMeshToRender.getAndSet(null);
if (clear.getAndSet(false))
{
children.clear();
currentScanIndex.set(0);
}
while (children.size() > numberOfScans.get())
children.remove(children.size() - 1);
if (!enable.get())
return;
if (newScanMeshView != null)
{
if (children.size() <= currentScanIndex.get())
children.add(newScanMeshView);
else
children.set(currentScanIndex.get(), newScanMeshView);
for (int i = currentScanIndex.get() + 1; i < currentScanIndex.get() + children.size(); i++)
((MeshView) children.get(i % children.size())).setMaterial(defaultMaterial);
currentScanIndex.set((currentScanIndex.get() + 1) % numberOfScans.get());
}
}
代码示例来源:origin: us.ihmc/IHMCRobotDataVisualizer
@Override
public void handle(long now)
{
Affine affine = lastAffine.getAndSet(null);
MeshView newScanMeshView = scanMeshToRender.getAndSet(null);
if (clearScan.getAndSet(false))
{
scans.getChildren().clear();
currentScanIndex.set(0);
}
if (!enabled.get())
return;
if (affine != null)
lidarPose.setToTransform(affine);
if (newScanMeshView != null)
{
ObservableList<Node> children = scans.getChildren();
if (children.size() <= currentScanIndex.get())
children.add(newScanMeshView);
else
children.set(currentScanIndex.get(), newScanMeshView);
for (int i = currentScanIndex.get() + 1; i < currentScanIndex.get() + children.size(); i++)
((MeshView) children.get(i % children.size())).setMaterial(defaultMaterial);
currentScanIndex.set((currentScanIndex.get() + 1) % NUMBER_OF_SCANS);
}
}
代码示例来源:origin: us.ihmc/ihmc-robot-data-visualizer
@Override
public void handle(long now)
{
Affine affine = lastAffine.getAndSet(null);
MeshView newScanMeshView = scanMeshToRender.getAndSet(null);
if (clearScan.getAndSet(false))
{
scans.getChildren().clear();
currentScanIndex.set(0);
}
if (!enabled.get())
return;
if (affine != null)
lidarPose.setToTransform(affine);
if (newScanMeshView != null)
{
ObservableList<Node> children = scans.getChildren();
if (children.size() <= currentScanIndex.get())
children.add(newScanMeshView);
else
children.set(currentScanIndex.get(), newScanMeshView);
for (int i = currentScanIndex.get() + 1; i < currentScanIndex.get() + children.size(); i++)
((MeshView) children.get(i % children.size())).setMaterial(defaultMaterial);
currentScanIndex.set((currentScanIndex.get() + 1) % NUMBER_OF_SCANS);
}
}
代码示例来源:origin: eu.mihosoft.vrl.jcsg/jcsg
keyValues.addAll(dup.getValues());
timelineKeyFrames.set(timelineKeyFrames.indexOf(orig),
new KeyFrame(orig.getTime(), keyValues.toArray(new KeyValue[keyValues.size()])));
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
List<B> beforePermutate = b.subList(change.getFrom(), change.getTo());
for (int i = 0; i < beforePermutate.size(); i++) {
b.set(change.getPermutation(change.getFrom() + i), beforePermutate.get(i));
List<B> updatedMapped = updated.stream().map(map).collect(Collectors.toList());
for (int i = 0; i < updatedMapped.size(); i++) {
b.set(change.getFrom(), updatedMapped.get(i));
代码示例来源:origin: at.bestsolution.efxclipse.rt/org.eclipse.fx.ui.controls
private void rebuildControl() {
if( this.b.getChildren().size() > 1 ) {
this.b.getChildren().set(1,
Util.toNode(getSkinnable().getStyleString()));
} else {
this.b.getChildren().add(
Util.toNode(getSkinnable().getStyleString()));
}
}
代码示例来源:origin: at.bestsolution.eclipse/org.eclipse.fx.ui.controls
private void rebuildControl() {
if( this.b.getChildren().size() > 1 ) {
this.b.getChildren().set(1,
Util.toNode(getSkinnable().getStyleString()));
} else {
this.b.getChildren().add(
Util.toNode(getSkinnable().getStyleString()));
}
}
代码示例来源:origin: com.github.almasb/fxgl-extra
public GTAVMenu(GameApplication app, MenuType type) {
super(app, type);
menuBody = type == MenuType.MAIN_MENU
? createMenuBodyMainMenu()
: createMenuBodyGameMenu();
vbox.getChildren().addAll(new Pane(), new Pane());
vbox.setTranslateX(50);
vbox.setTranslateY(50);
contentRoot.setTranslateX(280);
contentRoot.setTranslateY(130);
menuRoot.getChildren().add(vbox);
contentRoot.getChildren().add(EMPTY);
vbox.getChildren().set(0, makeMenuBar());
activeProperty().addListener((observable, wasActive, isActive) -> {
if (!isActive) {
// the scene is no longer active so reset everything
// so that next time scene is active everything is loaded properly
switchMenuTo(menuBody);
switchMenuContentTo(EMPTY);
}
});
}
代码示例来源:origin: com.github.almasb/fxgl-base
@Override
protected void switchMenuTo(Node menu) {
Node oldMenu = menuRoot.getChildren().get(0);
FadeTransition ft = new FadeTransition(Duration.seconds(0.33), oldMenu);
ft.setToValue(0);
ft.setOnFinished(e -> {
menu.setOpacity(0);
menuRoot.getChildren().set(0, menu);
oldMenu.setOpacity(1);
FadeTransition ft2 = new FadeTransition(Duration.seconds(0.33), menu);
ft2.setToValue(1);
ft2.play();
});
ft.play();
}
内容来源于网络,如有侵权,请联系作者删除!