Skip to content

Commit a14bb5d

Browse files
committed
fixed background
1 parent f96a5df commit a14bb5d

File tree

8 files changed

+35
-22
lines changed

8 files changed

+35
-22
lines changed

build-native.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project name="jME SpaceShift Editor" default="do-deploy" basedir="build"
33
xmlns:fx="javafx:com.sun.javafx.tools.ant">
44

5-
<property name="editor.version" value="0.9.1" />
5+
<property name="editor.version" value="0.9.2" />
66

77
<target name="init-fx-tasks">
88
<path id="fxant">

resources/ui/css/custom_ids.bss

42 Bytes
Binary file not shown.

resources/ui/css/custom_ids.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,4 +834,8 @@
834834
#AudioViewEditorContainer {
835835
-fx-alignment: center;
836836
-fx-background-color: -fx-background-background;
837+
}
838+
839+
#Root {
840+
-fx-background-color: -fx-background-background;
837841
}

src/com/ss/editor/JFXApplication.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,15 @@ public void buildScene() {
236236
}
237237

238238
private void createSceneProcessor(@NotNull final EditorFXScene scene, @NotNull final Editor editor) {
239-
this.sceneProcessor = bind(editor, scene.getCanvas(), editor.getViewPort());
239+
240+
final FrameTransferSceneProcessor sceneProcessor = bind(editor, scene.getCanvas(), editor.getViewPort());
241+
sceneProcessor.setEnabled(false);
242+
243+
this.sceneProcessor = sceneProcessor;
244+
240245
final Stage stage = getStage();
241246
stage.focusedProperty().addListener((observable, oldValue, newValue) -> editor.setPaused(!newValue));
247+
242248
Platform.runLater(scene::notifyFinishBuild);
243249
}
244250

src/com/ss/editor/config/Config.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public abstract class Config {
2525
public static final String CONFIG_RESOURCE_PATH = "/com/ss/editor/config/config.xml";
2626

2727
public static final String TITLE = "jME3 SpaceShift Editor";
28-
public static final String VERSION = "v.0.9.1";
28+
public static final String VERSION = "v.0.9.2";
2929

3030
public static final String SS_FOLDER_IN_USER_HOME = ".jme3-spaceshift-editor";
3131

src/com/ss/editor/ui/component/editor/area/EditorAreaComponent.java

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import javafx.collections.ListChangeListener;
4646
import javafx.collections.ObservableList;
4747
import javafx.collections.ObservableMap;
48+
import javafx.scene.canvas.Canvas;
4849
import javafx.scene.control.SingleSelectionModel;
4950
import javafx.scene.control.Tab;
5051
import javafx.scene.control.TabPane;
@@ -316,6 +317,7 @@ public FileEditor getCurrentEditor() {
316317
private void processShowEditor(@Nullable final Tab prevTab, @Nullable final Tab newTab) {
317318

318319
final AppStateManager stateManager = EDITOR.getStateManager();
320+
final Canvas canvas = JFX_APPLICATION.getScene().getCanvas();
319321
final FrameTransferSceneProcessor sceneProcessor = JFX_APPLICATION.getSceneProcessor();
320322

321323
boolean enabled = false;
@@ -344,6 +346,7 @@ private void processShowEditor(@Nullable final Tab prevTab, @Nullable final Tab
344346
final boolean result = enabled;
345347
EXECUTOR_MANAGER.addFXTask(() -> {
346348
ThreadUtils.sleep(100);
349+
canvas.setOpacity(result ? 1D : 0D);
347350
sceneProcessor.setEnabled(result);
348351
});
349352
}
@@ -445,25 +448,16 @@ public String getComponentId() {
445448

446449
@Override
447450
public void notifyFinishBuild() {
448-
EXECUTOR_MANAGER.addFXTask(() -> {
449-
setIgnoreOpenedFiles(true);
450-
try {
451-
loadOpenedFiles();
452-
} finally {
453-
setIgnoreOpenedFiles(false);
454-
}
455-
});
451+
setIgnoreOpenedFiles(true);
452+
try {
453+
loadOpenedFiles();
454+
} finally {
455+
setIgnoreOpenedFiles(false);
456+
}
456457
}
457458

458459
private void loadOpenedFiles() {
459460

460-
final FrameTransferSceneProcessor sceneProcessor = JFX_APPLICATION.getSceneProcessor();
461-
462-
EXECUTOR_MANAGER.addFXTask(() -> {
463-
ThreadUtils.sleep(200);
464-
sceneProcessor.setEnabled(false);
465-
});
466-
467461
final Workspace workspace = WORKSPACE_MANAGER.getCurrentWorkspace();
468462
if (workspace == null) return;
469463

src/com/ss/editor/ui/css/CSSIds.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package com.ss.editor.ui.css;
22

33
/**
4-
* Интерфейс с набором констант ID используемых в CSS.
4+
* The list of css ids which used in the editor.
55
*
6-
* @author Ronn
6+
* @author JavaSaBr
77
*/
88
public interface CSSIds {
99

10+
String ROOT = "Root";
11+
1012
String EDITOR_BAR_COMPONENT = "EditorBarComponent";
1113
String EDITOR_BAR_COMPONENT_TITLE_LABEL = "EditorBarComponentTitleLabel";
1214
String EDITOR_BAR_COMPONENT_MENU_BUTTON = "EditorBarComponentMenuButton";

src/com/ss/editor/ui/scene/EditorFXScene.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import javafx.scene.Scene;
1616
import javafx.scene.canvas.Canvas;
1717
import javafx.scene.control.ProgressIndicator;
18+
import javafx.scene.layout.Pane;
1819
import javafx.scene.layout.StackPane;
1920
import javafx.scene.layout.VBox;
2021
import rlib.ui.util.FXUtils;
@@ -64,7 +65,7 @@ public class EditorFXScene extends Scene {
6465
*/
6566
private ProgressIndicator progressIndicator;
6667

67-
public EditorFXScene(final Group root) {
68+
public EditorFXScene(@NotNull final Group root) {
6869
super(root);
6970

7071
this.canvas = new Canvas();
@@ -78,12 +79,18 @@ public EditorFXScene(final Group root) {
7879
this.loadingLayer.setId(CSSIds.EDITOR_LOADING_LAYER);
7980
this.loadingLayer.setVisible(false);
8081

81-
root.getChildren().addAll(hideLayer, canvas, container, loadingLayer);
82+
final Pane background = new Pane();
83+
background.setId(CSSIds.ROOT);
84+
85+
root.getChildren().addAll(hideLayer, background, canvas, container, loadingLayer);
8286

8387
canvas.setPickOnBounds(true);
8488
canvas.heightProperty().bind(heightProperty());
8589
canvas.widthProperty().bind(widthProperty());
90+
canvas.setOpacity(0);
8691

92+
FXUtils.bindFixedWidth(background, widthProperty());
93+
FXUtils.bindFixedHeight(background, heightProperty());
8794
FXUtils.bindFixedWidth(hideLayer, widthProperty());
8895
FXUtils.bindFixedHeight(hideLayer, heightProperty());
8996
FXUtils.bindFixedWidth(container, widthProperty());

0 commit comments

Comments
 (0)