javafx.collections.ObservableList.iterator()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中javafx.collections.ObservableList.iterator()方法的一些代码示例,展示了ObservableList.iterator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ObservableList.iterator()方法的具体详情如下:
包路径:javafx.collections.ObservableList
类名称:ObservableList
方法名:iterator

ObservableList.iterator介绍

暂无

代码示例

代码示例来源:origin: jfoenixadmin/JFoenix

double w = header.getWidth() - snapSize(rightControlButton.prefWidth(-1)) - snapSize(
  leftControlButton.prefWidth(-1)) - snappedLeftInset() - SPACER;
Iterator<Node> itr = getChildren().iterator();
while (itr.hasNext()) {
  Node temp = itr.next();

代码示例来源:origin: org.reactfx/reactfx

@Override
public Iterator<E> iterator() {
  return delegate.iterator();
}

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

private List<Point2D> convertToPoints(ObservableList<Double> points) {
  ArrayList<Point2D> list = new ArrayList<>();
  for (Iterator<Double> it = points.iterator(); it.hasNext();) {
    double x = it.next();
    double y = it.next();
    list.add(new Point2D(x, y));
  }
  return list;
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

@Override
  public void rebind() {
    for (Iterator<Node> iterator = mapPane.getChildren().iterator(); iterator.hasNext(); ) {
      Node node = iterator.next();
      if (node instanceof Circle) {
        iterator.remove();
      }
    }
  }
}

代码示例来源:origin: org.codehaus.griffon/griffon-javafx

public Iterator<E> iterator() {
  return getDelegate().iterator();
}

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

private EventHandler<MouseEvent> getDisplayMessageMouseExitFocusEventHandler(DecoratedText text){
    return event -> {
      final Group viewContainer = (Group) ((StackPane)text.getScene().getRoot()).getChildren().get(1);
      for (Iterator<Node> iterator = viewContainer.getChildren().iterator(); iterator.hasNext(); ) {
        Node node =  iterator.next();
        if (node instanceof DisplayMessageOverlayLabel) {
          iterator.remove();
          break;
        }
      }
    };
  }
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

@Override
  protected void selectionChanged() {
    super.selectionChanged();
    Group footerText = createFooterText();
    footerText.setLayoutX(50);
    footerText.setLayoutY(250 + 36 + 7 * 24);
    for (Iterator<Node> iterator = getContent().iterator(); iterator.hasNext(); ) {
      Node child =  iterator.next();
      if ("footerText".equals(child.getId())) {
        iterator.remove();
        break;
      }
    }
    getContent().add(footerText);
  }
}

代码示例来源:origin: stackoverflow.com

for (Iterator it = rowList.iterator(); it.hasNext();) {
  ObservableList<Object> row = (ObservableList<Object>) it.next();

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

@Override
  protected void selectionChanged() {
    super.selectionChanged();
    initializeRequirements();
    Group footerText = createFooterText();
    footerText.setLayoutX(50);
    footerText.setLayoutY(250 + 36 + 7 * 24);
    for (Iterator<Node> iterator = getContent().iterator(); iterator.hasNext(); ) {
      Node child =  iterator.next();
      if ("footerText".equals(child.getId())) {
        iterator.remove();
        break;
      }
    }
    getContent().add(footerText);
  }
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

@Override
  protected void selectionChanged() {
    super.selectionChanged();
    initializeRequirements();
    Group footerText = createFooterText();
    footerText.setLayoutX(50);
    footerText.setLayoutY(250 + 36 + 7 * 24);
    for (Iterator<Node> iterator = getContent().iterator(); iterator.hasNext(); ) {
      Node child =  iterator.next();
      if ("footerText".equals(child.getId())) {
        iterator.remove();
        break;
      }
    }
    getContent().add(footerText);
  }
}

代码示例来源:origin: eu.mihosoft.vrl.jcsg/jcsg

