Skip to content

Commit b6d0462

Browse files
committed
finished updating style of editors.
1 parent 4ec46b1 commit b6d0462

16 files changed

Lines changed: 109 additions & 134 deletions
382 Bytes
Binary file not shown.

resources/ui/css/custom_classes.css

Lines changed: 69 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -151,38 +151,6 @@
151151
-fx-min-width: 20;
152152
}
153153

154-
155-
/*******************************************************************************
156-
* *
157-
* Audio Editor *
158-
* *
159-
******************************************************************************/
160-
161-
.audio-viewer-editor-param-label {
162-
-fx-alignment: center-right;
163-
-fx-min-width: 200px;
164-
-fx-pref-width: -fx-min-width;
165-
-fx-max-width: -fx-min-width;
166-
-fx-font-size: 16px;
167-
-fx-padding: 0px 6px 0px 0px;
168-
}
169-
170-
.audio-viewer-editor-param-value {
171-
-fx-min-width: 200px;
172-
-fx-pref-width: -fx-min-width;
173-
-fx-max-width: -fx-min-width;
174-
-fx-font-size: 16px;
175-
}
176-
177-
.audio-viewer-editor-button {
178-
-fx-min-height: 142px;
179-
-fx-pref-height: -fx-min-height;
180-
-fx-max-height: -fx-min-height;
181-
-fx-min-width: 142px;
182-
-fx-pref-width: -fx-min-width;
183-
-fx-max-width: -fx-min-width;
184-
}
185-
186154
/*******************************************************************************
187155
* *
188156
* Custom Buttons *
@@ -645,6 +613,75 @@
645613
-fx-min-width: 20px;
646614
}
647615

616+
/*******************************************************************************
617+
* *
618+
* Audio Editor *
619+
* *
620+
******************************************************************************/
621+
622+
.audio-view-editor-container {
623+
-fx-alignment: center;
624+
-fx-background-color: -var-background-color;
625+
}
626+
627+
.audio-view-editor-container > .label {
628+
-fx-alignment: center-right;
629+
-fx-min-width: 200px;
630+
-fx-pref-width: -fx-min-width;
631+
-fx-max-width: -fx-min-width;
632+
-fx-font-size: 16px;
633+
-fx-padding: 0px 6px 0px 0px;
634+
}
635+
636+
.audio-view-editor-container > .text-field {
637+
-fx-min-width: 200px;
638+
-fx-pref-width: -fx-min-width;
639+
-fx-max-width: -fx-min-width;
640+
-fx-font-size: 16px;
641+
}
642+
643+
.audio-view-editor-container > .hbox {
644+
-fx-alignment: center;
645+
}
646+
647+
.audio-view-editor-container > .hbox > .button {
648+
-fx-min-height: 142px;
649+
-fx-pref-height: -fx-min-height;
650+
-fx-max-height: -fx-min-height;
651+
-fx-min-width: 142px;
652+
-fx-pref-width: -fx-min-width;
653+
-fx-max-width: -fx-min-width;
654+
}
655+
656+
.audio-view-editor-container > .hbox > .grid-pane {
657+
-fx-alignment: center;
658+
-fx-padding: 20px;
659+
-fx-vgap: 2px;
660+
}
661+
662+
/*******************************************************************************
663+
* *
664+
* Text File Editor *
665+
* *
666+
******************************************************************************/
667+
668+
.text-editor-text-area {
669+
-fx-font-family: "Ubuntu Mono";
670+
-fx-font-size: 13px;
671+
}
672+
673+
/*******************************************************************************
674+
* *
675+
* Image View Editor *
676+
* *
677+
******************************************************************************/
678+
679+
.image-view-editor-container {
680+
-fx-alignment: center;
681+
-fx-background-color: -var-background-color;
682+
}
683+
684+
648685
/*******************************************************************************
649686
* *
650687
* Abstract Property Component *
@@ -711,7 +748,6 @@
711748
.abstract-param-control-vector2f-field {
712749
}
713750

714-
715751
.abstract-param-control-vector3f-field {
716752
}
717753

resources/ui/css/custom_ids.bss

-384 Bytes
Binary file not shown.

resources/ui/css/custom_ids.css

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,6 @@
8686
-fx-tab-max-height: 18;
8787
}
8888

89-
/*******************************************************************************
90-
* *
91-
* Text File Editor *
92-
* *
93-
******************************************************************************/
94-
95-
#TextEditorTextArea {
96-
}
97-
9889
#AssetEditorDialogButtonContainer {
9990
-fx-alignment: center-right;
10091
-fx-padding: 0 0 0 0;
@@ -237,27 +228,6 @@
237228
-fx-text-fill: white;
238229
}
239230

