Skip to content

Commit 2de71f0

Browse files
committed
updated Material Editor.
1 parent a604019 commit 2de71f0

51 files changed

Lines changed: 674 additions & 2218 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/main/java/com/ss/editor/Messages.java

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -210,23 +210,6 @@ public class Messages {
210210
*/
211211
public static final String MATERIAL_FILE_EDITOR_BUCKET_TYPE_LABEL;
212212

213-
/**
214-
* The constant MATERIAL_FILE_EDITOR_TEXTURES_COMPONENT_TITLE.
215-
*/
216-
public static final String MATERIAL_FILE_EDITOR_TEXTURES_COMPONENT_TITLE;
217-
/**
218-
* The constant MATERIAL_FILE_EDITOR_COLORS_COMPONENT_TITLE.
219-
*/
220-
public static final String MATERIAL_FILE_EDITOR_COLORS_COMPONENT_TITLE;
221-
/**
222-
* The constant MATERIAL_FILE_EDITOR_OTHER_COMPONENT_TITLE.
223-
*/
224-
public static final String MATERIAL_FILE_EDITOR_OTHER_COMPONENT_TITLE;
225-
/**
226-
* The constant MATERIAL_FILE_EDITOR_RENDER_PARAMS_COMPONENT_TITLE.
227-
*/
228-
public static final String MATERIAL_FILE_EDITOR_RENDER_PARAMS_COMPONENT_TITLE;
229-
230213
/**
231214
* The constant TEXTURE_2D_MATERIAL_PARAM_CONTROL_REPEAT.
232215
*/
@@ -249,6 +232,27 @@ public class Messages {
249232
*/
250233
public static final String COLOR_MATERIAL_PARAM_CONTROL_REMOVE;
251234

235+
/**
236+
* The constant MATERIAL_SETTINGS_MAIN.
237+
*/
238+
public static final String MATERIAL_SETTINGS_MAIN;
239+
/**
240+
* The constant MATERIAL_SETTINGS_TEXTURES.
241+
*/
242+
public static final String MATERIAL_SETTINGS_TEXTURES;
243+
/**
244+
* The constant MATERIAL_SETTINGS_COLORS.
245+
*/
246+
public static final String MATERIAL_SETTINGS_COLORS;
247+
/**
248+
* The constant MATERIAL_SETTINGS_RENDER.
249+
*/
250+
public static final String MATERIAL_SETTINGS_RENDER;
251+
/**
252+
* The constant MATERIAL_SETTINGS_OTHER.
253+
*/
254+
public static final String MATERIAL_SETTINGS_OTHER;
255+
252256
/**
253257
* The constant MATERIAL_RENDER_STATE_FACE_CULL_MODE.
254258
*/
@@ -257,6 +261,14 @@ public class Messages {
257261
* The constant MATERIAL_RENDER_STATE_BLEND_MODE.
258262
*/
259263
public static final String MATERIAL_RENDER_STATE_BLEND_MODE;
264+
/**
265+
* The constant MATERIAL_RENDER_STATE_BLEND_EQUATION.
266+
*/
267+
public static final String MATERIAL_RENDER_STATE_BLEND_EQUATION;
268+
/**
269+
* The constant MATERIAL_RENDER_STATE_BLEND_EQUATION_ALPHA.
270+
*/
271+
public static final String MATERIAL_RENDER_STATE_BLEND_EQUATION_ALPHA;
260272
/**
261273
* The constant MATERIAL_RENDER_STATE_POLY_OFFSET_FACTOR.
262274
*/
@@ -265,10 +277,6 @@ public class Messages {
265277
* The constant MATERIAL_RENDER_STATE_POLY_OFFSET_UNITS.
266278
*/
267279
public static final String MATERIAL_RENDER_STATE_POLY_OFFSET_UNITS;
268-
/**
269-
* The constant MATERIAL_RENDER_STATE_POINT_SPRITE.
270-
*/
271-
public static final String MATERIAL_RENDER_STATE_POINT_SPRITE;
272280
/**
273281
* The constant MATERIAL_RENDER_STATE_DEPTH_WRITE.
274282
*/
@@ -2419,23 +2427,25 @@ public class Messages {
24192427
PARTICLE_ASSET_EDITOR_DIALOG_TEXTURE_PARAM_LABEL = bundle.getString("ParticlesAssetEditorDialogTextureParamLabel");
24202428
PARTICLE_ASSET_EDITOR_DIALOG_LIGHTING_TRANSFORM_LABEL = bundle.getString("ParticlesAssetEditorDialogTextureLightingTransformLabel");
24212429

2422-
MATERIAL_FILE_EDITOR_TEXTURES_COMPONENT_TITLE = bundle.getString("MaterialFileEditorTexturesComponentTitle");
2423-
MATERIAL_FILE_EDITOR_COLORS_COMPONENT_TITLE = bundle.getString("MaterialFileEditorColorsComponentTitle");
2424-
MATERIAL_FILE_EDITOR_OTHER_COMPONENT_TITLE = bundle.getString("MaterialFileEditorOtherComponentTitle");
2425-
MATERIAL_FILE_EDITOR_RENDER_PARAMS_COMPONENT_TITLE = bundle.getString("MaterialFileEditorRenderParamsComponentTitle");
2426-
24272430
TEXTURE_2D_MATERIAL_PARAM_CONTROL_REPEAT = bundle.getString("Texture2DMaterialParamControlRepeat");
24282431
TEXTURE_2D_MATERIAL_PARAM_CONTROL_FLIP = bundle.getString("Texture2DMaterialParamControlFlip");
24292432
TEXTURE_2D_MATERIAL_PARAM_CONTROL_ADD = bundle.getString("Texture2DMaterialParamControlAdd");
24302433
TEXTURE_2D_MATERIAL_PARAM_CONTROL_REMOVE = bundle.getString("Texture2DMaterialParamControlRemove");
24312434

24322435
COLOR_MATERIAL_PARAM_CONTROL_REMOVE = bundle.getString("ColorMaterialParamControlRemove");
24332436

2437+
MATERIAL_SETTINGS_MAIN = bundle.getString("MaterialSettingsMain");
2438+
MATERIAL_SETTINGS_TEXTURES = bundle.getString("MaterialSettingsTextures");
2439+
MATERIAL_SETTINGS_COLORS = bundle.getString("MaterialSettingsColors");
2440+
MATERIAL_SETTINGS_RENDER = bundle.getString("MaterialSettingsRender");
2441+
MATERIAL_SETTINGS_OTHER = bundle.getString("MaterialSettingsOther");
24342442
MATERIAL_RENDER_STATE_FACE_CULL_MODE = bundle.getString("MaterialRenderStateFaceCullMode");
24352443
MATERIAL_RENDER_STATE_BLEND_MODE = bundle.getString("MaterialRenderStateBlendMode");
2444+
MATERIAL_RENDER_STATE_BLEND_EQUATION = bundle.getString("MaterialRenderStateBlendEquation");
2445+
MATERIAL_RENDER_STATE_BLEND_EQUATION_ALPHA = bundle.getString("MaterialRenderStateBlendEquationAlpha");
2446+
24362447
MATERIAL_RENDER_STATE_POLY_OFFSET_FACTOR = bundle.getString("MaterialRenderStatePolyOffsetFactor");
24372448
MATERIAL_RENDER_STATE_POLY_OFFSET_UNITS = bundle.getString("MaterialRenderStatePolyOffsetUnits");
2438-
MATERIAL_RENDER_STATE_POINT_SPRITE = bundle.getString("MaterialRenderStatePointSprite");
24392449
MATERIAL_RENDER_STATE_DEPTH_WRITE = bundle.getString("MaterialRenderStateDepthWrite");
24402450
MATERIAL_RENDER_STATE_COLOR_WRITE = bundle.getString("MaterialRenderStateColorWrite");
24412451
MATERIAL_RENDER_STATE_DEPTH_TEST = bundle.getString("MaterialRenderStateDepthTest");
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.ss.editor.model.node.material;
2+
3+
import com.jme3.material.Material;
4+
import org.jetbrains.annotations.NotNull;
5+
6+
/**
7+
* The colors settings of a material.
8+
*
9+
* @author JavaSaBr
10+
*/
11+
public class ColorsSettings extends MaterialSettings {
12+
13+
public ColorsSettings(@NotNull final Material material) {
14+
super(material);
15+
}
16+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package com.ss.editor.model.node.material;
2+
3+
import com.jme3.material.Material;
4+
import org.jetbrains.annotations.NotNull;
5+
6+
/**
7+
* The base class of material settings.
8+
*
9+
* @author JavaSaBr
10+
*/
11+
public class MaterialSettings {
12+
13+
@NotNull
14+
private final Material material;
15+
16+
public MaterialSettings(@NotNull final Material material) {
17+
this.material = material;
18+
}
19+
20+
/**
21+
* @return the material.
22+
*/
23+
public @NotNull Material getMaterial() {
24+
return material;
25+
}
26+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.ss.editor.model.node.material;
2+
3+
import com.jme3.material.Material;
4+
import org.jetbrains.annotations.NotNull;
5+
6+
/**
7+
* The other settings of a material.
8+
*
9+
* @author JavaSaBr
10+
*/
11+
public class OtherSettings extends MaterialSettings {
12+
13+
public OtherSettings(@NotNull final Material material) {
14+
super(material);
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.ss.editor.model.node.material;
2+
3+
import com.jme3.material.Material;
4+
import org.jetbrains.annotations.NotNull;
5+
6+
/**
7+
* The render settings of a material.
8+
*
9+
* @author JavaSaBr
10+
*/
11+
public class RenderSettings extends MaterialSettings {
12+
13+
public RenderSettings(@NotNull final Material material) {
14+
super(material);
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.ss.editor.model.node.material;
2+
3+
import com.jme3.material.Material;
4+
import org.jetbrains.annotations.NotNull;
5+
6+
/**
7+
* The root settings of a material.
8+
*
9+
* @author JavaSaBr
10+
*/
11+
public class RootMaterialSettings extends MaterialSettings {
12+
13+
public RootMaterialSettings(@NotNull final Material material) {
14+
super(material);
15+
}
16+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
package com.ss.editor.model.node.material;
2+
3+
import com.jme3.material.Material;
4+
import org.jetbrains.annotations.NotNull;
5+
6+
/**
7+
* The texture's settings of a material.
8+
*
9+
* @author JavaSaBr
10+
*/
11+
public class TexturesSettings extends MaterialSettings {
12+
13+
public TexturesSettings(@NotNull final Material material) {
14+
super(material);
15+
}
16+
}

src/main/java/com/ss/editor/model/node/Toneg0dParticleInfluencers.java renamed to src/main/java/com/ss/editor/model/node/particles/Toneg0dParticleInfluencers.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.ss.editor.model.node;
1+
package com.ss.editor.model.node.particles;
22

33
import org.jetbrains.annotations.NotNull;
44
import tonegod.emitter.ParticleEmitterNode;

src/main/java/com/ss/editor/ui/component/editor/impl/AbstractFileEditor.java

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -366,20 +366,12 @@ public void save(@Nullable final Consumer<@NotNull FileEditor> callback) {
366366

367367
final Path editFile = getEditFile();
368368

369-
LOGGER.info(this, "Try to save data to the file " + tempFile + ", isReadable " +
370-
Files.isReadable(tempFile) + ", isWritable " + Files.isWritable(tempFile));
371-
372369
doSave(tempFile);
373-
374-
LOGGER.info(this, "Try to move the file " + tempFile + " to the file " + editFile + ", isReadable " +
375-
Files.isReadable(editFile) + ", isWritable " + Files.isWritable(editFile));
376-
377370
try {
378371
Files.move(tempFile, editFile, REPLACE_EXISTING, ATOMIC_MOVE);
379372
} catch (final AtomicMoveNotSupportedException e) {
380373
Files.move(tempFile, editFile, REPLACE_EXISTING);
381374
} catch (final AccessDeniedException e) {
382-
LOGGER.error("Access error: " + e.getMessage() + ", " + e.getReason());
383375
Files.copy(tempFile, editFile, StandardCopyOption.REPLACE_EXISTING);
384376
FileUtils.delete(tempFile);
385377
}

src/main/java/com/ss/editor/ui/component/editor/impl/material/AbstractMaterialPropertiesComponent.java

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

0 commit comments

Comments
 (0)