Skip to content

Commit 57e6769

Browse files
committed
udate the API for updates
1 parent 8b21281 commit 57e6769

File tree

7 files changed

+15
-12
lines changed

7 files changed

+15
-12
lines changed

BowlerStudio

src/main/java/com/commonwealthrobotics/ActiveProject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -496,10 +496,10 @@ public void onRegenerateStart() {
496496
}
497497

498498
@Override
499-
public void onTimelineUpdate() {
499+
public void onTimelineUpdate(int num) {
500500
for (ICaDoodleStateUpdate l : listeners) {
501501
try {
502-
l.onTimelineUpdate();
502+
l.onTimelineUpdate( num);
503503
} catch (Throwable e) {
504504
e.printStackTrace();
505505
}

src/main/java/com/commonwealthrobotics/MainController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ public void onRegenerateStart() {
12891289
}
12901290

12911291
@Override
1292-
public void onTimelineUpdate() {
1292+
public void onTimelineUpdate(int num) {
12931293
// TODO Auto-generated method stub
12941294

12951295
}

src/main/java/com/commonwealthrobotics/TimelineManager.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ public void onInitializationDone() {
7070
update(false);
7171
}
7272
@Override
73-
public void onTimelineUpdate() {
74-
//new Exception().printStackTrace();
75-
update(true);
73+
public void onTimelineUpdate(int num) {
74+
if(num>1)
75+
update(true);
76+
else if (num==1)
77+
update(false);
7678
}
7779
});
7880
}
@@ -178,6 +180,7 @@ private void update(boolean clear) {
178180
deleteItem.setOnAction(event -> {
179181
toAdd.setDisable(true);
180182
buttons.remove(toAdd);
183+
timeline.getChildren().remove(toAdd);
181184
ap.get().deleteOperation(op);
182185
});
183186
// Add the delete item to the context menu
@@ -202,7 +205,7 @@ private void update(boolean clear) {
202205
}
203206
//System.out.println("Timeline updated");
204207
if (addrem)
205-
Platform.runLater(() -> {
208+
BowlerStudio.runLater(java.time.Duration.ofMillis(100),() -> {
206209
timelineScroll.setHvalue(1.0);
207210
updating = false;
208211
if(updateNeeded)
@@ -218,7 +221,7 @@ private void update(boolean clear) {
218221
}
219222

220223
public void clear() {
221-
System.out.println("Old Timeline buttons cleared");
224+
//System.out.println("Old Timeline buttons cleared");
222225
buttons.clear();
223226
timeline.getChildren().clear();
224227
}

src/main/java/com/commonwealthrobotics/controls/ControlSprites.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public void onRegenerateStart() {
148148
}
149149

150150
@Override
151-
public void onTimelineUpdate() {
151+
public void onTimelineUpdate(int num) {
152152
// TODO Auto-generated method stub
153153

154154
}

src/main/java/com/commonwealthrobotics/controls/SelectionSession.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1731,7 +1731,7 @@ public void setMeshes(HashMap<CSG, MeshView> meshes) {
17311731
}
17321732

17331733
@Override
1734-
public void onTimelineUpdate() {
1734+
public void onTimelineUpdate(int num) {
17351735
// TODO Auto-generated method stub
17361736

17371737
}

src/main/java/com/commonwealthrobotics/mirror/MirrorHandle.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ public void onWorkplaneChange(TransformNR newWP) {
359359
}
360360

361361
@Override
362-
public void onTimelineUpdate() {
362+
public void onTimelineUpdate(int num) {
363363
// TODO Auto-generated method stub
364364

365365
}

0 commit comments

Comments
 (0)