Removed some cloneForSpatial() methods that weren't doing anything

that the super class would do.
Adding @Override to cloneForSpatial() methods in jme3-core controls
and CloneableTracks.
cleanup_build_scripts
Paul Speed 9 years ago
parent eb2e2f4cdc
commit f83c7006f0
  1. 1
      jme3-core/src/main/java/com/jme3/animation/AnimControl.java
  2. 1
      jme3-core/src/main/java/com/jme3/animation/AudioTrack.java
  3. 1
      jme3-core/src/main/java/com/jme3/animation/EffectTrack.java
  4. 1
      jme3-core/src/main/java/com/jme3/animation/SkeletonControl.java
  5. 1
      jme3-core/src/main/java/com/jme3/app/StatsView.java
  6. 1
      jme3-core/src/main/java/com/jme3/cinematic/events/MotionEvent.java
  7. 1
      jme3-core/src/main/java/com/jme3/effect/ParticleEmitter.java
  8. 1
      jme3-core/src/main/java/com/jme3/input/ChaseCamera.java
  9. 13
      jme3-core/src/main/java/com/jme3/scene/control/BillboardControl.java
  10. 15
      jme3-core/src/main/java/com/jme3/scene/control/CameraControl.java
  11. 15
      jme3-core/src/main/java/com/jme3/scene/control/LightControl.java
  12. 1
      jme3-core/src/main/java/com/jme3/scene/control/UpdateControl.java

@ -108,6 +108,7 @@ public final class AnimControl extends AbstractControl implements Cloneable {
/**
* Internal use only.
*/
@Override
public Control cloneForSpatial(Spatial spatial) {
try {
AnimControl clone = (AnimControl) super.clone();

@ -174,6 +174,7 @@ public class AudioTrack implements ClonableTrack {
* @param spatial the Spatial holding the AnimControl
* @return the cloned Track with proper reference
*/
@Override
public Track cloneForSpatial(Spatial spatial) {
AudioTrack audioTrack = new AudioTrack();
audioTrack.length = this.length;

@ -263,6 +263,7 @@ public class EffectTrack implements ClonableTrack {
* @param spatial the Spatial holding the AnimControl
* @return the cloned Track with proper reference
*/
@Override
public Track cloneForSpatial(Spatial spatial) {
EffectTrack effectTrack = new EffectTrack();
effectTrack.particlesPerSeconds = this.particlesPerSeconds;

@ -345,6 +345,7 @@ public class SkeletonControl extends AbstractControl implements Cloneable {
}
}
@Override
public Control cloneForSpatial(Spatial spatial) {
Node clonedNode = (Node) spatial;
SkeletonControl clone = new SkeletonControl();

@ -115,6 +115,7 @@ public class StatsView extends Node implements Control {
//statistics.clearFrame();
}
@Override
public Control cloneForSpatial(Spatial spatial) {
return (Control) spatial;
}

@ -274,6 +274,7 @@ public class MotionEvent extends AbstractCinematicEvent implements Control {
* @param spatial
* @return
*/
@Override
public Control cloneForSpatial(Spatial spatial) {
MotionEvent control = new MotionEvent(spatial, path);
control.playState = playState;

@ -119,6 +119,7 @@ public class ParticleEmitter extends Geometry {
this.parentEmitter = parentEmitter;
}
@Override
public Control cloneForSpatial(Spatial spatial) {
return this; // WARNING: Sets wrong control on spatial. Will be
// fixed automatically by ParticleEmitter.clone() method.

@ -567,6 +567,7 @@ public class ChaseCamera implements ActionListener, AnalogListener, Control {
* @param spatial
* @return
*/
@Override
public Control cloneForSpatial(Spatial spatial) {
ChaseCamera cc = new ChaseCamera(cam, spatial, inputManager);
cc.setMaxDistance(getMaxDistance());

@ -86,12 +86,13 @@ public class BillboardControl extends AbstractControl {
alignment = Alignment.Screen;
}
public Control cloneForSpatial(Spatial spatial) {
BillboardControl control = new BillboardControl();
control.alignment = this.alignment;
control.setSpatial(spatial);
return control;
}
// default implementation from AbstractControl is equivalent
//public Control cloneForSpatial(Spatial spatial) {
// BillboardControl control = new BillboardControl();
// control.alignment = this.alignment;
// control.setSpatial(spatial);
// return control;
//}
@Override
protected void controlUpdate(float tpf) {

@ -136,13 +136,14 @@ public class CameraControl extends AbstractControl {
// nothing to do
}
@Override
public Control cloneForSpatial(Spatial newSpatial) {
CameraControl control = new CameraControl(camera, controlDir);
control.setSpatial(newSpatial);
control.setEnabled(isEnabled());
return control;
}
// default implementation from AbstractControl is equivalent
//@Override
//public Control cloneForSpatial(Spatial newSpatial) {
// CameraControl control = new CameraControl(camera, controlDir);
// control.setSpatial(newSpatial);
// control.setEnabled(isEnabled());
// return control;
//}
private static final String CONTROL_DIR_NAME = "controlDir";
private static final String CAMERA_NAME = "camera";

@ -167,13 +167,14 @@ public class LightControl extends AbstractControl {
// nothing to do
}
@Override
public Control cloneForSpatial(Spatial newSpatial) {
LightControl control = new LightControl(light, controlDir);
control.setSpatial(newSpatial);
control.setEnabled(isEnabled());
return control;
}
// default implementation from AbstractControl is equivalent
//@Override
//public Control cloneForSpatial(Spatial newSpatial) {
// LightControl control = new LightControl(light, controlDir);
// control.setSpatial(newSpatial);
// control.setEnabled(isEnabled());
// return control;
//}
private static final String CONTROL_DIR_NAME = "controlDir";
private static final String LIGHT_NAME = "light";

@ -85,6 +85,7 @@ public class UpdateControl extends AbstractControl {
}
@Override
public Control cloneForSpatial(Spatial newSpatial) {
UpdateControl control = new UpdateControl();
control.setSpatial(newSpatial);

Loading…
Cancel
Save