////////////// send the new graphic, along with instructions
//on what to do with it, to the server.
String id = null; // unknown
Object obj = omg.getAppObject();
LinkProperties lp = null;
if (obj != null && obj instanceof LinkProperties) {
lp = (LinkProperties) obj;
id = lp.getProperty(LPC_GRAPHICID);
Debug.message("link",
"AmpLinkLayer: received modified server graphic " + lp);
} else {
Debug.message("link", "AmpLinkLayer: received new graphic from dt");
}
if (id == null) {
// Doesn't look like it was a modified graphic already
// recieved from the server, so we should tell the server
// to add it to its list.
action.setMask(OMAction.ADD_GRAPHIC_MASK);
} else {
action.setMask(OMAction.UPDATE_GRAPHIC_MASK);
}
if (omg instanceof OMRangeRings) {
extraGraphics.doAction(omg, action);
repaint();
return;
}
try {
// We do want the link object here... If another thread is
// using the link, wait.
ClientLink l = linkManager.getLink(true);
if (l == null) {
System.err.println("LinkLayer.drawingComplete: unable to get link.");
return;
}
synchronized (l) {
LinkActionList lal = new LinkActionList(l, new LinkProperties());
if (action.isMask(OMAction.ADD_GRAPHIC_MASK)
|| action.isMask(OMAction.UPDATE_GRAPHIC_MASK)) {
lal.writeGraphicGestureHeader(action.getValue());
LinkGraphic.write(omg, l);