Nixed a bunch of redundant casts.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@304 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -61,7 +61,7 @@ public class FadeLabelAnimation extends FadeAnimation
|
||||
|
||||
// if our label is not yet laid out, do the deed
|
||||
if (!_label.isLaidOut()) {
|
||||
Graphics2D gfx = (Graphics2D)_mgr.createGraphics();
|
||||
Graphics2D gfx = _mgr.createGraphics();
|
||||
if (gfx != null) {
|
||||
gfx.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
|
||||
_antiAliased ?
|
||||
|
||||
@@ -120,8 +120,7 @@ public class TileSetTrimmer
|
||||
// create the new tileset image
|
||||
BufferedImage image = null;
|
||||
try {
|
||||
image = ImageUtil.createCompatibleImage(
|
||||
(BufferedImage)source.getRawTileSetImage(), nextx, maxy);
|
||||
image = ImageUtil.createCompatibleImage(source.getRawTileSetImage(), nextx, maxy);
|
||||
|
||||
} catch (RasterFormatException rfe) {
|
||||
throw new IOException("Failed to create trimmed tileset image " +
|
||||
|
||||
@@ -157,7 +157,7 @@ public class AStarPathUtil
|
||||
while (info.open.size() > 0) {
|
||||
|
||||
// pop the best node so far from open
|
||||
Node n = (Node)info.open.first();
|
||||
Node n = info.open.first();
|
||||
info.open.remove(n);
|
||||
|
||||
// if node is a goal node
|
||||
|
||||
@@ -94,8 +94,7 @@ public class LineSegmentPath
|
||||
*/
|
||||
public int getFinalOrientation ()
|
||||
{
|
||||
return (_nodes.size() == 0) ? NORTH :
|
||||
((PathNode)_nodes.get(_nodes.size()-1)).dir;
|
||||
return (_nodes.size() == 0) ? NORTH : _nodes.get(_nodes.size()-1).dir;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,7 +120,7 @@ public class LineSegmentPath
|
||||
*/
|
||||
public PathNode getNode (int idx)
|
||||
{
|
||||
return (PathNode)_nodes.get(idx);
|
||||
return _nodes.get(idx);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -168,11 +167,10 @@ public class LineSegmentPath
|
||||
|
||||
// compute the total distance along our path
|
||||
float distance = 0;
|
||||
PathNode start = (PathNode)_nodes.get(0);
|
||||
PathNode start = _nodes.get(0);
|
||||
for (int ii = 1; ii < ncount; ii++) {
|
||||
PathNode end = (PathNode)_nodes.get(ii);
|
||||
distance += MathUtil.distance(
|
||||
start.loc.x, start.loc.y, end.loc.x, end.loc.y);
|
||||
PathNode end = _nodes.get(ii);
|
||||
distance += MathUtil.distance(start.loc.x, start.loc.y, end.loc.x, end.loc.y);
|
||||
start = end;
|
||||
}
|
||||
|
||||
@@ -192,7 +190,7 @@ public class LineSegmentPath
|
||||
// move the pathable to the location specified by the first
|
||||
// node (assuming we have a first node)
|
||||
if (size() == 1) {
|
||||
PathNode node = (PathNode)_nodes.get(0);
|
||||
PathNode node = _nodes.get(0);
|
||||
pable.setLocation(node.loc.x, node.loc.y);
|
||||
}
|
||||
// and let the pathable know that we're done
|
||||
@@ -313,7 +311,7 @@ public class LineSegmentPath
|
||||
Point prev = null;
|
||||
int size = size();
|
||||
for (int ii = 0; ii < size; ii++) {
|
||||
PathNode n = (PathNode)getNode(ii);
|
||||
PathNode n = getNode(ii);
|
||||
if (prev != null) {
|
||||
gfx.drawLine(prev.x, prev.y, n.loc.x, n.loc.y);
|
||||
}
|
||||
@@ -354,7 +352,7 @@ public class LineSegmentPath
|
||||
}
|
||||
|
||||
/** The nodes that make up the path. */
|
||||
protected ArrayList _nodes = new ArrayList();
|
||||
protected ArrayList<PathNode> _nodes = new ArrayList<PathNode>();
|
||||
|
||||
/** We use this when moving along this path. */
|
||||
protected Iterator _niter;
|
||||
|
||||
Reference in New Issue
Block a user