注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 利用IPSec实现网络安全之..
 帮助

改变图元的属性值


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 ;
OverrideLabelTheme ovlt = new OverrideLabelTheme(oLabelProperties,"myLabel");
oLabelThemeList.add(ovlt) ;
iNum = new Integer(oLabelThemeList.size());
//System.out.println(iNum.toString());
BaseLabelProperties oblp = new BaseLabelProperties(oLabelProperties);
olayer.setLabelProperties(oblp) ;
 
 
 





    文章评论
 
2006-08-05 10:54:00
olayer = m_map.getLayers().getLayer("摄像机");
mapxtreme471中提倡使用featureLayer吧,这样用不太好

2008-06-11 13:23:16
文章很不错,也欢迎博主访问我的技术blog:
http://xiaowang.blog.51cto.com

 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: