protected boolean position(Projection proj){
  if (proj == null) {
    logger.fine("OMRasterObject: null projection in position!");
    return false;
  }
  projWidth=proj.getWidth();
  projHeight=proj.getHeight();
switch (renderType) {
case RENDERTYPE_LATLON:
    if (!proj.isPlotable(lat,lon)) {
      if (DEBUG) {
        logger.fine("OMRasterObject: point is not plotable!");
      }
      setNeedToReposition(true);
      return false;
    }
  point1=(Point)proj.forward(lat,lon,new Point());
break;
case RENDERTYPE_XY:
point1=new Point(x,y);
break;
case RENDERTYPE_OFFSET:
if (!proj.isPlotable(lat,lon)) {
if (DEBUG) {
logger.fine("OMRasterObject: point is not plotable!");
}
setNeedToReposition(true);
return false;
}
point1=(Point)proj.forward(lat,lon,new Point());
point1.x+=x;
point1.y+=y;
break;
case RENDERTYPE_UNKNOWN:
if (DEBUG) {
logger.fine("OMRasterObject.position(): ignoring unknown rendertype, wingin' it");
}
if (lat == 0 && lon == 0) {
if (x == 0 && y == 0) {
if (DEBUG) {
logger.fine("OMRasterObject.position(): Not enough info in object to place it reasonably.");
}
point1=new Point(-width,-height);
point2=new Point(0,0);
return false;
}
 else {
point1=new Point(x,y);
}
}
 else {
if (!proj.isPlotable(lat,lon)) {
logger.fine("OMRasterObject: point is not plotable!");
return false;
}
point1=(Point)proj.forward(lat,lon,new Point());
}
break;
}
point2=new Point(0,0);
point2.x=point1.x + width;
point2.y=point1.y + height;
setNeedToReposition(false);
return true;
}

protected boolean position ( Projection proj ) { if ( proj == null ) { logger . fine ( "OMRasterObject: null projection in position!" ) ; return false ; } projWidth = proj . getWidth ( ) ; projHeight = proj . getHeight ( ) ; switch ( renderType ) { case RENDERTYPE_LATLON : if ( ! proj . isPlotable ( lat , lon ) ) { if ( DEBUG ) { logger . fine ( "OMRasterObject: point is not plotable!" ) ; } setNeedToReposition ( true ) ; return false ; } point1 = ( Point ) proj . forward ( lat , lon , new Point ( ) ) ; break ; case RENDERTYPE_XY : point1 = new Point ( x , y ) ; break ; case RENDERTYPE_OFFSET : if ( ! proj . isPlotable ( lat , lon ) ) { if ( DEBUG ) { logger . fine ( "OMRasterObject: point is not plotable!" ) ; } setNeedToReposition ( true ) ; return false ; } point1 = ( Point ) proj . forward ( lat , lon , new Point ( ) ) ; point1 . x += x ; point1 . y += y ; break ; case RENDERTYPE_UNKNOWN : if ( DEBUG ) { logger . fine ( "OMRasterObject.position(): ignoring unknown rendertype, wingin' it" ) ; } if ( lat == 0 && lon == 0 ) { if ( x == 0 && y == 0 ) { if ( DEBUG ) { logger . fine ( "OMRasterObject.position(): Not enough info in object to place it reasonably." ) ; } point1 = new Point ( - width , - height ) ; point2 = new Point ( 0 , 0 ) ; return false ; } else { point1 = new Point ( x , y ) ; } } else { if ( ! proj . isPlotable ( lat , lon ) ) { logger . fine ( "OMRasterObject: point is not plotable!" ) ; return false ; } point1 = ( Point ) proj . forward ( lat , lon , new Point ( ) ) ; } break ; } point2 = new Point ( 0 , 0 ) ; point2 . x = point1 . x + width ; point2 . y = point1 . y + height ; setNeedToReposition ( false ) ; return true ; }
since the image doesn ' t necessarily need to be regenerated when it is merely moved , raster objects have this function , called from generate ( ) and when a placement attribute is changed .
