public int compare(Run record, String key) { try { int k = Integer.parseInt(key); return record.getNumber() - k; } catch (NumberFormatException nfe) { return String.valueOf(record.getNumber()).compareTo(key); } }
public static void main(String[] args) { final Run application = new Run(); application.setVisible(true); application.setSize(1200, 800); application.addWindowListener( new WindowAdapter() { @Override public void windowClosing(WindowEvent windowEvent) { System.exit(0); } }); ActionListener nextFrameAction = new ActionListener() { public void actionPerformed(ActionEvent actionEvent) { synchronized (application.engine) { application.engine.generateNextFrame(); } application.repaint(); } }; new Timer(50, nextFrameAction).start(); }
public boolean isBuilding(Run record) { return record.isBuilding(); }
public String getKey(Run record) { return String.valueOf(record.getNumber()); }