Remove Java 1.5 legacy code.

This commit is contained in:
Michael Vehrs 2013-01-19 15:47:39 +01:00
parent e0de04a2c4
commit 9d34857a21
5 changed files with 16 additions and 37 deletions

View File

@ -27,19 +27,9 @@
<property name="miglayout.jar" value="jars/miglayout-4.0-swing.jar"/>
<property name="cli.jar" value="jars/commons-cli-1.1.jar"/>
<property name="cortado.jar" value="jars/cortado-0.6.0.jar"/>
<!--
<property name="stax.jar" value="jars/stax2-api-3.0.3.jar"/>
<property name="woodstox.jar" value="jars/woodstox-core-lgpl-4.0.9.jar"/>
-->
<property name="stax.jar" value="jars/jsr173_1.0_api.jar"/>
<property name="woodstox.jar" value="jars/wstx-lgpl-4.0pr1.jar"/>
<path id="libraries.classpath">
<!-- StAX xml parser -->
<pathelement location="${basedir}/${stax.jar}" />
<!-- Woodstox XML processor -->
<pathelement location="${basedir}/${woodstox.jar}"/>
<!-- MigLayout manager -->
<pathelement location="${basedir}/${miglayout.jar}"/>
<!-- Command line processor -->
@ -157,13 +147,13 @@
</exec>
<property prefix="svn" file="build/svn.properties"/>
</target>
<target name="manifest" depends="svnproperties,gitproperties"
description="Creates the Manifest file.">
<manifest file="${basedir}/src/MANIFEST.MF">
<attribute name="Created-By" value="FreeCol Team"/>
<attribute name="Main-Class" value="net.sf.freecol.FreeCol"/>
<attribute name="Class-Path" value="${stax.jar} ${woodstox.jar} jars/jogg-0.0.7.jar jars/jorbis-0.0.15.jar ${miglayout.jar} ${cli.jar} ${cortado.jar}"/>
<attribute name="Class-Path" value="jars/jogg-0.0.7.jar jars/jorbis-0.0.15.jar ${miglayout.jar} ${cli.jar} ${cortado.jar}"/>
<attribute name="Product-Name" value="FreeCol"/>
<attribute name="Package-Title" value="FreeCol"/>
<attribute name="Package-Version" value="${svn.Revision}"/>

Binary file not shown.

Binary file not shown.

View File

@ -58,7 +58,7 @@ public final class StatisticsPanel extends FreeColPanel
private static final int NAME_COLUMN = 0, VALUE_COLUMN = 1;
private final String[] columnNames = { "Name", "Value" };
private Object data[][] = null;
/**
@ -87,7 +87,7 @@ public final class StatisticsPanel extends FreeColPanel
/**
* Returns the amount of columns in this statesTable.
*
*
* @return The amount of columns in this statesTable.
*/
public int getColumnCount() {
@ -96,7 +96,7 @@ public final class StatisticsPanel extends FreeColPanel
/**
* Returns the name of the specified column.
*
*
* @return The name of the specified column.
*/
public String getColumnName(int column) {
@ -105,7 +105,7 @@ public final class StatisticsPanel extends FreeColPanel
/**
* Returns the amount of rows in this statesTable.
*
*
* @return The amount of rows in this statesTable.
*/
public int getRowCount() {
@ -114,7 +114,7 @@ public final class StatisticsPanel extends FreeColPanel
/**
* Returns the value at the requested location.
*
*
* @param row The requested row.
* @param column The requested column.
* @return The value at the requested location.
@ -134,7 +134,7 @@ public final class StatisticsPanel extends FreeColPanel
/**
* Returns 'true' if the specified cell is editable, 'false' otherwise.
*
*
* @param row The specified row.
* @param column The specified column.
* @return 'true' if the specified cell is editable, 'false' otherwise.
@ -142,7 +142,7 @@ public final class StatisticsPanel extends FreeColPanel
public boolean isCellEditable(int row, int column) {
return false;
}
/**
* Returns the Class of the objects in the given column.
*/
@ -150,7 +150,7 @@ public final class StatisticsPanel extends FreeColPanel
return String.class;
}
}
/**
* Creates the statistics panel.
@ -160,7 +160,7 @@ public final class StatisticsPanel extends FreeColPanel
*/
public StatisticsPanel(FreeColClient freeColClient, GUI gui) {
super(freeColClient, gui, new BorderLayout());
// Retrieve the client and server data
Map<String, String> serverStatistics
= getController().getServerStatistics();
@ -171,7 +171,7 @@ public final class StatisticsPanel extends FreeColPanel
JPanel header = new JPanel();
this.add(header, BorderLayout.NORTH);
header.add(new JLabel("Statistics"),JPanel.CENTER_ALIGNMENT);
// Actual stats panel
JPanel statsPanel = new JPanel(new GridLayout(1,2));
JScrollPane scrollPane = new JScrollPane(statsPanel,
@ -220,7 +220,7 @@ public final class StatisticsPanel extends FreeColPanel
}
return panel;
}
private JPanel createStatsTable(String title, Map<String, String> data) {
JPanel panel = new JPanel();
panel.setLayout(new BorderLayout());
@ -230,7 +230,7 @@ public final class StatisticsPanel extends FreeColPanel
JTable table = new JTable(model);
table.setAutoCreateColumnsFromModel(true);
table.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
//table.setAutoCreateRowSorter(true); // Java 1.6 only
table.setAutoCreateRowSorter(true);
JScrollPane scrollPane = new JScrollPane(table);
table.addNotify();
scrollPane.getViewport().setOpaque(false);

View File

@ -64,21 +64,10 @@ public class FontResource extends Resource {
font = Font.decode(name.substring(SCHEME.length()));
}
// @compat java 1.5
// registerFont was only introduced in Java 1.6
if (font != null) {
try {
GraphicsEnvironment environment =
GraphicsEnvironment.getLocalGraphicsEnvironment();
Method registerFont = environment
.getClass().getMethod("registerFont", Font.class);
registerFont.invoke(environment, font);
} catch(Exception e) {
logger.warning("Failed to register font " + font.getName()
+ ": " + e.toString());
}
GraphicsEnvironment.getLocalGraphicsEnvironment()
.registerFont(font);
}
// end @compat
logger.info("Loaded font: "
+ ((font==null) ? "(null)" : font.getFontName())