Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23808/src/net/sf/magicmap/client/gui
Modified Files:
MapPanel.java
Log Message:
added support for info objects and rfid antennas and tags
Index: MapPanel.java
===================================================================
RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/gui/MapPanel.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** MapPanel.java 23 Feb 2006 18:34:39 -0000 1.14
--- MapPanel.java 28 Feb 2006 11:23:16 -0000 1.15
***************
*** 19,22 ****
--- 19,24 ----
import net.sf.magicmap.client.controller.Controller;
import net.sf.magicmap.client.gui.dialogs.GeoPosDialog;
+ import net.sf.magicmap.client.gui.dialogs.InfoObjectDialog;
+ import net.sf.magicmap.client.gui.dialogs.RFIDAntennaDialog;
import net.sf.magicmap.client.gui.utils.GUIBuilder;
import net.sf.magicmap.client.gui.utils.GUIConstants;
***************
*** 31,37 ****
--- 33,41 ----
import net.sf.magicmap.client.model.node.ClientNode;
import net.sf.magicmap.client.model.node.GeoPos;
+ import net.sf.magicmap.client.model.node.InfoObject;
import net.sf.magicmap.client.model.node.LocationNode;
import net.sf.magicmap.client.model.node.Node;
import net.sf.magicmap.client.model.node.NodeModel;
+ import net.sf.magicmap.client.model.node.RFIDAntenna;
import net.sf.magicmap.client.utils.Settings;
import net.sf.magicmap.client.views.MapView;
***************
*** 65,68 ****
--- 69,73 ----
private AbstractAction createInfoObjectAction;
private AbstractAction createRFIDAntennaAction;
+ private AbstractAction createRFIDTagAction;
private AbstractAction fetchLocationsAction;
private MagicAction fixAction;
***************
*** 142,145 ****
--- 147,161 ----
}
};
+
+ createRFIDTagAction = new AbstractAction(GUIUtils.i18n("createrfidtag")) {
+ /**
+ * serial version id
+ */
+ private static final long serialVersionUID = 1L;
+
+ public void actionPerformed(ActionEvent e){
+ createRFIDTag();
+ }
+ };
measureLocationAction = new AbstractAction(GUIUtils.i18n("measurelocation")) {
***************
*** 232,237 ****
menu.add(GUIBuilder.createMenuItem(createLocationAction));
menu.add(GUIBuilder.createMenuItem(createGeoPosAction));
! // menu.add(GUIBuilder.createMenuItem(createInfoObjectAction));
! // menu.add(GUIBuilder.createMenuItem(createRFIDAntennaAction));
menu.addSeparator();
menu.add(GUIBuilder.createMenuItem(fetchLocationsAction));
--- 248,253 ----
menu.add(GUIBuilder.createMenuItem(createLocationAction));
menu.add(GUIBuilder.createMenuItem(createGeoPosAction));
! menu.add(GUIBuilder.createMenuItem(createInfoObjectAction));
! menu.add(GUIBuilder.createMenuItem(createRFIDAntennaAction));
menu.addSeparator();
menu.add(GUIBuilder.createMenuItem(fetchLocationsAction));
***************
*** 345,360 ****
*/
void createInfoObject() {
! String r = JOptionPane.showInputDialog(this, GUIUtils.i18n("locationname"));
! if (r != null){
! Date date = new Date();
! String timeAsString = new SimpleDateFormat(Settings.TIME_DATE_FORMAT).format(date);
!
! /*TODO: WORKAROUND, die Position hat alle nötigen Informationen (Client, der sie angelegt/verändert hat), Zeitpunkt der letzten Änderung,
! * daher sollte die Information über den Client und der Zeitpunkt des Anlegens einer Position !!!NICHT!!! in ihrem Namen gespeichert werden!!!!
! *
! * todo: Hier den Client und den Zeitpunkt aus dem Namen entfernen, Information nur beim Darstellen auf der Karte aus dem PositionDTO nehmen!
! */
! Controller.getInstance().createLocation(getLastX(), getLastY(),
! (r + " (" + Controller.getInstance().getClient().getName() + ") <" + timeAsString + ">"), true, this);
}
}
--- 361,368 ----
*/
void createInfoObject() {
! InfoObject infoObject = InfoObjectDialog.showDialog(MainGUI.getInstance());
! if (infoObject != null) {
! Controller.getInstance().createInfoObject(getLastX(), getLastY(), infoObject,
! Controller.getInstance().getCurrentMap().name, true, this);
}
}
***************
*** 366,369 ****
--- 374,390 ----
*/
void createRFIDAntenna() {
+ RFIDAntenna antenna = RFIDAntennaDialog.showDialog(MainGUI.getInstance());
+ if (antenna != null) {
+ Controller.getInstance().createRFIDAntenna(getLastX(), getLastY(), antenna,
+ Controller.getInstance().getCurrentMap().name, true, this);
+ }
+ }
+
+
+ /**
+ * Create an info object for the current selected location
+ *
+ */
+ void createRFIDTag() {
String r = JOptionPane.showInputDialog(this, GUIUtils.i18n("locationname"));
if (r != null){
|