You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (leftmostIndex > this.previewedSockets.indexOf(i))
85
+
}
86
+
87
+
if (leftmostIndex > this.previewedSockets.indexOf(i)) {
85
88
leftmostIndex = this.previewedSockets.indexOf(i);
89
+
}
90
+
86
91
}
87
92
}
88
93
@@ -93,10 +98,11 @@ public synchronized void onPreviewOrderChanged(StepMovedEvent event) {
93
98
94
99
intnewLocation = 0;//This will hold the new index in the list of previewed sockets for this socket
95
100
96
-
if (distanceMoved < 0) //If the step moved left....
101
+
if (distanceMoved < 0) { //If the step moved left....
97
102
newLocation = leftmostIndex + distanceMoved; //Calculate the new index from the leftmost previewed socket of this step
98
-
else//The step must have moved right....
103
+
}else {//The step must have moved right....
99
104
newLocation = rightmostIndex + distanceMoved;//So calculate the new index from the rightmost previewed socket of this step
105
+
}
100
106
101
107
if (newLocation < numberOfSourcePreviews) {//If the new calculated index would put it in the midst of source previews
102
108
newLocation = numberOfSourcePreviews;//Make the index the location of the first non-source preview
@@ -112,10 +118,11 @@ public synchronized void onPreviewOrderChanged(StepMovedEvent event) {
112
118
((nextSocketInDirection.getStep().isPresent())
113
119
&& (nextSocketInDirection.getStep().get() == this.previewedSockets.get(newLocation).getStep().get()))) { //While we haven't reached the beginning of the list of previews, the socket at this location is a socket from a step, and it is the SAME step as the step of the socket at the new location...
114
120
count++;
115
-
if ((newLocation - count) > 0)//If we haven't reached the beginning of the list of open previews...
121
+
if ((newLocation - count) > 0) {//If we haven't reached the beginning of the list of open previews...
116
122
nextSocketInDirection = this.previewedSockets.get(newLocation - count);//Grab the next previewed socket to examine in the direction we are moving
117
-
else
123
+
} else {
118
124
zeroReached = true;//Mark that we've reached the beginning of the list of previews so we know to stop looking for more
125
+
}
119
126
}
120
127
newLocation = newLocation - (count - 1);//Since the first compare of the while loop will always be true, we subract one from the count when we use it to adjust newLocation
121
128
@@ -132,9 +139,9 @@ public synchronized void onPreviewOrderChanged(StepMovedEvent event) {
if (newLocation > this.previewedSockets.size())//If the new index is now too big for the list of previews
142
+
if (newLocation > this.previewedSockets.size()) {//If the new index is now too big for the list of previews
136
143
newLocation = this.previewedSockets.size();//Make it so it will be added to the end of the list of previews
137
-
144
+
}
138
145
this.previewedSockets.add(newLocation, current);//...add it to the correct location in the list of previews open
139
146
this.previewBox.getChildren().add(newLocation, SocketPreviewViewFactory.createPreviewView(this.eventBus, current));//...and display it in the correct location in the list of previews open
0 commit comments