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