240-
/*******************************************************************************
241-
* *
242-
* Audio Editor *
243-
* *
244-
******************************************************************************/
245-
246-
#AudioViewEditorContainer {
247-
-fx-alignment: center;
248-
-fx-background-color: -var-background-color;
249-
}
250-
251-
#AudioViewerEditorButtonContainer {
252-
-fx-alignment: center;
253-
}
254-
255-
#AudioViewerEditorParamContainer {
256-
-fx-alignment: center;
257-
-fx-padding: 20px;
258-
-fx-vgap: 2px;
259-
}
260-
261231
#GenerateLoDDialogListView {
262232
-fx-min-height: 160px;
263233
-fx-pref-height: -fx-min-height;
@@ -282,11 +252,6 @@
282252
-fx-hgap: 2px;
283253
}
284254

285-
#ImageViewEditorContainer {
286-
-fx-alignment: center;
287-
-fx-background-color: -var-background-color;
288-
}
289-
290255
#Root {
291256
-fx-background-color: -var-background-color;
292257
}

src/com/ss/editor/FileExtensions.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ public interface FileExtensions {
9696
* The constant GLSL_FRAGMENT.
9797
*/
9898
String GLSL_FRAGMENT = "frag";
99+
/**
100+
* The constant GLSL_TESSELLATION_CONTROL.
101+
*/
102+
String GLSL_TESSELLATION_CONTROL = "tsctrl";
103+
/**
104+
* The constant GLSL_TESSELLATION_EVALUATION.
105+
*/
106+
String GLSL_TESSELLATION_EVALUATION = "tseval";
99107
/**
100108
* The constant GLSL_GEOM.
101109
*/

src/com/ss/editor/manager/FileIconManager.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ public class FileIconManager {
8686
EXTENSION_TO_CONTENT_TYPE.put(FileExtensions.GLSL_VERTEX, "text-x-csharp");
8787
EXTENSION_TO_CONTENT_TYPE.put(FileExtensions.GLSL_GEOM, "text-x-csharp");
8888
EXTENSION_TO_CONTENT_TYPE.put(FileExtensions.GLSL_LIB, "text-x-csharp");
89+
EXTENSION_TO_CONTENT_TYPE.put(FileExtensions.GLSL_TESSELLATION_CONTROL, "text-x-csharp");
90+
EXTENSION_TO_CONTENT_TYPE.put(FileExtensions.GLSL_TESSELLATION_EVALUATION, "text-x-csharp");
8991
EXTENSION_TO_CONTENT_TYPE.put(FileExtensions.MODEL_XBUF, "image-svg+xml-compressed");
9092
}
9193

src/com/ss/editor/ui/component/editor/impl/AudioViewerEditor.java

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,8 @@
1515
import com.ss.editor.ui.Icons;
1616
import com.ss.editor.ui.component.editor.EditorDescription;
1717
import com.ss.editor.ui.css.CSSClasses;
18-
import com.ss.editor.ui.css.CSSIds;
1918
import com.ss.editor.util.EditorUtil;
2019
import com.ss.rlib.ui.util.FXUtils;
21-
import javafx.geometry.Insets;
2220
import javafx.scene.control.Button;
2321
import javafx.scene.control.Label;
2422
import javafx.scene.control.TextField;
@@ -112,9 +110,9 @@ protected VBox createRoot() {
112110
return new VBox();
113111
}
114112

113+
115114
@Override
116115
protected void createContent(@NotNull final VBox root) {
117-
root.setId(CSSIds.AUDIO_VIEW_EDITOR_CONTAINER);
118116

119117
final Label durationLabel = new Label(Messages.AUDIO_VIEWER_EDITOR_DURATION_LABEL + ":");
120118
final Label bitsPerSampleLabel = new Label(Messages.AUDIO_VIEWER_EDITOR_BITS_PER_SAMPLE_LABEL + ":");
@@ -138,7 +136,6 @@ protected void createContent(@NotNull final VBox root) {
138136
sampleRateField.setEditable(false);
139137

140138
final GridPane gridPane = new GridPane();
141-
gridPane.setId(CSSIds.AUDIO_VIEWER_EDITOR_PARAM_CONTAINER);
142139
gridPane.add(durationLabel, 0, 0);
143140
gridPane.add(bitsPerSampleLabel, 0, 1);
144141
gridPane.add(channelsLabel, 0, 2);
@@ -150,9 +147,6 @@ protected void createContent(@NotNull final VBox root) {
150147
gridPane.add(dataTypeField, 1, 3);
151148
gridPane.add(sampleRateField, 1, 4);
152149

153-
final HBox container = new HBox();
154-
container.setId(CSSIds.AUDIO_VIEWER_EDITOR_BUTTON_CONTAINER);
155-
156150
playButton = new Button();
157151
playButton.setGraphic(new ImageView(Icons.PLAY_128));
158152
playButton.setOnAction(event -> processPlay());
@@ -162,20 +156,18 @@ protected void createContent(@NotNull final VBox root) {
162156
stopButton.setOnAction(event -> processStop());
163157
stopButton.setDisable(true);
164158

159+
final HBox container = new HBox();
160+
165161
FXUtils.addToPane(gridPane, container);
166162
FXUtils.addToPane(playButton, container);
167163
FXUtils.addToPane(stopButton, container);
168164
FXUtils.addToPane(container, root);
169165

170-
HBox.setMargin(stopButton, new Insets(0, 0, 0, 0));
171-
172-
FXUtils.addClassesTo(durationLabel, bitsPerSampleLabel, channelsLabel, dataTypeLabel, sampleRateLabel,
173-
CSSClasses.AUDIO_VIEWER_EDITOR_PARAM_LABEL);
174-
FXUtils.addClassesTo(durationField, bitsPerSampleField, sampleRateField, channelsField, dataTypeField,
175-
CSSClasses.AUDIO_VIEWER_EDITOR_PARAM_VALUE);
176-
FXUtils.addClassesTo(playButton, stopButton, CSSClasses.AUDIO_VIEWER_EDITOR_BUTTON);
177166
FXUtils.addClassTo(playButton, CSSClasses.BUTTON_WITHOUT_RIGHT_BORDER);
178167
FXUtils.addClassTo(stopButton, CSSClasses.BUTTON_WITHOUT_LEFT_BORDER);
168+
FXUtils.addClassTo(container, CSSClasses.DEF_HBOX);
169+
FXUtils.addClassTo(gridPane, CSSClasses.DEF_GRID_PANE);
170+
FXUtils.addClassesTo(root, CSSClasses.DEF_VBOX, CSSClasses.AUDIO_VIEW_EDITOR_CONTAINER);
179171
}
180172

181173
/**

src/com/ss/editor/ui/component/editor/impl/CodeAreaFileEditor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import static com.ss.rlib.util.ObjectUtils.notNull;
44
import com.ss.editor.annotation.FXThread;
5-
import com.ss.editor.ui.css.CSSIds;
5+
import com.ss.editor.ui.css.CSSClasses;
66
import com.ss.rlib.ui.util.FXUtils;
77
import com.ss.rlib.util.FileUtils;
88
import javafx.scene.layout.HBox;
@@ -48,13 +48,13 @@ protected VBox createRoot() {
4848
protected void createContent(@NotNull final VBox root) {
4949

5050
codeArea = new CodeArea();
51-
codeArea.setId(CSSIds.TEXT_EDITOR_TEXT_AREA);
5251
codeArea.richChanges().subscribe(change -> codeArea.setStyleSpans(0, getStyleSpans(codeArea.getText())));
5352
codeArea.textProperty().addListener((observable, oldValue, newValue) -> updateDirty(newValue));
5453
codeArea.prefHeightProperty().bind(root.heightProperty());
5554
codeArea.prefWidthProperty().bind(root.widthProperty());
5655

5756
FXUtils.addToPane(codeArea, root);
57+
FXUtils.addClassTo(codeArea, CSSClasses.TEXT_EDITOR_TEXT_AREA);
5858
}
5959

6060
/**

src/com/ss/editor/ui/component/editor/impl/GLSLFileEditor.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ public class GLSLFileEditor extends CodeAreaFileEditor {
3131
DESCRIPTION.setEditorId(GLSLFileEditor.class.getSimpleName());
3232
DESCRIPTION.addExtension(FileExtensions.GLSL_FRAGMENT);
3333
DESCRIPTION.addExtension(FileExtensions.GLSL_VERTEX);
34+
DESCRIPTION.addExtension(FileExtensions.GLSL_TESSELLATION_CONTROL);
35+
DESCRIPTION.addExtension(FileExtensions.GLSL_TESSELLATION_EVALUATION);
3436
DESCRIPTION.addExtension(FileExtensions.GLSL_GEOM);
3537
DESCRIPTION.addExtension(FileExtensions.GLSL_LIB);
3638
}

src/com/ss/editor/ui/component/editor/impl/ImageViewerEditor.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
package com.ss.editor.ui.component.editor.impl;
22

3-
import static java.util.Objects.requireNonNull;
3+
import static com.ss.rlib.util.ObjectUtils.notNull;
44
import com.ss.editor.Editor;
55
import com.ss.editor.FileExtensions;
66
import com.ss.editor.Messages;
77
import com.ss.editor.annotation.FXThread;
88
import com.ss.editor.manager.JavaFXImageManager;
99
import com.ss.editor.ui.component.editor.EditorDescription;
10-
import com.ss.editor.ui.css.CSSIds;
10+
import com.ss.editor.ui.css.CSSClasses;
1111
import com.ss.editor.ui.event.impl.FileChangedEvent;
12+
import com.ss.rlib.ui.util.FXUtils;
1213
import javafx.scene.image.Image;
1314
import javafx.scene.image.ImageView;
1415
import javafx.scene.layout.VBox;
1516
import org.jetbrains.annotations.NotNull;
1617
import org.jetbrains.annotations.Nullable;
17-
import com.ss.rlib.ui.util.FXUtils;
1818

1919
import java.nio.file.Path;
2020

@@ -64,19 +64,19 @@ protected VBox createRoot() {
6464

6565
@Override
6666
protected void createContent(@NotNull final VBox root) {
67-
root.setId(CSSIds.IMAGE_VIEW_EDITOR_CONTAINER);
6867

6968
imageView = new ImageView();
7069

7170
FXUtils.addToPane(imageView, root);
71+
FXUtils.addClassTo(root, CSSClasses.IMAGE_VIEW_EDITOR_CONTAINER);
7272
}
7373

7474
/**
7575
* @return the image view.
7676
*/
7777
@NotNull
7878
private ImageView getImageView() {
79-
return requireNonNull(imageView);
79+
return notNull(imageView);
8080
}
8181

8282
@Override

0 commit comments

Comments
 (0)