改变图元的属性值
2006-06-29 08:54:55
Layer olayer = null;
olayer = m_map.getLayers().getLayer("摄像机"); olayer.setAutoLabel(true) ; LabelThemeList oLabelThemeList = null; oLabelThemeList = olayer.getLabelThemeList(); Integer iNum=null; iNum = new Integer(oLabelThemeList.size()); //System.out.println(iNum.toString());
LabelProperties oLabelProperties = new LabelProperties(); String labelString = ""Name:["+Name+"]""; //System.out.println(labelString); oLabelProperties.setMultiLineTextMode(oLabelProperties.MULTILINE_TEXT_ON) ; oLabelProperties.setOffset(new DoublePoint(0,0)); oLabelProperties.setLabelExpression(labelString); oLabelProperties.setHorizontalAlignment(LabelProperties.HORIZ_ALIGN_DEFAULT); oLabelProperties.setVerticalAlignment(LabelProperties.VERT_ALIGN_DEFAULT); com.mapinfo.graphics.Rendition rend = com.mapinfo.graphics.RenditionImpl.getDefaultRendition(); rend.setvalue(com.mapinfo.graphics.Rendition.FONT_FAMILY,"宋体"); rend.setvalue(com.mapinfo.graphics.Rendition.FONT_SIZE,9); rend.setvalue(com.mapinfo.graphics.Rendition.FONT_WEIGHT ,4); rend.setvalue(com.mapinfo.graphics.Rendition.FONT_STYLE, com.mapinfo.graphics.Rendition.FontStyle.NORMAL); rend.setvalue(com.mapinfo.graphics.Rendition.SYMBOL_FOREGROUND,Color.black ); //rend.setvalue(com.mapinfo.graphics.Rendition.FILTER_EFFECTS, com.mapinfo.graphics.Rendition.FilterEffects.OUTLINE); oLabelProperties.setRenditi ;
BaseLabelProperties oblp = new BaseLabelProperties(oLabelProperties);OverrideLabelTheme ovlt = new OverrideLabelTheme(oLabelProperties,"myLabel"); oLabelThemeList.add(ovlt) ; iNum = new Integer(oLabelThemeList.size()); //System.out.println(iNum.toString()); olayer.setLabelProperties(oblp) ; 本文出自 51CTO.COM技术博客 |


wenbo
博客统计信息
热门文章
最新评论
友情链接