Found a solution , i hope this can be a bug fix , looks like opening IMap using new editor , it does not update MapGraphicContext viewportmodel , but IMap. Changing "!context.getViewportModel()" to "context.getMap().getViewportModel()" solved problem.
public MapGraphicContextImpl(final IRenderContext context,
Graphics2D destination) {
super();
setGeoResourceInternal(context.getGeoResource());
setLayerInternal((Layer) context.getLayer());
setRenderManagerInternal((RenderManager) context.getRenderManager());
setMapInternal((Map) context.getMap());
vpg = new AWTGraphics(destination, context.getMapDisplay().getDPI());
// add listener if doesn't already exist for layer
IViewportModelListener listener = (IViewportModelListener) context
.getLayer().getBlackboard().get(BLACKBOARD_LAYER_KEY);
if (listener == null) {
listener = new IViewportModelListener() {
public void changed(ViewportModelEvent event) {
// need to invalidate image & refresh the layer
if (renderManagerInternal.isDisposed()) {
setRenderManagerInternal(new RenderManagerDynamic());
}
try {
//if (!context.getViewportModel().isBoundsChanging()) { <-- old code
if (!context.getMap().getViewportModel().isBoundsChanging()) { // <-- new code
context.getLayer()
.getBlackboard()
.put(MapGraphicRenderer.BLACKBOARD_IMAGE_KEY,
null);
context.getLayer().refresh(null);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
};
context.getViewportModel().addViewportModelListener(listener);
context.getLayer().getBlackboard()
.put(BLACKBOARD_LAYER_KEY, listener);
}