Envelope bounds = new Envelope(c1, c2);
ILayer activeRegionLayer = JGrassPlugin.getDefault().getActiveRegionMapGraphic();
IMap activeMap = ApplicationGIS.getActiveMap();
IBlackboard blackboard = activeMap.getBlackboard();
ActiveRegionStyle style = (ActiveRegionStyle) blackboard.get(ActiveregionStyleContent.ID);
if (style != null) {
try {
JGrassRegion activeRegion = new JGrassRegion(style.windPath);
JGrassRegion newActiveRegion = JGrassRegion.adaptActiveRegionToEnvelope(bounds, activeRegion);
JGrassRegion.writeWINDToMapset(new File(style.windPath).getParent(), newActiveRegion);
style.north = (float) newActiveRegion.getNorth();
style.south = (float) newActiveRegion.getSouth();
style.east = (float) newActiveRegion.getEast();
style.west = (float) newActiveRegion.getWest();
style.rows = newActiveRegion.getRows();
style.cols = newActiveRegion.getCols();
blackboard.put(ActiveregionStyleContent.ID, style);
activeRegionLayer.refresh(null);
} catch (IOException e1) {
e1.printStackTrace();
}