Exemplo n.º 1
0
 public boolean action(Event e, Object o) {
   // Handle user selection of menu items.
   if (e.target instanceof MenuItem) {
     if (o.equals("Exit")) t.exit(0);
     if (o.equals("Query results")) redrawRect(200);
     if (o.equals("All")) redrawRect(199);
     else if (o.equals("Level 0")) redrawRect(0);
     else if (o.equals("Level 1")) redrawRect(1);
     else if (o.equals("Level 2")) redrawRect(2);
     else if (o.equals("Level 3")) redrawRect(3);
     else if (o.equals("Level 4")) redrawRect(4);
     else if (o.equals("Level 5")) redrawRect(5);
     else if (o.equals("Range query")) showQueryDlg(Constants.RANGEQUERY);
     else if (o.equals("Point query")) showQueryDlg(Constants.POINTQUERY);
     else if (o.equals("Circle query")) showQueryDlg(Constants.CIRCLEQUERY);
     else if (o.equals("Ring query")) showQueryDlg(Constants.RINGQUERY);
     else if (o.equals("Constraints query")) showQueryDlg(Constants.CONSTQUERY);
   } else return super.action(e, o);
   return true;
 }
Exemplo n.º 2
0
 public boolean handleEvent(Event e) {
   if (e.id == Event.WINDOW_DESTROY && e.target == this) t.exit(0);
   return super.handleEvent(e);
 }
Exemplo n.º 3
0
 private void redrawRect(int level) {
   // redraw the canvas if display level is changed.
   t.displaylevel = level;
   framedArea.area.repaint();
   label.setText("Current display level: " + t.displaylevel);
 }