[OpenMap Users] OMText please help

From: Mariusz Chmielewski <mchmiel@isi.wat.waw.pl>
Date: Fri Jun 03 2005 - 08:35:43 EDT

I created a layer that viewes my Pictures and inside each Picture object
i put the description (OMText) but the thext ins't showing i debugged it
sereral times and found that when called rander on OMText the function
returns without any results in this line:

public synchronized void render(Graphics g) {
       g = g.create();

>>>>> if (getNeedToRegenerate() || pt == null || !isVisible())
                       return;

i do not know why perhaps my concept of extending an OMRaster class and
putting attribute of OMText inside it which displays the text under the
icon isn't right???

what am i doing wrong ??

here is the layer implementation:

   public void projectionChanged(ProjectionEvent event) {
       projection = event.getProjection();
       Iterator itList = unitList.iterator();
       while (itList.hasNext()) {
           MilitaryUnitGraphicsObj graphic = (MilitaryUnitGraphicsObj)
itList
                   .next();
          
          
           //OMGraphicList graphic = (OMGraphicList) itList.next();
          
           //graphic.getUnitDescription().generate(projection);
           graphic.generate(projection);
           graphic.getUnitDescription().generate(projection);
       }
   }

   public void paint(Graphics g) {
       Iterator itList = unitList.iterator();
       while (itList.hasNext()) {
           MilitaryUnitGraphicsObj graphic = (MilitaryUnitGraphicsObj)
itList.next();
           //OMGraphicList graphic = (OMGraphicList) itList.next();
           //OMGraphicList a = new OMGraphicList();
           //a.add(graphic);
           graphic.render(g);
          
           //a.add(graphic.getUnitDescription());
           graphic.getUnitDescription().render(g);
           //a.render(g);
       }
      
       //thisS.render(g);
       //unitList.renderAllAsSelected(g);
      
   }

   public void updateGraphics() {

      
       Iterator iter = unitList.iterator();
       while (iter.hasNext()) {
           MilitaryUnitGraphicsObj militaryUnit =
(MilitaryUnitGraphicsObj) iter.next();
           militaryUnit.setNeedToRegenerate(true);
           militaryUnit.getUnitDescription().setNeedToRegenerate(true);
           if (projection != null){
               militaryUnit.getUnitDescription().generate(projection);
               militaryUnit.generate(projection);
              
           }
          
       }
       repaint();

   }

please help

Mariusz Chmielewski

--
[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 Fri Jun 3 08:40:39 2005

This archive was generated by hypermail 2.1.8 : Fri Jun 03 2005 - 08:40:40 EDT