我设置后不起作用,代码如下:
if(dataset.getType() == DatasetType.TEXT) { layer.setEditable(true); TextStyle textStyle = new TextStyle(); textStyle.setRotation(30.0); textStyle.setShadow(true); textStyle.setAlignment(TextAlignment.TOPCENTER); textStyle.setForeColor(new Color(0, 0,0)); textStyle.setBackOpaque(true); textStyle.setBold(true); textStyle.setFontName("宋体"); textStyle.setFontHeight(1.0); textStyle.setFontWidth(1.0); textStyle.setSizeFixed(true); textStyle.setItalic(true); textStyle.setOutline(true); textStyle.setStrikeout(true); textStyle.setUnderline(true); textStyle.setWeight(500); Recordset recordset = ((DatasetVector)dataset).getRecordset(false, CursorType.DYNAMIC); recordset.edit(); boolean status = recordset.moveFirst(); while(status) { GeoText text = (GeoText)recordset.getGeometry(); if(text != null) { text.setTextStyle(textStyle); } status = recordset.moveNext(); } recordset.update(); recordset.close(); recordset.dispose(); layer.setEditable(false); }