Skip to content

Commit 8a4424a

Browse files
committed
updated model tree node, added actions to edit parameters animation playing, added action to remove an animation.
1 parent 01aa707 commit 8a4424a

30 files changed

+736
-70
lines changed
243 Bytes
Binary file not shown.

libs/jME/jme3-core-3.2.0.jar

344 Bytes
Binary file not shown.
1 Byte
Binary file not shown.

libs/jME/jme3-effects-3.2.0.jar

7 Bytes
Binary file not shown.

resources/ui/css/custom_ids.bss

-251 Bytes
Binary file not shown.

resources/ui/css/custom_ids.css

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@
412412

413413
#SettingsDialogLabel {
414414
-fx-alignment: center-right;
415-
-fx-min-width: 240;
415+
-fx-min-width: 250;
416416
-fx-pref-width: -fx-min-width;
417417
-fx-max-width: -fx-min-width;
418418
-fx-min-height: 25;
@@ -688,25 +688,6 @@
688688
-fx-max-width: -fx-min-width;
689689
}
690690

691-
#GenerateTangentsDialogLabel {
692-
-fx-min-height: 24;
693-
-fx-pref-height: -fx-min-height;
694-
-fx-max-height: -fx-min-height;
695-
-fx-min-width: 200;
696-
-fx-pref-width: -fx-min-width;
697-
-fx-max-width: -fx-min-width;
698-
-fx-alignment: center-right;
699-
}
700-
701-
#GenerateTangentsDialogComboBox {
702-
-fx-min-height: 24;
703-
-fx-pref-height: -fx-min-height;
704-
-fx-max-height: -fx-min-height;
705-
-fx-min-width: 250;
706-
-fx-pref-width: -fx-min-width;
707-
-fx-max-width: -fx-min-width;
708-
}
709-
710691
#JmePreviewManagerImageView {
711692
}
712693

594 Bytes
Loading

src/com/ss/editor/model/tool/TangentGenerator.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@
55
import com.jme3.util.mikktspace.MikktspaceTangentGenerator;
66

77
/**
8-
* Реализация генератора тангентов для геометрии.
8+
* Tangent generators.
99
*
10-
* @author Ronn
10+
* @author JavaSaBr
1111
*/
1212
public class TangentGenerator {
1313

1414
/**
15-
* Генерация тангетсов используя стандартный алгоритм.
15+
* Generate tangents using a standard algorithm.
1616
*/
1717
public static void useStandardGenerator(final Spatial spatial, final boolean splitMirrored) {
1818
TangentBinormalGenerator.generate(spatial, splitMirrored);
1919
}
2020

2121
/**
22-
* Генерация тангетсов используя новый алгоритм.
22+
* Generate tangents using a Mikktspace algorithm.
2323
*/
2424
public static void useMikktspaceGenerator(final Spatial spatial) {
2525
MikktspaceTangentGenerator.generate(spatial);

src/com/ss/editor/ui/Icons.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public interface Icons {
3939
Image GEAR_16 = ICON_MANAGER.getImage("/ui/icons/actions/16/gear.png");
4040
Image BONE_16 = ICON_MANAGER.getImage("/ui/icons/actions/16/bone.png");
4141
Image AUDIO_16 = ICON_MANAGER.getImage("/ui/icons/actions/16/audio.png");
42+
Image SETTINGS_16 = ICON_MANAGER.getImage("/ui/icons/actions/16/settings.png");
4243

4344
Image REFRESH_18 = ICON_MANAGER.getImage("/ui/icons/actions/18/refresh.png", 18);
4445
Image REMOVE_18 = ICON_MANAGER.getImage("/ui/icons/actions/18/remove.png", 18);

src/com/ss/editor/ui/control/model/tree/ModelNodeTreeCell.java

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
import com.jme3.scene.Node;
77
import com.jme3.scene.Spatial;
8+
import com.ss.editor.manager.ExecutorManager;
89
import com.ss.editor.model.undo.editor.ModelChangeConsumer;
910
import com.ss.editor.ui.control.model.tree.action.operation.MoveChildOperation;
1011
import com.ss.editor.ui.control.model.tree.node.ModelNode;
@@ -14,10 +15,11 @@
1415

1516
import java.util.Set;
1617

18+
import javafx.geometry.Pos;
1719
import javafx.geometry.Side;
1820
import javafx.scene.Cursor;
1921
import javafx.scene.control.ContextMenu;
20-
import javafx.scene.control.TextField;
22+
import javafx.scene.control.Control;
2123
import javafx.scene.control.TreeCell;
2224
import javafx.scene.control.TreeItem;
2325
import javafx.scene.control.TreeView;
@@ -30,6 +32,7 @@
3032
import javafx.scene.input.MouseButton;
3133
import javafx.scene.input.MouseEvent;
3234
import javafx.scene.input.TransferMode;
35+
import javafx.scene.layout.HBox;
3336
import javafx.util.StringConverter;
3437
import rlib.ui.util.FXUtils;
3538
import rlib.util.StringUtils;
@@ -41,6 +44,8 @@
4144
*/
4245
public class ModelNodeTreeCell extends TextFieldTreeCell<ModelNode<?>> {
4346

47+
private static final ExecutorManager EXECUTOR_MANAGER = ExecutorManager.getInstance();
48+
4449
private static final DataFormat DATA_FORMAT = new DataFormat("SSEditor.modelNodeTree.modelNode");
4550

4651
public final StringConverter<ModelNode<?>> stringConverter = new StringConverter<ModelNode<?>>() {
@@ -96,8 +101,15 @@ public void startEdit() {
96101

97102
super.startEdit();
98103

99-
final TextField textField = (TextField) getGraphic();
100-
textField.setMinHeight(getMinHeight());
104+
final javafx.scene.Node graphic = getGraphic();
105+
106+
if (graphic instanceof HBox) {
107+
final HBox hbox = (HBox) graphic;
108+
hbox.setAlignment(Pos.CENTER_LEFT);
109+
hbox.setMinHeight(getMinHeight());
110+
} else if (graphic instanceof Control) {
111+
((Control) graphic).setMinHeight(getMinHeight());
112+
}
101113
}
102114

103115
/**
@@ -114,16 +126,20 @@ public void updateItem(final ModelNode<?> item, final boolean empty) {
114126
final ImageView imageView = getImageView();
115127

116128
if (item == null) {
129+
final TreeItem<ModelNode<?>> treeItem = getTreeItem();
130+
if (treeItem != null) treeItem.setGraphic(null);
117131
setText(StringUtils.EMPTY);
118-
setGraphic(null);
132+
setEditable(false);
119133
return;
120134
}
121135

122136
imageView.setImage(item.getIcon());
123137

138+
final TreeItem<ModelNode<?>> treeItem = getTreeItem();
139+
if (treeItem != null) treeItem.setGraphic(imageView);
140+
124141
setText(item.getName());
125142
setEditable(item.canEditName());
126-
setGraphic(imageView);
127143
}
128144

129145
/**
@@ -148,7 +164,7 @@ private void processClick(final MouseEvent event) {
148164
final ContextMenu contextMenu = nodeTree.getContextMenu(item);
149165
if (contextMenu == null) return;
150166

151-
contextMenu.show(this, Side.BOTTOM, 0, 0);
167+
EXECUTOR_MANAGER.addFXTask(() -> contextMenu.show(this, Side.BOTTOM, 0, 0));
152168
}
153169

154170
/**

0 commit comments

Comments
 (0)