[OpenMap Users] DeclutterMatrix

From: Alessio Iannone <alessio_iannone_at_yahoo.it>
Date: Mon, 28 Apr 2008 13:41:13 +0000 (GMT)

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.iannone_at_nextant.it IM: quonn77_at_hotmail.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_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Mon Apr 28 2008 - 09:51:45 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:09 EDT