Put markers in a component, add generic component update messages

This commit is contained in:
Mike Primm 2011-09-03 16:49:18 -05:00
parent dd8a84165b
commit 3f585c84b7
7 changed files with 151 additions and 46 deletions

View file

@ -79,35 +79,8 @@ public class Client {
}
}
public static class MarkerUpdate extends Update {
public String type = "marker";
public int x, y, z;
public String id;
public String label;
public String icon;
public String set;
public MarkerUpdate(Marker m, boolean deleted) {
this.id = m.getMarkerID();
this.label = m.getLabel();
this.x = m.getX();
this.y = m.getY();
this.z = m.getZ();
this.set = m.getMarkerSet().getMarkerSetID();
this.icon = m.getMarkerIcon().getMarkerIconID();
if(deleted) type = "markerdeleted";
}
}
public static class MarkerSetUpdate extends Update {
public String type = "markerset";
public String id;
public String label;
public MarkerSetUpdate(MarkerSet markerset, boolean deleted) {
this.id = markerset.getMarkerSetID();
this.label = markerset.getMarkerSetLabel();
if(deleted) type = "markersetdeleted";
}
public static class ComponentMessage extends Update {
public String type = "component";
/* Each subclass must provide 'ctype' string for component 'type' */
}
}