Nixed redundant casts.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@532 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2007-12-18 20:03:23 +00:00
parent 4e1f8f78c8
commit 8b2c12bd7d
4 changed files with 7 additions and 8 deletions
@@ -341,7 +341,7 @@ public class EditorScenePanel extends StageScenePanel
} }
// pass location information on to the dialog // pass location information on to the dialog
_dialogPortal.prepare((StageScene)_scene, portal); _dialogPortal.prepare(_scene, portal);
// allow the user to edit the info // allow the user to edit the info
EditorDialogUtil.display(_frame, _dialogPortal); EditorDialogUtil.display(_frame, _dialogPortal);
@@ -965,12 +965,11 @@ public class EditorScenePanel extends StageScenePanel
{ {
if (tile instanceof ObjectTile) { if (tile instanceof ObjectTile) {
// create a temporary scene object for this tile // create a temporary scene object for this tile
SceneObject nobj = new SceneObject(this, new ObjectInfo(0, x, y), SceneObject nobj = new SceneObject(this, new ObjectInfo(0, x, y), (ObjectTile)tile);
(ObjectTile)tile);
// report invalidity if overlaps any existing objects // report invalidity if overlaps any existing objects
int ocount = _vizobjs.size(); int ocount = _vizobjs.size();
for (int ii = 0; ii < ocount; ii++) { for (int ii = 0; ii < ocount; ii++) {
SceneObject scobj = (SceneObject)_vizobjs.get(ii); SceneObject scobj = _vizobjs.get(ii);
if (scobj.objectFootprintOverlaps(nobj)) { if (scobj.objectFootprintOverlaps(nobj)) {
return false; return false;
} }
@@ -128,11 +128,11 @@ public class EditorScrollBox extends ScrollBox
int horz = _horz.getMaximum() - _horz.getMinimum(); int horz = _horz.getMaximum() - _horz.getMinimum();
int vert = _vert.getMaximum() - _vert.getMinimum(); int vert = _vert.getMaximum() - _vert.getMinimum();
int height = MAX_HEIGHT; int height = MAX_HEIGHT;
int width = (int) Math.round(horz * (((float) height) / vert)); int width = Math.round(horz * (((float) height) / vert));
int maxwidth = getParent().getWidth(); int maxwidth = getParent().getWidth();
if (maxwidth > 0 && width > maxwidth) { if (maxwidth > 0 && width > maxwidth) {
height = (int) Math.round(height * (((float) maxwidth) / width)); height = Math.round(height * (((float) maxwidth) / width));
width = maxwidth; width = maxwidth;
} }
@@ -48,7 +48,7 @@ public class PortalTool extends MouseInputAdapter
public void init (EditorScenePanel panel, int centerx, int centery) public void init (EditorScenePanel panel, int centerx, int centery)
{ {
_panel = panel; _panel = panel;
_scene = (StageScene)_panel.getScene(); _scene = _panel.getScene();
// adjust the center screen coordinate so that it is positioned at // adjust the center screen coordinate so that it is positioned at
// the closest full coordinate where a portal may be placed // the closest full coordinate where a portal may be placed
@@ -386,7 +386,7 @@ public class TileInfoPanel extends JSplitPane
// now select the previously selected item, or the first... // now select the previously selected item, or the first...
if (_selected == null) { if (_selected == null) {
_selected = (DefaultMutableTreeNode) root.getFirstLeaf(); _selected = root.getFirstLeaf();
} }
_tsettree.setSelectionPath(new TreePath(_selected.getPath())); _tsettree.setSelectionPath(new TreePath(_selected.getPath()));
} }