Add in @Overrides across the board, clean up the comments around them some, and remove
unneeded imports. I've got partially completed patches for narya & vilya, too, but nenya was the only one that wound up in a decent state after a friday evening puttering at it, killing time waiting on other things to finish. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@572 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -56,9 +56,7 @@ public class ActionSequence implements Serializable
|
|||||||
* action. */
|
* action. */
|
||||||
public int[] orients;
|
public int[] orients;
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns a string representation of this action sequence.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[name=" + name + ", framesPerSecond=" + framesPerSecond +
|
return "[name=" + name + ", framesPerSecond=" + framesPerSecond +
|
||||||
|
|||||||
@@ -85,10 +85,7 @@ public class CharacterComponent implements Serializable
|
|||||||
return _frameProvider.getFramePath(this, action, type, existentPaths);
|
return _frameProvider.getFramePath(this, action, type, existentPaths);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns true if this component is equal to the other component. The
|
|
||||||
* comparison is made on <code>componentId</code>.
|
|
||||||
*/
|
|
||||||
public boolean equals (Object other)
|
public boolean equals (Object other)
|
||||||
{
|
{
|
||||||
if (other instanceof CharacterComponent) {
|
if (other instanceof CharacterComponent) {
|
||||||
@@ -98,9 +95,7 @@ public class CharacterComponent implements Serializable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns a string representation of this character component.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return StringUtil.fieldsToString(this);
|
return StringUtil.fieldsToString(this);
|
||||||
|
|||||||
@@ -93,9 +93,7 @@ public class CharacterDescriptor
|
|||||||
_xlations = xlations;
|
_xlations = xlations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Compute a sensible hashcode for this object.
|
|
||||||
*/
|
|
||||||
public int hashCode ()
|
public int hashCode ()
|
||||||
{
|
{
|
||||||
int code = 0, clength = _components.length;
|
int code = 0, clength = _components.length;
|
||||||
@@ -105,9 +103,7 @@ public class CharacterDescriptor
|
|||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Compares this character descriptor to another.
|
|
||||||
*/
|
|
||||||
public boolean equals (Object other)
|
public boolean equals (Object other)
|
||||||
{
|
{
|
||||||
if (!(other instanceof CharacterDescriptor)) {
|
if (!(other instanceof CharacterDescriptor)) {
|
||||||
@@ -145,9 +141,7 @@ public class CharacterDescriptor
|
|||||||
return Arrays.equals(_xlations, odesc._xlations);
|
return Arrays.equals(_xlations, odesc._xlations);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns a string representation of this character descriptor.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[cids=" + StringUtil.toString(_components) +
|
return "[cids=" + StringUtil.toString(_components) +
|
||||||
|
|||||||
@@ -373,6 +373,7 @@ public class CharacterManager
|
|||||||
// multi-frame image that does the necessary shadow magic
|
// multi-frame image that does the necessary shadow magic
|
||||||
ComponentFrames[] svec = sources.toArray(new ComponentFrames[sources.size()]);
|
ComponentFrames[] svec = sources.toArray(new ComponentFrames[sources.size()]);
|
||||||
cframes.frames = new CompositedActionFrames(_imgr, _frameCache, action, svec) {
|
cframes.frames = new CompositedActionFrames(_imgr, _frameCache, action, svec) {
|
||||||
|
@Override
|
||||||
protected CompositedMultiFrameImage createFrames (int orient) {
|
protected CompositedMultiFrameImage createFrames (int orient) {
|
||||||
return new CompositedShadowImage(
|
return new CompositedShadowImage(
|
||||||
_imgr, _sources, _action, orient, cclass.shadowAlpha);
|
_imgr, _sources, _action, orient, cclass.shadowAlpha);
|
||||||
@@ -399,6 +400,7 @@ public class CharacterManager
|
|||||||
}
|
}
|
||||||
ComponentFrames[] mvec = sources.toArray(new ComponentFrames[sources.size()]);
|
ComponentFrames[] mvec = sources.toArray(new ComponentFrames[sources.size()]);
|
||||||
return new CompositedActionFrames(_imgr, _frameCache, action, mvec) {
|
return new CompositedActionFrames(_imgr, _frameCache, action, mvec) {
|
||||||
|
@Override
|
||||||
protected CompositedMultiFrameImage createFrames (int orient) {
|
protected CompositedMultiFrameImage createFrames (int orient) {
|
||||||
return new CompositedMaskedImage(_imgr, _sources, _action, orient);
|
return new CompositedMaskedImage(_imgr, _sources, _action, orient);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ public class CharacterSprite extends ImageSprite
|
|||||||
updateActionFrames();
|
updateActionFrames();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void setOrientation (int orient)
|
public void setOrientation (int orient)
|
||||||
{
|
{
|
||||||
if (orient < 0 || orient >= FINE_DIRECTION_COUNT) {
|
if (orient < 0 || orient >= FINE_DIRECTION_COUNT) {
|
||||||
@@ -158,7 +158,7 @@ public class CharacterSprite extends ImageSprite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public boolean hitTest (int x, int y)
|
public boolean hitTest (int x, int y)
|
||||||
{
|
{
|
||||||
// the irect adjustments are to account for our decorations
|
// the irect adjustments are to account for our decorations
|
||||||
@@ -166,7 +166,7 @@ public class CharacterSprite extends ImageSprite
|
|||||||
_frames.hitTest(_frameIdx, x - _ibounds.x, y - _ibounds.y));
|
_frames.hitTest(_frameIdx, x - _ibounds.x, y - _ibounds.y));
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
// composite our action frames if something since the last call to
|
// composite our action frames if something since the last call to
|
||||||
@@ -178,14 +178,14 @@ public class CharacterSprite extends ImageSprite
|
|||||||
compositeActionFrames();
|
compositeActionFrames();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void cancelMove ()
|
public void cancelMove ()
|
||||||
{
|
{
|
||||||
super.cancelMove();
|
super.cancelMove();
|
||||||
halt();
|
halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void pathBeginning ()
|
public void pathBeginning ()
|
||||||
{
|
{
|
||||||
super.pathBeginning();
|
super.pathBeginning();
|
||||||
@@ -195,14 +195,14 @@ public class CharacterSprite extends ImageSprite
|
|||||||
setActionSequence(getFollowingPathAction());
|
setActionSequence(getFollowingPathAction());
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void pathCompleted (long timestamp)
|
public void pathCompleted (long timestamp)
|
||||||
{
|
{
|
||||||
super.pathCompleted(timestamp);
|
super.pathCompleted(timestamp);
|
||||||
halt();
|
halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
if (_frames != null) {
|
if (_frames != null) {
|
||||||
@@ -289,7 +289,7 @@ public class CharacterSprite extends ImageSprite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected boolean tickPath (long tickStamp)
|
protected boolean tickPath (long tickStamp)
|
||||||
{
|
{
|
||||||
boolean moved = super.tickPath(tickStamp);
|
boolean moved = super.tickPath(tickStamp);
|
||||||
@@ -299,7 +299,7 @@ public class CharacterSprite extends ImageSprite
|
|||||||
return moved;
|
return moved;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void updateRenderOrigin ()
|
protected void updateRenderOrigin ()
|
||||||
{
|
{
|
||||||
super.updateRenderOrigin();
|
super.updateRenderOrigin();
|
||||||
@@ -309,7 +309,7 @@ public class CharacterSprite extends ImageSprite
|
|||||||
_ibounds.y = _bounds.y + _ioff.y;
|
_ibounds.y = _bounds.y + _ioff.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void accomodateFrame (int frameIdx, int width, int height)
|
protected void accomodateFrame (int frameIdx, int width, int height)
|
||||||
{
|
{
|
||||||
// this will update our width and height
|
// this will update our width and height
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
package com.threerings.cast;
|
package com.threerings.cast;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import com.samskivert.util.ArrayIntSet;
|
import com.samskivert.util.ArrayIntSet;
|
||||||
@@ -95,7 +94,7 @@ public class ComponentClass implements Serializable
|
|||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generates a string representation of this instance. */
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[pri=" + renderPriority + ", action=" + action +
|
return "[pri=" + renderPriority + ", action=" + action +
|
||||||
@@ -196,6 +195,7 @@ public class ComponentClass implements Serializable
|
|||||||
/**
|
/**
|
||||||
* Classes with the same name are the same.
|
* Classes with the same name are the same.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean equals (Object other)
|
public boolean equals (Object other)
|
||||||
{
|
{
|
||||||
if (other instanceof ComponentClass) {
|
if (other instanceof ComponentClass) {
|
||||||
@@ -208,14 +208,13 @@ public class ComponentClass implements Serializable
|
|||||||
/**
|
/**
|
||||||
* Hashcode is based on component class name.
|
* Hashcode is based on component class name.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public int hashCode ()
|
public int hashCode ()
|
||||||
{
|
{
|
||||||
return name.hashCode();
|
return name.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns a string representation of this component class.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder("[");
|
StringBuilder buf = new StringBuilder("[");
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class CompositedActionFrames
|
|||||||
this.frames = frames;
|
this.frames = frames;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString () {
|
public String toString () {
|
||||||
return ccomp + ":" + frames;
|
return ccomp + ":" + frames;
|
||||||
}
|
}
|
||||||
@@ -162,12 +163,14 @@ public class CompositedActionFrames
|
|||||||
return CompositedActionFrames.this;
|
return CompositedActionFrames.this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals (Object other) {
|
public boolean equals (Object other) {
|
||||||
CompositedFramesKey okey = (CompositedFramesKey)other;
|
CompositedFramesKey okey = (CompositedFramesKey)other;
|
||||||
return ((getOwner() == okey.getOwner()) &&
|
return ((getOwner() == okey.getOwner()) &&
|
||||||
(_orient == okey._orient));
|
(_orient == okey._orient));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode () {
|
public int hashCode () {
|
||||||
return CompositedActionFrames.this.hashCode() ^ _orient;
|
return CompositedActionFrames.this.hashCode() ^ _orient;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,14 +22,9 @@
|
|||||||
package com.threerings.cast;
|
package com.threerings.cast;
|
||||||
|
|
||||||
import java.awt.AlphaComposite;
|
import java.awt.AlphaComposite;
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Composite;
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.Transparency;
|
|
||||||
|
|
||||||
import com.threerings.media.image.ImageManager;
|
import com.threerings.media.image.ImageManager;
|
||||||
import com.threerings.media.image.Mirage;
|
|
||||||
import com.threerings.media.image.VolatileMirage;
|
import com.threerings.media.image.VolatileMirage;
|
||||||
|
|
||||||
import com.threerings.cast.CompositedActionFrames.ComponentFrames;
|
import com.threerings.cast.CompositedActionFrames.ComponentFrames;
|
||||||
@@ -46,41 +41,43 @@ public class CompositedMaskedImage extends CompositedMultiFrameImage
|
|||||||
super(imgr, sources, action, orient);
|
super(imgr, sources, action, orient);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
@Override
|
||||||
public int getWidth (int index) {
|
public int getWidth (int index) {
|
||||||
return _sources[0].frames.getFrames(_orient).getWidth(index);
|
return _sources[0].frames.getFrames(_orient).getWidth(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
@Override
|
||||||
public int getHeight (int index) {
|
public int getHeight (int index) {
|
||||||
return _sources[0].frames.getFrames(_orient).getHeight(index);
|
return _sources[0].frames.getFrames(_orient).getHeight(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getXOrigin (int index) {
|
public int getXOrigin (int index) {
|
||||||
return _sources[0].frames.getXOrigin(_orient, index);
|
return _sources[0].frames.getXOrigin(_orient, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getYOrigin (int index) {
|
public int getYOrigin (int index) {
|
||||||
return _sources[0].frames.getYOrigin(_orient, index);
|
return _sources[0].frames.getYOrigin(_orient, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
@Override
|
||||||
public void paintFrame (Graphics2D g, int index, int x, int y) {
|
public void paintFrame (Graphics2D g, int index, int x, int y) {
|
||||||
_images[index].paint(g, x + getX(index), y + getY(index));
|
_images[index].paint(g, x + getX(index), y + getY(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
@Override
|
||||||
public boolean hitTest (int index, int x, int y) {
|
public boolean hitTest (int index, int x, int y) {
|
||||||
return _images[index].hitTest(x + getX(index), y + getY(index));
|
return _images[index].hitTest(x + getX(index), y + getY(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface TrimmedMultiFrameImage
|
@Override
|
||||||
public void getTrimmedBounds (int index, Rectangle bounds) {
|
public void getTrimmedBounds (int index, Rectangle bounds) {
|
||||||
bounds.setBounds(getX(index), getY(index), _images[index].getWidth(),
|
bounds.setBounds(getX(index), getY(index), _images[index].getWidth(),
|
||||||
_images[index].getHeight());
|
_images[index].getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected CompositedMirage createCompositedMirage (int index)
|
protected CompositedMirage createCompositedMirage (int index)
|
||||||
{
|
{
|
||||||
return new MaskedMirage(index);
|
return new MaskedMirage(index);
|
||||||
@@ -95,7 +92,7 @@ public class CompositedMaskedImage extends CompositedMultiFrameImage
|
|||||||
super(index);
|
super(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Rectangle combineBounds (Rectangle bounds, Rectangle tbounds)
|
protected Rectangle combineBounds (Rectangle bounds, Rectangle tbounds)
|
||||||
{
|
{
|
||||||
if (bounds.width == 0 && bounds.height == 0) {
|
if (bounds.width == 0 && bounds.height == 0) {
|
||||||
@@ -106,7 +103,7 @@ public class CompositedMaskedImage extends CompositedMultiFrameImage
|
|||||||
return bounds;
|
return bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void refreshVolatileImage ()
|
protected void refreshVolatileImage ()
|
||||||
{
|
{
|
||||||
Graphics2D g = (Graphics2D)_image.getGraphics();
|
Graphics2D g = (Graphics2D)_image.getGraphics();
|
||||||
|
|||||||
@@ -1,8 +1,5 @@
|
|||||||
package com.threerings.cast;
|
package com.threerings.cast;
|
||||||
|
|
||||||
import java.util.Comparator;
|
|
||||||
|
|
||||||
import com.threerings.cast.CompositedActionFrames.ComponentFrames;
|
|
||||||
import com.threerings.media.image.Mirage;
|
import com.threerings.media.image.Mirage;
|
||||||
|
|
||||||
public interface CompositedMirage
|
public interface CompositedMirage
|
||||||
|
|||||||
@@ -277,13 +277,13 @@ public class CompositedMultiFrameImage
|
|||||||
return bounds;
|
return bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected int getTransparency ()
|
protected int getTransparency ()
|
||||||
{
|
{
|
||||||
return Transparency.BITMASK;
|
return Transparency.BITMASK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void refreshVolatileImage ()
|
protected void refreshVolatileImage ()
|
||||||
{
|
{
|
||||||
// long start = System.currentTimeMillis();
|
// long start = System.currentTimeMillis();
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ import java.awt.Graphics2D;
|
|||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
import com.threerings.media.image.ImageManager;
|
import com.threerings.media.image.ImageManager;
|
||||||
import com.threerings.media.image.Mirage;
|
|
||||||
import com.threerings.media.image.VolatileMirage;
|
import com.threerings.media.image.VolatileMirage;
|
||||||
|
|
||||||
import com.threerings.cast.CompositedActionFrames.ComponentFrames;
|
import com.threerings.cast.CompositedActionFrames.ComponentFrames;
|
||||||
@@ -48,31 +47,33 @@ public class CompositedShadowImage extends CompositedMultiFrameImage
|
|||||||
AlphaComposite.SRC_OVER, shadowAlpha);
|
AlphaComposite.SRC_OVER, shadowAlpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
@Override
|
||||||
public int getWidth (int index) {
|
public int getWidth (int index) {
|
||||||
return _sources[0].frames.getFrames(_orient).getWidth(index);
|
return _sources[0].frames.getFrames(_orient).getWidth(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
@Override
|
||||||
public int getHeight (int index) {
|
public int getHeight (int index) {
|
||||||
return _sources[0].frames.getFrames(_orient).getHeight(index);
|
return _sources[0].frames.getFrames(_orient).getHeight(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getXOrigin (int index) {
|
public int getXOrigin (int index) {
|
||||||
return _sources[0].frames.getXOrigin(_orient, index);
|
return _sources[0].frames.getXOrigin(_orient, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int getYOrigin (int index) {
|
public int getYOrigin (int index) {
|
||||||
return _sources[0].frames.getYOrigin(_orient, index);
|
return _sources[0].frames.getYOrigin(_orient, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
protected CompositedMirage createCompositedMirage (int index) {
|
protected CompositedMirage createCompositedMirage (int index) {
|
||||||
// Always use a CompositedVolatileMirage for ShadowImage since we need to draw into it.
|
// Always use a CompositedVolatileMirage for ShadowImage since we need to draw into it.
|
||||||
return new CompositedVolatileMirage(index);
|
return new CompositedVolatileMirage(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
@Override
|
||||||
public void paintFrame (Graphics2D g, int index, int x, int y) {
|
public void paintFrame (Graphics2D g, int index, int x, int y) {
|
||||||
Composite ocomp = g.getComposite();
|
Composite ocomp = g.getComposite();
|
||||||
g.setComposite(_shadowAlpha);
|
g.setComposite(_shadowAlpha);
|
||||||
@@ -80,12 +81,12 @@ public class CompositedShadowImage extends CompositedMultiFrameImage
|
|||||||
g.setComposite(ocomp);
|
g.setComposite(ocomp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface
|
@Override
|
||||||
public boolean hitTest (int index, int x, int y) {
|
public boolean hitTest (int index, int x, int y) {
|
||||||
return _images[index].hitTest(x + getX(index), y + getY(index));
|
return _images[index].hitTest(x + getX(index), y + getY(index));
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited from interface TrimmedMultiFrameImage
|
@Override
|
||||||
public void getTrimmedBounds (int index, Rectangle bounds) {
|
public void getTrimmedBounds (int index, Rectangle bounds) {
|
||||||
bounds.setBounds(getX(index), getY(index), _images[index].getWidth(),
|
bounds.setBounds(getX(index), getY(index), _images[index].getWidth(),
|
||||||
_images[index].getHeight());
|
_images[index].getHeight());
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ public class SpritePanel extends JPanel
|
|||||||
_model.addListener(this);
|
_model.addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paintComponent (Graphics g)
|
public void paintComponent (Graphics g)
|
||||||
{
|
{
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
@@ -67,7 +67,7 @@ public class SpritePanel extends JPanel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void doLayout ()
|
public void doLayout ()
|
||||||
{
|
{
|
||||||
super.doLayout();
|
super.doLayout();
|
||||||
|
|||||||
@@ -206,6 +206,7 @@ public class BundledComponentRepository
|
|||||||
public Iterator enumerateComponentIds (final ComponentClass compClass)
|
public Iterator enumerateComponentIds (final ComponentClass compClass)
|
||||||
{
|
{
|
||||||
return new Predicate<Integer>() {
|
return new Predicate<Integer>() {
|
||||||
|
@Override
|
||||||
public boolean isMatch (Integer input) {
|
public boolean isMatch (Integer input) {
|
||||||
CharacterComponent comp = (CharacterComponent)_components.get(input);
|
CharacterComponent comp = (CharacterComponent)_components.get(input);
|
||||||
return comp.componentClass.equals(compClass);
|
return comp.componentClass.equals(compClass);
|
||||||
@@ -365,7 +366,7 @@ public class BundledComponentRepository
|
|||||||
return _bundle.getIdent() + root + imgpath + BundleUtil.IMAGE_EXTENSION;
|
return _bundle.getIdent() + root + imgpath + BundleUtil.IMAGE_EXTENSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from IMImageProvider
|
@Override
|
||||||
public Mirage getTileImage (String path, Rectangle bounds, Colorization[] zations)
|
public Mirage getTileImage (String path, Rectangle bounds, Colorization[] zations)
|
||||||
{
|
{
|
||||||
// we don't need our images prepared for screen rendering
|
// we don't need our images prepared for screen rendering
|
||||||
|
|||||||
@@ -129,6 +129,7 @@ public class ComponentBundlerTask extends Task
|
|||||||
/**
|
/**
|
||||||
* Performs the actual work of the task.
|
* Performs the actual work of the task.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void execute () throws BuildException
|
public void execute () throws BuildException
|
||||||
{
|
{
|
||||||
// make sure everything was set up properly
|
// make sure everything was set up properly
|
||||||
@@ -158,6 +159,7 @@ public class ComponentBundlerTask extends Task
|
|||||||
|
|
||||||
// create an image provider for loading our component images
|
// create an image provider for loading our component images
|
||||||
ImageProvider improv = new SimpleCachingImageProvider() {
|
ImageProvider improv = new SimpleCachingImageProvider() {
|
||||||
|
@Override
|
||||||
protected BufferedImage loadImage (String path)
|
protected BufferedImage loadImage (String path)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return ImageIO.read(new File(path));
|
return ImageIO.read(new File(path));
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ import java.io.FileOutputStream;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
|
|
||||||
import com.threerings.util.FileUtil;
|
|
||||||
|
|
||||||
import com.threerings.media.tile.TileSet;
|
import com.threerings.media.tile.TileSet;
|
||||||
import com.threerings.media.tile.TrimmedTileSet;
|
import com.threerings.media.tile.TrimmedTileSet;
|
||||||
|
|
||||||
@@ -38,7 +36,7 @@ import com.threerings.media.tile.TrimmedTileSet;
|
|||||||
*/
|
*/
|
||||||
public class DirectoryComponentBundlerTask extends ComponentBundlerTask
|
public class DirectoryComponentBundlerTask extends ComponentBundlerTask
|
||||||
{
|
{
|
||||||
@Override // documentation inherited.
|
@Override
|
||||||
protected OutputStream createOutputStream (File target)
|
protected OutputStream createOutputStream (File target)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
@@ -48,7 +46,7 @@ public class DirectoryComponentBundlerTask extends ComponentBundlerTask
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
protected OutputStream nextEntry (OutputStream lastEntry, String path)
|
protected OutputStream nextEntry (OutputStream lastEntry, String path)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
@@ -61,21 +59,21 @@ public class DirectoryComponentBundlerTask extends ComponentBundlerTask
|
|||||||
return new FileOutputStream(file);
|
return new FileOutputStream(file);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
protected boolean skipEntry (String path, long newest)
|
protected boolean skipEntry (String path, long newest)
|
||||||
{
|
{
|
||||||
File file = new File(_target, path);
|
File file = new File(_target, path);
|
||||||
return (file.lastModified() > newest);
|
return (file.lastModified() > newest);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
protected TrimmedTileSet trim (TileSet aset, OutputStream fout)
|
protected TrimmedTileSet trim (TileSet aset, OutputStream fout)
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return TrimmedTileSet.trimTileSet(aset, fout, "png");
|
return TrimmedTileSet.trimTileSet(aset, fout, "png");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
protected boolean skipIfTargetNewer ()
|
protected boolean skipIfTargetNewer ()
|
||||||
{
|
{
|
||||||
// We have to check modification later on a file-by-file basis, so cannot skip.
|
// We have to check modification later on a file-by-file basis, so cannot skip.
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ public class MetadataBundlerTask extends Task
|
|||||||
/**
|
/**
|
||||||
* Performs the actual work of the task.
|
* Performs the actual work of the task.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void execute ()
|
public void execute ()
|
||||||
throws BuildException
|
throws BuildException
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ public class ActionRuleSet extends RuleSetBase
|
|||||||
/**
|
/**
|
||||||
* Adds the necessary rules to the digester to parse our actions.
|
* Adds the necessary rules to the digester to parse our actions.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addRuleInstances (Digester digester)
|
public void addRuleInstances (Digester digester)
|
||||||
{
|
{
|
||||||
// this creates the appropriate instance when we encounter a
|
// this creates the appropriate instance when we encounter a
|
||||||
@@ -85,6 +86,7 @@ public class ActionRuleSet extends RuleSetBase
|
|||||||
new SetFieldRule("framesPerSecond"));
|
new SetFieldRule("framesPerSecond"));
|
||||||
|
|
||||||
CallMethodSpecialRule origin = new CallMethodSpecialRule() {
|
CallMethodSpecialRule origin = new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
int[] coords = StringUtil.parseIntArray(bodyText);
|
int[] coords = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -100,6 +102,7 @@ public class ActionRuleSet extends RuleSetBase
|
|||||||
digester.addRule(_prefix + ACTION_PATH + "/origin", origin);
|
digester.addRule(_prefix + ACTION_PATH + "/origin", origin);
|
||||||
|
|
||||||
CallMethodSpecialRule orient = new CallMethodSpecialRule() {
|
CallMethodSpecialRule orient = new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
ActionSequence seq = ((ActionSequence)target);
|
ActionSequence seq = ((ActionSequence)target);
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ public class ClassRuleSet extends RuleSetBase
|
|||||||
/**
|
/**
|
||||||
* Adds the necessary rules to the digester to parse our classes.
|
* Adds the necessary rules to the digester to parse our classes.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addRuleInstances (Digester digester)
|
public void addRuleInstances (Digester digester)
|
||||||
{
|
{
|
||||||
// this creates the appropriate instance when we encounter a
|
// this creates the appropriate instance when we encounter a
|
||||||
|
|||||||
@@ -235,9 +235,7 @@ public abstract class AbstractMedia
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Dumps this media to a String object.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
|
|||||||
@@ -43,7 +43,6 @@ import java.util.Map;
|
|||||||
|
|
||||||
import com.google.common.collect.Maps;
|
import com.google.common.collect.Maps;
|
||||||
|
|
||||||
import com.samskivert.swing.RuntimeAdjust;
|
|
||||||
import com.samskivert.util.ListUtil;
|
import com.samskivert.util.ListUtil;
|
||||||
import com.samskivert.util.RunAnywhere;
|
import com.samskivert.util.RunAnywhere;
|
||||||
import com.samskivert.util.StringUtil;
|
import com.samskivert.util.StringUtil;
|
||||||
@@ -68,7 +67,7 @@ public class ActiveRepaintManager extends RepaintManager
|
|||||||
_root = root;
|
_root = root;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public synchronized void addInvalidComponent (JComponent comp)
|
public synchronized void addInvalidComponent (JComponent comp)
|
||||||
{
|
{
|
||||||
Component vroot = null;
|
Component vroot = null;
|
||||||
@@ -128,7 +127,7 @@ public class ActiveRepaintManager extends RepaintManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public synchronized void addDirtyRegion (JComponent comp, int x, int y, int width, int height)
|
public synchronized void addDirtyRegion (JComponent comp, int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
// ignore invalid requests
|
// ignore invalid requests
|
||||||
@@ -187,7 +186,7 @@ public class ActiveRepaintManager extends RepaintManager
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public synchronized Rectangle getDirtyRegion (JComponent comp)
|
public synchronized Rectangle getDirtyRegion (JComponent comp)
|
||||||
{
|
{
|
||||||
Rectangle drect = _dirty.get(comp);
|
Rectangle drect = _dirty.get(comp);
|
||||||
@@ -196,7 +195,7 @@ public class ActiveRepaintManager extends RepaintManager
|
|||||||
return (drect == null) ? new Rectangle(0, 0, 0, 0) : new Rectangle(drect);
|
return (drect == null) ? new Rectangle(0, 0, 0, 0) : new Rectangle(drect);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public synchronized void markCompletelyClean (JComponent comp)
|
public synchronized void markCompletelyClean (JComponent comp)
|
||||||
{
|
{
|
||||||
_dirty.remove(comp);
|
_dirty.remove(comp);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ import static com.threerings.media.Log.log;
|
|||||||
*/
|
*/
|
||||||
public class BackFrameManager extends FrameManager
|
public class BackFrameManager extends FrameManager
|
||||||
{
|
{
|
||||||
// from FrameManager
|
@Override
|
||||||
protected void paint (long tickStamp)
|
protected void paint (long tickStamp)
|
||||||
{
|
{
|
||||||
// start out assuming we can do an incremental render
|
// start out assuming we can do an incremental render
|
||||||
@@ -99,13 +99,13 @@ public class BackFrameManager extends FrameManager
|
|||||||
} while (_backimg.contentsLost());
|
} while (_backimg.contentsLost());
|
||||||
}
|
}
|
||||||
|
|
||||||
// from FrameManager
|
@Override
|
||||||
protected Graphics2D createGraphics ()
|
protected Graphics2D createGraphics ()
|
||||||
{
|
{
|
||||||
return _backimg.createGraphics();
|
return _backimg.createGraphics();
|
||||||
}
|
}
|
||||||
|
|
||||||
// from FrameManager
|
@Override
|
||||||
protected void restoreFromBack (Rectangle dirty)
|
protected void restoreFromBack (Rectangle dirty)
|
||||||
{
|
{
|
||||||
if (_fgfx == null || _backimg == null) {
|
if (_fgfx == null || _backimg == null) {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ import static com.threerings.media.Log.log;
|
|||||||
*/
|
*/
|
||||||
public class FlipFrameManager extends FrameManager
|
public class FlipFrameManager extends FrameManager
|
||||||
{
|
{
|
||||||
// from FrameManager
|
@Override
|
||||||
protected void paint (long tickStamp)
|
protected void paint (long tickStamp)
|
||||||
{
|
{
|
||||||
// create our buffer strategy if we don't already have one
|
// create our buffer strategy if we don't already have one
|
||||||
@@ -92,13 +92,13 @@ public class FlipFrameManager extends FrameManager
|
|||||||
} while (_bufstrat.contentsLost());
|
} while (_bufstrat.contentsLost());
|
||||||
}
|
}
|
||||||
|
|
||||||
// from FrameManager
|
@Override
|
||||||
protected Graphics2D createGraphics ()
|
protected Graphics2D createGraphics ()
|
||||||
{
|
{
|
||||||
return (Graphics2D)_bufstrat.getDrawGraphics();
|
return (Graphics2D)_bufstrat.getDrawGraphics();
|
||||||
}
|
}
|
||||||
|
|
||||||
// from FrameManager
|
@Override
|
||||||
protected void restoreFromBack (Rectangle dirty)
|
protected void restoreFromBack (Rectangle dirty)
|
||||||
{
|
{
|
||||||
// nothing doing
|
// nothing doing
|
||||||
|
|||||||
@@ -624,6 +624,7 @@ public abstract class FrameManager
|
|||||||
super("FrameManagerTicker");
|
super("FrameManagerTicker");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void run ()
|
public void run ()
|
||||||
{
|
{
|
||||||
log.info("Frame manager ticker running " +
|
log.info("Frame manager ticker running " +
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
package com.threerings.media;
|
package com.threerings.media;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
@@ -29,9 +28,6 @@ import java.awt.Shape;
|
|||||||
|
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
|
|
||||||
import com.samskivert.util.Interval;
|
|
||||||
import com.samskivert.util.ResultListener;
|
|
||||||
|
|
||||||
import com.threerings.media.image.Mirage;
|
import com.threerings.media.image.Mirage;
|
||||||
import com.threerings.media.util.MultiFrameImage;
|
import com.threerings.media.util.MultiFrameImage;
|
||||||
|
|
||||||
@@ -85,14 +81,14 @@ public class HourglassView extends TimerView
|
|||||||
_changeThreshold = 1.0f / _bounds.height;
|
_changeThreshold = 1.0f / _bounds.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void changeComplete (float complete)
|
public void changeComplete (float complete)
|
||||||
{
|
{
|
||||||
super.changeComplete(complete);
|
super.changeComplete(complete);
|
||||||
setSandTrickleY();
|
setSandTrickleY();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
// Let the parent handle its stuff
|
// Let the parent handle its stuff
|
||||||
@@ -111,7 +107,7 @@ public class HourglassView extends TimerView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx, float completed)
|
public void paint (Graphics2D gfx, float completed)
|
||||||
{
|
{
|
||||||
// Handle processing from parent class
|
// Handle processing from parent class
|
||||||
|
|||||||
@@ -24,10 +24,6 @@ package com.threerings.media;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Component;
|
|
||||||
import java.awt.Graphics;
|
|
||||||
|
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
|
|
||||||
|
|||||||
@@ -22,15 +22,8 @@
|
|||||||
package com.threerings.media;
|
package com.threerings.media;
|
||||||
|
|
||||||
import java.awt.Component;
|
import java.awt.Component;
|
||||||
import java.awt.Graphics;
|
|
||||||
import java.awt.Insets;
|
|
||||||
import java.awt.Rectangle;
|
|
||||||
import java.awt.Shape;
|
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
import javax.swing.JApplet;
|
import javax.swing.JApplet;
|
||||||
import javax.swing.RepaintManager;
|
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When using the {@link FrameManager} in an Applet, one must use this
|
* When using the {@link FrameManager} in an Applet, one must use this
|
||||||
|
|||||||
@@ -30,10 +30,6 @@ import java.awt.Window;
|
|||||||
|
|
||||||
import javax.swing.JFrame;
|
import javax.swing.JFrame;
|
||||||
|
|
||||||
import com.samskivert.util.StringUtil;
|
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When using the {@link FrameManager}, one must use this top-level frame
|
* When using the {@link FrameManager}, one must use this top-level frame
|
||||||
* class.
|
* class.
|
||||||
@@ -89,6 +85,7 @@ public class ManagedJFrame extends JFrame
|
|||||||
* We catch paint requests and forward them on to the repaint
|
* We catch paint requests and forward them on to the repaint
|
||||||
* infrastructure.
|
* infrastructure.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void paint (Graphics g)
|
public void paint (Graphics g)
|
||||||
{
|
{
|
||||||
update(g);
|
update(g);
|
||||||
@@ -98,6 +95,7 @@ public class ManagedJFrame extends JFrame
|
|||||||
* We catch update requests and forward them on to the repaint
|
* We catch update requests and forward them on to the repaint
|
||||||
* infrastructure.
|
* infrastructure.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void update (Graphics g)
|
public void update (Graphics g)
|
||||||
{
|
{
|
||||||
Shape clip = g.getClip();
|
Shape clip = g.getClip();
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
package com.threerings.media;
|
package com.threerings.media;
|
||||||
|
|
||||||
import java.awt.Component;
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|||||||
@@ -41,14 +41,11 @@ import java.util.ArrayList;
|
|||||||
import com.samskivert.swing.Controller;
|
import com.samskivert.swing.Controller;
|
||||||
import com.samskivert.swing.event.AncestorAdapter;
|
import com.samskivert.swing.event.AncestorAdapter;
|
||||||
import com.samskivert.swing.event.CommandEvent;
|
import com.samskivert.swing.event.CommandEvent;
|
||||||
import com.samskivert.util.StringUtil;
|
|
||||||
|
|
||||||
import com.threerings.media.timer.MediaTimer;
|
import com.threerings.media.timer.MediaTimer;
|
||||||
|
|
||||||
import com.threerings.media.animation.Animation;
|
import com.threerings.media.animation.Animation;
|
||||||
import com.threerings.media.animation.AnimationManager;
|
import com.threerings.media.animation.AnimationManager;
|
||||||
|
|
||||||
import com.threerings.media.sprite.ButtonSprite;
|
|
||||||
import com.threerings.media.sprite.Sprite;
|
import com.threerings.media.sprite.Sprite;
|
||||||
import com.threerings.media.sprite.SpriteManager;
|
import com.threerings.media.sprite.SpriteManager;
|
||||||
|
|
||||||
@@ -104,9 +101,11 @@ public class MediaPanel extends JComponent
|
|||||||
|
|
||||||
// participate in the frame when we're visible
|
// participate in the frame when we're visible
|
||||||
addAncestorListener(new AncestorAdapter() {
|
addAncestorListener(new AncestorAdapter() {
|
||||||
|
@Override
|
||||||
public void ancestorAdded (AncestorEvent event) {
|
public void ancestorAdded (AncestorEvent event) {
|
||||||
_metamgr.getFrameManager().registerFrameParticipant(MediaPanel.this);
|
_metamgr.getFrameManager().registerFrameParticipant(MediaPanel.this);
|
||||||
}
|
}
|
||||||
|
@Override
|
||||||
public void ancestorRemoved (AncestorEvent event) {
|
public void ancestorRemoved (AncestorEvent event) {
|
||||||
_metamgr.getFrameManager().removeFrameParticipant(MediaPanel.this);
|
_metamgr.getFrameManager().removeFrameParticipant(MediaPanel.this);
|
||||||
}
|
}
|
||||||
@@ -298,7 +297,7 @@ public class MediaPanel extends JComponent
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from JComponent
|
@Override
|
||||||
public void setOpaque (boolean opaque)
|
public void setOpaque (boolean opaque)
|
||||||
{
|
{
|
||||||
if (!opaque) {
|
if (!opaque) {
|
||||||
@@ -308,7 +307,7 @@ public class MediaPanel extends JComponent
|
|||||||
super.setOpaque(true);
|
super.setOpaque(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from JComponent
|
@Override
|
||||||
public void repaint (long tm, int x, int y, int width, int height)
|
public void repaint (long tm, int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
if (width > 0 && height > 0) {
|
if (width > 0 && height > 0) {
|
||||||
@@ -316,7 +315,7 @@ public class MediaPanel extends JComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from JComponent
|
@Override
|
||||||
public void paint (Graphics g)
|
public void paint (Graphics g)
|
||||||
{
|
{
|
||||||
Graphics2D gfx = (Graphics2D)g;
|
Graphics2D gfx = (Graphics2D)g;
|
||||||
@@ -567,7 +566,7 @@ public class MediaPanel extends JComponent
|
|||||||
/** Handles ActionSprite/HoverSprite/ArmingSprite manipulation. */
|
/** Handles ActionSprite/HoverSprite/ArmingSprite manipulation. */
|
||||||
protected class ActionSpriteHandler extends MouseInputAdapter
|
protected class ActionSpriteHandler extends MouseInputAdapter
|
||||||
{
|
{
|
||||||
// documentation inherited
|
@Override
|
||||||
public void mousePressed (MouseEvent me)
|
public void mousePressed (MouseEvent me)
|
||||||
{
|
{
|
||||||
if (_activeSprite == null) {
|
if (_activeSprite == null) {
|
||||||
@@ -583,7 +582,7 @@ public class MediaPanel extends JComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void mouseReleased (MouseEvent me)
|
public void mouseReleased (MouseEvent me)
|
||||||
{
|
{
|
||||||
if (_activeSprite instanceof ArmingSprite) {
|
if (_activeSprite instanceof ArmingSprite) {
|
||||||
@@ -616,7 +615,7 @@ public class MediaPanel extends JComponent
|
|||||||
mouseMoved(me);
|
mouseMoved(me);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void mouseDragged (MouseEvent me)
|
public void mouseDragged (MouseEvent me)
|
||||||
{
|
{
|
||||||
if (_activeSprite instanceof ArmingSprite) {
|
if (_activeSprite instanceof ArmingSprite) {
|
||||||
@@ -625,7 +624,7 @@ public class MediaPanel extends JComponent
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void mouseMoved (MouseEvent me)
|
public void mouseMoved (MouseEvent me)
|
||||||
{
|
{
|
||||||
Sprite s = getHit(me);
|
Sprite s = getHit(me);
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class SafeScrollPane extends JScrollPane
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public Dimension getPreferredSize ()
|
public Dimension getPreferredSize ()
|
||||||
{
|
{
|
||||||
Dimension d = super.getPreferredSize();
|
Dimension d = super.getPreferredSize();
|
||||||
@@ -66,9 +66,11 @@ public class SafeScrollPane extends JScrollPane
|
|||||||
return d;
|
return d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
protected JViewport createViewport ()
|
protected JViewport createViewport ()
|
||||||
{
|
{
|
||||||
JViewport vp = new JViewport() {
|
JViewport vp = new JViewport() {
|
||||||
|
@Override
|
||||||
public void setViewPosition (Point p) {
|
public void setViewPosition (Point p) {
|
||||||
super.setViewPosition(p);
|
super.setViewPosition(p);
|
||||||
// simple scroll mode results in setViewPosition causing
|
// simple scroll mode results in setViewPosition causing
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ package com.threerings.media;
|
|||||||
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Graphics;
|
import java.awt.Graphics;
|
||||||
import java.awt.Point;
|
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import java.awt.event.MouseWheelEvent;
|
import java.awt.event.MouseWheelEvent;
|
||||||
@@ -101,6 +100,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
* Returns the bounds of the viewport in virtual coordinates. The
|
* Returns the bounds of the viewport in virtual coordinates. The
|
||||||
* returned rectangle must <em>not</em> be modified.
|
* returned rectangle must <em>not</em> be modified.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Rectangle getViewBounds ()
|
public Rectangle getViewBounds ()
|
||||||
{
|
{
|
||||||
return _vbounds;
|
return _vbounds;
|
||||||
@@ -150,6 +150,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
* coordinates before they are dispatched to any of the mouse
|
* coordinates before they are dispatched to any of the mouse
|
||||||
* listeners.
|
* listeners.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void processMouseEvent (MouseEvent event)
|
protected void processMouseEvent (MouseEvent event)
|
||||||
{
|
{
|
||||||
event.translatePoint(_vbounds.x, _vbounds.y);
|
event.translatePoint(_vbounds.x, _vbounds.y);
|
||||||
@@ -161,6 +162,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
* coordinates before they are dispatched to any of the mouse
|
* coordinates before they are dispatched to any of the mouse
|
||||||
* listeners.
|
* listeners.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void processMouseMotionEvent (MouseEvent event)
|
protected void processMouseMotionEvent (MouseEvent event)
|
||||||
{
|
{
|
||||||
event.translatePoint(_vbounds.x, _vbounds.y);
|
event.translatePoint(_vbounds.x, _vbounds.y);
|
||||||
@@ -172,13 +174,14 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
* coordinates before they are dispatched to any of the mouse
|
* coordinates before they are dispatched to any of the mouse
|
||||||
* listeners.
|
* listeners.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
protected void processMouseWheelEvent (MouseWheelEvent event)
|
protected void processMouseWheelEvent (MouseWheelEvent event)
|
||||||
{
|
{
|
||||||
event.translatePoint(_vbounds.x, _vbounds.y);
|
event.translatePoint(_vbounds.x, _vbounds.y);
|
||||||
super.processMouseWheelEvent(event);
|
super.processMouseWheelEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void dirtyScreenRect (Rectangle rect)
|
protected void dirtyScreenRect (Rectangle rect)
|
||||||
{
|
{
|
||||||
// translate the screen rect into happy coordinates
|
// translate the screen rect into happy coordinates
|
||||||
@@ -186,7 +189,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
_metamgr.getRegionManager().addDirtyRegion(rect);
|
_metamgr.getRegionManager().addDirtyRegion(rect);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void doLayout ()
|
public void doLayout ()
|
||||||
{
|
{
|
||||||
super.doLayout();
|
super.doLayout();
|
||||||
@@ -196,7 +199,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
findRootBounds();
|
findRootBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void setBounds (int x, int y, int width, int height)
|
public void setBounds (int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
super.setBounds(x, y, width, height);
|
super.setBounds(x, y, width, height);
|
||||||
@@ -230,7 +233,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
FrameManager.getRoot(this, _abounds);
|
FrameManager.getRoot(this, _abounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void didTick (long tickStamp)
|
protected void didTick (long tickStamp)
|
||||||
{
|
{
|
||||||
super.didTick(tickStamp);
|
super.didTick(tickStamp);
|
||||||
@@ -356,7 +359,7 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
setViewLocation(nx, ny);
|
setViewLocation(nx, ny);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void paint (Graphics2D gfx, Rectangle[] dirty)
|
protected void paint (Graphics2D gfx, Rectangle[] dirty)
|
||||||
{
|
{
|
||||||
// if we're scrolling, go ahead and do the business
|
// if we're scrolling, go ahead and do the business
|
||||||
@@ -410,14 +413,14 @@ public class VirtualMediaPanel extends MediaPanel
|
|||||||
gfx.translate(_vbounds.x, _vbounds.y);
|
gfx.translate(_vbounds.x, _vbounds.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void constrainToBounds (Rectangle dirty)
|
protected void constrainToBounds (Rectangle dirty)
|
||||||
{
|
{
|
||||||
SwingUtilities.computeIntersection(
|
SwingUtilities.computeIntersection(
|
||||||
_vbounds.x, _vbounds.y, getWidth(), getHeight(), dirty);
|
_vbounds.x, _vbounds.y, getWidth(), getHeight(), dirty);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void paintBehind (Graphics2D gfx, Rectangle dirtyRect)
|
protected void paintBehind (Graphics2D gfx, Rectangle dirtyRect)
|
||||||
{
|
{
|
||||||
// if we have a background image specified, tile it!
|
// if we have a background image specified, tile it!
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ public abstract class Animation extends AbstractMedia
|
|||||||
_finished = false;
|
_finished = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void setLocation (int x, int y)
|
public void setLocation (int x, int y)
|
||||||
{
|
{
|
||||||
if (_bounds.x == x && _bounds.y == y) {
|
if (_bounds.x == x && _bounds.y == y) {
|
||||||
@@ -79,7 +79,7 @@ public abstract class Animation extends AbstractMedia
|
|||||||
invalidateAfterChange(obounds);
|
invalidateAfterChange(obounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void willStart (long tickStamp)
|
protected void willStart (long tickStamp)
|
||||||
{
|
{
|
||||||
super.willStart(tickStamp);
|
super.willStart(tickStamp);
|
||||||
|
|||||||
@@ -59,6 +59,7 @@ public class AnimationArranger
|
|||||||
|
|
||||||
/** Automatically removes avoid animations when they're done. */
|
/** Automatically removes avoid animations when they're done. */
|
||||||
protected AnimationAdapter _avoidAnimObs = new AnimationAdapter() {
|
protected AnimationAdapter _avoidAnimObs = new AnimationAdapter() {
|
||||||
|
@Override
|
||||||
public void animationCompleted (Animation anim, long when) {
|
public void animationCompleted (Animation anim, long when) {
|
||||||
if (!_avoidAnims.remove(anim)) {
|
if (!_avoidAnims.remove(anim)) {
|
||||||
log.warning("Couldn't remove avoid animation?! " + anim + ".");
|
log.warning("Couldn't remove avoid animation?! " + anim + ".");
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ import com.samskivert.util.SortableArrayList;
|
|||||||
|
|
||||||
import com.threerings.media.AbstractMedia;
|
import com.threerings.media.AbstractMedia;
|
||||||
import com.threerings.media.AbstractMediaManager;
|
import com.threerings.media.AbstractMediaManager;
|
||||||
import com.threerings.media.MediaHost;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Manages a collection of animations, ticking them when the animation manager itself is ticked and
|
* Manages a collection of animations, ticking them when the animation manager itself is ticked and
|
||||||
@@ -51,7 +50,7 @@ public class AnimationManager extends AbstractMediaManager
|
|||||||
removeMedia(anim);
|
removeMedia(anim);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from AbstractMediaManager
|
@Override
|
||||||
protected void tickAllMedia (long tickStamp)
|
protected void tickAllMedia (long tickStamp)
|
||||||
{
|
{
|
||||||
super.tickAllMedia(tickStamp);
|
super.tickAllMedia(tickStamp);
|
||||||
@@ -70,7 +69,7 @@ public class AnimationManager extends AbstractMediaManager
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // from AbstractMediaManager
|
@Override
|
||||||
protected SortableArrayList<? extends AbstractMedia> createMediaList ()
|
protected SortableArrayList<? extends AbstractMedia> createMediaList ()
|
||||||
{
|
{
|
||||||
return (_anims = new SortableArrayList<Animation>());
|
return (_anims = new SortableArrayList<Animation>());
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ public class AnimationSequencer extends Animation
|
|||||||
_lastStamp = 0;
|
_lastStamp = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
if (_lastStamp == 0) {
|
if (_lastStamp == 0) {
|
||||||
@@ -148,19 +148,19 @@ public class AnimationSequencer extends Animation
|
|||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
// don't care
|
// don't care
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
_lastStamp += timeDelta;
|
_lastStamp += timeDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void viewLocationDidChange (int dx, int dy)
|
public void viewLocationDidChange (int dx, int dy)
|
||||||
{
|
{
|
||||||
super.viewLocationDidChange(dx, dy);
|
super.viewLocationDidChange(dx, dy);
|
||||||
@@ -259,11 +259,13 @@ public class AnimationSequencer extends Animation
|
|||||||
tick(when);
|
tick(when);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void animationCompleted (Animation anim, long when)
|
public void animationCompleted (Animation anim, long when)
|
||||||
{
|
{
|
||||||
fireCompletion(when);
|
fireCompletion(when);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[anim=" + StringUtil.shortClassName(_anim) +
|
return "[anim=" + StringUtil.shortClassName(_anim) +
|
||||||
|
|||||||
@@ -24,12 +24,9 @@ package com.threerings.media.animation;
|
|||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
import com.threerings.media.AbstractMediaManager;
|
|
||||||
import com.threerings.media.MediaPanel;
|
import com.threerings.media.MediaPanel;
|
||||||
import com.threerings.media.sprite.Sprite;
|
import com.threerings.media.sprite.Sprite;
|
||||||
import com.threerings.media.animation.Animation;
|
import com.threerings.media.animation.Animation;
|
||||||
import com.threerings.media.animation.AnimationAdapter;
|
|
||||||
import com.threerings.media.animation.AnimationObserver;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A Sprite that wraps an animation so that a sequence of frames can be easily
|
* A Sprite that wraps an animation so that a sequence of frames can be easily
|
||||||
@@ -47,12 +44,13 @@ public class AnimationSprite extends Sprite
|
|||||||
_owner = owner;
|
_owner = owner;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init ()
|
public void init ()
|
||||||
{
|
{
|
||||||
_anim.init(_mgr);
|
_anim.init(_mgr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
super.tick(tickStamp);
|
super.tick(tickStamp);
|
||||||
@@ -67,21 +65,21 @@ public class AnimationSprite extends Sprite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited.
|
@Override
|
||||||
public void setLocation (int x, int y)
|
public void setLocation (int x, int y)
|
||||||
{
|
{
|
||||||
_anim.setLocation(x - _oxoff, y - _oyoff);
|
_anim.setLocation(x - _oxoff, y - _oyoff);
|
||||||
super.setLocation(x, y);
|
super.setLocation(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void willStart (long tickStamp)
|
public void willStart (long tickStamp)
|
||||||
{
|
{
|
||||||
super.willStart(tickStamp);
|
super.willStart(tickStamp);
|
||||||
_anim.willStart(tickStamp);
|
_anim.willStart(tickStamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx) {
|
public void paint (Graphics2D gfx) {
|
||||||
// Nothing to paint for ourselves.
|
// Nothing to paint for ourselves.
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class BlankAnimation extends Animation
|
|||||||
_duration = duration;
|
_duration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
if (_start == 0) {
|
if (_start == 0) {
|
||||||
@@ -49,7 +49,7 @@ public class BlankAnimation extends Animation
|
|||||||
_finished = (timestamp - _start >= _duration);
|
_finished = (timestamp - _start >= _duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
if (_start > 0) {
|
if (_start > 0) {
|
||||||
@@ -57,7 +57,7 @@ public class BlankAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
// nothing doing
|
// nothing doing
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public class BlendAnimation extends Animation
|
|||||||
_tfunc = new LinearTimeFunction(0, 100 * fades, delay * fades);
|
_tfunc = new LinearTimeFunction(0, 100 * fades, delay * fades);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
// check to see if our blend level has changed
|
// check to see if our blend level has changed
|
||||||
@@ -64,13 +64,13 @@ public class BlendAnimation extends Animation
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
_tfunc.fastForward(timeDelta);
|
_tfunc.fastForward(timeDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
int index = _level / 100;
|
int index = _level / 100;
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class BobbleAnimation extends Animation
|
|||||||
_duration = duration;
|
_duration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
// grab our ending time on our first tick
|
// grab our ending time on our first tick
|
||||||
@@ -78,19 +78,19 @@ public class BobbleAnimation extends Animation
|
|||||||
_y = _sy + dy * ((RandomUtil.getInt(2) == 0) ? -1 : 1);
|
_y = _sy + dy * ((RandomUtil.getInt(2) == 0) ? -1 : 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
_end += timeDelta;
|
_end += timeDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
_image.paint(gfx, _x, _y);
|
_image.paint(gfx, _x, _y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class ExplodeAnimation extends Animation
|
|||||||
* should continue until all pieces are outside the bounds. */
|
* should continue until all pieces are outside the bounds. */
|
||||||
public long delay;
|
public long delay;
|
||||||
|
|
||||||
/** Returns a string representation of this instance. */
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return StringUtil.fieldsToString(this);
|
return StringUtil.fieldsToString(this);
|
||||||
@@ -156,7 +156,7 @@ public class ExplodeAnimation extends Animation
|
|||||||
_angle = 0.0f;
|
_angle = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
if (_start > 0) {
|
if (_start > 0) {
|
||||||
@@ -165,7 +165,7 @@ public class ExplodeAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
if (_start == 0) {
|
if (_start == 0) {
|
||||||
@@ -218,7 +218,7 @@ public class ExplodeAnimation extends Animation
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
Shape oclip = gfx.getClip();
|
Shape oclip = gfx.getClip();
|
||||||
@@ -270,7 +270,7 @@ public class ExplodeAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -21,15 +21,11 @@
|
|||||||
|
|
||||||
package com.threerings.media.animation;
|
package com.threerings.media.animation;
|
||||||
|
|
||||||
import java.awt.AlphaComposite;
|
|
||||||
import java.awt.Composite;
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
|
|
||||||
import com.threerings.media.effects.FadeEffect;
|
import com.threerings.media.effects.FadeEffect;
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An animation that displays an image fading from one alpha level to
|
* An animation that displays an image fading from one alpha level to
|
||||||
* another in specified increments over time. The animation is finished
|
* another in specified increments over time. The animation is finished
|
||||||
@@ -52,7 +48,7 @@ public abstract class FadeAnimation extends Animation
|
|||||||
_effect = new FadeEffect(alpha, step, target);
|
_effect = new FadeEffect(alpha, step, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
if (_effect.tick(timestamp)) {
|
if (_effect.tick(timestamp)) {
|
||||||
@@ -61,7 +57,7 @@ public abstract class FadeAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
_effect.beforePaint(gfx);
|
_effect.beforePaint(gfx);
|
||||||
@@ -69,7 +65,7 @@ public abstract class FadeAnimation extends Animation
|
|||||||
_effect.afterPaint(gfx);
|
_effect.afterPaint(gfx);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void willStart (long tickStamp)
|
protected void willStart (long tickStamp)
|
||||||
{
|
{
|
||||||
super.willStart(tickStamp);
|
super.willStart(tickStamp);
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class FadeImageAnimation extends FadeAnimation
|
|||||||
_image = image;
|
_image = image;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void paintAnimation (Graphics2D gfx)
|
protected void paintAnimation (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
_image.paint(gfx, _bounds.x, _bounds.y);
|
_image.paint(gfx, _bounds.x, _bounds.y);
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ import java.awt.RenderingHints;
|
|||||||
import com.samskivert.swing.Label;
|
import com.samskivert.swing.Label;
|
||||||
import com.samskivert.swing.util.SwingUtil;
|
import com.samskivert.swing.util.SwingUtil;
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Does something extraordinary.
|
* Does something extraordinary.
|
||||||
*/
|
*/
|
||||||
@@ -54,7 +52,7 @@ public class FadeLabelAnimation extends FadeAnimation
|
|||||||
_antiAliased = antiAliased;
|
_antiAliased = antiAliased;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void init ()
|
protected void init ()
|
||||||
{
|
{
|
||||||
super.init();
|
super.init();
|
||||||
@@ -78,7 +76,7 @@ public class FadeLabelAnimation extends FadeAnimation
|
|||||||
_bounds.height = size.height;
|
_bounds.height = size.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void paintAnimation (Graphics2D gfx)
|
protected void paintAnimation (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
Object ohints = null;
|
Object ohints = null;
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ public class FloatingTextAnimation extends Animation
|
|||||||
return _label;
|
return _label;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void setLocation (int x, int y)
|
public void setLocation (int x, int y)
|
||||||
{
|
{
|
||||||
super.setLocation(x, y);
|
super.setLocation(x, y);
|
||||||
@@ -119,7 +119,7 @@ public class FloatingTextAnimation extends Animation
|
|||||||
_floatPeriod = floatPeriod;
|
_floatPeriod = floatPeriod;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
boolean invalid = false;
|
boolean invalid = false;
|
||||||
@@ -172,7 +172,7 @@ public class FloatingTextAnimation extends Animation
|
|||||||
_finished = (msecs >= _floatPeriod);
|
_finished = (msecs >= _floatPeriod);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
if (_start > 0) {
|
if (_start > 0) {
|
||||||
@@ -180,7 +180,7 @@ public class FloatingTextAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
Composite ocomp = gfx.getComposite();
|
Composite ocomp = gfx.getComposite();
|
||||||
@@ -203,7 +203,7 @@ public class FloatingTextAnimation extends Animation
|
|||||||
_label.render(gfx, x, y);
|
_label.render(gfx, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -64,17 +64,14 @@ public class MultiFrameAnimation extends Animation
|
|||||||
reset();
|
reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public Rectangle getBounds ()
|
public Rectangle getBounds ()
|
||||||
{
|
{
|
||||||
// fill in the bounds with our current animation frame's bounds
|
// fill in the bounds with our current animation frame's bounds
|
||||||
return _bounds;
|
return _bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* If this animation has run to completion, it can be reset to prepare
|
|
||||||
* it for another go.
|
|
||||||
*/
|
|
||||||
public void reset ()
|
public void reset ()
|
||||||
{
|
{
|
||||||
super.reset();
|
super.reset();
|
||||||
@@ -90,7 +87,7 @@ public class MultiFrameAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
int fidx = _seeker.tick(tickStamp);
|
int fidx = _seeker.tick(tickStamp);
|
||||||
@@ -119,13 +116,13 @@ public class MultiFrameAnimation extends Animation
|
|||||||
_bounds.height = _frames.getHeight(_fidx);
|
_bounds.height = _frames.getHeight(_fidx);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
_frames.paintFrame(gfx, _fidx, _bounds.x, _bounds.y);
|
_frames.paintFrame(gfx, _fidx, _bounds.x, _bounds.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
_seeker.fastForward(timeDelta);
|
_seeker.fastForward(timeDelta);
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ public class RainAnimation extends Animation
|
|||||||
_duration = duration;
|
_duration = duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
// grab our ending time on our first tick
|
// grab our ending time on our first tick
|
||||||
@@ -96,13 +96,13 @@ public class RainAnimation extends Animation
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
_end += timeDelta;
|
_end += timeDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
gfx.setColor(Color.white);
|
gfx.setColor(Color.white);
|
||||||
|
|||||||
@@ -21,21 +21,13 @@
|
|||||||
|
|
||||||
package com.threerings.media.animation;
|
package com.threerings.media.animation;
|
||||||
|
|
||||||
import java.awt.AlphaComposite;
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.Composite;
|
|
||||||
import java.awt.Image;
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
import java.awt.RenderingHints;
|
import java.awt.RenderingHints;
|
||||||
import java.awt.Transparency;
|
|
||||||
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
import com.threerings.media.image.Mirage;
|
import com.threerings.media.image.Mirage;
|
||||||
import com.threerings.media.sprite.Sprite;
|
|
||||||
import com.threerings.media.sprite.SpriteManager;
|
|
||||||
import com.threerings.media.util.LinearTimeFunction;
|
import com.threerings.media.util.LinearTimeFunction;
|
||||||
import com.threerings.media.util.TimeFunction;
|
import com.threerings.media.util.TimeFunction;
|
||||||
|
|
||||||
@@ -100,10 +92,7 @@ public class ScaleAnimation extends Animation
|
|||||||
return new Rectangle(corner.x, corner.y, size.x, size.y);
|
return new Rectangle(corner.x, corner.y, size.x, size.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Compute the bounds to use to render the animation's image
|
|
||||||
* right now.
|
|
||||||
*/
|
|
||||||
public Rectangle getBounds ()
|
public Rectangle getBounds ()
|
||||||
{
|
{
|
||||||
return getBounds(_scale, _center, _image);
|
return getBounds(_scale, _center, _image);
|
||||||
@@ -126,7 +115,7 @@ public class ScaleAnimation extends Animation
|
|||||||
return new Point(center.x - size.x/2, center.y - size.y/2);
|
return new Point(center.x - size.x/2, center.y - size.y/2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
// Compute the new scaling value
|
// Compute the new scaling value
|
||||||
@@ -147,13 +136,13 @@ public class ScaleAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
_scaleFunc.fastForward(timeDelta);
|
_scaleFunc.fastForward(timeDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
// Compute the bounding box to render this image
|
// Compute the bounding box to render this image
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ import com.samskivert.util.RandomUtil;
|
|||||||
import com.threerings.media.animation.Animation;
|
import com.threerings.media.animation.Animation;
|
||||||
import com.threerings.media.image.Mirage;
|
import com.threerings.media.image.Mirage;
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays a set of spark images originating from a specified position
|
* Displays a set of spark images originating from a specified position
|
||||||
* and flying outward in random directions, fading out as they go, for a
|
* and flying outward in random directions, fading out as they go, for a
|
||||||
@@ -126,20 +124,20 @@ public class SparkAnimation extends Animation
|
|||||||
return (RandomUtil.getInt(2) == 0) ? -1 : 1;
|
return (RandomUtil.getInt(2) == 0) ? -1 : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void willStart (long stamp)
|
protected void willStart (long stamp)
|
||||||
{
|
{
|
||||||
super.willStart(stamp);
|
super.willStart(stamp);
|
||||||
_start = stamp;
|
_start = stamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
_start += timeDelta;
|
_start += timeDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
// figure out the distance the chunks have travelled
|
// figure out the distance the chunks have travelled
|
||||||
@@ -184,7 +182,7 @@ public class SparkAnimation extends Animation
|
|||||||
invalidate();
|
invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
Shape oclip = gfx.getClip();
|
Shape oclip = gfx.getClip();
|
||||||
@@ -206,7 +204,7 @@ public class SparkAnimation extends Animation
|
|||||||
gfx.setClip(oclip);
|
gfx.setClip(oclip);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -50,10 +50,7 @@ public class SpriteAnimation extends Animation
|
|||||||
_sprite.addSpriteObserver(this);
|
_sprite.addSpriteObserver(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Derived classes can override tick if they want to end the animation
|
|
||||||
* in some other way than the sprite completing a path.
|
|
||||||
*/
|
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
// start the sprite moving on its path on our first tick
|
// start the sprite moving on its path on our first tick
|
||||||
@@ -64,7 +61,7 @@ public class SpriteAnimation extends Animation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
// nothing for now
|
// nothing for now
|
||||||
@@ -82,7 +79,7 @@ public class SpriteAnimation extends Animation
|
|||||||
_finished = true;
|
_finished = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void didFinish (long tickStamp)
|
protected void didFinish (long tickStamp)
|
||||||
{
|
{
|
||||||
super.didFinish(tickStamp);
|
super.didFinish(tickStamp);
|
||||||
|
|||||||
@@ -48,13 +48,13 @@ public class BackedVolatileMirage extends VolatileMirage
|
|||||||
createVolatileImage();
|
createVolatileImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected int getTransparency ()
|
protected int getTransparency ()
|
||||||
{
|
{
|
||||||
return _source.getColorModel().getTransparency();
|
return _source.getColorModel().getTransparency();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void refreshVolatileImage ()
|
protected void refreshVolatileImage ()
|
||||||
{
|
{
|
||||||
Graphics gfx = null;
|
Graphics gfx = null;
|
||||||
@@ -70,7 +70,7 @@ public class BackedVolatileMirage extends VolatileMirage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class CachedVolatileMirage extends VolatileMirage
|
|||||||
createVolatileImage();
|
createVolatileImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected int getTransparency ()
|
protected int getTransparency ()
|
||||||
{
|
{
|
||||||
BufferedImage source = _imgr.getImage(_source, _zations);
|
BufferedImage source = _imgr.getImage(_source, _zations);
|
||||||
@@ -64,7 +64,7 @@ public class CachedVolatileMirage extends VolatileMirage
|
|||||||
source.getColorModel().getTransparency();
|
source.getColorModel().getTransparency();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void refreshVolatileImage ()
|
protected void refreshVolatileImage ()
|
||||||
{
|
{
|
||||||
Graphics gfx = null;
|
Graphics gfx = null;
|
||||||
@@ -89,7 +89,7 @@ public class CachedVolatileMirage extends VolatileMirage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -164,9 +164,7 @@ public class ColorPository implements Serializable
|
|||||||
return (ColorRecord) colors.get(defaultId);
|
return (ColorRecord) colors.get(defaultId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns a string representation of this instance.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[id=" + classId + ", name=" + name + ", source=#" +
|
return "[id=" + classId + ", name=" + name + ", source=#" +
|
||||||
@@ -232,9 +230,7 @@ public class ColorPository implements Serializable
|
|||||||
cclass.range, offsets);
|
cclass.range, offsets);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns a string representation of this instance.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[id=" + colorId + ", name=" + name +
|
return "[id=" + colorId + ", name=" + name +
|
||||||
|
|||||||
@@ -118,15 +118,13 @@ public class Colorization
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public int hashCode ()
|
public int hashCode ()
|
||||||
{
|
{
|
||||||
return colorizationId ^ rootColor.hashCode();
|
return colorizationId ^ rootColor.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Compares this colorization to another based on id.
|
|
||||||
*/
|
|
||||||
public boolean equals (Object other)
|
public boolean equals (Object other)
|
||||||
{
|
{
|
||||||
if (other instanceof Colorization) {
|
if (other instanceof Colorization) {
|
||||||
@@ -136,9 +134,7 @@ public class Colorization
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns a string representation of this colorization.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return String.valueOf(colorizationId);
|
return String.valueOf(colorizationId);
|
||||||
|
|||||||
@@ -47,11 +47,13 @@ public class ImageManager
|
|||||||
this.path = path;
|
this.path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode ()
|
public int hashCode ()
|
||||||
{
|
{
|
||||||
return path.hashCode() ^ daprov.getIdent().hashCode();
|
return path.hashCode() ^ daprov.getIdent().hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals (Object other)
|
public boolean equals (Object other)
|
||||||
{
|
{
|
||||||
if (other == null || !(other instanceof ImageKey)) {
|
if (other == null || !(other instanceof ImageKey)) {
|
||||||
@@ -63,6 +65,7 @@ public class ImageManager
|
|||||||
(okey.path.equals(path)));
|
(okey.path.equals(path)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return daprov.getIdent() + ":" + path;
|
return daprov.getIdent() + ":" + path;
|
||||||
@@ -495,6 +498,7 @@ public class ImageManager
|
|||||||
return usage;
|
return usage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[key=" + _key + ", wid=" + _source.getWidth() + ", hei=" + _source.getHeight() +
|
return "[key=" + _key + ", wid=" + _source.getWidth() + ", hei=" + _source.getHeight() +
|
||||||
|
|||||||
@@ -754,6 +754,7 @@ public class Quantize {
|
|||||||
SQUARES[((color >> 0) & 0xFF) - b + MAX_RGB]);
|
SQUARES[((color >> 0) & 0xFF) - b + MAX_RGB]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
if (parent == this) {
|
if (parent == this) {
|
||||||
|
|||||||
@@ -21,7 +21,6 @@
|
|||||||
|
|
||||||
package com.threerings.media.image;
|
package com.threerings.media.image;
|
||||||
|
|
||||||
import java.awt.Dimension;
|
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Point;
|
import java.awt.Point;
|
||||||
import java.awt.Rectangle;
|
import java.awt.Rectangle;
|
||||||
@@ -29,8 +28,6 @@ import java.awt.geom.AffineTransform;
|
|||||||
import java.awt.geom.NoninvertibleTransformException;
|
import java.awt.geom.NoninvertibleTransformException;
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Draws a mirage combined with an arbitrary AffineTransform.
|
* Draws a mirage combined with an arbitrary AffineTransform.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -167,9 +167,7 @@ public abstract class VolatileMirage implements Mirage
|
|||||||
*/
|
*/
|
||||||
protected abstract void refreshVolatileImage ();
|
protected abstract void refreshVolatileImage ();
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Generates a string representation of this instance.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder("[");
|
StringBuilder buf = new StringBuilder("[");
|
||||||
|
|||||||
@@ -40,13 +40,13 @@ import com.threerings.media.image.ColorPository;
|
|||||||
*/
|
*/
|
||||||
public class ColorPositoryParser extends CompiledConfigParser
|
public class ColorPositoryParser extends CompiledConfigParser
|
||||||
{
|
{
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Serializable createConfigObject ()
|
protected Serializable createConfigObject ()
|
||||||
{
|
{
|
||||||
return new ColorPository();
|
return new ColorPository();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void addRules (Digester digest)
|
protected void addRules (Digester digest)
|
||||||
{
|
{
|
||||||
// create and configure class record instances
|
// create and configure class record instances
|
||||||
@@ -58,6 +58,7 @@ public class ColorPositoryParser extends CompiledConfigParser
|
|||||||
// create and configure color record instances
|
// create and configure color record instances
|
||||||
prefix += "/color";
|
prefix += "/color";
|
||||||
digest.addRule(prefix, new Rule() {
|
digest.addRule(prefix, new Rule() {
|
||||||
|
@Override
|
||||||
public void begin (String namespace, String name,
|
public void begin (String namespace, String name,
|
||||||
Attributes attributes) throws Exception {
|
Attributes attributes) throws Exception {
|
||||||
// we want to inherit settings from the color class when
|
// we want to inherit settings from the color class when
|
||||||
@@ -68,6 +69,7 @@ public class ColorPositoryParser extends CompiledConfigParser
|
|||||||
digester.push(record);
|
digester.push(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void end (String namespace, String name) throws Exception {
|
public void end (String namespace, String name) throws Exception {
|
||||||
digester.pop();
|
digester.pop();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import static com.threerings.media.Log.log;
|
|||||||
*/
|
*/
|
||||||
public class Mp3Player extends MusicPlayer
|
public class Mp3Player extends MusicPlayer
|
||||||
{
|
{
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public void init ()
|
public void init ()
|
||||||
{
|
{
|
||||||
// TODO: some stuff needs to move here, like setting up the line
|
// TODO: some stuff needs to move here, like setting up the line
|
||||||
@@ -51,18 +51,19 @@ public class Mp3Player extends MusicPlayer
|
|||||||
// out (the format might always be known..).
|
// out (the format might always be known..).
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public void shutdown ()
|
public void shutdown ()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public void start (final InputStream stream)
|
public void start (final InputStream stream)
|
||||||
throws Exception
|
throws Exception
|
||||||
{
|
{
|
||||||
// TODO: some stuff needs to come out of here and into init/shutdown
|
// TODO: some stuff needs to come out of here and into init/shutdown
|
||||||
// but we'll deal with all that later, d00d.
|
// but we'll deal with all that later, d00d.
|
||||||
_player = new Thread("narya mp3 relay") {
|
_player = new Thread("narya mp3 relay") {
|
||||||
|
@Override
|
||||||
public void run () {
|
public void run () {
|
||||||
AudioInputStream inStream = null;
|
AudioInputStream inStream = null;
|
||||||
try {
|
try {
|
||||||
@@ -119,13 +120,13 @@ public class Mp3Player extends MusicPlayer
|
|||||||
_player.start();
|
_player.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public void stop ()
|
public void stop ()
|
||||||
{
|
{
|
||||||
_player = null;
|
_player = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public void setVolume (float volume)
|
public void setVolume (float volume)
|
||||||
{
|
{
|
||||||
// TODO : line won't be null when we initialize it in the right place
|
// TODO : line won't be null when we initialize it in the right place
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public class SoundManager
|
|||||||
_strname = strname;
|
_strname = strname;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return _strname;
|
return _strname;
|
||||||
@@ -343,6 +343,7 @@ public class SoundManager
|
|||||||
final SoundKey skey = new SoundKey(PLAY, pkgPath, key, delay, _clipVol, pan);
|
final SoundKey skey = new SoundKey(PLAY, pkgPath, key, delay, _clipVol, pan);
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
new Interval() {
|
new Interval() {
|
||||||
|
@Override
|
||||||
public void expired () {
|
public void expired () {
|
||||||
addToPlayQueue(skey);
|
addToPlayQueue(skey);
|
||||||
}
|
}
|
||||||
@@ -420,6 +421,7 @@ public class SoundManager
|
|||||||
// and if we need a new thread, add it
|
// and if we need a new thread, add it
|
||||||
if (add) {
|
if (add) {
|
||||||
Thread spooler = new Thread("narya SoundManager line spooler") {
|
Thread spooler = new Thread("narya SoundManager line spooler") {
|
||||||
|
@Override
|
||||||
public void run () {
|
public void run () {
|
||||||
spoolerRun();
|
spoolerRun();
|
||||||
}
|
}
|
||||||
@@ -993,19 +995,19 @@ public class SoundManager
|
|||||||
return (stamp + MAX_SOUND_DELAY < System.currentTimeMillis());
|
return (stamp + MAX_SOUND_DELAY < System.currentTimeMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "SoundKey{cmd=" + cmd + ", pkgPath=" + pkgPath + ", key=" + key + "}";
|
return "SoundKey{cmd=" + cmd + ", pkgPath=" + pkgPath + ", key=" + key + "}";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public int hashCode ()
|
public int hashCode ()
|
||||||
{
|
{
|
||||||
return pkgPath.hashCode() ^ key.hashCode();
|
return pkgPath.hashCode() ^ key.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public boolean equals (Object o)
|
public boolean equals (Object o)
|
||||||
{
|
{
|
||||||
if (o instanceof SoundKey) {
|
if (o instanceof SoundKey) {
|
||||||
|
|||||||
@@ -24,8 +24,6 @@ package com.threerings.media.sprite;
|
|||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.awt.Dimension;
|
import java.awt.Dimension;
|
||||||
import java.awt.Graphics2D;
|
import java.awt.Graphics2D;
|
||||||
import java.awt.Shape;
|
|
||||||
|
|
||||||
import com.samskivert.swing.Label;
|
import com.samskivert.swing.Label;
|
||||||
import com.samskivert.swing.util.SwingUtil;
|
import com.samskivert.swing.util.SwingUtil;
|
||||||
|
|
||||||
@@ -247,7 +245,7 @@ public class ButtonSprite extends Sprite
|
|||||||
return _pressed;
|
return _pressed;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void init ()
|
protected void init ()
|
||||||
{
|
{
|
||||||
super.init();
|
super.init();
|
||||||
@@ -267,7 +265,7 @@ public class ButtonSprite extends Sprite
|
|||||||
updateBounds();
|
updateBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
Color baseTextColor = _label.getTextColor(),
|
Color baseTextColor = _label.getTextColor(),
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class FadableImageSprite extends OrientableImageSprite
|
|||||||
_fadeInDuration = _fadeOutDuration = (long)(pathDuration * fadePortion);
|
_fadeInDuration = _fadeOutDuration = (long)(pathDuration * fadePortion);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Documentation inherited.
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
super.tick(tickStamp);
|
super.tick(tickStamp);
|
||||||
@@ -158,7 +158,7 @@ public class FadableImageSprite extends OrientableImageSprite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Documentation inherited.
|
@Override
|
||||||
public void pathCompleted (long timestamp)
|
public void pathCompleted (long timestamp)
|
||||||
{
|
{
|
||||||
super.pathCompleted(timestamp);
|
super.pathCompleted(timestamp);
|
||||||
@@ -183,7 +183,7 @@ public class FadableImageSprite extends OrientableImageSprite
|
|||||||
_fadeOutDuration = -1;
|
_fadeOutDuration = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Documentation inherited.
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
if (_alphaComposite.getAlpha() < 1.0f) {
|
if (_alphaComposite.getAlpha() < 1.0f) {
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class ImageSprite extends Sprite
|
|||||||
this(new SingleFrameImageImpl(image));
|
this(new SingleFrameImageImpl(image));
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void init ()
|
protected void init ()
|
||||||
{
|
{
|
||||||
super.init();
|
super.init();
|
||||||
@@ -104,6 +104,7 @@ public class ImageSprite extends Sprite
|
|||||||
* and if there is a non-transparent pixel in the sprite's image at
|
* and if there is a non-transparent pixel in the sprite's image at
|
||||||
* the specified point, false if not.
|
* the specified point, false if not.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public boolean hitTest (int x, int y)
|
public boolean hitTest (int x, int y)
|
||||||
{
|
{
|
||||||
// first check to see that we're in the sprite's bounds and that
|
// first check to see that we're in the sprite's bounds and that
|
||||||
@@ -239,7 +240,7 @@ public class ImageSprite extends Sprite
|
|||||||
_bounds.height = height;
|
_bounds.height = height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
if (_frames != null) {
|
if (_frames != null) {
|
||||||
@@ -258,7 +259,7 @@ public class ImageSprite extends Sprite
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long timestamp)
|
public void tick (long timestamp)
|
||||||
{
|
{
|
||||||
// if we have no frames, we're hosulated (to use a Greenwell term)
|
// if we have no frames, we're hosulated (to use a Greenwell term)
|
||||||
@@ -303,7 +304,7 @@ public class ImageSprite extends Sprite
|
|||||||
setFrameIndex(nfidx, false);
|
setFrameIndex(nfidx, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ public class LabelSprite extends Sprite
|
|||||||
_bounds.height = size.height;
|
_bounds.height = size.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void init ()
|
protected void init ()
|
||||||
{
|
{
|
||||||
super.init();
|
super.init();
|
||||||
@@ -84,7 +84,7 @@ public class LabelSprite extends Sprite
|
|||||||
updateBounds();
|
updateBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
_label.render(gfx, _bounds.x, _bounds.y);
|
_label.render(gfx, _bounds.x, _bounds.y);
|
||||||
|
|||||||
@@ -27,8 +27,6 @@ import java.awt.Rectangle;
|
|||||||
import java.awt.geom.AffineTransform;
|
import java.awt.geom.AffineTransform;
|
||||||
import java.awt.geom.Area;
|
import java.awt.geom.Area;
|
||||||
|
|
||||||
import java.awt.image.*;
|
|
||||||
|
|
||||||
import com.threerings.media.image.Mirage;
|
import com.threerings.media.image.Mirage;
|
||||||
|
|
||||||
import com.threerings.media.util.MultiFrameImage;
|
import com.threerings.media.util.MultiFrameImage;
|
||||||
@@ -149,7 +147,7 @@ public class OrientableImageSprite extends ImageSprite
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Documentation inherited.
|
@Override
|
||||||
protected void accomodateFrame (int frameIdx, int width, int height)
|
protected void accomodateFrame (int frameIdx, int width, int height)
|
||||||
{
|
{
|
||||||
Area area = new Area(
|
Area area = new Area(
|
||||||
@@ -166,7 +164,7 @@ public class OrientableImageSprite extends ImageSprite
|
|||||||
_bounds = area.getBounds();
|
_bounds = area.getBounds();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Documentation inherited.
|
@Override
|
||||||
public void setOrientation (int orient)
|
public void setOrientation (int orient)
|
||||||
{
|
{
|
||||||
super.setOrientation(orient);
|
super.setOrientation(orient);
|
||||||
@@ -174,7 +172,7 @@ public class OrientableImageSprite extends ImageSprite
|
|||||||
layout();
|
layout();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Documentation inherited.
|
@Override
|
||||||
public void paint (Graphics2D graphics)
|
public void paint (Graphics2D graphics)
|
||||||
{
|
{
|
||||||
AffineTransform at = graphics.getTransform();
|
AffineTransform at = graphics.getTransform();
|
||||||
|
|||||||
@@ -32,8 +32,6 @@ import com.threerings.media.AbstractMedia;
|
|||||||
import com.threerings.media.util.Path;
|
import com.threerings.media.util.Path;
|
||||||
import com.threerings.media.util.Pathable;
|
import com.threerings.media.util.Pathable;
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The sprite class represents a single moveable object in an animated
|
* The sprite class represents a single moveable object in an animated
|
||||||
* view. A sprite has a position and orientation within the view, and can
|
* view. A sprite has a position and orientation within the view, and can
|
||||||
@@ -147,7 +145,7 @@ public abstract class Sprite extends AbstractMedia
|
|||||||
return _orient;
|
return _orient;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void setLocation (int x, int y)
|
public void setLocation (int x, int y)
|
||||||
{
|
{
|
||||||
if (x == _ox && y == _oy) {
|
if (x == _ox && y == _oy) {
|
||||||
@@ -169,7 +167,7 @@ public abstract class Sprite extends AbstractMedia
|
|||||||
invalidateAfterChange(obounds);
|
invalidateAfterChange(obounds);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx)
|
public void paint (Graphics2D gfx)
|
||||||
{
|
{
|
||||||
gfx.drawRect(_bounds.x, _bounds.y, _bounds.width-1, _bounds.height-1);
|
gfx.drawRect(_bounds.x, _bounds.y, _bounds.width-1, _bounds.height-1);
|
||||||
@@ -296,7 +294,7 @@ public abstract class Sprite extends AbstractMedia
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void tick (long tickStamp)
|
public void tick (long tickStamp)
|
||||||
{
|
{
|
||||||
tickPath(tickStamp);
|
tickPath(tickStamp);
|
||||||
@@ -325,7 +323,7 @@ public abstract class Sprite extends AbstractMedia
|
|||||||
return (_path == null) ? true : _path.tick(this, tickStamp);
|
return (_path == null) ? true : _path.tick(this, tickStamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void fastForward (long timeDelta)
|
public void fastForward (long timeDelta)
|
||||||
{
|
{
|
||||||
// fast forward any path we're following
|
// fast forward any path we're following
|
||||||
@@ -363,7 +361,7 @@ public abstract class Sprite extends AbstractMedia
|
|||||||
removeObserver(obs);
|
removeObserver(obs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void viewLocationDidChange (int dx, int dy)
|
public void viewLocationDidChange (int dx, int dy)
|
||||||
{
|
{
|
||||||
if (_renderOrder >= HUD_LAYER) {
|
if (_renderOrder >= HUD_LAYER) {
|
||||||
@@ -371,14 +369,14 @@ public abstract class Sprite extends AbstractMedia
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void shutdown ()
|
protected void shutdown ()
|
||||||
{
|
{
|
||||||
super.shutdown();
|
super.shutdown();
|
||||||
cancelMove(); // cancel any active path
|
cancelMove(); // cancel any active path
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ import com.samskivert.util.SortableArrayList;
|
|||||||
|
|
||||||
import com.threerings.media.AbstractMedia;
|
import com.threerings.media.AbstractMedia;
|
||||||
import com.threerings.media.AbstractMediaManager;
|
import com.threerings.media.AbstractMediaManager;
|
||||||
import com.threerings.media.MediaHost;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The sprite manager manages the sprites running about in the game.
|
* The sprite manager manages the sprites running about in the game.
|
||||||
@@ -247,7 +246,7 @@ public class SpriteManager extends AbstractMediaManager
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
@Override // from AbstractMediaManager
|
@Override
|
||||||
protected SortableArrayList<? extends AbstractMedia> createMediaList ()
|
protected SortableArrayList<? extends AbstractMedia> createMediaList ()
|
||||||
{
|
{
|
||||||
return (_sprites = new SortableArrayList<Sprite>());
|
return (_sprites = new SortableArrayList<Sprite>());
|
||||||
|
|||||||
@@ -192,7 +192,7 @@ public class ObjectTile extends Tile
|
|||||||
_constraints = constraints;
|
_constraints = constraints;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void toString (StringBuilder buf)
|
public void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ public class ObjectTileSet extends SwissArmyTileSet
|
|||||||
return _zations;
|
return _zations;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
@@ -216,7 +216,7 @@ public class ObjectTileSet extends SwissArmyTileSet
|
|||||||
buf.append(", constraints=").append(StringUtil.toString(_constraints));
|
buf.append(", constraints=").append(StringUtil.toString(_constraints));
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Colorization[] getColorizations (int tileIndex, Colorizer rizer)
|
protected Colorization[] getColorizations (int tileIndex, Colorizer rizer)
|
||||||
{
|
{
|
||||||
Colorization[] zations = null;
|
Colorization[] zations = null;
|
||||||
@@ -229,13 +229,13 @@ public class ObjectTileSet extends SwissArmyTileSet
|
|||||||
return zations;
|
return zations;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Tile createTile ()
|
protected Tile createTile ()
|
||||||
{
|
{
|
||||||
return new ObjectTile();
|
return new ObjectTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
|
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
|
||||||
{
|
{
|
||||||
super.initTile(tile, tileIndex, zations);
|
super.initTile(tile, tileIndex, zations);
|
||||||
|
|||||||
@@ -38,13 +38,13 @@ import com.samskivert.util.StringUtil;
|
|||||||
*/
|
*/
|
||||||
public class SwissArmyTileSet extends TileSet
|
public class SwissArmyTileSet extends TileSet
|
||||||
{
|
{
|
||||||
// documentation inherited
|
@Override
|
||||||
public int getTileCount ()
|
public int getTileCount ()
|
||||||
{
|
{
|
||||||
return _numTiles;
|
return _numTiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public Rectangle computeTileBounds (int tileIndex, Rectangle bounds)
|
public Rectangle computeTileBounds (int tileIndex, Rectangle bounds)
|
||||||
{
|
{
|
||||||
// find the row number containing the sought-after tile
|
// find the row number containing the sought-after tile
|
||||||
@@ -156,7 +156,7 @@ public class SwissArmyTileSet extends TileSet
|
|||||||
_gapSize = gapSize;
|
_gapSize = gapSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class Tile // implements Cloneable
|
|||||||
this.zations = zations;
|
this.zations = zations;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean equals (Object other) {
|
public boolean equals (Object other) {
|
||||||
if (other instanceof Key) {
|
if (other instanceof Key) {
|
||||||
Key okey = (Key)other;
|
Key okey = (Key)other;
|
||||||
@@ -56,6 +57,7 @@ public class Tile // implements Cloneable
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public int hashCode () {
|
public int hashCode () {
|
||||||
int code = (tileSet == null) ? tileIndex :
|
int code = (tileSet == null) ? tileIndex :
|
||||||
(tileSet.hashCode() ^ tileIndex);
|
(tileSet.hashCode() ^ tileIndex);
|
||||||
@@ -140,9 +142,7 @@ public class Tile // implements Cloneable
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Return a string representation of this tile.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder("[");
|
StringBuilder buf = new StringBuilder("[");
|
||||||
@@ -162,6 +162,7 @@ public class Tile // implements Cloneable
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Decrement total tile memory by our value. */
|
/** Decrement total tile memory by our value. */
|
||||||
|
@Override
|
||||||
protected void finalize ()
|
protected void finalize ()
|
||||||
{
|
{
|
||||||
if (_mirage != null) {
|
if (_mirage != null) {
|
||||||
|
|||||||
@@ -35,9 +35,6 @@ import com.threerings.media.image.Colorization;
|
|||||||
import com.threerings.media.image.Mirage;
|
import com.threerings.media.image.Mirage;
|
||||||
import com.threerings.media.image.ImageUtil;
|
import com.threerings.media.image.ImageUtil;
|
||||||
import com.threerings.media.image.BufferedMirage;
|
import com.threerings.media.image.BufferedMirage;
|
||||||
import com.threerings.media.util.MultiFrameImage;
|
|
||||||
import com.threerings.media.util.MultiFrameImageImpl;
|
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
import static com.threerings.media.Log.log;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -350,9 +347,7 @@ public abstract class TileSet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Generates a string representation of the tileset information.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder("[");
|
StringBuilder buf = new StringBuilder("[");
|
||||||
|
|||||||
@@ -42,13 +42,13 @@ import com.threerings.media.tile.util.TileSetTrimmer;
|
|||||||
public class TrimmedObjectTileSet extends TileSet
|
public class TrimmedObjectTileSet extends TileSet
|
||||||
implements RecolorableTileSet
|
implements RecolorableTileSet
|
||||||
{
|
{
|
||||||
// documentation inherited
|
@Override
|
||||||
public int getTileCount ()
|
public int getTileCount ()
|
||||||
{
|
{
|
||||||
return _bounds.length;
|
return _bounds.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public Rectangle computeTileBounds (int tileIndex, Rectangle bounds)
|
public Rectangle computeTileBounds (int tileIndex, Rectangle bounds)
|
||||||
{
|
{
|
||||||
bounds.setBounds(_bounds[tileIndex]);
|
bounds.setBounds(_bounds[tileIndex]);
|
||||||
@@ -120,7 +120,7 @@ public class TrimmedObjectTileSet extends TileSet
|
|||||||
return _ometrics[tileIdx].height;
|
return _ometrics[tileIdx].height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Colorization[] getColorizations (int tileIndex, Colorizer rizer)
|
protected Colorization[] getColorizations (int tileIndex, Colorizer rizer)
|
||||||
{
|
{
|
||||||
Colorization[] zations = null;
|
Colorization[] zations = null;
|
||||||
@@ -133,13 +133,13 @@ public class TrimmedObjectTileSet extends TileSet
|
|||||||
return zations;
|
return zations;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Tile createTile ()
|
protected Tile createTile ()
|
||||||
{
|
{
|
||||||
return new ObjectTile();
|
return new ObjectTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
|
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
|
||||||
{
|
{
|
||||||
super.initTile(tile, tileIndex, zations);
|
super.initTile(tile, tileIndex, zations);
|
||||||
@@ -157,7 +157,7 @@ public class TrimmedObjectTileSet extends TileSet
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
@@ -272,7 +272,7 @@ public class TrimmedObjectTileSet extends TileSet
|
|||||||
/** The constraints associated with this object. */
|
/** The constraints associated with this object. */
|
||||||
public String[] constraints;
|
public String[] constraints;
|
||||||
|
|
||||||
/** Generates a string representation of this instance. */
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return StringUtil.fieldsToString(this);
|
return StringUtil.fieldsToString(this);
|
||||||
|
|||||||
@@ -44,19 +44,19 @@ public class TrimmedTile extends Tile
|
|||||||
_tbounds = tbounds;
|
_tbounds = tbounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public int getWidth ()
|
public int getWidth ()
|
||||||
{
|
{
|
||||||
return _tbounds.width;
|
return _tbounds.width;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public int getHeight ()
|
public int getHeight ()
|
||||||
{
|
{
|
||||||
return _tbounds.height;
|
return _tbounds.height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paint (Graphics2D gfx, int x, int y)
|
public void paint (Graphics2D gfx, int x, int y)
|
||||||
{
|
{
|
||||||
_mirage.paint(gfx, x + _tbounds.x, y + _tbounds.y);
|
_mirage.paint(gfx, x + _tbounds.x, y + _tbounds.y);
|
||||||
@@ -71,13 +71,13 @@ public class TrimmedTile extends Tile
|
|||||||
tbounds.setBounds(_tbounds.x, _tbounds.y, _mirage.getWidth(), _mirage.getHeight());
|
tbounds.setBounds(_tbounds.x, _tbounds.y, _mirage.getWidth(), _mirage.getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public boolean hitTest (int x, int y)
|
public boolean hitTest (int x, int y)
|
||||||
{
|
{
|
||||||
return super.hitTest(x - _tbounds.x, y - _tbounds.y);
|
return super.hitTest(x - _tbounds.x, y - _tbounds.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
buf.append(", tbounds=").append(StringUtil.toString(_tbounds));
|
buf.append(", tbounds=").append(StringUtil.toString(_tbounds));
|
||||||
|
|||||||
@@ -36,26 +36,26 @@ import com.threerings.media.tile.util.TileSetTrimmer;
|
|||||||
*/
|
*/
|
||||||
public class TrimmedTileSet extends TileSet
|
public class TrimmedTileSet extends TileSet
|
||||||
{
|
{
|
||||||
// documentation inherited
|
@Override
|
||||||
public int getTileCount ()
|
public int getTileCount ()
|
||||||
{
|
{
|
||||||
return _obounds.length;
|
return _obounds.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public Rectangle computeTileBounds (int tileIndex, Rectangle bounds)
|
public Rectangle computeTileBounds (int tileIndex, Rectangle bounds)
|
||||||
{
|
{
|
||||||
bounds.setBounds(_obounds[tileIndex]);
|
bounds.setBounds(_obounds[tileIndex]);
|
||||||
return bounds;
|
return bounds;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Tile createTile ()
|
protected Tile createTile ()
|
||||||
{
|
{
|
||||||
return new TrimmedTile();
|
return new TrimmedTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
|
protected void initTile (Tile tile, int tileIndex, Colorization[] zations)
|
||||||
{
|
{
|
||||||
super.initTile(tile, tileIndex, zations);
|
super.initTile(tile, tileIndex, zations);
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ import com.threerings.geom.GeomUtil;
|
|||||||
*/
|
*/
|
||||||
public class UniformTileSet extends TileSet
|
public class UniformTileSet extends TileSet
|
||||||
{
|
{
|
||||||
// documentation inherited
|
@Override
|
||||||
public int getTileCount ()
|
public int getTileCount ()
|
||||||
{
|
{
|
||||||
BufferedImage tsimg = getRawTileSetImage();
|
BufferedImage tsimg = getRawTileSetImage();
|
||||||
@@ -43,7 +43,7 @@ public class UniformTileSet extends TileSet
|
|||||||
return perRow * perCol;
|
return perRow * perCol;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public Rectangle computeTileBounds (int tileIndex, Rectangle bounds)
|
public Rectangle computeTileBounds (int tileIndex, Rectangle bounds)
|
||||||
{
|
{
|
||||||
BufferedImage tsimg = getRawTileSetImage();
|
BufferedImage tsimg = getRawTileSetImage();
|
||||||
@@ -83,7 +83,7 @@ public class UniformTileSet extends TileSet
|
|||||||
return _height;
|
return _height;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ import javax.imageio.ImageIO;
|
|||||||
|
|
||||||
import org.apache.commons.io.IOUtils;
|
import org.apache.commons.io.IOUtils;
|
||||||
|
|
||||||
import com.threerings.util.FileUtil;
|
|
||||||
import com.threerings.media.tile.ImageProvider;
|
import com.threerings.media.tile.ImageProvider;
|
||||||
import com.threerings.media.tile.ObjectTileSet;
|
import com.threerings.media.tile.ObjectTileSet;
|
||||||
import com.threerings.media.tile.TileSet;
|
import com.threerings.media.tile.TileSet;
|
||||||
@@ -59,7 +58,7 @@ public class DirectoryTileSetBundler extends TileSetBundler
|
|||||||
super(configPath);
|
super(configPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public boolean createBundle (
|
public boolean createBundle (
|
||||||
File target, TileSetBundle bundle, ImageProvider improv, String imageBase, long newestMod)
|
File target, TileSetBundle bundle, ImageProvider improv, String imageBase, long newestMod)
|
||||||
throws IOException
|
throws IOException
|
||||||
@@ -164,7 +163,7 @@ public class DirectoryTileSetBundler extends TileSetBundler
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
protected boolean skipIfTargetNewer ()
|
protected boolean skipIfTargetNewer ()
|
||||||
{
|
{
|
||||||
// We have to check modification later on a file-by-file basis, so cannot skip.
|
// We have to check modification later on a file-by-file basis, so cannot skip.
|
||||||
|
|||||||
@@ -23,14 +23,7 @@ package com.threerings.media.tile.bundle.tools;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
import org.apache.tools.ant.BuildException;
|
import org.apache.tools.ant.BuildException;
|
||||||
import org.apache.tools.ant.DirectoryScanner;
|
|
||||||
import org.apache.tools.ant.Task;
|
|
||||||
import org.apache.tools.ant.types.FileSet;
|
|
||||||
|
|
||||||
import com.threerings.media.tile.tools.MapFileTileSetIDBroker;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ant task for creating tileset bundles that are placed in a specified directory instead
|
* Ant task for creating tileset bundles that are placed in a specified directory instead
|
||||||
@@ -46,21 +39,21 @@ public class DirectoryTileSetBundlerTask extends TileSetBundlerTask
|
|||||||
_deployDir = deployDir;
|
_deployDir = deployDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public void execute () throws BuildException
|
public void execute () throws BuildException
|
||||||
{
|
{
|
||||||
ensureSet(_deployDir, "Must specify the path to which we want to deploy tileset files.");
|
ensureSet(_deployDir, "Must specify the path to which we want to deploy tileset files.");
|
||||||
super.execute();
|
super.execute();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
protected TileSetBundler createBundler ()
|
protected TileSetBundler createBundler ()
|
||||||
throws IOException
|
throws IOException
|
||||||
{
|
{
|
||||||
return new DirectoryTileSetBundler(_config);
|
return new DirectoryTileSetBundler(_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
protected String getTargetPath (File fromDir, String path)
|
protected String getTargetPath (File fromDir, String path)
|
||||||
{
|
{
|
||||||
File xmlFile = new File(path.replace(fromDir.getPath(), _deployDir.getPath()));
|
File xmlFile = new File(path.replace(fromDir.getPath(), _deployDir.getPath()));
|
||||||
|
|||||||
@@ -313,6 +313,7 @@ public class TileSetBundler
|
|||||||
|
|
||||||
// create an image provider for loading our tileset images
|
// create an image provider for loading our tileset images
|
||||||
SimpleCachingImageProvider improv = new SimpleCachingImageProvider() {
|
SimpleCachingImageProvider improv = new SimpleCachingImageProvider() {
|
||||||
|
@Override
|
||||||
protected BufferedImage loadImage (String path)
|
protected BufferedImage loadImage (String path)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
return ImageIO.read(new File(bundleDesc.getParent(), path));
|
return ImageIO.read(new File(bundleDesc.getParent(), path));
|
||||||
@@ -486,6 +487,7 @@ public class TileSetBundler
|
|||||||
this.ruleset = ruleset;
|
this.ruleset = ruleset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return "[path=" + path + ", ruleset=" + ruleset + "]";
|
return "[path=" + path + ", ruleset=" + ruleset + "]";
|
||||||
|
|||||||
@@ -66,6 +66,7 @@ public class TileSetBundlerTask extends Task
|
|||||||
/**
|
/**
|
||||||
* Performs the actual work of the task.
|
* Performs the actual work of the task.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void execute () throws BuildException
|
public void execute () throws BuildException
|
||||||
{
|
{
|
||||||
// make sure everything was set up properly
|
// make sure everything was set up properly
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ import com.threerings.util.DirectionUtil;
|
|||||||
*/
|
*/
|
||||||
public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
||||||
{
|
{
|
||||||
// documentation inherited
|
@Override
|
||||||
public void addRuleInstances (Digester digester)
|
public void addRuleInstances (Digester digester)
|
||||||
{
|
{
|
||||||
super.addRuleInstances(digester);
|
super.addRuleInstances(digester);
|
||||||
@@ -68,6 +68,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/objectWidths",
|
_path + "/objectWidths",
|
||||||
new CallMethodSpecialRule() {
|
new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] widths = StringUtil.parseIntArray(bodyText);
|
int[] widths = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -78,6 +79,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/objectHeights",
|
_path + "/objectHeights",
|
||||||
new CallMethodSpecialRule() {
|
new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] heights = StringUtil.parseIntArray(bodyText);
|
int[] heights = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -87,6 +89,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/xOrigins", new CallMethodSpecialRule() {
|
_path + "/xOrigins", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] xorigins = StringUtil.parseIntArray(bodyText);
|
int[] xorigins = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -96,6 +99,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/yOrigins", new CallMethodSpecialRule() {
|
_path + "/yOrigins", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] yorigins = StringUtil.parseIntArray(bodyText);
|
int[] yorigins = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -106,6 +110,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/priorities",
|
_path + "/priorities",
|
||||||
new CallMethodSpecialRule() {
|
new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
byte[] prios = StringUtil.parseByteArray(bodyText);
|
byte[] prios = StringUtil.parseByteArray(bodyText);
|
||||||
@@ -115,6 +120,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/zations", new CallMethodSpecialRule() {
|
_path + "/zations", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
String[] zations = StringUtil.parseStringArray(bodyText);
|
String[] zations = StringUtil.parseStringArray(bodyText);
|
||||||
@@ -124,6 +130,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/xspots", new CallMethodSpecialRule() {
|
_path + "/xspots", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
short[] xspots = StringUtil.parseShortArray(bodyText);
|
short[] xspots = StringUtil.parseShortArray(bodyText);
|
||||||
@@ -133,6 +140,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/yspots", new CallMethodSpecialRule() {
|
_path + "/yspots", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
short[] yspots = StringUtil.parseShortArray(bodyText);
|
short[] yspots = StringUtil.parseShortArray(bodyText);
|
||||||
@@ -142,6 +150,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/sorients", new CallMethodSpecialRule() {
|
_path + "/sorients", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
ObjectTileSet set = (ObjectTileSet)target;
|
ObjectTileSet set = (ObjectTileSet)target;
|
||||||
@@ -167,6 +176,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/constraints",
|
_path + "/constraints",
|
||||||
new CallMethodSpecialRule() {
|
new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
String[] constrs = StringUtil.parseStringArray(
|
String[] constrs = StringUtil.parseStringArray(
|
||||||
@@ -180,7 +190,7 @@ public class ObjectTileSetRuleSet extends SwissArmyTileSetRuleSet
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Class getTileSetClass ()
|
protected Class getTileSetClass ()
|
||||||
{
|
{
|
||||||
return ObjectTileSet.class;
|
return ObjectTileSet.class;
|
||||||
|
|||||||
@@ -55,13 +55,14 @@ import static com.threerings.media.Log.log;
|
|||||||
*/
|
*/
|
||||||
public class SwissArmyTileSetRuleSet extends TileSetRuleSet
|
public class SwissArmyTileSetRuleSet extends TileSetRuleSet
|
||||||
{
|
{
|
||||||
// documentation inherited
|
@Override
|
||||||
public void addRuleInstances (Digester digester)
|
public void addRuleInstances (Digester digester)
|
||||||
{
|
{
|
||||||
super.addRuleInstances(digester);
|
super.addRuleInstances(digester);
|
||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/widths", new CallMethodSpecialRule() {
|
_path + "/widths", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] widths = StringUtil.parseIntArray(bodyText);
|
int[] widths = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -71,6 +72,7 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/heights", new CallMethodSpecialRule() {
|
_path + "/heights", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] heights = StringUtil.parseIntArray(bodyText);
|
int[] heights = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -81,6 +83,7 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
|
|||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/tileCounts",
|
_path + "/tileCounts",
|
||||||
new CallMethodSpecialRule() {
|
new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] tileCounts = StringUtil.parseIntArray(bodyText);
|
int[] tileCounts = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -90,6 +93,7 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/offsetPos", new CallMethodSpecialRule() {
|
_path + "/offsetPos", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] values = StringUtil.parseIntArray(bodyText);
|
int[] values = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -105,6 +109,7 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
|
|||||||
|
|
||||||
digester.addRule(
|
digester.addRule(
|
||||||
_path + "/gapSize", new CallMethodSpecialRule() {
|
_path + "/gapSize", new CallMethodSpecialRule() {
|
||||||
|
@Override
|
||||||
public void parseAndSet (String bodyText, Object target)
|
public void parseAndSet (String bodyText, Object target)
|
||||||
{
|
{
|
||||||
int[] values = StringUtil.parseIntArray(bodyText);
|
int[] values = StringUtil.parseIntArray(bodyText);
|
||||||
@@ -119,7 +124,7 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public boolean isValid (Object target)
|
public boolean isValid (Object target)
|
||||||
{
|
{
|
||||||
SwissArmyTileSet set = (SwissArmyTileSet)target;
|
SwissArmyTileSet set = (SwissArmyTileSet)target;
|
||||||
@@ -149,7 +154,7 @@ public class SwissArmyTileSetRuleSet extends TileSetRuleSet
|
|||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Class getTileSetClass ()
|
protected Class getTileSetClass ()
|
||||||
{
|
{
|
||||||
return SwissArmyTileSet.class;
|
return SwissArmyTileSet.class;
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ public abstract class TileSetRuleSet
|
|||||||
* should register themselves relative to the <code>_prefix</code>
|
* should register themselves relative to the <code>_prefix</code>
|
||||||
* member).
|
* member).
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addRuleInstances (Digester digester)
|
public void addRuleInstances (Digester digester)
|
||||||
{
|
{
|
||||||
// this creates the appropriate instance when we encounter a
|
// this creates the appropriate instance when we encounter a
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class UniformTileSetRuleSet extends TileSetRuleSet
|
|||||||
_tilesetPath = tilesetPath;
|
_tilesetPath = tilesetPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void addRuleInstances (Digester digester)
|
public void addRuleInstances (Digester digester)
|
||||||
{
|
{
|
||||||
super.addRuleInstances(digester);
|
super.addRuleInstances(digester);
|
||||||
@@ -62,7 +62,7 @@ public class UniformTileSetRuleSet extends TileSetRuleSet
|
|||||||
new Class[] { java.lang.Integer.TYPE });
|
new Class[] { java.lang.Integer.TYPE });
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public boolean isValid (Object target)
|
public boolean isValid (Object target)
|
||||||
{
|
{
|
||||||
UniformTileSet set = (UniformTileSet)target;
|
UniformTileSet set = (UniformTileSet)target;
|
||||||
@@ -85,7 +85,7 @@ public class UniformTileSetRuleSet extends TileSetRuleSet
|
|||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected Class getTileSetClass ()
|
protected Class getTileSetClass ()
|
||||||
{
|
{
|
||||||
return UniformTileSet.class;
|
return UniformTileSet.class;
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ public class RecolorImage extends JPanel
|
|||||||
|
|
||||||
// listen for mouse clicks
|
// listen for mouse clicks
|
||||||
images.addMouseListener(new MouseAdapter() {
|
images.addMouseListener(new MouseAdapter() {
|
||||||
|
@Override
|
||||||
public void mousePressed (MouseEvent event) {
|
public void mousePressed (MouseEvent event) {
|
||||||
RecolorImage.this.mousePressed(event);
|
RecolorImage.this.mousePressed(event);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package com.threerings.media.tools;
|
package com.threerings.media.tools;
|
||||||
|
|
||||||
import java.io.FileOutputStream;
|
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
@@ -29,7 +28,7 @@ public class ResourceIndexerTask extends Task
|
|||||||
_indexFile = file;
|
_indexFile = file;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override // documentation inherited
|
@Override
|
||||||
public void execute () throws BuildException
|
public void execute () throws BuildException
|
||||||
{
|
{
|
||||||
PrintWriter fout = null;
|
PrintWriter fout = null;
|
||||||
|
|||||||
@@ -204,7 +204,7 @@ public class ArcPath extends TimedPath
|
|||||||
gfx.drawArc(x, y, width-1, height-1, 360-sangle, -delta);
|
gfx.drawArc(x, y, width-1, height-1, 360-sangle, -delta);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -26,8 +26,6 @@ import java.awt.Graphics2D;
|
|||||||
|
|
||||||
import com.samskivert.util.RandomUtil;
|
import com.samskivert.util.RandomUtil;
|
||||||
|
|
||||||
import static com.threerings.media.Log.log;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Bobble a Pathable.
|
* Bobble a Pathable.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public class DelayPath extends TimedPath
|
|||||||
_source = source;
|
_source = source;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void init (Pathable pable, long timestamp)
|
public void init (Pathable pable, long timestamp)
|
||||||
{
|
{
|
||||||
super.init(pable, timestamp);
|
super.init(pable, timestamp);
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ public class LinePath extends TimedPath
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void init (Pathable pable, long timestamp)
|
public void init (Pathable pable, long timestamp)
|
||||||
{
|
{
|
||||||
super.init(pable, timestamp);
|
super.init(pable, timestamp);
|
||||||
@@ -119,7 +119,7 @@ public class LinePath extends TimedPath
|
|||||||
gfx.drawLine(_source.x, _source.y, _dest.x, _dest.y);
|
gfx.drawLine(_source.x, _source.y, _dest.x, _dest.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected void toString (StringBuilder buf)
|
protected void toString (StringBuilder buf)
|
||||||
{
|
{
|
||||||
super.toString(buf);
|
super.toString(buf);
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ public class LineSegmentPath
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return StringUtil.toString(_nodes.iterator());
|
return StringUtil.toString(_nodes.iterator());
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public class LinearTimeFunction extends TimeFunction
|
|||||||
super(start, end, duration);
|
super(start, end, duration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
protected int computeValue (int dt)
|
protected int computeValue (int dt)
|
||||||
{
|
{
|
||||||
int dv = (_end - _start);
|
int dv = (_end - _start);
|
||||||
|
|||||||
@@ -47,9 +47,7 @@ public class PathNode
|
|||||||
this.dir = dir;
|
this.dir = dir;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Return a string representation of this path node.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ public class PathSequence
|
|||||||
{
|
{
|
||||||
_pable = pable;
|
_pable = pable;
|
||||||
_pableRep = new DelegatingPathable(_pable) {
|
_pableRep = new DelegatingPathable(_pable) {
|
||||||
|
@Override
|
||||||
public void pathCompleted (long timeStamp) {
|
public void pathCompleted (long timeStamp) {
|
||||||
long initStamp;
|
long initStamp;
|
||||||
// if we just finished a timed path, we can figure out how
|
// if we just finished a timed path, we can figure out how
|
||||||
|
|||||||
@@ -182,6 +182,7 @@ class PerformanceAction
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ public class SmoothBobblePath extends BobblePath
|
|||||||
super(dx, dy, duration, updateFreq);
|
super(dx, dy, duration, updateFreq);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void init (Pathable pable, long tickstamp)
|
public void init (Pathable pable, long tickstamp)
|
||||||
{
|
{
|
||||||
super.init(pable, tickstamp);
|
super.init(pable, tickstamp);
|
||||||
@@ -49,7 +49,7 @@ public class SmoothBobblePath extends BobblePath
|
|||||||
_oldy = _sy;
|
_oldy = _sy;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public boolean tick (Pathable pable, long tickStamp)
|
public boolean tick (Pathable pable, long tickStamp)
|
||||||
{
|
{
|
||||||
// see if we need to stop
|
// see if we need to stop
|
||||||
|
|||||||
@@ -43,14 +43,14 @@ public class TiledArea extends JComponent
|
|||||||
setOpaque(true);
|
setOpaque(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public void paintComponent (Graphics g)
|
public void paintComponent (Graphics g)
|
||||||
{
|
{
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
_tiler.paint(g, 0, 0, getWidth(), getHeight());
|
_tiler.paint(g, 0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public Dimension getPreferredSize ()
|
public Dimension getPreferredSize ()
|
||||||
{
|
{
|
||||||
return new Dimension(_tiler.getNaturalWidth(),
|
return new Dimension(_tiler.getNaturalWidth(),
|
||||||
|
|||||||
@@ -71,9 +71,7 @@ public abstract class TimedPath implements Path
|
|||||||
// nothing doing
|
// nothing doing
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Generates a string representation of this instance.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder("[");
|
StringBuilder buf = new StringBuilder("[");
|
||||||
|
|||||||
@@ -65,9 +65,7 @@ public class TrailingAverage
|
|||||||
return (end > 0) ? (value/end) : 0;
|
return (end > 0) ? (value/end) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns the current trailing average value as a string.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
return Integer.toString(value());
|
return Integer.toString(value());
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ public class DirtyItemList
|
|||||||
obj = null;
|
obj = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public boolean equals (Object other)
|
public boolean equals (Object other)
|
||||||
{
|
{
|
||||||
// we're never equal to something that's not our kind
|
// we're never equal to something that's not our kind
|
||||||
@@ -356,15 +356,13 @@ public class DirtyItemList
|
|||||||
return obj.equals(b.obj);
|
return obj.equals(b.obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// documentation inherited
|
@Override
|
||||||
public int hashCode ()
|
public int hashCode ()
|
||||||
{
|
{
|
||||||
return obj.hashCode();
|
return obj.hashCode();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Returns a string representation of the dirty item.
|
|
||||||
*/
|
|
||||||
public String toString ()
|
public String toString ()
|
||||||
{
|
{
|
||||||
StringBuilder buf = new StringBuilder();
|
StringBuilder buf = new StringBuilder();
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user