private void optimize(Node node) {
  ObservableList<Transform> transforms = node.getTransforms();
  Iterator<Transform> iterator = transforms.iterator();
  boolean prevIsStatic = false;
  while (iterator.hasNext()) {

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

private void updateCityEvent() {
  threadExecution.execute(() -> {
    ObjectProperty<ECityState> cityEvent = cityState.cityEventProperty();
    for (Iterator<Node> iterator = getChildren().iterator(); iterator.hasNext(); ) {
      Node child = iterator.next();
      if (child.getId().equals(CITY_EVENT_ID)) {
        iterator.remove();
        break;
      }
    }
    if (cityEvent.get() != null) {
      // display event icon
      Image iconImg = imageLoader.getImage("icons/32/" + getEventIconName(cityEvent.get()));
      ImageView imgView = new ImageView(iconImg);
      getChildren().add(imgView);
    }
  });
}

代码示例来源:origin: nl.cloudfarming.client/calendar-api

public void removeNode(CalendarNode node) {
  Iterator<XYChart.Series<DateTime, CalendarNode>> seriesIterator = getData().iterator();
  XYChart.Series<DateTime, CalendarNode> series = null;
  
  while (seriesIterator.hasNext()) {
    series = seriesIterator.next();
    CalendarNode seriesNode = series.getData().get(0).getYValue();
    if (node.equals(seriesNode)) {
      break;
    }
  }
  
  if (series != null) {
    getData().remove(series);
  }
  
  rootNode.removeChild(node);
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

protected void structureModelUpdated(ObservableList<OperationData> observableList) {
 titleContainer.getChildren().clear();
 Iterator<OperationData> it = observableList.iterator();
 if (it.hasNext()) {
  titleContainer.getChildren().add(NodeHelper.getSep("ep-tab-pane-header-structure-navigation-label-each"));
  while (it.hasNext()) {
   Text l = new Text();
   OperationData opd = it.next();
   l.setText(NodeHelper.getDisplayName(opd));
   l.getStyleClass().add("ep-tab-pane-header-structure-navigation-label-each");
   titleContainer.getChildren().add(l);
   if (it.hasNext()) {
    titleContainer.getChildren().add(NodeHelper.getSep("ep-tab-pane-header-structure-navigation-label-each"));
   }
  }
 }
 else {
  Text l = new Text("Home");
  l.getStyleClass().add("ep-tab-pane-header-structure-navigation-label-each");
  titleContainer.getChildren().addAll(NodeHelper.getSep("ep-tab-pane-header-structure-navigation-label-each"), l);
 }
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

@Subscribe
public void handleShipLeavesCity(ShipLeavingPort event) {
  ICity city = event.getCity();
  final IShipOwner owner = event.getShip().getOwner();
  if (owner instanceof IHumanPlayer && owner.equals(viewState.getPlayer())) {
    List<INavigableVessel> ships = ((IHumanPlayer)owner).findShips(city);
    if (ships.isEmpty()) {
      double cityX = (int) Math.rint(city.getCoordinates().getX()) * scale.doubleValue();
      double cityY = (int) Math.rint(city.getCoordinates().getY()) * scale.doubleValue();
      for (Iterator<Node> iterator = shipCanvas.getChildren().iterator(); iterator.hasNext(); ) {
        Node node = iterator.next();
        if (node instanceof Circle) {
          Circle c = (Circle) node;
          if (c.getCenterX() == cityX && c.getCenterY() == cityY) {
            Platform.runLater(iterator::remove);
            break;
          }
        }
      }
    }
  }
}

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

@Subscribe
public void handleShipLeavesCity(ShipLeavingPort event) {
  ICity city = event.getCity();
  final IShipOwner owner = event.getShip().getOwner();
  if (owner instanceof IHumanPlayer && owner.equals(viewState.getPlayer())) {
    List<INavigableVessel> ships = ((IHumanPlayer)owner).findShips(city);
    if (ships.isEmpty()) {
      double cityX = (int) Math.rint(city.getCoordinates().getX()) * scale;
      double cityY = (int) Math.rint(city.getCoordinates().getY()) * scale;
      double viewportOffset = imgView.getViewport().getMinX() * scale;
      for (Iterator<Node> iterator = mapPane.getChildren().iterator(); iterator.hasNext(); ) {
        Node node = iterator.next();
        if (node instanceof Circle) {
          Circle c = (Circle) node;
          if (c.getCenterX() + viewportOffset == cityX && c.getCenterY() == cityY) {
            Platform.runLater(iterator::remove);
            break;
          }
        }
      }
    }
  }
}
@Subscribe

代码示例来源:origin: eu.mihosoft.vrl.jcsg/jcsg

Map<WritableValue, KeyValue> kvUnique = new HashMap<>();
MapOfLists<KeyFrame, KeyFrame> duplicates = new MapOfLists<>();
Iterator<KeyFrame> iterator = timelineKeyFrames.iterator();
while (iterator.hasNext()) {
  KeyFrame duplicate = iterator.next();

代码示例来源:origin: ch.sahits.game/OpenPatricianJavaFX

private void updateMissingWare() {
  threadExecution.execute(() -> {
    ObjectBinding<IWare> missingWareeBinding = cityState.longestMissingWaresBinding();
    for (Iterator<Node> iterator = getChildren().iterator(); iterator.hasNext(); ) {
      Node child = iterator.next();
      if (child.getId().equals(MISSING_WARE_ID)) {
        iterator.remove();
        break;
      }
    }
    if (missingWareeBinding.get() != null) {
      if (cityState.famineBinding().get()) {
        // display famine icon
        Image famine = imageLoader.getImage("icons/32/icon_famine");
        ImageView famineView = new ImageView(famine);
        famineView.setId(MISSING_WARE_ID);
        getChildren().add(0, famineView);
      } else {
        // display missing ware icon
        String wareIconName = "icons/32/" + getIconName(missingWareeBinding.get());
        Image missingWare = imageLoader.getImage(wareIconName);
        ImageView missingWareView = new ImageView(missingWare);
        missingWareView.setId(MISSING_WARE_ID);
        getChildren().add(0, missingWareView);
      }
    }
  });
}

代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine

Iterator<OperationData> it = ts.childTree().iterator();

代码示例来源:origin: ch.sahits.game/OpenPatricianDisplay

resetClipXPosition(xx);
for (Iterator<Node> iterator = shipCanvas.getChildren().iterator(); iterator.hasNext(); ) {
  Node node = iterator.next();
  if (node instanceof Circle) {

相关文章