Remove Live Preview functions
This commit is contained in:
parent
66557320ff
commit
924726a7b5
|
@ -41,7 +41,7 @@ import javafx.scene.layout.StackPane;
|
||||||
import javafx.scene.paint.Color;
|
import javafx.scene.paint.Color;
|
||||||
import javafx.scene.paint.Paint;
|
import javafx.scene.paint.Paint;
|
||||||
import javafx.scene.shape.Circle;
|
import javafx.scene.shape.Circle;
|
||||||
import javafx.scene.shape.Polygon;
|
// import javafx.scene.shape.Polygon;
|
||||||
import javafx.scene.shape.Rectangle;
|
import javafx.scene.shape.Rectangle;
|
||||||
import javafx.scene.shape.Shape;
|
import javafx.scene.shape.Shape;
|
||||||
import javafx.scene.text.Text;
|
import javafx.scene.text.Text;
|
||||||
|
@ -98,7 +98,7 @@ public class ThumbCell extends StackPane {
|
||||||
private final Recorder recorder;
|
private final Recorder recorder;
|
||||||
private final RecordingIndicator recordingIndicator;
|
private final RecordingIndicator recordingIndicator;
|
||||||
private final Tooltip recordingIndicatorTooltip;
|
private final Tooltip recordingIndicatorTooltip;
|
||||||
private StackPane previewTrigger;
|
// private StackPane previewTrigger;
|
||||||
private final StackPane groupIndicator;
|
private final StackPane groupIndicator;
|
||||||
private final Label groupIndicatorTooltipTrigger;
|
private final Label groupIndicatorTooltipTrigger;
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
|
@ -117,7 +117,7 @@ public class ThumbCell extends StackPane {
|
||||||
.maximumSize(10000)
|
.maximumSize(10000)
|
||||||
.build(CacheLoader.from(ThumbCell::getStreamResolution));
|
.build(CacheLoader.from(ThumbCell::getStreamResolution));
|
||||||
private final ThumbOverviewTab parent;
|
private final ThumbOverviewTab parent;
|
||||||
private CompletableFuture<Boolean> startPreview;
|
// private CompletableFuture<Boolean> startPreview;
|
||||||
|
|
||||||
public ThumbCell(ThumbOverviewTab parent, Model model, Recorder recorder, double aspectRatio) {
|
public ThumbCell(ThumbOverviewTab parent, Model model, Recorder recorder, double aspectRatio) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
@ -269,74 +269,6 @@ public class ThumbCell extends StackPane {
|
||||||
.thenAccept(r -> update());
|
.thenAccept(r -> update());
|
||||||
}
|
}
|
||||||
|
|
||||||
private Node createPreviewTrigger() {
|
|
||||||
var s = 24;
|
|
||||||
previewTrigger = new StackPane();
|
|
||||||
previewTrigger.setStyle("-fx-background-color: white;");
|
|
||||||
previewTrigger.setOpacity(.8);
|
|
||||||
previewTrigger.setMaxSize(s, s);
|
|
||||||
|
|
||||||
var play = new Polygon(16, 8, 26, 15, 16, 22);
|
|
||||||
StackPane.setMargin(play, new Insets(0, 0, 0, 3));
|
|
||||||
play.setStyle("-fx-background-color: black;");
|
|
||||||
previewTrigger.getChildren().add(play);
|
|
||||||
|
|
||||||
var clip = new Circle(s / 2.0);
|
|
||||||
clip.setTranslateX(clip.getRadius());
|
|
||||||
clip.setTranslateY(clip.getRadius());
|
|
||||||
previewTrigger.setClip(clip);
|
|
||||||
StackPane.setAlignment(previewTrigger, Pos.BOTTOM_LEFT);
|
|
||||||
StackPane.setMargin(previewTrigger, new Insets(0, 0, 24, 4));
|
|
||||||
previewTrigger.setOnMouseEntered(evt -> startPreview());
|
|
||||||
previewTrigger.setOnMouseExited(evt -> stopPreview());
|
|
||||||
return previewTrigger;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void stopPreview() {
|
|
||||||
if (startPreview != null) {
|
|
||||||
startPreview.cancel(true);
|
|
||||||
}
|
|
||||||
setPreviewVisible(previewTrigger, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void startPreview() {
|
|
||||||
previewTrigger.setCursor(Cursor.HAND);
|
|
||||||
startPreview = CompletableFuture.supplyAsync(() -> {
|
|
||||||
try {
|
|
||||||
Thread.sleep(500);
|
|
||||||
return true;
|
|
||||||
} catch (InterruptedException e) {
|
|
||||||
Thread.currentThread().interrupt();
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}, GlobalThreadPool.get()).whenComplete((result, exception) -> {
|
|
||||||
startPreview = null;
|
|
||||||
if (Boolean.TRUE.equals(result)) {
|
|
||||||
setPreviewVisible(previewTrigger, true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private void setPreviewVisible(Node previewTrigger, boolean visible) {
|
|
||||||
parent.suspendUpdates(visible);
|
|
||||||
iv.setVisible(!visible);
|
|
||||||
topic.setVisible(!visible);
|
|
||||||
topicBackground.setVisible(!visible);
|
|
||||||
name.setVisible(!visible);
|
|
||||||
nameBackground.setVisible(!visible);
|
|
||||||
streamPreview.setVisible(visible);
|
|
||||||
if (visible) {
|
|
||||||
streamPreview.startStream(model);
|
|
||||||
} else {
|
|
||||||
streamPreview.stop();
|
|
||||||
}
|
|
||||||
recordingIndicator.setVisible(!visible);
|
|
||||||
if (!visible) {
|
|
||||||
updateRecordingIndicator();
|
|
||||||
}
|
|
||||||
previewTrigger.setCursor(visible ? Cursor.HAND : Cursor.DEFAULT);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSelected(boolean selected) {
|
public void setSelected(boolean selected) {
|
||||||
selectionProperty.set(selected);
|
selectionProperty.set(selected);
|
||||||
selectionOverlay.setOpacity(selected ? .75 : 0);
|
selectionOverlay.setOpacity(selected ? .75 : 0);
|
||||||
|
@ -512,7 +444,7 @@ public class ThumbCell extends StackPane {
|
||||||
recordingIndicator.setVisible(true);
|
recordingIndicator.setVisible(true);
|
||||||
modelRecordingState = ModelRecordingState.BOOKMARKED;
|
modelRecordingState = ModelRecordingState.BOOKMARKED;
|
||||||
recordingIndicator.setImage(imgBookmarkIndicator);
|
recordingIndicator.setImage(imgBookmarkIndicator);
|
||||||
recordingIndicatorTooltip.setText("Forget Model");
|
recordingIndicatorTooltip.setText("Remove bookmark");
|
||||||
} else {
|
} else {
|
||||||
recordingIndicator.setVisible(false);
|
recordingIndicator.setVisible(false);
|
||||||
modelRecordingState = ModelRecordingState.NOT;
|
modelRecordingState = ModelRecordingState.NOT;
|
||||||
|
|
Loading…
Reference in New Issue