1- package com .ss .editor .control .editing .impl ;
1+ package com .ss .editor .control .painting .impl ;
22
33import com .jme3 .material .Material ;
44import com .jme3 .math .ColorRGBA ;
99import com .jme3 .scene .Spatial ;
1010import com .jme3 .scene .control .AbstractControl ;
1111import com .ss .editor .annotation .JmeThread ;
12- import com .ss .editor .control .editing . EditingControl ;
13- import com .ss .editor .control .editing . EditingInput ;
12+ import com .ss .editor .control .painting . PaintingControl ;
13+ import com .ss .editor .control .painting . PaintingInput ;
1414import com .ss .editor .util .EditorUtil ;
1515import org .jetbrains .annotations .NotNull ;
1616import org .jetbrains .annotations .Nullable ;
1717
1818/**
19- * The base implementation of an editing control .
19+ * The base implementation of {@link PaintingControl} .
2020 *
2121 * @author JavaSaBr
2222 */
23- public class AbstractEditingControl extends AbstractControl implements EditingControl {
23+ public class AbstractPaintingControl extends AbstractControl implements PaintingControl {
2424
2525 /**
26- * The current editing input.
26+ * The current painting input.
2727 */
2828 @ Nullable
29- private EditingInput editingInput ;
29+ private PaintingInput paintingInput ;
3030
3131 /**
32- * The flag of editing state.
32+ * The flag of painting state.
3333 */
34- private boolean editing ;
34+ private boolean painting ;
3535
3636 @ Override
37- public void setSpatial (final Spatial spatial ) {
37+ @ JmeThread
38+ public void setSpatial (@ Nullable final Spatial spatial ) {
3839
3940 final Spatial prev = getSpatial ();
4041 if (prev instanceof Node ) {
@@ -49,30 +50,28 @@ public void setSpatial(final Spatial spatial) {
4950 }
5051
5152 /**
52- * Create wireframe material material.
53+ * Create a colored wireframe material.
5354 *
54- * @param color the color
55- * @return the material
55+ * @param color the color.
56+ * @return the colored wireframe material.
5657 */
5758 @ JmeThread
5859 protected @ NotNull Material createWireframeMaterial (@ NotNull final ColorRGBA color ) {
59- final Material material = createMaterial (color );
60+ final Material material = createColoredMaterial (color );
6061 material .getAdditionalRenderState ().setWireframe (true );
6162 return material ;
6263 }
6364
6465 /**
65- * Create material material.
66+ * Create a colored material.
6667 *
67- * @param color the color
68- * @return the material
68+ * @param color the color.
69+ * @return the colored material.
6970 */
7071 @ JmeThread
71- protected @ NotNull Material createMaterial (@ NotNull final ColorRGBA color ) {
72-
72+ protected @ NotNull Material createColoredMaterial (@ NotNull final ColorRGBA color ) {
7373 final Material material = new Material (EditorUtil .getAssetManager (), "Common/MatDefs/Misc/Unshaded.j3md" );
7474 material .setColor ("Color" , color );
75-
7675 return material ;
7776 }
7877
@@ -88,51 +87,53 @@ protected void controlRender(@NotNull final RenderManager renderManager, @NotNul
8887
8988 @ Override
9089 @ JmeThread
91- public boolean isStartedEditing () {
92- return editing ;
90+ public boolean isStartedPainting () {
91+ return painting ;
9392 }
9493
9594 /**
96- * Sets editing .
95+ * Set the painting state .
9796 *
98- * @param editing the flag of editing state.
97+ * @param painting the flag of painting state.
9998 */
10099 @ JmeThread
101- protected void setEditing (final boolean editing ) {
102- this .editing = editing ;
100+ protected void setPainting (final boolean painting ) {
101+ this .painting = painting ;
103102 }
104103
105104 @ Override
106105 @ JmeThread
107- public void startEditing (@ NotNull final EditingInput editingInput , @ NotNull final Vector3f contactPoint ) {
108- setEditing (true );
109- setEditingInput ( editingInput );
106+ public void startPainting (@ NotNull final PaintingInput input , @ NotNull final Vector3f contactPoint ) {
107+ setPainting (true );
108+ setPaintingInput ( input );
110109 }
111110
112111 @ Override
113112 @ JmeThread
114- public void finishEditing (@ NotNull final Vector3f contactPoint ) {
115- setEditing (false );
113+ public void finishPainting (@ NotNull final Vector3f contactPoint ) {
114+ setPainting (false );
116115 }
117116
118117 /**
119- * @param editingInput the current editing input.
118+ * Set the painting input,
119+ *
120+ * @param input the current painting input.
120121 */
121122 @ JmeThread
122- private void setEditingInput (@ Nullable final EditingInput editingInput ) {
123- this .editingInput = editingInput ;
123+ private void setPaintingInput (@ Nullable final PaintingInput input ) {
124+ this .paintingInput = input ;
124125 }
125126
126127 @ Override
127128 @ JmeThread
128- public @ Nullable EditingInput getCurrentInput () {
129- return editingInput ;
129+ public @ Nullable PaintingInput getCurrentInput () {
130+ return paintingInput ;
130131 }
131132
132133 /**
133134 * Notify about that this control was attached.
134135 *
135- * @param node the node
136+ * @param node the node.
136137 */
137138 @ JmeThread
138139 protected void onAttached (@ NotNull final Node node ) {
@@ -141,7 +142,7 @@ protected void onAttached(@NotNull final Node node) {
141142 /**
142143 * Notify about that this control was detached.
143144 *
144- * @param node the node
145+ * @param node the node.
145146 */
146147 @ JmeThread
147148 protected void onDetached (@ NotNull final Node node ) {
0 commit comments