本文整理汇总了Java中org.geotools.map.StyleLayer类的典型用法代码示例。如果您正苦于以下问题:Java StyleLayer类的具体用法?Java StyleLayer怎么用?Java StyleLayer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StyleLayer类属于org.geotools.map包,在下文中一共展示了StyleLayer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import org.geotools.map.StyleLayer; //导入依赖的package包/类
@Override
public void init(final IEditorSite site, final IEditorInput input) throws PartInitException {
setSite(site);
final FileEditorInput fi = (FileEditorInput) input;
file = fi.getFile();
final IPath path = fi.getPath();
final File f = path.makeAbsolute().toFile();
try {
pathStr = f.getAbsolutePath();
final ShapefileDataStore store = new ShapefileDataStore(f.toURI().toURL());
content = new MapContent();
featureSource = store.getFeatureSource();
style = Utils.createStyle(f, featureSource);
layer = new FeatureLayer(featureSource, style);
mode = determineMode(featureSource.getSchema(), "Polygon");
final List<FeatureTypeStyle> ftsList = style.featureTypeStyles();
if (ftsList.size() > 0) {
fts = ftsList.get(0);
} else {
fts = null;
}
if (fts != null) {
this.setFillColor(PreferencesHelper.SHAPEFILE_VIEWER_FILL.getValue(), mode, fts);
this.setStrokeColor(PreferencesHelper.SHAPEFILE_VIEWER_LINE_COLOR.getValue(), mode, fts);
((StyleLayer) layer).setStyle(style);
}
content.addLayer(layer);
} catch (final IOException e) {
System.out.println("Unable to view file " + path);
}
this.setPartName(path.lastSegment());
setInput(input);
}
示例2: setColor
import org.geotools.map.StyleLayer; //导入依赖的package包/类
/**
* Method setColor()
*
* @see ummisco.gama.ui.views.toolbar.IToolbarDecoratedView.Colorizable#setColor(int,
* ummisco.gama.ui.resources.GamaColors.GamaUIColor)
*/
@Override
public void setColor(final int index, final GamaUIColor gc) {
final RGB rgb = gc.getRGB();
final Color c = new Color(rgb.red, rgb.green, rgb.blue);
if (index == 0) {
setStrokeColor(c, mode, fts);
} else {
setFillColor(c, mode, fts);
}
((StyleLayer) layer).setStyle(style);
}
示例3: doSetStyle
import org.geotools.map.StyleLayer; //导入依赖的package包/类
/**
* Show a style dialog to create a new Style for the layer
*
* @param layer
* the layer to be styled
* @throws IOException
*/
private void doSetStyle(final Layer layer) throws IOException {
if (layer instanceof StyleLayer) {
final StyleLayer styleLayer = (StyleLayer) layer;
final Style style = SimpleStyleConfigurator.showDialog(this.getTable().getShell(), layer);
if (style != null) {
styleLayer.setStyle(style);
}
}
}
示例4: setLayer
import org.geotools.map.StyleLayer; //导入依赖的package包/类
public void setLayer(StyleLayer layer) {
this.layer = layer;
}