if (graphic instanceof OMScalingIcon) { setGrabPointsForOMSI((OMScalingIcon)graphic); return; }
    public void setGrabPoints(OMGraphic graphic) {        Debug.message("eomg", "EditableOMScalingRaster.setGrabPoints(graphic)");        if (!(graphic instanceof OMScalingRaster)) {            return;        }        assertGrabPoints();        OMScalingRaster raster = (OMScalingRaster) graphic;        boolean ntr = raster.getNeedToRegenerate();        int renderType = raster.getRenderType();        int lineType = raster.getLineType();        int top = 0;        int bottom = 0;        int left = 0;        int right = 0;        LatLonPoint llp;        int latoffset = 0;        int lonoffset = 0;        boolean doStraight = true;        if (ntr == false) {            if (renderType == OMGraphic.RENDERTYPE_LATLON                    || renderType == OMGraphic.RENDERTYPE_OFFSET) {                if (projection != null) {                    float wlon = raster.getULLon();                    float nlat = raster.getULLat();                    float elon = raster.getLRLon();                    float slat = raster.getLRLat();                    llp = new LatLonPoint(nlat, wlon);                    java.awt.Point p = projection.forward(llp);                    if (renderType == OMGraphic.RENDERTYPE_LATLON) {                        doStraight = false;                        top = (int) p.getY();                        left = (int) p.getX();                        gpnw.set((int) p.getX(), (int) p.getY());                        p = projection.forward(slat, elon);                        gpse.set((int) p.getX(), (int) p.getY());                        p = projection.forward(nlat, elon);                        gpne.set((int) p.getX(), (int) p.getY());                        p = projection.forward(slat, wlon);                        gpsw.set((int) p.getX(), (int) p.getY());                        p = projection.forward(nlat - (nlat - slat) / 2f, wlon                                + (elon - wlon) / 2f);                        gpc.set((int) p.getX(), (int) p.getY());                    } else {                        latoffset = (int) p.getY();                        lonoffset = (int) p.getX();                        gpo.set(lonoffset, latoffset);                    }                }            }            if (doStraight) {                Debug.message("eomg",                        "EditableOMScalingRaster: drawing straight line rectangle");                top = raster.getY() + latoffset;                bottom = raster.getY() + raster.getHeight() + latoffset;                right = raster.getX() + raster.getWidth() + lonoffset;                left = raster.getX() + lonoffset;                // We have to do some fancy point wrangling to keep                // from messing up the next setGrabPoints().                if (movingPoint == gpc || movingPoint == gpo                        || movingPoint == null) {                    gpne.set(right, top);                    gpnw.set(left, top);                    gpse.set(right, bottom);                    gpsw.set(left, bottom);                } else if (movingPoint == gpnw) {                    gpne.set(gpse.getX(), gpnw.getY());                    gpsw.set(gpnw.getX(), gpse.getY());                } else if (movingPoint == gpse) {                    gpne.set(gpse.getX(), gpnw.getY());                    gpsw.set(gpnw.getX(), gpse.getY());                } else if (movingPoint == gpsw) {                    gpnw.set(gpsw.getX(), gpne.getY());                    gpse.set(gpne.getX(), gpsw.getY());                } else if (movingPoint == gpne) {                    gpnw.set(gpsw.getX(), gpne.getY());                    gpse.set(gpne.getX(), gpsw.getY());                }                int middlex = (right - left) / 2;                int middley = (bottom - top) / 2;                gpc.set(left + middlex, top + middley);                gpc.updateOffsets();                //              Debug.output("Center setting x: " + gpc.getX() + ",                // y:" + gpc.getY());            }            if (renderType == OMGraphic.RENDERTYPE_OFFSET) {                gpo.updateOffsets();            }        } else {            Debug.message("eomg",                    "EditableOMScalingRaster.setGrabPoints: graphic needs to be regenerated");        }    }