An error

From: Shah,Nirav G. <nshah@mitre.org>
Date: Thu Jun 07 2001 - 08:25:18 EDT

I am getting the following runtime error
OMRasterObject.render : Attempting to draw a Image that is not ready!
Image probably wasn't available

While trying to run the following code that adds my own layer to the
openmap viewer.

package com.bbn.openmap.layer;

import com.bbn.openmap.Layer;
import com.bbn.openmap.event.*;
import com.bbn.openmap.layer.location.*;
import com.bbn.openmap.omGraphics.*;
import com.bbn.openmap.proj.*;
import com.bbn.openmap.tools.drawing.DrawingTool;
import com.bbn.openmap.tools.drawing.DrawingToolRequestor;
import com.bbn.openmap.util.Debug;
import com.bbn.openmap.util.PaletteHelper;

import java.awt.Color;
import java.awt.Component;
import java.awt.event.*;
import java.util.*;
import java.util.Properties;
import javax.swing.*;

public class TankLayer extends Layer {
   Projection oldProjection;
   OMGraphicList omList = new OMGraphicList();
   OMRaster omr;
   ImageIcon tank ;
   
public void draw() {
    tank = new ImageIcon("tank.gif");
    omr = new OMRaster(45.3f,-65.04f,tank);
    omList.add(omr);
    
}

public void setProperties(String prefix, Properties props) {
super.setProperties(prefix,props);
draw();
setAddToBeanContext(true);
}
public void paint(java.awt.Graphics g) {
omList.render(g);
   }
   /*
    /**
     * Implementing the ProjectionPainter interface.
     */
  
    public synchronized void renderDataForProjection(Projection proj,
java.awt.Graphics g) {
        if (proj != null && !proj.equals(oldProjection)) {
            oldProjection = proj.makeClone();
            omList.generate(proj);
            
        }
        paint(g);
        
    }

    /** From the ProjectionListener interface. */
    public void projectionChanged(com.bbn.openmap.event.ProjectionEvent
pe) {
        System.out.println("hello");
        Projection newProjection = pe.getProjection();
        
        if (!newProjection.equals(oldProjection)) {
            oldProjection = newProjection.makeClone();
            omList.generate(newProjection);
            repaint();
        }
        
        fireStatusUpdate(LayerStatusEvent.FINISH_WORKING);
    }
}

--
[To unsubscribe to this list send an email to "majdart@bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Thu Jun 7 08:23:46 2001

This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:31 EDT