int posX = LayerUtils.intFromProperties(eventProps, POSX_FIELD, ERROR_VALUE_INT); int posY = LayerUtils.intFromProperties(eventProps, POSY_FIELD, ERROR_VALUE_INT); int width = LayerUtils.intFromProperties(eventProps, WIDTH_FIELD, ERROR_VALUE_INT); int height = LayerUtils.intFromProperties(eventProps, HEIGHT_FIELD, ERROR_VALUE_INT);
    protected void processEventProperties(Properties eventProps) {        JIcon jicon = null;        int status;        Node node;        Line line;        String cmd = eventProps.getProperty(COMMAND_FIELD);        // Used for many (if not all commands, might as well do this        // here.        int index = LayerUtils.intFromProperties(eventProps,                INDEX_FIELD,                ERROR_VALUE_INT);        if (cmd.equals(NODE_OBJECT)) {            int shape = LayerUtils.intFromProperties(eventProps,                    SHAPE_FIELD,                    ERROR_VALUE_INT);            if (index == ERROR_VALUE_INT) {                Debug.error("NMGL: error parsing object index for node.");                return;            }            node = nodeList.get(index);            if (shape == 11) {                String icon = eventProps.getProperty(ICON_FIELD);                if (DEBUG)                    Debug.output("NetMapReader: jimage  " + icon);            }            if (shape == NODE_DELETE) { // Delete                // While we're at it, we might as well delete all the                // "Line" entries that terminate on this node as                // well...                if (node != null) {                    lineList.del(node);                    nodeList.del(node);                }            } else if (shape == NODE_MOVE && node != null) { // move                setNodePositionFromEventProps(node, eventProps);                lineList.move(node);                node.setTime(Double.parseDouble(eventProps.getProperty(TIME_FIELD,                        "0")));            } else {                // Define a new entry if "shape" is anything else,                // including NODE_MOVE without a valid node.                int posX = LayerUtils.intFromProperties(eventProps,                        POSX_FIELD,                        ERROR_VALUE_INT);                int posY = LayerUtils.intFromProperties(eventProps,                        POSY_FIELD,                        ERROR_VALUE_INT);                int width = LayerUtils.intFromProperties(eventProps,                        WIDTH_FIELD,                        ERROR_VALUE_INT);                int height = LayerUtils.intFromProperties(eventProps,                        HEIGHT_FIELD,                        ERROR_VALUE_INT);                status = LayerUtils.intFromProperties(eventProps,                        STATUS_FIELD,                        0);                int menu = LayerUtils.intFromProperties(eventProps,                        MENU_FIELD,                        0);                int joffset = LayerUtils.intFromProperties(eventProps,                        JOFFSET_FIELD,                        ERROR_VALUE_INT);                String label = eventProps.getProperty(LABEL_FIELD);                if (label == null) {                    // This label misdirection is temporary...                    label = eventProps.getProperty(INDEX_FIELD);                }                String ip = eventProps.getProperty(IP_FIELD);                float elevation = LayerUtils.floatFromProperties(eventProps,                        ELEVATION_FIELD,                        0f);                boolean isLocalhost = false;                if (ip != null && localhostIP != null) {                    isLocalhost = localhostIP.equals(ip);                    if (DEBUG) {                        Debug.output("NetMapGraphicLoader displaying a node running on the localhost: "                                + localhostIP);                    }                }                if (DEBUG) {                    Debug.output("Creating node (" + label + ")");                }                try {                    if (shape != ERROR_VALUE_INT) {                        node = nodeList.add(label, index, shape, menu, status);                        node.setLocalhost(isLocalhost);                    }                } catch (Exception e) {                    Debug.error("NMGL: error creating node");                }                setNodePositionFromEventProps(node, eventProps);            }        } else if (cmd.equals(NODE_OBJECT_STATUS)) {            if (index == ERROR_VALUE_INT) {                Debug.error("NMGL: error parsing object index for status update.");                return;            }            node = nodeList.get(index);            if (node != null) {                status = LayerUtils.intFromProperties(eventProps,                        STATUS_FIELD,                        ERROR_VALUE_INT);                if (status != ERROR_VALUE_INT) {                    node.setStatus(status);                }            }        } else if (cmd.equals(LINK_OBJECT_STATUS)) {            if (index == ERROR_VALUE_INT) {                Debug.error("NMGL: error parsing line index for status update.");                return;            }            line = lineList.get(index);            if (line != null) {                status = LayerUtils.intFromProperties(eventProps,                        STATUS_FIELD,                        ERROR_VALUE_INT);                if (status != ERROR_VALUE_INT) {                    line.setStatus(status);                }            }        } else if (cmd.equals(LINK_OBJECT)) {            if (index == ERROR_VALUE_INT) {                Debug.error("NMGL: error parsing line index for link.");                return;            }            line = lineList.get(index);            int shape = LayerUtils.intFromProperties(eventProps,                    SHAPE_FIELD,                    ERROR_VALUE_INT);            if (shape == NODE_DELETE) {                lineList.del(index);            } else {                status = LayerUtils.intFromProperties(eventProps,                        STATUS_FIELD,                        0);                int node1 = LayerUtils.intFromProperties(eventProps,                        LINK_NODE1_FIELD,                        ERROR_VALUE_INT);                int node2 = LayerUtils.intFromProperties(eventProps,                        LINK_NODE2_FIELD,                        ERROR_VALUE_INT);                if (node1 == ERROR_VALUE_INT || node2 == ERROR_VALUE_INT) {                    Debug.error("NMGL: error parsing node indexes for link");                    return;                }                Node n1 = nodeList.get(node1);                Node n2 = nodeList.get(node2);                if (n1 != null && n2 != null) {                    lineList.add(String.valueOf(index),                            index,                            shape,                            status,                            n1,                            n2);                } else {                    if (DEBUG) {                        Debug.output("NetMapGraphicLoader: can't create lobj, nodes are undefined");                    }                }            }        } else if (cmd.equals(REFRESH) || cmd.equals(UPDATE)) {            //          manageGraphics();        } else if (cmd.equals(CLEAR)) {            if (nodeList != null) {                nodeList.flush();            }            if (lineList != null) {                lineList.flush();            }            //          manageGraphics();        } else {            if (DEBUG) {                Debug.output("NMGL: received unused event: "                        + eventProps.toString());            }        }        manageGraphics();    }