本文整理汇总了Java中javafx.scene.Parent.getChildrenUnmodifiable方法的典型用法代码示例。如果您正苦于以下问题:Java Parent.getChildrenUnmodifiable方法的具体用法?Java Parent.getChildrenUnmodifiable怎么用?Java Parent.getChildrenUnmodifiable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.Parent
的用法示例。
在下文中一共展示了Parent.getChildrenUnmodifiable方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: found
import javafx.scene.Parent; //导入方法依赖的package包/类
protected List<IJavaFXElement> found(List<IJavaFXElement> pElements, IJavaFXAgent driver) {
List<IJavaFXElement> r = new ArrayList<IJavaFXElement>();
for (IJavaFXElement je : pElements) {
Node component = je.getComponent();
if (!(component instanceof Parent)) {
continue;
}
int index = getIndexOfComponentInParent(component);
if (index < 0) {
continue;
}
Parent parent = component.getParent();
JFXWindow topContainer = driver.switchTo().getTopContainer();
ObservableList<Node> children = parent.getChildrenUnmodifiable();
for (int i = index + 1; i < children.size(); i++) {
Node c = children.get(i);
IJavaFXElement je2 = JavaFXElementFactory.createElement(c, driver, driver.switchTo().getTopContainer());
if (sibling.matchesSelector(je2).size() > 0) {
IJavaFXElement e = topContainer.addElement(JavaFXElementFactory.createElement(c, driver, topContainer));
if (!r.contains(e)) {
r.add(e);
}
}
}
}
return r;
}
示例2: setState
import javafx.scene.Parent; //导入方法依赖的package包/类
public void setState(int state)
{
// 0 is on, 1 is off
for (int index = 0; index < segments.size(); index++)
{
int maskedBit = (state >> index) & 1;
boolean isOn = (maskedBit == 0);
String color = isOn ? OFF_COLOR : ON_COLOR;
Parent segment = segments.get(index);
for (Node section : segment.getChildrenUnmodifiable())
{
section.setStyle("-fx-background-color: " + color);
}
}
}
示例3: doFindEntryView
import javafx.scene.Parent; //导入方法依赖的package包/类
private EntryViewBase<?> doFindEntryView(Parent parent, Entry<?> entry) {
EntryViewBase<?> result = null;
for (Node node : parent.getChildrenUnmodifiable()) {
if (node instanceof EntryViewBase) {
EntryViewBase<?> base = (EntryViewBase<?>) node;
if (base.getEntry().equals(entry)) {
result = base;
break;
}
} else if (node instanceof Parent) {
result = doFindEntryView((Parent) node, entry);
if (result != null) {
break;
}
}
}
return result;
}
示例4: addAllDescendents
import javafx.scene.Parent; //导入方法依赖的package包/类
private static void addAllDescendents(Parent parent, ArrayList<Node> nodes) {
for (Node node : parent.getChildrenUnmodifiable()) {
nodes.add(node);
if (node instanceof Parent)
addAllDescendents((Parent)node, nodes);
}
}
示例5: getIndexOfComponentInParent
import javafx.scene.Parent; //导入方法依赖的package包/类
private int getIndexOfComponentInParent(Node component) {
Parent parent = component.getParent();
if (parent == null) {
return -1;
}
ObservableList<Node> components = parent.getChildrenUnmodifiable();
for (int i = 0; i < components.size(); i++) {
if (components.get(i) == component) {
return i;
}
}
return -1;
}
示例6: search
import javafx.scene.Parent; //导入方法依赖的package包/类
private void search(UIPlatform uiPlatform, Parent parent)
{
ObservableList<Node> list = parent.getChildrenUnmodifiable();
if (list.size() == 0)
{
return;
}
final String idPrefix = getPrefix().idPrefix;
final String pathPrefix = getPrefix().pathPrefix;
IdDeal idDeal = uiPlatform.getIdDeal();
BinderFactory factory = uiPlatform.getBinderFactory();
for (int i = 0; i < list.size(); i++)
{
Node node = list.get(i);
UiId id = UiId.newInstance(node.getId(), idPrefix);
if (id != null)
{
IdDeal.Result result = idDeal.dealId(id, pathPrefix);
if (result != null)
{
hashMap.put(id, factory.getBinder(node));
}
}
if (node instanceof Parent)
{
search(uiPlatform, (Parent) node);
}
if (node instanceof MenuBar)
{
search(uiPlatform, (MenuBar) node);
}
}
}
示例7: addAllDescendents
import javafx.scene.Parent; //导入方法依赖的package包/类
private static void addAllDescendents(Parent parent, ArrayList<Node> nodes) {
for (Node node : parent.getChildrenUnmodifiable()) {
nodes.add(node);
if (node instanceof Parent)
addAllDescendents((Parent) node, nodes);
}
}