1 /*
2  * $Id: PolygonPopup.java,v 1.1 2003/08/24 18:37:36 juhal Exp $
3  */
4 package org.xpilot.jxpmap;
5 
6 import java.awt.event.ActionEvent;
7 
8 import javax.swing.JMenuItem;
9 
10 /**
11  * @author jli
12  */
13 public class PolygonPopup extends MapObjectPopup {
14 
15     protected MapPolygon poly;
16     private JMenuItem itemRotate;
17 
PolygonPopup(MapPolygon poly)18     public PolygonPopup(MapPolygon poly) {
19         super(poly);
20         this.poly = poly;
21         JMenuItem item = new JMenuItem("Rotate");
22         item.addActionListener(this);
23         add(item);
24         itemRotate = item;
25     }
26 
actionPerformed(ActionEvent ae)27     public void actionPerformed(ActionEvent ae) {
28         if (ae.getSource() == itemRotate) {
29             canvas.setCanvasEventHandler(poly.getRotateHandler());
30         } else {
31             super.actionPerformed(ae);
32         }
33     }
34 }
35