Skip to content

Commit 422a48b

Browse files
committed
updated property controls.
1 parent 9e78d93 commit 422a48b

27 files changed

Lines changed: 143 additions & 125 deletions

resources/ui/css/base.bss

74 Bytes
Binary file not shown.

resources/ui/css/base.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1316,7 +1316,8 @@
13161316
}
13171317

13181318
.color-picker > .color-picker-label {
1319-
-fx-alignment: center;
1319+
-fx-alignment: center-left;
1320+
-fx-padding: 0px 0px 0px 0px;
13201321
}
13211322

13221323
.color-picker.button > .arrow-button {
@@ -1329,7 +1330,7 @@
13291330
}
13301331

13311332
.color-picker > .color-picker-label > .picker-color {
1332-
-fx-padding: 1px 1px 1px 1px;
1333+
-fx-padding: 1px 1px 1px 6px;
13331334
-fx-background-color: null;
13341335
}
13351336

312 Bytes
Binary file not shown.

resources/ui/css/custom_classes.css

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,19 @@
611611
-fx-padding: 0px 0px 0px 0px;
612612
}
613613

614+
.abstract-param-control-element-label {
615+
-fx-alignment: center-left;
616+
-fx-text-alignment: left;
617+
}
618+
614619
.abstract-param-control-param-name-single-row {
615620
-fx-alignment: center-right;
616621
}
617622

623+
.abstract-param-control-input-container {
624+
-fx-padding: 0px 0px 0px 6px;
625+
}
626+
618627
.abstract-param-control-param-color-picker {
619628
}
620629

@@ -654,6 +663,14 @@
654663
-fx-text-alignment: right;
655664
}
656665

666+
.abstract-param-control-number-label-3 {
667+
-fx-min-width: 60px;
668+
-fx-pref-width: -fx-min-width;
669+
-fx-max-width: -fx-min-width;
670+
-fx-alignment: center-right;
671+
-fx-text-alignment: right;
672+
}
673+
657674
.abstract-param-control-influencer-element {
658675
-fx-spacing: 2px;
659676
-fx-padding: 0px;

resources/ui/css/custom_ids.bss

-162 Bytes
Binary file not shown.

resources/ui/css/custom_ids.css

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -309,17 +309,6 @@
309309
-fx-padding: 0 2 0 2;
310310
}
311311

312-
#AbstractParamControlElementLabel {
313-
-fx-min-height: 20;
314-
-fx-pref-height: -fx-min-height;
315-
-fx-max-height: -fx-min-height;
316-
-fx-alignment: center-left;
317-
-fx-text-alignment: left;
318-
}
319-
320-
#AbstractParamControlElementButton {
321-
}
322-
323312
#AbstractParamControlMultiValuesContainer {
324313
-fx-alignment: center;
325314
-fx-hgap: 2px;

