Skip to content

Commit 962d286

Browse files
committed
updated controls to edit particle interpolations.
1 parent 5a2d0a3 commit 962d286

5 files changed

Lines changed: 41 additions & 99 deletions

File tree

src/main/java/com/ss/editor/config/Config.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
import com.ss.editor.Editor;
44
import com.ss.editor.document.DocumentConfig;
5-
import com.ss.editor.util.AppVersion;
65
import com.ss.editor.util.EditorUtil;
7-
import org.jetbrains.annotations.NotNull;
6+
import com.ss.rlib.plugin.Version;
87
import com.ss.rlib.util.Utils;
98
import com.ss.rlib.util.VarTable;
109
import com.ss.rlib.util.os.OperatingSystem;
10+
import org.jetbrains.annotations.NotNull;
1111

1212
import java.awt.*;
1313
import java.nio.file.Path;
@@ -36,7 +36,7 @@ public abstract class Config {
3636
* The constant APP_VERSION.
3737
*/
3838
@NotNull
39-
public static final AppVersion APP_VERSION = new AppVersion("0.9.10");
39+
public static final Version APP_VERSION = new Version("0.9.11");
4040

4141
/**
4242
* The constant STRING_VERSION.

src/main/java/com/ss/editor/task/CheckNewVersionTask.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44
import com.ss.editor.JFXApplication;
55
import com.ss.editor.Messages;
66
import com.ss.editor.config.Config;
7-
import com.ss.editor.util.AppVersion;
7+
import com.ss.rlib.logging.Logger;
8+
import com.ss.rlib.logging.LoggerManager;
9+
import com.ss.rlib.plugin.Version;
810
import javafx.application.HostServices;
911
import javafx.application.Platform;
1012
import javafx.scene.control.Alert;
13+
import javafx.scene.control.Alert.AlertType;
1114
import javafx.scene.control.DialogPane;
1215
import javafx.scene.control.Hyperlink;
1316
import org.apache.commons.io.IOUtils;
@@ -17,8 +20,6 @@
1720
import org.apache.http.client.methods.CloseableHttpResponse;
1821
import org.apache.http.client.methods.HttpGet;
1922
import org.apache.http.impl.client.CloseableHttpClient;
20-
import com.ss.rlib.logging.Logger;
21-
import com.ss.rlib.logging.LoggerManager;
2223
import org.jetbrains.annotations.NotNull;
2324

2425
import java.io.IOException;
@@ -63,7 +64,7 @@ public void run() {
6364
.trim()
6465
.replace("v.", "");
6566

66-
if (Config.APP_VERSION.compareTo(new AppVersion(targetVersion)) <= 0) {
67+
if (Config.APP_VERSION.compareTo(new Version(targetVersion)) <= 0) {
6768
return;
6869
}
6970

@@ -89,7 +90,7 @@ public void run() {
8990
final Hyperlink hyperlink = new Hyperlink(Messages.CHECK_NEW_VERSION_DIALOG_HYPERLINK + targetLink);
9091
hyperlink.setOnAction(event -> hostServices.showDocument(targetLink));
9192

92-
final Alert alert = new Alert(Alert.AlertType.INFORMATION);
93+
final Alert alert = new Alert(AlertType.INFORMATION);
9394
alert.setTitle(Messages.CHECK_NEW_VERSION_DIALOG_TITLE);
9495
alert.setHeaderText(Messages.CHECK_NEW_VERSION_DIALOG_HEADER_TEXT + targetVersion);
9596

src/main/java/com/ss/editor/ui/control/model/property/control/particle/influencer/interpolation/element/DestinationWeightInterpolationElement.java

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.ss.rlib.ui.control.input.FloatTextField;
88
import com.ss.rlib.ui.util.FXUtils;
99
import javafx.scene.Parent;
10-
import javafx.scene.control.Label;
1110
import javafx.scene.layout.HBox;
1211
import org.jetbrains.annotations.NotNull;
1312
import org.jetbrains.annotations.Nullable;
@@ -57,42 +56,42 @@ public DestinationWeightInterpolationElement(@NotNull final DestinationInfluence
5756
@Override
5857
protected Parent createEditableControl() {
5958

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));
6461

6562
xField = new FloatTextField();
63+
xField.prefWidthProperty().bind(container.widthProperty().divide(0.25));
6664
xField.addChangeListener((observable, oldValue, newValue) -> processDestinationChange());
6765

6866
yField = new FloatTextField();
67+
yField.prefWidthProperty().bind(container.widthProperty().divide(0.25));
6968
yField.addChangeListener((observable, oldValue, newValue) -> processDestinationChange());
7069

7170
zField = new FloatTextField();
71+
zField.prefWidthProperty().bind(container.widthProperty().divide(0.25));
7272
zField.addChangeListener((observable, oldValue, newValue) -> processDestinationChange());
7373

7474
weightField = new FloatTextField();
75+
weightField.prefWidthProperty().bind(container.widthProperty().divide(0.25));
7576
weightField.addChangeListener((observable, oldValue, newValue) -> processWeightChange());
7677

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);
7882

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);
8987

9088
return container;
9189
}
9290

91+
@NotNull
9392
@Override
94-
public boolean isNeedEditableLabel() {
95-
return false;
93+
protected String getEditableTitle() {
94+
return "xyzw";
9695
}
9796

9897
/**

src/main/java/com/ss/editor/ui/control/model/property/control/particle/influencer/interpolation/element/Vector3fInterpolationElement.java

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import com.ss.rlib.ui.control.input.FloatTextField;
88
import com.ss.rlib.ui.util.FXUtils;
99
import javafx.scene.Parent;
10-
import javafx.scene.control.Label;
1110
import javafx.scene.layout.HBox;
1211
import org.jetbrains.annotations.NotNull;
1312
import org.jetbrains.annotations.Nullable;
@@ -54,40 +53,40 @@ public Vector3fInterpolationElement(@NotNull final C control, final int index) {
5453
@Override
5554
protected Parent createEditableControl() {
5655

57-
final Label xLabel = new Label("x:");
58-
final Label yLabel = new Label("y:");
59-
final Label zLabel = new Label("z:");
56+
final HBox container = new HBox();
57+
container.prefWidthProperty().bind(widthProperty().multiply(0.4));
6058

6159
xField = new FloatTextField();
6260
xField.setMinMax(getMinValue(), getMaxValue());
61+
xField.prefWidthProperty().bind(container.widthProperty().multiply(0.33));
6362
xField.addChangeListener((observable, oldValue, newValue) -> processChange());
6463

6564
yField = new FloatTextField();
6665
yField.setMinMax(getMinValue(), getMaxValue());
66+
yField.prefWidthProperty().bind(container.widthProperty().multiply(0.33));
6767
yField.addChangeListener((observable, oldValue, newValue) -> processChange());
6868

6969
zField = new FloatTextField();
7070
zField.setMinMax(getMinValue(), getMaxValue());
71+
zField.prefWidthProperty().bind(container.widthProperty().multiply(0.33));
7172
zField.addChangeListener((observable, oldValue, newValue) -> processChange());
7273

73-
final HBox container = new HBox(xLabel, xField, yLabel, yField, zLabel, zField);
74+
FXUtils.addToPane(xField, container);
75+
FXUtils.addToPane(yField, container);
76+
FXUtils.addToPane(zField, container);
7477

75-
FXUtils.addClassTo(container, CSSClasses.DEF_HBOX);
76-
FXUtils.addClassTo(xLabel, yLabel, zLabel, CSSClasses.ABSTRACT_PARAM_CONTROL_NUMBER_LABEL);
77-
FXUtils.addClassTo(xField, yField, zField, CSSClasses.ABSTRACT_PARAM_CONTROL_VECTOR3F_FIELD);
78-
79-
xField.prefWidthProperty().bind(container.widthProperty().divide(4));
80-
yField.prefWidthProperty().bind(container.widthProperty().divide(4));
81-
zField.prefWidthProperty().bind(container.widthProperty().divide(4));
82-
83-
container.prefWidthProperty().bind(widthProperty().multiply(0.5));
78+
FXUtils.addClassesTo(xField, yField, zField, CSSClasses.ABSTRACT_PARAM_CONTROL_VECTOR3F_FIELD,
79+
CSSClasses.TRANSPARENT_TEXT_FIELD);
80+
FXUtils.addClassesTo(container, CSSClasses.DEF_HBOX, CSSClasses.TEXT_INPUT_CONTAINER,
81+
CSSClasses.ABSTRACT_PARAM_CONTROL_SHORT_INPUT_CONTAINER);
8482

8583
return container;
8684
}
8785

86+
@NotNull
8887
@Override
89-
public boolean isNeedEditableLabel() {
90-
return false;
88+
protected String getEditableTitle() {
89+
return "xyz";
9190
}
9291

9392
/**

src/main/java/com/ss/editor/util/AppVersion.java

Lines changed: 0 additions & 57 deletions
This file was deleted.

0 commit comments

Comments
 (0)