|
From: Johannes Z. <jza...@us...> - 2006-02-28 11:23:24
|
Update of /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23808/src/net/sf/magicmap/client/model/node Modified Files: InfoObject.java NodeModel.java InfoObjectNode.java Added Files: RFIDTagNode.java RFIDTag.java RFIDAntenna.java RFIDAntennaNode.java Log Message: added support for info objects and rfid antennas and tags --- NEW FILE: RFIDAntenna.java --- /** * */ package net.sf.magicmap.client.model.node; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class RFIDAntenna { private String url; private int x; private int y; private String map; /** * */ public RFIDAntenna(String url, int x, int y, String mapName) { this.url = url; this.x = x; this.y = y; this.map = mapName; } public String getURL() { return url; } public String getMap() { return map; } public void setMap(String map) { this.map = map; } public int getX() { return x; } public int getY() { return y; } } --- NEW FILE: RFIDAntennaNode.java --- /** * */ package net.sf.magicmap.client.model.node; import java.util.ArrayList; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class RFIDAntennaNode extends Node { /** * @param model */ public RFIDAntennaNode(NodeModel model) { super(model); } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getNeighbors() */ @Override public ArrayList getNeighbors() { return null; } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getType() */ @Override public int getType() { return NodeModel.NODETYPE_RFID_ANTENNA; } } Index: NodeModel.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node/NodeModel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** NodeModel.java 26 Feb 2006 10:20:57 -0000 1.4 --- NodeModel.java 28 Feb 2006 11:23:16 -0000 1.5 *************** *** 40,43 **** --- 40,46 ---- public static final int NODETYPE_MAP = 4; public static final int NODETYPE_GEOPOS = 5; + public static final int NODETYPE_INFO = 6; + public static final int NODETYPE_RFID_ANTENNA = 7; + public static final int NODETYPE_RFID_TAG = 8; private HashMap nodes; --- NEW FILE: RFIDTagNode.java --- /** * */ package net.sf.magicmap.client.model.node; import java.util.ArrayList; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class RFIDTagNode extends Node { /** * @param model */ public RFIDTagNode(NodeModel model) { super(model); } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getNeighbors() */ @Override public ArrayList getNeighbors() { return null; } /* (non-Javadoc) * @see net.sf.magicmap.client.model.node.Node#getType() */ @Override public int getType() { return NodeModel.NODETYPE_RFID_TAG; } } Index: InfoObjectNode.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObjectNode.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InfoObjectNode.java 23 Feb 2006 18:34:38 -0000 1.1 --- InfoObjectNode.java 28 Feb 2006 11:23:16 -0000 1.2 *************** *** 33,38 **** @Override public int getType() { ! // TODO Auto-generated method stub ! return 0; } --- 33,37 ---- @Override public int getType() { ! return NodeModel.NODETYPE_INFO; } --- NEW FILE: RFIDTag.java --- /** * */ package net.sf.magicmap.client.model.node; /** * @author Johannes Zapotoczky (joh...@za...) * */ public class RFIDTag { private String url; private int x; private int y; private String map; private long timestamp; /** * */ public RFIDTag(String id, long timestamp) { this.url = id; this.timestamp = timestamp; } public String getMap() { return map; } public String getUrl() { return url; } public int getX() { return x; } public int getY() { return y; } public boolean equals(RFIDTag tag2) { return url.equals(tag2.getUrl()); } public long getTimestamp() { return timestamp; } public void setTimestamp(long timestamp) { this.timestamp = timestamp; } } Index: InfoObject.java =================================================================== RCS file: /cvsroot/magicmap/magicmapclient/src/net/sf/magicmap/client/model/node/InfoObject.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** InfoObject.java 23 Feb 2006 18:34:38 -0000 1.1 --- InfoObject.java 28 Feb 2006 11:23:16 -0000 1.2 *************** *** 4,12 **** package net.sf.magicmap.client.model.node; /** * @author Johannes Zapotoczky (joh...@za...) * */ ! public class InfoObject { } --- 4,83 ---- package net.sf.magicmap.client.model.node; + import java.io.Serializable; + /** * @author Johannes Zapotoczky (joh...@za...) * */ ! public class InfoObject implements Serializable { ! ! public static final int TYPE_INFO = 1; ! public static final int TYPE_PHOTO = 2; ! ! /** ! * serial version id ! */ ! private static final long serialVersionUID = -1574621314942885814L; ! ! ! private int x; ! private int y; ! private String map; ! ! private int type; ! ! private String url; ! ! /** ! * Constructor, none of the parameters may be null ! * @param url ! * @param type ! */ ! public InfoObject (String url, int type) { ! this(url, type, -1, -1, ""); ! } ! ! /** ! * Constructor, none of the parameters may be null ! * @param url ! * @param type ! */ ! public InfoObject (String url, int type, int x, int y, String map) { ! this.url = url; ! this.type = type; ! this.x = x; ! this.y = y; ! this.map = map; ! } ! ! public int getType() { ! return type; ! } ! ! public void setType(int type) { ! this.type = type; ! } ! ! public String getUrl() { ! return url; ! } ! ! public void setUrl(String url) { ! this.url = url; ! } ! ! public String getMap() { ! return map; ! } ! ! public int getX() { ! return x; ! } ! ! public int getY() { ! return y; ! } ! ! } |