Skip to content

Commit 4ec46b1

Browse files
committed
updated scene editor UI.
1 parent 4da5648 commit 4ec46b1

20 files changed

Lines changed: 247 additions & 151 deletions

resources/ui/css/base.bss

55 Bytes
Binary file not shown.

resources/ui/css/base.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1134,6 +1134,7 @@
11341134
-fx-background-insets: 0;
11351135
}
11361136

1137+
.text-field-list-cell,
11371138
.list-cell {
11381139
-fx-min-height: -var-default-cell-height;
11391140
-fx-background-color: transparent;
@@ -1142,10 +1143,12 @@
11421143
-fx-indent: 1em;
11431144
}
11441145

1146+
.text-field-list-cell,
11451147
.list-cell .label {
11461148
-fx-padding: 0px 0px 0px 3px;
11471149
}
11481150

1151+
.text-field-list-cell,
11491152
.list-cell:odd {
11501153
-fx-background-color: transparent;
11511154
}
1.23 KB
Binary file not shown.

resources/ui/css/custom_classes.css

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,10 @@
676676
-fx-spacing: 2px;
677677
}
678678

679+
.abstract-param-control-multi-value-container {
680+
-fx-padding: 0px 2px 0px 2px;
681+
}
682+
679683
.abstract-param-control-param-name {
680684
-fx-alignment: center;
681685
-fx-text-alignment: center;
@@ -774,6 +778,98 @@
774778
-fx-max-width: -fx-min-width;
775779
}
776780

