Skip to content

Commit 9e78d93

Browse files
committed
updated styles of meshes properties.
1 parent 54166d6 commit 9e78d93

9 files changed

Lines changed: 35 additions & 28 deletions

File tree

181 Bytes
Binary file not shown.

resources/ui/css/custom_classes.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@
579579
* *
580580
******************************************************************************/
581581

582+
582583
.abstract-param-control-container {
583584
-fx-alignment: top-center;
584585
-fx-padding: 2px 6px 4px 4px;
@@ -630,6 +631,13 @@
630631
.abstract-param-control-vector3f-field {
631632
}
632633

634+
.abstract-param-control-label-value {
635+
-fx-alignment: center-left;
636+
-fx-text-alignment: left;
637+
-fx-min-height: -var-default-field-height;
638+
-fx-padding: 0px 0px 0px 4px;
639+
}
640+
633641
.abstract-param-control-number-label {
634642
-fx-min-width: 16px;
635643
-fx-pref-width: -fx-min-width;

resources/ui/css/custom_ids.bss

-65 Bytes
Binary file not shown.

resources/ui/css/custom_ids.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,6 @@
302302
-fx-max-height: -fx-min-height;
303303
}
304304

305-
#AbstractParamControlLabelValue {
306-
-fx-alignment: center-left;
307-
-fx-text-alignment: left;
308-
}
309-
310305
#AbstractParamControlNumberLabel {
311306
-fx-min-height: 24;
312307
-fx-pref-height: -fx-min-height;

src/com/ss/editor/ui/control/property/builder/PropertyBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import javafx.scene.layout.VBox;
1010

1111
/**
12-
* The interface for implementing property builder for creating property controls for some objects.
12+
* The interface to implement property builder to create property controls for some objects.
1313
*
1414
* @author JavaSaBr
1515
*/

src/com/ss/editor/ui/control/property/impl/AbstractDefaultPropertyControl.java

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
package com.ss.editor.ui.control.property.impl;
22

3+
import static com.ss.rlib.util.ObjectUtils.notNull;
34
import com.ss.editor.model.undo.editor.ChangeConsumer;
45
import com.ss.editor.ui.control.property.AbstractPropertyControl;
56
import com.ss.editor.ui.css.CSSClasses;
6-
import com.ss.editor.ui.css.CSSIds;
7-
7+
import com.ss.rlib.function.SixObjectConsumer;
8+
import com.ss.rlib.ui.util.FXUtils;
9+
import javafx.scene.control.Label;
10+
import javafx.scene.layout.HBox;
811
import org.jetbrains.annotations.NotNull;
912
import org.jetbrains.annotations.Nullable;
1013

1114
import java.util.function.BiConsumer;
1215
import java.util.function.Function;
1316

