alpha < 1.
* @param direction Indicates whether the timelines are mixing in or out. Used by timelines which perform instant transitions,
* such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}. */
- public void apply (Skeleton skeleton, float lastTime, float time, boolean loop, Arrayalpha < 1.
* @param direction Indicates whether the timeline is mixing in or out. Used by timelines which perform instant transitions,
* such as {@link DrawOrderTimeline} or {@link AttachmentTimeline}. */
- abstract public void apply (Skeleton skeleton, float lastTime, float time, ArraylastTime and <= time. */
- public void apply (Skeleton skeleton, float lastTime, float time, Array- * {@link #setAnimation(int, Animation, boolean)}. */ + * See {@link #setAnimation(int, Animation, boolean)}. */ public TrackEntry setAnimation (int trackIndex, String animationName, boolean loop) { Animation animation = data.skeletonData.findAnimation(animationName); if (animation == null) throw new IllegalArgumentException("Animation not found: " + animationName); @@ -649,8 +650,7 @@ public class AnimationState { return null; } - /** @param last May be null. */ - private TrackEntry trackEntry (int trackIndex, Animation animation, boolean loop, TrackEntry last) { + private TrackEntry trackEntry (int trackIndex, Animation animation, boolean loop, @Null TrackEntry last) { TrackEntry entry = trackEntryPool.obtain(); entry.trackIndex = trackIndex; entry.animation = animation; @@ -772,6 +772,7 @@ public class AnimationState { } /** Returns the track entry for the animation currently playing on the track, or null if no animation is currently playing. */ + @Null public TrackEntry getCurrent (int trackIndex) { if (trackIndex < 0) throw new IllegalArgumentException("trackIndex must be >= 0."); if (trackIndex >= tracks.size) return null; @@ -1009,12 +1010,12 @@ public class AnimationState { *
* A track entry returned from {@link AnimationState#setAnimation(int, Animation, boolean)} is already the current animation
* for the track, so the track entry listener {@link AnimationStateListener#start(TrackEntry)} will not be called. */
+ @Null
public AnimationStateListener getListener () {
return listener;
}
- /** @param listener May be null. */
- public void setListener (AnimationStateListener listener) {
+ public void setListener (@Null AnimationStateListener listener) {
this.listener = listener;
}
@@ -1065,6 +1066,7 @@ public class AnimationState {
}
/** The animation queued to start after this animation, or null. next makes up a linked list. */
+ @Null
public TrackEntry getNext () {
return next;
}
@@ -1124,12 +1126,14 @@ public class AnimationState {
/** The track entry for the previous animation when mixing from the previous animation to this animation, or null if no
* mixing is currently occuring. When mixing from multiple animations, mixingFrom makes up a linked list. */
+ @Null
public TrackEntry getMixingFrom () {
return mixingFrom;
}
/** The track entry for the next animation when mixing from this animation to the next animation, or null if no mixing is
* currently occuring. When mixing to multiple animations, mixingTo makes up a linked list. */
+ @Null
public TrackEntry getMixingTo () {
return mixingTo;
}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java
index cb8d33daa..4c38ae839 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Bone.java
@@ -37,6 +37,7 @@ import com.badlogic.gdx.math.Vector2;
import com.badlogic.gdx.utils.Array;
import com.esotericsoftware.spine.BoneData.TransformMode;
+import com.esotericsoftware.spine.utils.Null;
/** Stores a bone's current pose.
*
@@ -56,8 +57,7 @@ public class Bone implements Updatable { boolean sorted, active; - /** @param parent May be null. */ - public Bone (BoneData data, Skeleton skeleton, Bone parent) { + public Bone (BoneData data, Skeleton skeleton, @Null Bone parent) { if (data == null) throw new IllegalArgumentException("data cannot be null."); if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null."); this.data = data; @@ -66,9 +66,8 @@ public class Bone implements Updatable { setToSetupPose(); } - /** Copy constructor. Does not copy the children bones. - * @param parent May be null. */ - public Bone (Bone bone, Skeleton skeleton, Bone parent) { + /** Copy constructor. Does not copy the children bones. */ + public Bone (Bone bone, Skeleton skeleton, @Null Bone parent) { if (bone == null) throw new IllegalArgumentException("bone cannot be null."); if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null."); this.skeleton = skeleton; @@ -226,6 +225,7 @@ public class Bone implements Updatable { } /** The parent bone, or null if this is the root bone. */ + @Null public Bone getParent () { return parent; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java index 1238fafc7..c4d952007 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/BoneData.java @@ -31,6 +31,8 @@ package com.esotericsoftware.spine; import com.badlogic.gdx.graphics.Color; +import com.esotericsoftware.spine.utils.Null; + /** Stores the setup pose for a {@link Bone}. */ public class BoneData { final int index; @@ -44,8 +46,7 @@ public class BoneData { // Nonessential. final Color color = new Color(0.61f, 0.61f, 0.61f, 1); // 9b9b9bff - /** @param parent May be null. */ - public BoneData (int index, String name, BoneData parent) { + public BoneData (int index, String name, @Null BoneData parent) { if (index < 0) throw new IllegalArgumentException("index must be >= 0."); if (name == null) throw new IllegalArgumentException("name cannot be null."); this.index = index; @@ -53,9 +54,8 @@ public class BoneData { this.parent = parent; } - /** Copy constructor. - * @param parent May be null. */ - public BoneData (BoneData bone, BoneData parent) { + /** Copy constructor. */ + public BoneData (BoneData bone, @Null BoneData parent) { if (bone == null) throw new IllegalArgumentException("bone cannot be null."); index = bone.index; name = bone.name; @@ -80,7 +80,7 @@ public class BoneData { return name; } - /** @return May be null. */ + @Null public BoneData getParent () { return parent; } @@ -179,7 +179,8 @@ public class BoneData { /** When true, {@link Skeleton#updateWorldTransform()} only updates this bone if the {@link Skeleton#getSkin()} contains this * bone. - * @see Skin#getBones() */ + *
+ * See {@link Skin#getBones()}. */ public boolean getSkinRequired () { return skinRequired; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/ConstraintData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/ConstraintData.java index a81fb08f1..3b64fcc20 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/ConstraintData.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/ConstraintData.java @@ -57,7 +57,8 @@ abstract public class ConstraintData { /** When true, {@link Skeleton#updateWorldTransform()} only updates this constraint if the {@link Skeleton#getSkin()} contains * this constraint. - * @see Skin#getConstraints() */ + *
+ * See {@link Skin#getConstraints()}. */ public boolean getSkinRequired () { return skinRequired; } diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java index 341090ae2..2db49badd 100644 --- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java +++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Skeleton.java @@ -41,6 +41,7 @@ import com.esotericsoftware.spine.attachments.Attachment; import com.esotericsoftware.spine.attachments.MeshAttachment; import com.esotericsoftware.spine.attachments.PathAttachment; import com.esotericsoftware.spine.attachments.RegionAttachment; +import com.esotericsoftware.spine.utils.Null; /** Stores the current pose for a skeleton. *
@@ -472,15 +473,14 @@ public class Skeleton {
return updateCache;
}
- /** Returns the root bone, or null. */
+ /** Returns the root bone, or null if the skeleton has no bones. */
public Bone getRootBone () {
- if (bones.size == 0) return null;
- return bones.first();
+ return bones.size == 0 ? null : bones.first();
}
/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it
- * repeatedly.
- * @return May be null. */
+ * repeatedly. */
+ @Null
public Bone findBone (String boneName) {
if (boneName == null) throw new IllegalArgumentException("boneName cannot be null.");
Array
* After changing the skin, the visible attachments can be reset to those attached in the setup pose by calling
* {@link #setSlotsToSetupPose()}. Also, often {@link AnimationState#apply(Skeleton)} is called before the next time the
- * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new skin.
- * @param newSkin May be null. */
- public void setSkin (Skin newSkin) {
+ * skeleton is rendered to allow any attachment keys in the current animation(s) to hide or show attachments from the new
+ * skin. */
+ public void setSkin (@Null Skin newSkin) {
if (newSkin == skin) return;
if (newSkin != null) {
if (skin != null)
@@ -568,8 +568,8 @@ public class Skeleton {
/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot name and attachment
* name.
*
- * See {@link #getAttachment(int, String)}.
- * @return May be null. */
+ * See {@link #getAttachment(int, String)}. */
+ @Null
public Attachment getAttachment (String slotName, String attachmentName) {
SlotData slot = data.findSlot(slotName);
if (slot == null) throw new IllegalArgumentException("Slot not found: " + slotName);
@@ -579,8 +579,8 @@ public class Skeleton {
/** Finds an attachment by looking in the {@link #skin} and {@link SkeletonData#defaultSkin} using the slot index and
* attachment name. First the skin is checked and if the attachment was not found, the default skin is checked.
*
- * See Runtime skins in the Spine Runtimes Guide.
- * @return May be null. */
+ * See Runtime skins in the Spine Runtimes Guide. */
+ @Null
public Attachment getAttachment (int slotIndex, String attachmentName) {
if (attachmentName == null) throw new IllegalArgumentException("attachmentName cannot be null.");
if (skin != null) {
@@ -594,7 +594,7 @@ public class Skeleton {
/** A convenience method to set an attachment by finding the slot with {@link #findSlot(String)}, finding the attachment with
* {@link #getAttachment(int, String)}, then setting the slot's {@link Slot#attachment}.
* @param attachmentName May be null to clear the slot's attachment. */
- public void setAttachment (String slotName, String attachmentName) {
+ public void setAttachment (String slotName, @Null String attachmentName) {
if (slotName == null) throw new IllegalArgumentException("slotName cannot be null.");
Slot slot = findSlot(slotName);
if (slot == null) throw new IllegalArgumentException("Slot not found: " + slotName);
@@ -613,8 +613,8 @@ public class Skeleton {
}
/** Finds an IK constraint by comparing each IK constraint's name. It is more efficient to cache the results of this method
- * than to call it repeatedly.
- * @return May be null. */
+ * than to call it repeatedly. */
+ @Null
public IkConstraint findIkConstraint (String constraintName) {
if (constraintName == null) throw new IllegalArgumentException("constraintName cannot be null.");
Array
@@ -138,7 +139,7 @@ public class SkeletonBinary {
try {
skeletonData.hash = input.readString();
if (skeletonData.hash.isEmpty()) skeletonData.hash = null;
- skeletonData.version = input.readString();
+ skeletonData.version = input.readString();
if (skeletonData.version.isEmpty()) skeletonData.version = null;
if ("3.8.75".equals(skeletonData.version))
throw new RuntimeException("Unsupported skeleton data, please export with a newer version of Spine.");
@@ -330,7 +331,7 @@ public class SkeletonBinary {
return skeletonData;
}
- /** @return May be null. */
+ @Null
private Skin readSkin (SkeletonInput input, SkeletonData skeletonData, boolean defaultSkin, boolean nonessential)
throws IOException {
@@ -773,7 +774,9 @@ public class SkeletonBinary {
for (int ii = 0, nn = input.readInt(true); ii < nn; ii++) {
int slotIndex = input.readInt(true);
for (int iii = 0, nnn = input.readInt(true); iii < nnn; iii++) {
- VertexAttachment attachment = (VertexAttachment)skin.getAttachment(slotIndex, input.readStringRef());
+ String attachmentName = input.readStringRef();
+ VertexAttachment attachment = (VertexAttachment)skin.getAttachment(slotIndex, attachmentName);
+ if (attachment == null) throw new SerializationException("Vertex attachment not found: " + attachmentName);
boolean weighted = attachment.getBones() != null;
float[] vertices = attachment.getVertices();
int deformLength = weighted ? (vertices.length / 3) << 1 : vertices.length;
@@ -937,7 +940,7 @@ public class SkeletonBinary {
super(file.read(512));
}
- /** @return May be null. */
+ @Null
public String readStringRef () throws IOException {
int index = readInt(true);
return index == 0 ? null : strings.get(index - 1);
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBounds.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBounds.java
index d102b8143..8c904fd18 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBounds.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SkeletonBounds.java
@@ -34,6 +34,7 @@ import com.badlogic.gdx.utils.FloatArray;
import com.badlogic.gdx.utils.Pool;
import com.esotericsoftware.spine.attachments.Attachment;
import com.esotericsoftware.spine.attachments.BoundingBoxAttachment;
+import com.esotericsoftware.spine.utils.Null;
/** Collects each visible {@link BoundingBoxAttachment} and computes the world vertices for its polygon. The polygon vertices are
* provided along with convenience methods for doing hit detection. */
@@ -141,6 +142,7 @@ public class SkeletonBounds {
/** Returns the first bounding box attachment that contains the point, or null. When doing many checks, it is usually more
* efficient to only call this method if {@link #aabbContainsPoint(float, float)} returns true. */
+ @Null
public BoundingBoxAttachment containsPoint (float x, float y) {
Array
* See Data objects in the Spine Runtimes
@@ -65,8 +67,8 @@ public class SkeletonData {
}
/** Finds a bone by comparing each bone's name. It is more efficient to cache the results of this method than to call it
- * multiple times.
- * @return May be null. */
+ * multiple times. */
+ @Null
public BoneData findBone (String boneName) {
if (boneName == null) throw new IllegalArgumentException("boneName cannot be null.");
Array
- * See {@link Skeleton#getAttachment(int, String)}.
- * @return May be null. */
+ * See {@link Skeleton#getAttachment(int, String)}. */
+ @Null
public Skin getDefaultSkin () {
return defaultSkin;
}
- /** @param defaultSkin May be null. */
- public void setDefaultSkin (Skin defaultSkin) {
+ public void setDefaultSkin (@Null Skin defaultSkin) {
this.defaultSkin = defaultSkin;
}
/** Finds a skin by comparing each skin's name. It is more efficient to cache the results of this method than to call it
- * multiple times.
- * @return May be null. */
+ * multiple times. */
+ @Null
public Skin findSkin (String skinName) {
if (skinName == null) throw new IllegalArgumentException("skinName cannot be null.");
for (Skin skin : skins)
@@ -130,8 +131,8 @@ public class SkeletonData {
// --- Events.
/** Finds an event by comparing each events's name. It is more efficient to cache the results of this method than to call it
- * multiple times.
- * @return May be null. */
+ * multiple times. */
+ @Null
public EventData findEvent (String eventDataName) {
if (eventDataName == null) throw new IllegalArgumentException("eventDataName cannot be null.");
for (EventData eventData : events)
@@ -152,8 +153,8 @@ public class SkeletonData {
}
/** Finds an animation by comparing each animation's name. It is more efficient to cache the results of this method than to
- * call it multiple times.
- * @return May be null. */
+ * call it multiple times. */
+ @Null
public Animation findAnimation (String animationName) {
if (animationName == null) throw new IllegalArgumentException("animationName cannot be null.");
Array
@@ -93,6 +94,7 @@ public class Skin {
}
/** Returns the attachment for the specified slot index and name, or null. */
+ @Null
public Attachment getAttachment (int slotIndex, String name) {
lookup.set(slotIndex, name);
SkinEntry entry = attachments.get(lookup);
@@ -154,15 +156,14 @@ public class Skin {
}
}
- /** Stores an entry in the skin consisting of the slot index, name, and attachment **/
+ /** Stores an entry in the skin consisting of the slot index and the attachment name. */
static public class SkinEntry {
int slotIndex;
String name;
Attachment attachment;
private int hashCode;
- /** @param attachment May be null. */
- SkinEntry (int slotIndex, String name, Attachment attachment) {
+ SkinEntry (int slotIndex, String name, @Null Attachment attachment) {
set(slotIndex, name);
this.attachment = attachment;
}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java
index 8a5bbca9a..70831c31e 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Slot.java
@@ -35,6 +35,7 @@ import com.badlogic.gdx.utils.FloatArray;
import com.esotericsoftware.spine.Animation.DeformTimeline;
import com.esotericsoftware.spine.attachments.Attachment;
import com.esotericsoftware.spine.attachments.VertexAttachment;
+import com.esotericsoftware.spine.utils.Null;
/** Stores a slot's current pose. Slots organize attachments for {@link Skeleton#drawOrder} purposes and provide a place to store
* state for an attachment. State cannot be stored in an attachment itself because attachments are stateless and may be shared
@@ -92,18 +93,19 @@ public class Slot {
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
* color's alpha is not used. */
+ @Null
public Color getDarkColor () {
return darkColor;
}
/** The current attachment for the slot, or null if the slot has no attachment. */
+ @Null
public Attachment getAttachment () {
return attachment;
}
- /** Sets the slot's attachment and, if the attachment changed, resets {@link #attachmentTime} and clears {@link #deform}.
- * @param attachment May be null. */
- public void setAttachment (Attachment attachment) {
+ /** Sets the slot's attachment and, if the attachment changed, resets {@link #attachmentTime} and clears {@link #deform}. */
+ public void setAttachment (@Null Attachment attachment) {
if (this.attachment == attachment) return;
this.attachment = attachment;
attachmentTime = bone.skeleton.time;
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java
index 3a0033af2..bb5b5dfaa 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/SlotData.java
@@ -31,6 +31,8 @@ package com.esotericsoftware.spine;
import com.badlogic.gdx.graphics.Color;
+import com.esotericsoftware.spine.utils.Null;
+
/** Stores the setup pose for a {@link Slot}. */
public class SlotData {
final int index;
@@ -73,21 +75,21 @@ public class SlotData {
/** The dark color used to tint the slot's attachment for two color tinting, or null if two color tinting is not used. The dark
* color's alpha is not used. */
+ @Null
public Color getDarkColor () {
return darkColor;
}
- /** @param darkColor May be null. */
- public void setDarkColor (Color darkColor) {
+ public void setDarkColor (@Null Color darkColor) {
this.darkColor = darkColor;
}
- /** @param attachmentName May be null. */
- public void setAttachmentName (String attachmentName) {
+ public void setAttachmentName (@Null String attachmentName) {
this.attachmentName = attachmentName;
}
/** The name of the attachment that is visible for this slot in the setup pose, or null if no attachment is visible. */
+ @Null
public String getAttachmentName () {
return attachmentName;
}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Attachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Attachment.java
index 3aca3fe6c..e590f9333 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Attachment.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/Attachment.java
@@ -47,6 +47,6 @@ abstract public class Attachment {
return name;
}
- /** Returns a copy of the attachment. **/
+ /** Returns a copy of the attachment. */
abstract public Attachment copy ();
}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/AttachmentLoader.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/AttachmentLoader.java
index 4599ef307..0f0fb27ab 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/AttachmentLoader.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/AttachmentLoader.java
@@ -30,6 +30,7 @@
package com.esotericsoftware.spine.attachments;
import com.esotericsoftware.spine.Skin;
+import com.esotericsoftware.spine.utils.Null;
/** The interface which can be implemented to customize creating and populating attachments.
*
@@ -37,20 +38,26 @@ import com.esotericsoftware.spine.Skin;
* Runtimes Guide. */
public interface AttachmentLoader {
/** @return May be null to not load the attachment. */
+ @Null
public RegionAttachment newRegionAttachment (Skin skin, String name, String path);
/** @return May be null to not load the attachment. */
+ @Null
public MeshAttachment newMeshAttachment (Skin skin, String name, String path);
/** @return May be null to not load the attachment. */
+ @Null
public BoundingBoxAttachment newBoundingBoxAttachment (Skin skin, String name);
-
+
/** @return May be null to not load the attachment. */
+ @Null
public ClippingAttachment newClippingAttachment (Skin skin, String name);
/** @return May be null to not load the attachment. */
+ @Null
public PathAttachment newPathAttachment (Skin skin, String name);
/** @return May be null to not load the attachment. */
+ @Null
public PointAttachment newPointAttachment (Skin skin, String name);
}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java
index 228d243ac..5d650e7b5 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/MeshAttachment.java
@@ -33,6 +33,9 @@ import static com.esotericsoftware.spine.utils.SpineUtils.*;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.g2d.TextureAtlas.AtlasRegion;
+
+import com.esotericsoftware.spine.utils.Null;
+
import com.badlogic.gdx.graphics.g2d.TextureRegion;
/** An attachment that displays a textured mesh. A mesh has hull vertices and internal vertices within the hull. Holes are not
@@ -218,8 +221,7 @@ public class MeshAttachment extends VertexAttachment {
return parentMesh;
}
- /** @param parentMesh May be null. */
- public void setParentMesh (MeshAttachment parentMesh) {
+ public void setParentMesh (@Null MeshAttachment parentMesh) {
this.parentMesh = parentMesh;
if (parentMesh != null) {
bones = parentMesh.bones;
@@ -261,7 +263,7 @@ public class MeshAttachment extends VertexAttachment {
return copy;
}
- /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. **/
+ /** Returns a new mesh with the {@link #parentMesh} set to this mesh's parent mesh, if any, else to this mesh. */
public MeshAttachment newLinkedMesh () {
MeshAttachment mesh = new MeshAttachment(name);
mesh.region = region;
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkeletonAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkeletonAttachment.java
index e8fccb513..bc0c59d89 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkeletonAttachment.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/SkeletonAttachment.java
@@ -30,6 +30,7 @@
package com.esotericsoftware.spine.attachments;
import com.esotericsoftware.spine.Skeleton;
+import com.esotericsoftware.spine.utils.Null;
/** Attachment that displays a skeleton. */
public class SkeletonAttachment extends Attachment {
@@ -44,8 +45,7 @@ public class SkeletonAttachment extends Attachment {
return skeleton;
}
- /** @param skeleton May be null. */
- public void setSkeleton (Skeleton skeleton) {
+ public void setSkeleton (@Null Skeleton skeleton) {
this.skeleton = skeleton;
}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java
index 40781bf4d..e67d7c54a 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/attachments/VertexAttachment.java
@@ -36,6 +36,7 @@ import com.badlogic.gdx.utils.FloatArray;
import com.esotericsoftware.spine.Bone;
import com.esotericsoftware.spine.Skeleton;
import com.esotericsoftware.spine.Slot;
+import com.esotericsoftware.spine.utils.Null;
/** Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's
* {@link Slot#getDeform()}. */
@@ -122,24 +123,26 @@ abstract public class VertexAttachment extends Attachment {
/** Deform keys for the deform attachment are also applied to this attachment.
* @return May be null if no deform keys should be applied. */
+ @Null
public VertexAttachment getDeformAttachment () {
return deformAttachment;
}
/** @param deformAttachment May be null if no deform keys should be applied. */
- public void setDeformAttachment (VertexAttachment deformAttachment) {
+ public void setDeformAttachment (@Null VertexAttachment deformAttachment) {
this.deformAttachment = deformAttachment;
}
/** The bones which affect the {@link #getVertices()}. The array entries are, for each vertex, the number of bones affecting
* the vertex followed by that many bone indices, which is the index of the bone in {@link Skeleton#getBones()}. Will be null
* if this attachment has no weights. */
+ @Null
public int[] getBones () {
return bones;
}
/** @param bones May be null if this attachment has no weights. */
- public void setBones (int[] bones) {
+ public void setBones (@Null int[] bones) {
this.bones = bones;
}
@@ -169,7 +172,7 @@ abstract public class VertexAttachment extends Attachment {
return id;
}
- /** Does not copy id (generated) or name (set on construction). **/
+ /** Does not copy id (generated) or name (set on construction). */
void copyTo (VertexAttachment attachment) {
if (bones != null) {
attachment.bones = new int[bones.length];
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/Null.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/Null.java
new file mode 100644
index 000000000..b14f75ca6
--- /dev/null
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/Null.java
@@ -0,0 +1,5 @@
+
+package com.esotericsoftware.spine.utils;
+
+public @interface Null {
+}
diff --git a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonDataLoader.java b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonDataLoader.java
index 22009f1b5..2a827142c 100644
--- a/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonDataLoader.java
+++ b/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/utils/SkeletonDataLoader.java
@@ -67,8 +67,7 @@ public class SkeletonDataLoader extends AsynchronousAssetLoader