java6-compat: eliminate use of diamond operator (a J7-only feature)
git-svn-id: https://micropolis.googlecode.com/svn/trunk/micropolis-java@576 d9718cc8-9f43-0410-858b-315f434eb58c
This commit is contained in:
parent
b1a1dea224
commit
7473c893bd
8 changed files with 17 additions and 17 deletions
|
@ -44,7 +44,7 @@
|
||||||
classpathref="build-classpath"
|
classpathref="build-classpath"
|
||||||
includeantruntime="false"
|
includeantruntime="false"
|
||||||
debug="true" debuglevel="lines,vars,source"
|
debug="true" debuglevel="lines,vars,source"
|
||||||
source="1.7" target="1.7"
|
source="1.6" target="1.6"
|
||||||
>
|
>
|
||||||
<compilerarg value="-Xlint:unchecked" />
|
<compilerarg value="-Xlint:unchecked" />
|
||||||
<compilerarg value="-Xlint:deprecation" />
|
<compilerarg value="-Xlint:deprecation" />
|
||||||
|
|
|
@ -54,10 +54,10 @@ public class CityEval
|
||||||
public CityProblem [] problemOrder = new CityProblem[0];
|
public CityProblem [] problemOrder = new CityProblem[0];
|
||||||
|
|
||||||
/** Number of votes given for the various problems identified by problemOrder[]. */
|
/** Number of votes given for the various problems identified by problemOrder[]. */
|
||||||
public EnumMap<CityProblem,Integer> problemVotes = new EnumMap<>(CityProblem.class);
|
public EnumMap<CityProblem,Integer> problemVotes = new EnumMap<CityProblem,Integer>(CityProblem.class);
|
||||||
|
|
||||||
/** Score for various problems. */
|
/** Score for various problems. */
|
||||||
public EnumMap<CityProblem,Integer> problemTable = new EnumMap<>(CityProblem.class);
|
public EnumMap<CityProblem,Integer> problemTable = new EnumMap<CityProblem,Integer>(CityProblem.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform an evaluation.
|
* Perform an evaluation.
|
||||||
|
@ -166,7 +166,7 @@ public class CityEval
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EnumMap<CityProblem,Integer> rv = new EnumMap<>(CityProblem.class);
|
EnumMap<CityProblem,Integer> rv = new EnumMap<CityProblem,Integer>(CityProblem.class);
|
||||||
for (int i = 0; i < pp.length; i++) {
|
for (int i = 0; i < pp.length; i++) {
|
||||||
rv.put(pp[i], votes[i]);
|
rv.put(pp[i], votes[i]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -190,7 +190,7 @@ public class Micropolis
|
||||||
|
|
||||||
public CityEval evaluation;
|
public CityEval evaluation;
|
||||||
|
|
||||||
ArrayList<Sprite> sprites = new ArrayList<>();
|
ArrayList<Sprite> sprites = new ArrayList<Sprite>();
|
||||||
|
|
||||||
static final int VALVERATE = 2;
|
static final int VALVERATE = 2;
|
||||||
public static final int CENSUSRATE = 4;
|
public static final int CENSUSRATE = 4;
|
||||||
|
@ -333,9 +333,9 @@ public class Micropolis
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<Listener> listeners = new ArrayList<>();
|
ArrayList<Listener> listeners = new ArrayList<Listener>();
|
||||||
ArrayList<MapListener> mapListeners = new ArrayList<>();
|
ArrayList<MapListener> mapListeners = new ArrayList<MapListener>();
|
||||||
ArrayList<EarthquakeListener> earthquakeListeners = new ArrayList<>();
|
ArrayList<EarthquakeListener> earthquakeListeners = new ArrayList<EarthquakeListener>();
|
||||||
|
|
||||||
public void addListener(Listener l)
|
public void addListener(Listener l)
|
||||||
{
|
{
|
||||||
|
@ -1729,7 +1729,7 @@ public class Micropolis
|
||||||
public int taxIncome;
|
public int taxIncome;
|
||||||
public int operatingExpenses;
|
public int operatingExpenses;
|
||||||
}
|
}
|
||||||
public ArrayList<FinancialHistory> financialHistory = new ArrayList<>();
|
public ArrayList<FinancialHistory> financialHistory = new ArrayList<FinancialHistory>();
|
||||||
|
|
||||||
void collectTax()
|
void collectTax()
|
||||||
{
|
{
|
||||||
|
@ -2253,7 +2253,7 @@ public class Micropolis
|
||||||
*/
|
*/
|
||||||
public boolean makeMeltdown()
|
public boolean makeMeltdown()
|
||||||
{
|
{
|
||||||
ArrayList<CityLocation> candidates = new ArrayList<>();
|
ArrayList<CityLocation> candidates = new ArrayList<CityLocation>();
|
||||||
for (int y = 0; y < map.length; y++) {
|
for (int y = 0; y < map.length; y++) {
|
||||||
for (int x = 0; x < map[y].length; x++) {
|
for (int x = 0; x < map[y].length; x++) {
|
||||||
if ((map[y][x] & LOMASK) == NUCLEAR) {
|
if ((map[y][x] & LOMASK) == NUCLEAR) {
|
||||||
|
|
|
@ -22,7 +22,7 @@ class TrafficGen
|
||||||
Micropolis.ZoneType sourceZone;
|
Micropolis.ZoneType sourceZone;
|
||||||
|
|
||||||
int lastdir;
|
int lastdir;
|
||||||
Stack<CityLocation> positions = new Stack<>();
|
Stack<CityLocation> positions = new Stack<CityLocation>();
|
||||||
|
|
||||||
static final int MAX_TRAFFIC_DISTANCE = 30;
|
static final int MAX_TRAFFIC_DISTANCE = 30;
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class GraphsPane extends JPanel
|
||||||
CRIME,
|
CRIME,
|
||||||
POLLUTION;
|
POLLUTION;
|
||||||
}
|
}
|
||||||
EnumMap<GraphData,JToggleButton> dataBtns = new EnumMap<>(GraphData.class);
|
EnumMap<GraphData,JToggleButton> dataBtns = new EnumMap<GraphData,JToggleButton>(GraphData.class);
|
||||||
|
|
||||||
static ResourceBundle strings = MainWindow.strings;
|
static ResourceBundle strings = MainWindow.strings;
|
||||||
static final int LEFT_MARGIN = 4;
|
static final int LEFT_MARGIN = 4;
|
||||||
|
@ -264,7 +264,7 @@ public class GraphsPane extends JPanel
|
||||||
}
|
}
|
||||||
|
|
||||||
int H = isOneTwenty ? 239 : 119;
|
int H = isOneTwenty ? 239 : 119;
|
||||||
final HashMap<GraphData, Path2D.Double> paths = new HashMap<>();
|
final HashMap<GraphData, Path2D.Double> paths = new HashMap<GraphData,Path2D.Double>();
|
||||||
for (GraphData gd : GraphData.values())
|
for (GraphData gd : GraphData.values())
|
||||||
{
|
{
|
||||||
if (dataBtns.get(gd).isSelected()) {
|
if (dataBtns.get(gd).isSelected()) {
|
||||||
|
|
|
@ -44,7 +44,7 @@ public class MainWindow extends JFrame
|
||||||
JLabel currentToolLbl;
|
JLabel currentToolLbl;
|
||||||
JLabel currentToolCostLbl;
|
JLabel currentToolCostLbl;
|
||||||
Map<MicropolisTool,JToggleButton> toolBtns;
|
Map<MicropolisTool,JToggleButton> toolBtns;
|
||||||
EnumMap<MapState,JMenuItem> mapStateMenuItems = new EnumMap<>(MapState.class);
|
EnumMap<MapState,JMenuItem> mapStateMenuItems = new EnumMap<MapState,JMenuItem>(MapState.class);
|
||||||
MicropolisTool currentTool;
|
MicropolisTool currentTool;
|
||||||
File currentFile;
|
File currentFile;
|
||||||
boolean doSounds = true;
|
boolean doSounds = true;
|
||||||
|
|
|
@ -25,7 +25,7 @@ public class MicropolisDrawingArea extends JComponent
|
||||||
{
|
{
|
||||||
Micropolis m;
|
Micropolis m;
|
||||||
boolean blinkUnpoweredZones = true;
|
boolean blinkUnpoweredZones = true;
|
||||||
HashSet<Point> unpoweredZones = new HashSet<>();
|
HashSet<Point> unpoweredZones = new HashSet<Point>();
|
||||||
boolean blink;
|
boolean blink;
|
||||||
Timer blinkTimer;
|
Timer blinkTimer;
|
||||||
ToolPreview toolPreview;
|
ToolPreview toolPreview;
|
||||||
|
@ -107,7 +107,7 @@ public class MicropolisDrawingArea extends JComponent
|
||||||
spriteImages = new EnumMap<SpriteKind, Map<Integer,Image> >(SpriteKind.class);
|
spriteImages = new EnumMap<SpriteKind, Map<Integer,Image> >(SpriteKind.class);
|
||||||
for (SpriteKind kind : SpriteKind.values())
|
for (SpriteKind kind : SpriteKind.values())
|
||||||
{
|
{
|
||||||
HashMap<Integer,Image> imgs = new HashMap<>();
|
HashMap<Integer,Image> imgs = new HashMap<Integer,Image>();
|
||||||
for (int i = 0; i < kind.numFrames; i++) {
|
for (int i = 0; i < kind.numFrames; i++) {
|
||||||
Image img = loadSpriteImage(kind, i);
|
Image img = loadSpriteImage(kind, i);
|
||||||
if (img != null) {
|
if (img != null) {
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class OverlayMapView extends JComponent
|
||||||
implements Scrollable, MapListener
|
implements Scrollable, MapListener
|
||||||
{
|
{
|
||||||
Micropolis engine;
|
Micropolis engine;
|
||||||
ArrayList<ConnectedView> views = new ArrayList<>();
|
ArrayList<ConnectedView> views = new ArrayList<ConnectedView>();
|
||||||
MapState mapState = MapState.ALL;
|
MapState mapState = MapState.ALL;
|
||||||
|
|
||||||
public OverlayMapView(Micropolis _engine)
|
public OverlayMapView(Micropolis _engine)
|
||||||
|
|
Reference in a new issue