14-
import javafx.scene.control.Label;
15-
import javafx.scene.layout.HBox;
16-
import com.ss.rlib.function.SixObjectConsumer;
17-
import com.ss.rlib.ui.util.FXUtils;
18-
1917
/**
2018
* The default implementation of the property control.
2119
*
@@ -24,16 +22,19 @@
2422
* @param <T> the type parameter
2523
* @author JavaSaBr
2624
*/
27-
public abstract class AbstractDefaultPropertyControl<C extends ChangeConsumer, D, T> extends AbstractPropertyControl<C, D, T> {
25+
public abstract class AbstractDefaultPropertyControl<C extends ChangeConsumer, D, T>
26+
extends AbstractPropertyControl<C, D, T> {
2827

2928
/**
3029
* The label with value of the property.
3130
*/
31+
@Nullable
3232
protected Label propertyValueLabel;
3333

3434
/**
3535
* The string function.
3636
*/
37+
@Nullable
3738
private Function<T, String> toStringFunction;
3839

3940
/**
@@ -55,32 +56,35 @@ public AbstractDefaultPropertyControl(@Nullable final T propertyValue, @NotNull
5556
*
5657
* @param toStringFunction the string function.
5758
*/
58-
public void setToStringFunction(final Function<T, String> toStringFunction) {
59+
public void setToStringFunction(@Nullable final Function<T, String> toStringFunction) {
5960
this.toStringFunction = toStringFunction;
6061
}
6162

6263
/**
6364
* @return the string function.
6465
*/
66+
@Nullable
6567
private Function<T, String> getToStringFunction() {
6668
return toStringFunction;
6769
}
6870

6971
/**
7072
* @return the label with value of the property.
7173
*/
74+
@NotNull
7275
private Label getPropertyValueLabel() {
73-
return propertyValueLabel;
76+
return notNull(propertyValueLabel);
7477
}
7578

7679
@Override
7780
protected void createComponents(@NotNull final HBox container) {
7881
super.createComponents(container);
7982

8083
propertyValueLabel = new Label();
81-
propertyValueLabel.setId(CSSIds.ABSTRACT_PARAM_CONTROL_LABEL_VALUE);
8284

83-
FXUtils.addClassTo(propertyValueLabel, CSSClasses.SPECIAL_FONT_13);
85+
FXUtils.addClassesTo(propertyValueLabel, CSSClasses.ABSTRACT_PARAM_CONTROL_LABEL_VALUE,
86+
CSSClasses.TEXT_INPUT_CONTAINER);
87+
8488
FXUtils.addToPane(propertyValueLabel, container);
8589
}
8690

@@ -91,6 +95,7 @@ public void reload() {
9195
final Function<T, String> function = getToStringFunction();
9296

9397
final Label propertyValueLabel = getPropertyValueLabel();
94-
propertyValueLabel.setText(function == null ? String.valueOf(getPropertyValue()) : function.apply(getPropertyValue()));
98+
propertyValueLabel.setText(function == null ? String.valueOf(getPropertyValue()) :
99+
function.apply(getPropertyValue()));
95100
}
96101
}

src/com/ss/editor/ui/control/property/impl/AbstractDefaultSinglePropertyControl.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
package com.ss.editor.ui.control.property.impl;
22

33
import com.ss.editor.model.undo.editor.ChangeConsumer;
4-
4+
import com.ss.rlib.function.SixObjectConsumer;
5+
import javafx.scene.layout.HBox;
56
import org.jetbrains.annotations.NotNull;
67
import org.jetbrains.annotations.Nullable;
78

89
import java.util.function.BiConsumer;
910

10-
import javafx.scene.layout.HBox;
11-
import com.ss.rlib.function.SixObjectConsumer;
12-
1311
/**
1412
* The default implementation of the property control.
1513
*
@@ -18,7 +16,8 @@
1816
* @param <T> the type parameter
1917
* @author JavaSaBr
2018
*/
21-
public abstract class AbstractDefaultSinglePropertyControl<C extends ChangeConsumer, D, T> extends AbstractDefaultPropertyControl<C, D, T> {
19+
public abstract class AbstractDefaultSinglePropertyControl<C extends ChangeConsumer, D, T>
20+
extends AbstractDefaultPropertyControl<C, D, T> {
2221

2322
/**
2423
* Instantiates a new Abstract default single property control.

src/com/ss/editor/ui/css/CSSClasses.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,10 @@ public interface CSSClasses {
311311
* The constant ABSTRACT_PARAM_CONTROL_VECTOR3F_FIELD.
312312
*/
313313
String ABSTRACT_PARAM_CONTROL_VECTOR3F_FIELD = "abstract-param-control-vector3f-field";
314+
/**
315+
* The constant ABSTRACT_PARAM_CONTROL_LABEL_VALUE.
316+
*/
317+
String ABSTRACT_PARAM_CONTROL_LABEL_VALUE = "abstract-param-control-label-value";
314318
/**
315319
* The constant ABSTRACT_PARAM_CONTROL_NUMBER_LABEL.
316320
*/

src/com/ss/editor/ui/css/CSSIds.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,6 @@ public interface CSSIds {
168168
*/
169169
String SCENE_APP_STATE_LIST_CELL = "SceneAppStateListCell";
170170

171-
/**
172-
* The constant ABSTRACT_PARAM_CONTROL_LABEL_VALUE.
173-
*/
174-
String ABSTRACT_PARAM_CONTROL_LABEL_VALUE = "AbstractParamControlLabelValue";
175171
/**
176172
* The constant ABSTRACT_PARAM_CONTROL_NUMBER_LABEL2F.
177173
*/

0 commit comments

Comments
 (0)