11package com .ss .editor .ui .control .model .property .builder .impl ;
22
3+ import static com .ss .rlib .util .ObjectUtils .notNull ;
34import com .jme3 .math .ColorRGBA ;
45import com .jme3 .math .Vector2f ;
56import com .jme3 .math .Vector3f ;
7+ import com .ss .editor .extension .property .EditableProperty ;
8+ import com .ss .editor .extension .property .EditablePropertyType ;
9+ import com .ss .editor .extension .scene .control .EditableControl ;
610import com .ss .editor .model .undo .editor .ModelChangeConsumer ;
711import com .ss .editor .ui .control .model .property .control .*;
812import com .ss .editor .ui .control .property .AbstractPropertyControl ;
913import com .ss .editor .ui .control .property .builder .impl .AbstractPropertyBuilder ;
10- import com .ss .editor .extension .property .EditableProperty ;
11- import com .ss .editor .extension .property .EditablePropertyType ;
12- import com .ss .editor .extension .scene .control .EditableControl ;
13- import javafx .scene .layout .VBox ;
14- import org .jetbrains .annotations .NotNull ;
15- import org .jetbrains .annotations .Nullable ;
1614import com .ss .rlib .ui .util .FXUtils ;
1715import com .ss .rlib .util .ClassUtils ;
1816import com .ss .rlib .util .array .Array ;
19-
20- import java .util .Objects ;
17+ import javafx .scene .layout .VBox ;
18+ import org .jetbrains .annotations .NotNull ;
19+ import org .jetbrains .annotations .Nullable ;
2120
2221/**
2322 * The property builder to build property controls of editable controls.
@@ -62,7 +61,7 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
6261 case BOOLEAN : {
6362
6463 final EditableProperty <Boolean , ?> property = cast (editableProperty );
65- final Boolean value = Objects . requireNonNull (property .getValue (), "Boolean value can't be null." );
64+ final Boolean value = notNull (property .getValue (), "Boolean value can't be null." );
6665
6766 final BooleanModelPropertyControl <EditableProperty <Boolean , ?>> propertyControl =
6867 new BooleanModelPropertyControl <>(value , property .getName (), changeConsumer );
@@ -73,7 +72,7 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
7372 case FLOAT : {
7473
7574 final EditableProperty <Float , ?> property = cast (editableProperty );
76- final Float value = Objects . requireNonNull (property .getValue (), "Float value can't be null." );
75+ final Float value = notNull (property .getValue (), "Float value can't be null." );
7776
7877 final FloatModelPropertyControl <EditableProperty <Float , ?>> propertyControl =
7978 new FloatModelPropertyControl <>(value , property .getName (), changeConsumer );
@@ -101,7 +100,7 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
101100 case INTEGER : {
102101
103102 final EditableProperty <Integer , ?> property = cast (editableProperty );
104- final Integer value = Objects . requireNonNull (property .getValue (), "Integer value can't be null." );
103+ final Integer value = notNull (property .getValue (), "Integer value can't be null." );
105104
106105 final IntegerModelPropertyControl <EditableProperty <Integer , ?>> propertyControl =
107106 new IntegerModelPropertyControl <>(value , property .getName (), changeConsumer );
@@ -123,7 +122,7 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
123122 case VECTOR_2F : {
124123
125124 final EditableProperty <Vector2f , ?> property = cast (editableProperty );
126- final Vector2f value = Objects . requireNonNull (property .getValue (), "Vector2f value can't be null." );
125+ final Vector2f value = notNull (property .getValue (), "Vector2f value can't be null." );
127126
128127 final Vector2fModelPropertyControl <EditableProperty <Vector2f , ?>> propertyControl =
129128 new Vector2fModelPropertyControl <>(value , property .getName (), changeConsumer );
@@ -134,7 +133,7 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
134133 case VECTOR_3F : {
135134
136135 final EditableProperty <Vector3f , ?> property = cast (editableProperty );
137- final Vector3f value = Objects . requireNonNull (property .getValue (), "Vector3f value can't be null." );
136+ final Vector3f value = notNull (property .getValue (), "Vector3f value can't be null." );
138137
139138 final Vector3fModelPropertyControl <EditableProperty <Vector3f , ?>> propertyControl =
140139 new Vector3fModelPropertyControl <>(value , property .getName (), changeConsumer );
@@ -145,7 +144,7 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
145144 case ENUM : {
146145
147146 final EditableProperty <Enum <?>, ?> property = cast (editableProperty );
148- final Enum <?> value = Objects . requireNonNull (property .getValue (), "Enum value can't be null." );
147+ final Enum <?> value = notNull (property .getValue (), "Enum value can't be null." );
149148
150149 final EnumControlPropertyControl <Enum <?>, EditableProperty <Enum <?>, ?>> propertyControl =
151150 new EnumControlPropertyControl <>(value , property .getName (), changeConsumer );
@@ -178,6 +177,7 @@ protected <T> void addControl(final @NotNull VBox container, @NotNull final Edit
178177 FXUtils .addToPane (propertyControl , container );
179178 }
180179
180+ @ NotNull
181181 private <T > EditableProperty <T , ?> cast (@ NotNull final EditableProperty <?, ?> property ) {
182182 return ClassUtils .unsafeCast (property );
183183 }
0 commit comments