Skip to content

Commit 91af7f6

Browse files
committed
small fixes
1 parent 8a95a24 commit 91af7f6

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/com/ss/editor/ui/component/editor/impl/material/MaterialFileEditor.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,14 +695,23 @@ private void changeModelType(@NotNull final ModelType modelType, final Boolean n
695695
final ToggleButton planeButton = getPlaneButton();
696696

697697
if (modelType == ModelType.BOX) {
698+
cubeButton.setMouseTransparent(true);
699+
sphereButton.setMouseTransparent(false);
700+
planeButton.setMouseTransparent(false);
698701
sphereButton.setSelected(false);
699702
planeButton.setSelected(false);
700703
editorAppState.changeMode(modelType);
701704
} else if (modelType == ModelType.SPHERE) {
705+
cubeButton.setMouseTransparent(false);
706+
sphereButton.setMouseTransparent(true);
707+
planeButton.setMouseTransparent(false);
702708
cubeButton.setSelected(false);
703709
planeButton.setSelected(false);
704710
editorAppState.changeMode(modelType);
705711
} else if (modelType == ModelType.QUAD) {
712+
cubeButton.setMouseTransparent(false);
713+
sphereButton.setMouseTransparent(false);
714+
planeButton.setMouseTransparent(true);
706715
sphereButton.setSelected(false);
707716
cubeButton.setSelected(false);
708717
editorAppState.changeMode(modelType);

src/com/ss/editor/ui/component/editor/impl/model/ModelFileEditor.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141
import javafx.scene.control.ToggleButton;
4242
import javafx.scene.image.ImageView;
4343
import javafx.scene.layout.HBox;
44+
import org.jetbrains.annotations.Nullable;
4445
import rlib.ui.util.FXUtils;
4546
import rlib.util.array.Array;
4647
import rlib.util.array.ArrayFactory;
@@ -52,9 +53,9 @@
5253
*/
5354
public class ModelFileEditor extends AbstractSceneFileEditor<ModelFileEditor, Spatial, ModelEditorAppState, ModelFileEditorState> {
5455

55-
public static final String NO_FAST_SKY = Messages.MODEL_FILE_EDITOR_NO_SKY;
56+
private static final String NO_FAST_SKY = Messages.MODEL_FILE_EDITOR_NO_SKY;
5657

57-
public static final Insets LIGHT_BUTTON_OFFSET = new Insets(0, 4, 0, 4);
58+
private static final Insets LIGHT_BUTTON_OFFSET = new Insets(0, 4, 0, 4);
5859

5960
public static final EditorDescription DESCRIPTION = new EditorDescription();
6061

@@ -81,14 +82,16 @@ public class ModelFileEditor extends AbstractSceneFileEditor<ModelFileEditor, Sp
8182
/**
8283
* The list of fast skies.
8384
*/
85+
@Nullable
8486
private ComboBox<String> fastSkyComboBox;
8587

8688
/**
8789
* The light toggle.
8890
*/
91+
@Nullable
8992
private ToggleButton lightButton;
9093

91-
public ModelFileEditor() {
94+
private ModelFileEditor() {
9295
super();
9396
}
9497

@@ -103,7 +106,7 @@ protected ModelEditorAppState createEditorAppState() {
103106
*/
104107
@NotNull
105108
private ComboBox<String> getFastSkyComboBox() {
106-
return fastSkyComboBox;
109+
return requireNonNull(fastSkyComboBox);
107110
}
108111

109112
@Override

0 commit comments

Comments
 (0)