src/com/ss/editor/ui/control/model/property/builder/impl/EmitterShapePropertyBuilder.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
6161
* @param changeConsumer the change consumer
6262
* @param shape the shape
6363
*/
64-
protected void createControls(@NotNull final VBox container, @NotNull final ModelChangeConsumer changeConsumer,
65-
@NotNull final EmitterPointShape shape) {
64+
private void createControls(@NotNull final VBox container, @NotNull final ModelChangeConsumer changeConsumer,
65+
@NotNull final EmitterPointShape shape) {
6666

6767
final Vector3f point = shape.getPoint();
6868

@@ -83,8 +83,8 @@ protected void createControls(@NotNull final VBox container, @NotNull final Mode
8383
* @param changeConsumer the change consumer
8484
* @param shape the shape
8585
*/
86-
protected void createControls(@NotNull final VBox container, @NotNull final ModelChangeConsumer changeConsumer,
87-
@NotNull final EmitterBoxShape shape) {
86+
private void createControls(@NotNull final VBox container, @NotNull final ModelChangeConsumer changeConsumer,
87+
@NotNull final EmitterBoxShape shape) {
8888

8989
final Vector3f length = shape.getLen();
9090
final Vector3f min = shape.getMin();
@@ -114,8 +114,8 @@ protected void createControls(@NotNull final VBox container, @NotNull final Mode
114114
* @param changeConsumer the change consumer
115115
* @param shape the shape
116116
*/
117-
protected void createControls(@NotNull final VBox container, @NotNull final ModelChangeConsumer changeConsumer,
118-
@NotNull final EmitterSphereShape shape) {
117+
private void createControls(@NotNull final VBox container, @NotNull final ModelChangeConsumer changeConsumer,
118+
@NotNull final EmitterSphereShape shape) {
119119

120120
final Vector3f center = shape.getCenter();
121121
final float radius = shape.getRadius();
@@ -134,7 +134,8 @@ protected void createControls(@NotNull final VBox container, @NotNull final Mode
134134
centerControl.setApplyHandler(EmitterSphereShape::setCenter);
135135
centerControl.setEditObject(shape);
136136

137-
FXUtils.addToPane(radiusControl, container);
138137
FXUtils.addToPane(centerControl, container);
138+
buildSplitLine(container);
139+
FXUtils.addToPane(radiusControl, container);
139140
}
140141
}

src/com/ss/editor/ui/control/model/property/builder/impl/GeometryPropertyBuilder.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
131131

132132
FXUtils.addToPane(boundingVolumeControl, container);
133133

134+
buildSplitLine(container);
135+
134136
final LodLevelModelPropertyControl lodLevelControl = new LodLevelModelPropertyControl(lodLevel,
135137
Messages.MODEL_PROPERTY_LOD, changeConsumer);
136138

src/com/ss/editor/ui/control/model/property/builder/impl/LightPropertyBuilder.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ private LightPropertyBuilder() {
4747
@Override
4848
protected void buildForImpl(@NotNull final Object object, @Nullable final Object parent, @NotNull final VBox container,
4949
@NotNull final ModelChangeConsumer changeConsumer) {
50+
5051
if (object instanceof DirectionalLight) {
5152
buildForDirectionLight((DirectionalLight) object, container, changeConsumer);
5253
} else if (object instanceof SpotLight) {
@@ -72,6 +73,8 @@ private void buildForDirectionLight(@NotNull final DirectionalLight light, @NotN
7273
directionControl.setEditObject(light);
7374

7475
FXUtils.addToPane(directionControl, container);
76+
77+
buildSplitLine(container);
7578
}
7679

7780
private void buildForPointLight(@NotNull final PointLight light, @NotNull final VBox container,
@@ -94,6 +97,7 @@ private void buildForPointLight(@NotNull final PointLight light, @NotNull final
9497
radiusControl.setEditObject(light);
9598

9699
FXUtils.addToPane(positionControl, container);
100+
buildSplitLine(container);
97101
FXUtils.addToPane(radiusControl, container);
98102
}
99103

@@ -144,6 +148,7 @@ private void buildForSpotLight(@NotNull final SpotLight light, @NotNull final VB
144148

145149
FXUtils.addToPane(directionControl, container);
146150
FXUtils.addToPane(positionControl, container);
151+
buildSplitLine(container);
147152
FXUtils.addToPane(rangeControl, container);
148153
FXUtils.addToPane(innerAngleControl, container);
149154
FXUtils.addToPane(outerAngleControl, container);

src/com/ss/editor/ui/control/model/property/builder/impl/ParticleInfluencerPropertyBuilder.java

Lines changed: 23 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.ss.editor.ui.control.model.property.builder.impl;
22

3+
import com.jme3.effect.influencers.EmptyParticleInfluencer;
34
import com.jme3.effect.influencers.ParticleInfluencer;
45
import com.jme3.effect.influencers.RadialParticleInfluencer;
56
import com.jme3.math.Vector3f;
@@ -50,27 +51,33 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
5051

5152
final float velocityVariation = influencer.getVelocityVariation();
5253

53-
final FloatModelPropertyControl<ParticleInfluencer> velocityVariationControl =
54-
new FloatModelPropertyControl<>(velocityVariation, Messages.MODEL_PROPERTY_VELOCITY_VARIATION, changeConsumer);
54+
final Vector3fModelPropertyControl<ParticleInfluencer> initialVelocityControl =
55+
new Vector3fModelPropertyControl<>(initialVelocity, Messages.MODEL_PROPERTY_INITIAL_VELOCITY, changeConsumer);
5556

56-
velocityVariationControl.setSyncHandler(ParticleInfluencer::getVelocityVariation);
57-
velocityVariationControl.setApplyHandler(ParticleInfluencer::setVelocityVariation);
58-
velocityVariationControl.setEditObject(influencer);
57+
initialVelocityControl.setSyncHandler(ParticleInfluencer::getInitialVelocity);
58+
initialVelocityControl.setApplyHandler(ParticleInfluencer::setInitialVelocity);
59+
initialVelocityControl.setEditObject(influencer);
5960

60-
FXUtils.addToPane(velocityVariationControl, container);
61+
FXUtils.addToPane(initialVelocityControl, container);
6162

6263
if (object instanceof RadialParticleInfluencer) {
6364
createControls(container, changeConsumer, (RadialParticleInfluencer) object);
65+
} else {
66+
buildSplitLine(initialVelocityControl);
6467
}
6568

66-
final Vector3fModelPropertyControl<ParticleInfluencer> initialVelocityControl =
67-
new Vector3fModelPropertyControl<>(initialVelocity, Messages.MODEL_PROPERTY_INITIAL_VELOCITY, changeConsumer);
69+
if (influencer instanceof EmptyParticleInfluencer) {
70+
initialVelocityControl.setDisable(true);
71+
}
6872

69-
initialVelocityControl.setSyncHandler(ParticleInfluencer::getInitialVelocity);
70-
initialVelocityControl.setApplyHandler(ParticleInfluencer::setInitialVelocity);
71-
initialVelocityControl.setEditObject(influencer);
73+
final FloatModelPropertyControl<ParticleInfluencer> velocityVariationControl =
74+
new FloatModelPropertyControl<>(velocityVariation, Messages.MODEL_PROPERTY_VELOCITY_VARIATION, changeConsumer);
7275

73-
FXUtils.addToPane(initialVelocityControl, container);
76+
velocityVariationControl.setSyncHandler(ParticleInfluencer::getVelocityVariation);
77+
velocityVariationControl.setApplyHandler(ParticleInfluencer::setVelocityVariation);
78+
velocityVariationControl.setEditObject(influencer);
79+
80+
FXUtils.addToPane(velocityVariationControl, container);
7481
}
7582

7683
/**
@@ -80,8 +87,8 @@ protected void buildForImpl(@NotNull final Object object, @Nullable final Object
8087
* @param changeConsumer the change consumer
8188
* @param influencer the influencer
8289
*/
83-
protected void createControls(final @NotNull VBox container, final @NotNull ModelChangeConsumer changeConsumer,
84-
@NotNull final RadialParticleInfluencer influencer) {
90+
private void createControls(@NotNull final VBox container, final @NotNull ModelChangeConsumer changeConsumer,
91+
@NotNull final RadialParticleInfluencer influencer) {
8592

8693
final Vector3f origin = influencer.getOrigin();
8794
final float radialVelocity = influencer.getRadialVelocity();
@@ -101,16 +108,16 @@ protected void createControls(final @NotNull VBox container, final @NotNull Mode
101108
horizontalControl.setApplyHandler(RadialParticleInfluencer::setHorizontal);
102109
horizontalControl.setEditObject(influencer);
103110

104-
105111
final Vector3fModelPropertyControl<RadialParticleInfluencer> originControl =
106112
new Vector3fModelPropertyControl<>(origin, Messages.MODEL_PROPERTY_ORIGIN, changeConsumer);
107113

108114
originControl.setSyncHandler(RadialParticleInfluencer::getOrigin);
109115
originControl.setApplyHandler(RadialParticleInfluencer::setOrigin);
110116
originControl.setEditObject(influencer);
111117

118+
FXUtils.addToPane(originControl, container);
119+
buildSplitLine(container);
112120
FXUtils.addToPane(radialVelocityControl, container);
113121
FXUtils.addToPane(horizontalControl, container);
114-
FXUtils.addToPane(originControl, container);
115122
}
116123
}

0 commit comments

Comments
 (0)