Skip to content

Commit ac0ef5e

Browse files
committed
refactoring.
1 parent fecb503 commit ac0ef5e

File tree

3 files changed

+5
-19
lines changed

3 files changed

+5
-19
lines changed

src/main/java/com/ss/editor/ui/control/model/node/light/LightTreeNode.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ss.editor.ui.control.model.node.light;
22

3+
import static com.ss.rlib.util.ObjectUtils.notNull;
34
import com.jme3.light.Light;
45
import com.ss.editor.annotation.FXThread;
56
import com.ss.editor.annotation.FromAnyThread;
@@ -17,8 +18,6 @@
1718
import org.jetbrains.annotations.NotNull;
1819
import org.jetbrains.annotations.Nullable;
1920

20-
import static com.ss.rlib.util.ObjectUtils.notNull;
21-
2221
/**
2322
* The base implementation of {@link TreeNode} to present lights.
2423
*
@@ -43,8 +42,6 @@ public LightTreeNode(@NotNull final T element, final long objectId) {
4342
@FXThread
4443
public void changeName(@NotNull final NodeTree<?> nodeTree, @NotNull final String newName) {
4544
final T element = getElement();
46-
element.setName(newName);
47-
4845
final ChangeConsumer consumer = notNull(nodeTree.getChangeConsumer());
4946
consumer.execute(new RenameLightOperation(element.getName(), newName, element));
5047
}

src/main/java/com/ss/editor/ui/control/model/tree/action/operation/RenameLightOperation.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
package com.ss.editor.ui.control.model.tree.action.operation;
22

3-
43
import com.jme3.light.Light;
54
import com.ss.editor.model.undo.editor.ModelChangeConsumer;
65
import com.ss.editor.model.undo.impl.AbstractEditorOperation;
76
import org.jetbrains.annotations.NotNull;
87

8+
/**
9+
* The operation to rename light.
10+
*/
911
public class RenameLightOperation extends AbstractEditorOperation<ModelChangeConsumer> {
12+
1013
/**
1114
* The constant PROPERTY_NAME.
1215
*/
@@ -30,13 +33,6 @@ public class RenameLightOperation extends AbstractEditorOperation<ModelChangeCon
3033
@NotNull
3134
private final Light light;
3235

33-
/**
34-
* Instantiates a new Rename node operation.
35-
*
36-
* @param oldName the old name
37-
* @param newName the new name
38-
* @param light the light
39-
*/
4036
public RenameLightOperation(@NotNull final String oldName, @NotNull final String newName, @NotNull final Light light) {
4137
this.oldName = oldName;
4238
this.newName = newName;

src/main/java/com/ss/editor/ui/control/model/tree/action/operation/RenameNodeOperation.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ public class RenameNodeOperation extends AbstractEditorOperation<ModelChangeCons
3636
@NotNull
3737
private final Spatial spatial;
3838

39-
/**
40-
* Instantiates a new Rename node operation.
41-
*
42-
* @param oldName the old name
43-
* @param newName the new name
44-
* @param spatial the spatial
45-
*/
4639
public RenameNodeOperation(@NotNull final String oldName, @NotNull final String newName, @NotNull final Spatial spatial) {
4740
this.oldName = oldName;
4841
this.newName = newName;

0 commit comments

Comments
 (0)