[OpenMap Users] DeclutterMatrix

From: Alessio Iannone <alessio_iannone_at_email.domain.hidden>
Date: Mon Apr 28 2008 - 09:41:13 EDT

Hi, I am trying to use the DeclutterMatrix in order to be able to declutter labelling of Shape File Features (road) according to DBF data and configured Rules. I need more info and or example on how to use it. I have tried to integrate it into the following class OMGraphic where i have added public Point setDeclutter(OMLabeler labeler) { if(labeler==null || declutterMatrix==null || declutterType==DECLUTTERTYPE_NONE) return null; if(declutterType==DECLUTTERTYPE_MOVE){ if (labeler instanceof OMText){ OMText text = (OMText)labeler; Point mapLoc = text.getMapLocation(); FontMetrics fm = FontDesignMetrics.getMetrics(text.getFont()); int fontSize = text.getFont().getSize(); int width=fm.stringWidth(text.getData()); int heigth=fm.getHeight(); Point takenPoint = declutterMatrix.setNextOpen(mapLoc, width,heigth); declutterMatrix.setTaken(takenPoint, width,heigth); return takenPoint; } } return null; } now i have Overrided the setLocation(Point p) of an OMLabeler instance with a code like this: public void setLocation(Point p) { try{ super.setLocation(p); Point newPos= setDeclutter(this); super.setLocation(newPos); }catch (Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); Debug.output(sw.toString()); } } A part the double call to super.setLocation all the label are shown on the top left corner......any hints, suggestion, tutorial or so on? Best Regards . Alessio Iannone Software Engineer Mobile: 39 329 8834960 Email: alessio.iannone1nextant.it IM: quonn771hotmail.com (AIM) http://www.linkedin.com/in/alessioiannone Web sites of the Martial Arts I play Nextant - Navcomm Applications Via Alessandro Noale See who we know in common Want a signature like this? Inviato da Yahoo! Mail. La casella di posta intelligente. http://it.docs.yahoo.com/mail/overview/index.html

--
[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 Mon Apr 28 09:59:15 2008

This archive was generated by hypermail 2.1.8 : Mon Apr 28 2008 - 09:59:16 EDT