781+
/*******************************************************************************
782+
* *
783+
* Editor Scripting Component *
784+
* *
785+
******************************************************************************/
786+
787+
.editor-scripting-component {
788+
-fx-background-color: -var-background-color;
789+
-fx-padding: 5px;
790+
-fx-vgap: 3px;
791+
}
792+
793+
.editor-scripting-component > .button {
794+
-fx-min-height: 32;
795+
-fx-pref-height: -fx-min-height;
796+
-fx-max-height: -fx-min-height;
797+
-fx-min-width: 150;
798+
-fx-pref-width: -fx-min-width;
799+
-fx-max-width: -fx-min-width;
800+
}
801+
802+
/*******************************************************************************
803+
* *
804+
* Scene App State List Component *
805+
* *
806+
******************************************************************************/
807+
808+
.scene-app-state-container {
809+
}
810+
811+
.scene-app-state-container > .hbox {
812+
-fx-alignment: center;
813+
-fx-padding: 4px;
814+
}
815+
816+
.scene-app-state-container > .hbox > .button {
817+
-fx-min-height: -var-default-toolbar-button-size;
818+
-fx-pref-height: -fx-min-height;
819+
-fx-max-height: -fx-min-height;
820+
-fx-min-width: -var-default-toolbar-button-size;
821+
-fx-pref-width: -fx-min-width;
822+
-fx-max-width: -fx-min-width;
823+
}
824+
825+
.scene-app-state-list-cell {
826+
}
827+
828+
.scene-app-state-list-cell > .hbox {
829+
-fx-alignment: center-left;
830+
}
831+
832+
/*******************************************************************************
833+
* *
834+
* Scene Filter List Component *
835+
* *
836+
******************************************************************************/
837+
838+
.scene-filter-container {
839+
}
840+
841+
.scene-filter-container > .hbox {
842+
-fx-alignment: center;
843+
-fx-padding: 4px;
844+
}
845+
846+
.scene-filter-container > .hbox > .button {
847+
-fx-min-height: -var-default-toolbar-button-size;
848+
-fx-pref-height: -fx-min-height;
849+
-fx-max-height: -fx-min-height;
850+
-fx-min-width: -var-default-toolbar-button-size;
851+
-fx-pref-width: -fx-min-width;
852+
-fx-max-width: -fx-min-width;
853+
}
854+
855+
.scene-filter-list-cell {
856+
}
857+
858+
.scene-filter-list-cell > .hbox {
859+
-fx-alignment: center-left;
860+
}
861+
862+
/*******************************************************************************
863+
* *
864+
* Groovy Editor Component *
865+
* *
866+
******************************************************************************/
867+
868+
.groovy-editor-component {
869+
-fx-border-width: 1px;
870+
-fx-border-color: -var-border-color;
871+
}
872+
777873
/*******************************************************************************
778874
* *
779875
* Paint Processing *

resources/ui/css/custom_ids.bss

-772 Bytes
Binary file not shown.

resources/ui/css/custom_ids.css

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -270,17 +270,6 @@
270270
-fx-max-height: -fx-min-height;
271271
}
272272

273-
#SceneAppStateContainer {
274-
-fx-background-color: -var-background-color;
275-
-fx-padding: 4 2 0 0;
276-
}
277-
278-
#SceneAppStateListCell {
279-
-fx-min-height: 25;
280-
-fx-pref-height: -fx-min-height;
281-
-fx-max-height: -fx-min-height;
282-
}
283-
284273
#AbstractParamControlNumberLabel {
285274
-fx-min-height: 24;
286275
-fx-pref-height: -fx-min-height;
@@ -324,27 +313,6 @@
324313
-fx-hgap: 3px;
325314
}
326315

327-
328-
#EditorScriptingComponent {
329-
-fx-background-color: -var-background-color;
330-
-fx-padding: 5px;
331-
-fx-vgap: 3px;
332-
}
333-
334-
#EditorScriptingComponentButtonRun {
335-
-fx-min-height: 32;
336-
-fx-pref-height: -fx-min-height;
337-
-fx-max-height: -fx-min-height;
338-
-fx-min-width: 150;
339-
-fx-pref-width: -fx-min-width;
340-
-fx-max-width: -fx-min-width;
341-
}
342-
343-
#GroovyEditorComponent {
344-
-fx-border-width: 1px;
345-
-fx-border-color: black;
346-
}
347-
348316
/*******************************************************************************
349317
* *
350318
* About Dialog *

src/com/ss/editor/ui/component/editor/impl/scene/AbstractSceneFileEditor.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ protected void loadState() {
483483
scriptingComponent.addImport(SpotLight.class);
484484
scriptingComponent.addImport(Material.class);
485485
scriptingComponent.addImport(Texture.class);
486-
scriptingComponent.setExampleCode("root.attachChild(new Node(\"created from Groovy\"));");
486+
scriptingComponent.setExampleCode("root.attachChild(\nnew Node(\"created from Groovy\"));");
487487
scriptingComponent.buildHeader();
488488

489489
final WorkspaceManager workspaceManager = WorkspaceManager.getInstance();
@@ -1151,14 +1151,23 @@ protected void processChangeTool(@Nullable final Number oldValue, @NotNull final
11511151
final int oldIndex = oldValue == null ? -1 : oldValue.intValue();
11521152
final int newIndex = newValue.intValue();
11531153

1154+
final VBox propertyContainer = getPropertyEditorObjectsContainer();
1155+
11541156
if (newIndex == OBJECTS_TOOL) {
1155-
FXUtils.addToPane(modelPropertyEditor, getPropertyEditorObjectsContainer());
1157+
FXUtils.addToPane(modelPropertyEditor, propertyContainer);
11561158
FXUtils.addToPane(modelNodeTree, getModelNodeTreeObjectsContainer());
1159+
modelPropertyEditor.rebuild();
11571160
} else if (newIndex == EDITING_TOOL) {
11581161
FXUtils.addToPane(modelNodeTree, getModelNodeTreeEditingContainer());
11591162
editingComponentContainer.notifyShowed();
11601163
}
11611164

1165+
EXECUTOR_MANAGER.addFXTask(() -> {
1166+
propertyContainer.requestLayout();
1167+
propertyContainer.applyCss();
1168+
propertyContainer.layout();
1169+
});
1170+
11621171
if (oldIndex == EDITING_TOOL) {
11631172
editingComponentContainer.notifyHided();
11641173
}

src/com/ss/editor/ui/component/editor/impl/scene/SceneFileEditor.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,7 @@ protected void createToolbar(@NotNull final HBox container) {
255255
audioButton.setSelected(true);
256256
audioButton.selectedProperty().addListener((observable, oldValue, newValue) -> changeAudio(newValue));
257257

258-
FXUtils.addClassTo(lightButton, CSSClasses.FLAT_BUTTON);
259-
FXUtils.addClassTo(lightButton, CSSClasses.FILE_EDITOR_TOOLBAR_BUTTON);
260-
FXUtils.addClassTo(audioButton, CSSClasses.FLAT_BUTTON);
261-
FXUtils.addClassTo(audioButton, CSSClasses.FILE_EDITOR_TOOLBAR_BUTTON);
258+
FXUtils.addClassesTo(lightButton, audioButton, CSSClasses.FILE_EDITOR_TOOLBAR_BUTTON);
262259

263260
FXUtils.addToPane(lightButton, container);
264261
FXUtils.addToPane(audioButton, container);

src/com/ss/editor/ui/component/editor/scripting/EditorScriptingComponent.java

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,17 @@
33
import com.ss.editor.Messages;
44
import com.ss.editor.ui.component.scripting.GroovyEditorComponent;
55
import com.ss.editor.ui.css.CSSClasses;
6-
import com.ss.editor.ui.css.CSSIds;
76
import com.ss.editor.util.EditorUtil;
8-
import groovy.lang.GroovyShell;
9-
import javafx.scene.control.Button;
10-
import javafx.scene.control.Label;
11-
import javafx.scene.layout.GridPane;
12-
import org.jetbrains.annotations.NotNull;
137
import com.ss.rlib.ui.util.FXUtils;
148
import com.ss.rlib.util.array.Array;
159
import com.ss.rlib.util.array.ArrayFactory;
1610
import com.ss.rlib.util.dictionary.DictionaryFactory;
1711
import com.ss.rlib.util.dictionary.ObjectDictionary;
12+
import groovy.lang.GroovyShell;
13+
import javafx.scene.control.Button;
14+
import javafx.scene.control.Label;
15+
import javafx.scene.layout.GridPane;
16+
import org.jetbrains.annotations.NotNull;
1817

1918
/**
2019
* The component to work with scripts in an editor.
@@ -66,13 +65,12 @@ public class EditorScriptingComponent extends GridPane {
6665
*/
6766
public EditorScriptingComponent(@NotNull final Runnable applyHandler) {
6867
this.applyHandler = applyHandler;
69-
setId(CSSIds.EDITOR_SCRIPTING_COMPONENT);
7068

7169
this.editorComponent = new GroovyEditorComponent(true);
72-
this.editorComponent.prefHeightProperty().bind(heightProperty());
70+
this.editorComponent.prefHeightProperty().bind(heightProperty().multiply(0.6));
7371
this.editorComponent.prefWidthProperty().bind(widthProperty());
7472
this.headerComponent = new GroovyEditorComponent(false);
75-
this.headerComponent.prefHeightProperty().bind(heightProperty().multiply(0.2));
73+
this.headerComponent.prefHeightProperty().bind(heightProperty().multiply(0.4));
7674
this.headerComponent.prefWidthProperty().bind(widthProperty());
7775
this.shell = new GroovyShell();
7876
this.variables = DictionaryFactory.newObjectDictionary();
@@ -82,20 +80,15 @@ public EditorScriptingComponent(@NotNull final Runnable applyHandler) {
8280
final Label scriptBodyLabel = new Label(Messages.EDITOR_SCRIPTING_COMPONENT_BODY + ":");
8381

8482
final Button runButton = new Button(Messages.EDITOR_SCRIPTING_COMPONENT_RUN);
85-
runButton.setId(CSSIds.EDITOR_SCRIPTING_COMPONENT_BUTTON_RUN);
8683
runButton.setOnAction(event -> run());
8784

88-
FXUtils.addClassTo(headersLabel, CSSClasses.SPECIAL_FONT_14);
89-
FXUtils.addClassTo(scriptBodyLabel, CSSClasses.SPECIAL_FONT_14);
90-
FXUtils.addClassTo(editorComponent, CSSClasses.SPECIAL_FONT_14);
91-
FXUtils.addClassTo(headerComponent, CSSClasses.SPECIAL_FONT_14);
92-
FXUtils.addClassTo(runButton, CSSClasses.SPECIAL_FONT_14);
93-
9485
add(headersLabel, 0, 0, 1, 1);
9586
add(headerComponent, 0, 1, 1, 1);
9687
add(scriptBodyLabel, 0, 2, 1, 1);
97-
add(editorComponent, 0, 3, 1, 5);
98-
add(runButton, 0, 8, 1, 1);
88+
add(editorComponent, 0, 3, 1, 1);
89+
add(runButton, 0, 4, 1, 1);
90+
91+
FXUtils.addClassTo(this, CSSClasses.EDITOR_SCRIPTING_COMPONENT);
9992
}
10093

10194
/**

src/com/ss/editor/ui/component/scripting/GroovyEditorComponent.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ private static StyleSpans<Collection<String>> computeHighlighting(final String t
110110
* @param editable the editable
111111
*/
112112
public GroovyEditorComponent(final boolean editable) {
113-
setId(CSSIds.GROOVY_EDITOR_COMPONENT);
114113

115114
codeArea = new CodeArea();
116115
codeArea.setId(CSSIds.TEXT_EDITOR_TEXT_AREA);
@@ -120,7 +119,7 @@ public GroovyEditorComponent(final boolean editable) {
120119
codeArea.setEditable(editable);
121120

122121
FXUtils.addToPane(codeArea, this);
123-
FXUtils.addClassTo(codeArea, CSSClasses.MONO_FONT_13);
122+
FXUtils.addClassTo(this, CSSClasses.GROOVY_EDITOR_COMPONENT);
124123
}
125124

126125
@NotNull

0 commit comments

Comments
 (0)