+ syncNozzles();
+ }
+
+ @Override
+ public void setGeometry(GeometryProvider provider) {
+ super.setGeometry(provider);
+ if (provider instanceof FixedNozzleProvider) {
+ fnp = (FixedNozzleProvider)provider;
+ syncNozzles();
+ }
+ }
+
+ public int numberOfFixedNozzles() {
+ if (fnp == null)
+ return 0;
+ return fnp.numberOfNozzles();
+ }
+
+ /**
+ * Synchronizes fixed nozzles.
+ *
+ * Note: this method does not create nozzles, just sets their positions and names.
+ */
+ public void syncNozzles() {
+ if (fnp == null)
+ return;
+ updateParameters();
+ int count = fnp.numberOfNozzles();
+ List<Nozzle> currentNozzles = getNodes();
+ for (int i = 0; i < count; i++) {
+ if (i < currentNozzles.size()) {
+ Nozzle nozzle = currentNozzles.get(i);
+ nozzle.setName(fnp.getNozzleName(i));
+ fnp.updateNozzlePosition(i, nozzle);
+ nozzle.setFixed(true);
+ }
+ }