|
7 | 7 | import com.ss.rlib.ui.control.input.FloatTextField; |
8 | 8 | import com.ss.rlib.ui.util.FXUtils; |
9 | 9 | import javafx.scene.Parent; |
10 | | -import javafx.scene.control.Label; |
11 | 10 | import javafx.scene.layout.HBox; |
12 | 11 | import org.jetbrains.annotations.NotNull; |
13 | 12 | import org.jetbrains.annotations.Nullable; |
@@ -57,42 +56,42 @@ public DestinationWeightInterpolationElement(@NotNull final DestinationInfluence |
57 | 56 | @Override |
58 | 57 | protected Parent createEditableControl() { |
59 | 58 |
|
60 | | - final Label xLabel = new Label("x:"); |
61 | | - final Label yLabel = new Label("y:"); |
62 | | - final Label zLabel = new Label("z:"); |
63 | | - final Label weightLabel = new Label("w:"); |
| 59 | + final HBox container = new HBox(); |
| 60 | + container.prefWidthProperty().bind(widthProperty().multiply(0.5)); |
64 | 61 |
|
65 | 62 | xField = new FloatTextField(); |
| 63 | + xField.prefWidthProperty().bind(container.widthProperty().divide(0.25)); |
66 | 64 | xField.addChangeListener((observable, oldValue, newValue) -> processDestinationChange()); |
67 | 65 |
|
68 | 66 | yField = new FloatTextField(); |
| 67 | + yField.prefWidthProperty().bind(container.widthProperty().divide(0.25)); |
69 | 68 | yField.addChangeListener((observable, oldValue, newValue) -> processDestinationChange()); |
70 | 69 |
|
71 | 70 | zField = new FloatTextField(); |
| 71 | + zField.prefWidthProperty().bind(container.widthProperty().divide(0.25)); |
72 | 72 | zField.addChangeListener((observable, oldValue, newValue) -> processDestinationChange()); |
73 | 73 |
|
74 | 74 | weightField = new FloatTextField(); |
| 75 | + weightField.prefWidthProperty().bind(container.widthProperty().divide(0.25)); |
75 | 76 | weightField.addChangeListener((observable, oldValue, newValue) -> processWeightChange()); |
76 | 77 |
|
77 | | - final HBox container = new HBox(xLabel, xField, yLabel, yField, zLabel, zField, weightLabel, weightField); |
| 78 | + FXUtils.addToPane(xField, container); |
| 79 | + FXUtils.addToPane(yField, container); |
| 80 | + FXUtils.addToPane(zField, container); |
| 81 | + FXUtils.addToPane(weightField, container); |
78 | 82 |
|
79 | | - xField.prefWidthProperty().bind(container.widthProperty().divide(6)); |
80 | | - yField.prefWidthProperty().bind(container.widthProperty().divide(6)); |
81 | | - zField.prefWidthProperty().bind(container.widthProperty().divide(6)); |
82 | | - weightField.prefWidthProperty().bind(container.widthProperty().divide(6)); |
83 | | - |
84 | | - FXUtils.addClassTo(container, CSSClasses.DEF_HBOX); |
85 | | - FXUtils.addClassTo(xLabel, yLabel, zLabel, weightLabel, CSSClasses.ABSTRACT_PARAM_CONTROL_NUMBER_LABEL); |
86 | | - FXUtils.addClassTo(xField, yField, zField, weightField, CSSClasses.ABSTRACT_PARAM_CONTROL_VECTOR3F_FIELD); |
87 | | - |
88 | | - container.prefWidthProperty().bind(widthProperty().multiply(0.6)); |
| 83 | + FXUtils.addClassesTo(xField, yField, zField, weightField, CSSClasses.ABSTRACT_PARAM_CONTROL_VECTOR3F_FIELD, |
| 84 | + CSSClasses.TRANSPARENT_TEXT_FIELD); |
| 85 | + FXUtils.addClassesTo(container, CSSClasses.DEF_HBOX, CSSClasses.TEXT_INPUT_CONTAINER, |
| 86 | + CSSClasses.ABSTRACT_PARAM_CONTROL_SHORT_INPUT_CONTAINER); |
89 | 87 |
|
90 | 88 | return container; |
91 | 89 | } |
92 | 90 |
|
| 91 | + @NotNull |
93 | 92 | @Override |
94 | | - public boolean isNeedEditableLabel() { |
95 | | - return false; |
| 93 | + protected String getEditableTitle() { |
| 94 | + return "xyzw"; |
96 | 95 | } |
97 | 96 |
|
98 | 97 | /** |
|
0 commit comments