Exemple #1
0
 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);
   }
 }
Exemple #2
0
 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();
 }
Exemple #3
0
 public boolean isBuilding(Run record) {
   return record.isBuilding();
 }
Exemple #4
0
 public String getKey(Run record) {
   return String.valueOf(record.getNumber());
 }