Skip to content

Commit af476de

Browse files
committed
Merge branch '0.9.3'
2 parents a9c75e0 + 91af7f6 commit af476de

File tree

284 files changed

+9058
-3283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

284 files changed

+9058
-3283
lines changed

.idea/codeStyleSettings.xml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 1 addition & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.2" />
5+
<property name="editor.version" value="0.9.3" />
66

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

jme3-spaceshift-extension/src/com/ss/extension/loader/SceneLoader.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import com.jme3.export.JmeImporter;
99
import com.jme3.export.Savable;
1010
import com.jme3.export.binary.BinaryImporter;
11-
1211
import org.jetbrains.annotations.NotNull;
1312

1413
import java.io.IOException;
@@ -40,12 +39,14 @@ public static void install(@NotNull final Application application) {
4039

4140
@NotNull
4241
public static AssetManager tryToGetAssetManager() {
43-
return Objects.requireNonNull(application).getAssetManager();
42+
return Objects.requireNonNull(application)
43+
.getAssetManager();
4444
}
4545

4646
@NotNull
4747
public static AppStateManager tryToGetStateManager() {
48-
return Objects.requireNonNull(application).getStateManager();
48+
return Objects.requireNonNull(application)
49+
.getStateManager();
4950
}
5051

5152
@NotNull

jme3-spaceshift-extension/src/com/ss/extension/property/SimpleProperty.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public class SimpleProperty<T, O> implements EditableProperty<T, O> {
1616
/**
1717
* The type of this property.
1818
*/
19+
@NotNull
1920
private final EditablePropertyType type;
2021

2122
/**
@@ -63,7 +64,8 @@ public SimpleProperty(@NotNull final EditablePropertyType type, @NotNull final S
6364
}
6465

6566
public SimpleProperty(@NotNull final EditablePropertyType type, @NotNull final String name, final float scrollPower,
66-
@NotNull final O object, @NotNull final Function<O, T> getter, @NotNull final BiConsumer<O, T> setter) {
67+
@NotNull final O object, @NotNull final Function<O, T> getter,
68+
@NotNull final BiConsumer<O, T> setter) {
6769
this(type, name, scrollPower, Integer.MIN_VALUE, Integer.MAX_VALUE, object, getter, setter);
6870
}
6971

@@ -126,15 +128,8 @@ public void setValue(@Nullable final T value) {
126128

127129
@Override
128130
public String toString() {
129-
return "SimpleProperty{" +
130-
"type=" + type +
131-
", name='" + name + '\'' +
132-
", getter=" + getter +
133-
", setter=" + setter +
134-
", object=" + object +
135-
", scrollPower=" + scrollPower +
136-
", minValue=" + minValue +
137-
", maxValue=" + maxValue +
138-
'}';
131+
return "SimpleProperty{" + "type=" + type + ", name='" + name + '\'' + ", getter=" + getter + ", setter=" +
132+
setter + ", object=" + object + ", scrollPower=" + scrollPower + ", minValue=" + minValue +
133+
", maxValue=" + maxValue + '}';
139134
}
140135
}

jme3-spaceshift-extension/src/com/ss/extension/scene/SceneLayer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import com.jme3.export.OutputCapsule;
77
import com.jme3.scene.Node;
88
import com.jme3.scene.Spatial;
9-
109
import org.jetbrains.annotations.NotNull;
1110
import org.jetbrains.annotations.Nullable;
1211

@@ -17,6 +16,7 @@
1716
*
1817
* @author JavaSaBr
1918
*/
19+
@SuppressWarnings("WeakerAccess")
2020
public class SceneLayer extends Node {
2121

2222
public static final String KEY = SceneLayer.class.getName();

jme3-spaceshift-extension/src/com/ss/extension/scene/SceneNode.java

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,22 @@
11
package com.ss.extension.scene;
22

3-
import com.jme3.export.InputCapsule;
4-
import com.jme3.export.JmeExporter;
5-
import com.jme3.export.JmeImporter;
6-
import com.jme3.export.OutputCapsule;
7-
import com.jme3.export.Savable;
3+
import com.jme3.export.*;
84
import com.jme3.scene.Node;
95
import com.jme3.util.clone.Cloner;
106
import com.ss.extension.scene.app.state.SceneAppState;
117
import com.ss.extension.scene.filter.SceneFilter;
12-
138
import org.jetbrains.annotations.NotNull;
14-
15-
import java.io.IOException;
16-
179
import rlib.util.array.Array;
1810
import rlib.util.array.ArrayFactory;
1911

12+
import java.io.IOException;
13+
2014
/**
2115
* The implementation of a scene node.
2216
*
2317
* @author JavaSaBr
2418
*/
19+
@SuppressWarnings("WeakerAccess")
2520
public class SceneNode extends Node {
2621

2722
public static final SceneLayer[] EMPTY_LAYERS = new SceneLayer[0];
@@ -199,4 +194,22 @@ public void cloneFields(final Cloner cloner, final Object original) {
199194
filters.set(i, cloner.clone(filters.get(i)));
200195
}
201196
}
197+
198+
/**
199+
* Notify a scene node about added an object to this scene.
200+
*
201+
* @param object the added object.
202+
*/
203+
public void notifyAdded(@NotNull final Object object) {
204+
getAppStates().forEach(object, SceneAppState::notifyAdded);
205+
}
206+
207+
/**
208+
* Notify a scene node about removed an object from this scene.
209+
*
210+
* @param object the removed object.
211+
*/
212+
public void notifyRemoved(@NotNull final Object object) {
213+
getAppStates().forEach(object, SceneAppState::notifyRemoved);
214+
}
202215
}

jme3-spaceshift-extension/src/com/ss/extension/scene/app/state/EditableSceneAppState.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,8 @@
22

33
import com.ss.extension.property.EditableProperty;
44
import com.ss.extension.scene.filter.SceneFilter;
5-
65
import org.jetbrains.annotations.NotNull;
76
import org.jetbrains.annotations.Nullable;
8-
97
import rlib.util.array.Array;
108
import rlib.util.array.ArrayFactory;
119

@@ -16,6 +14,7 @@
1614
*/
1715
public interface EditableSceneAppState extends SceneAppState {
1816

17+
@NotNull
1918
Array<EditableProperty<?, ?>> EMPTY_PROPERTIES = ArrayFactory.newArray(EditableProperty.class);
2019

2120
/**

jme3-spaceshift-extension/src/com/ss/extension/scene/app/state/SceneAppState.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.jme3.export.Savable;
55
import com.jme3.util.clone.JmeCloneable;
66
import com.ss.extension.scene.SceneNode;
7-
87
import org.jetbrains.annotations.NotNull;
98
import org.jetbrains.annotations.Nullable;
109

@@ -28,5 +27,21 @@ public interface SceneAppState extends AppState, Savable, Cloneable, JmeCloneabl
2827
*/
2928
default void setSceneNode(@Nullable final SceneNode sceneNode) {
3029
}
30+
31+
/**
32+
* Notify a scene node about added an object to a scene node.
33+
*
34+
* @param object the added object.
35+
*/
36+
default void notifyAdded(@NotNull final Object object) {
37+
}
38+
39+
/**
40+
* Notify a scene node about removed an object from a scene node.
41+
*
42+
* @param object the removed object.
43+
*/
44+
default void notifyRemoved(@NotNull final Object object) {
45+
}
3146
}
3247

jme3-spaceshift-extension/src/com/ss/extension/scene/app/state/impl/EditableLightingSceneAppState.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
import com.ss.extension.property.EditablePropertyType;
66
import com.ss.extension.property.SimpleProperty;
77
import com.ss.extension.scene.app.state.EditableSceneAppState;
8-
98
import org.jetbrains.annotations.NotNull;
10-
119
import rlib.util.array.Array;
1210
import rlib.util.array.ArrayFactory;
1311

@@ -35,13 +33,17 @@ public String getName() {
3533
final Array<EditableProperty<?, ?>> result = ArrayFactory.newArray(EditableProperty.class);
3634

3735
result.add(new SimpleProperty<>(EditablePropertyType.COLOR, "Ambient color", this,
38-
LightingState::getAmbientColor, LightingState::setAmbientColor));
36+
LightingState::getAmbientColor,
37+
LightingState::setAmbientColor));
3938
result.add(new SimpleProperty<>(EditablePropertyType.COLOR, "Sun color", this,
40-
LightingState::getSunColor, LightingState::setSunColor));
39+
LightingState::getSunColor,
40+
LightingState::setSunColor));
4141
result.add(new SimpleProperty<>(EditablePropertyType.FLOAT, "Time of day", 0.1F, -0.300F, 1.300F, this,
42-
LightingState::getTimeOfDay, LightingState::setTimeOfDay));
42+
LightingState::getTimeOfDay,
43+
LightingState::setTimeOfDay));
4344
result.add(new SimpleProperty<>(EditablePropertyType.FLOAT, "Orientation", 0.1F, 0F, 6.283F, this,
44-
LightingState::getOrientation, LightingState::setOrientation));
45+
LightingState::getOrientation,
46+
LightingState::setOrientation));
4547

4648
return result;
4749
}

0 commit comments

Comments
 (0)