if( mapEditor instanceof MapEditorPart ){
MapEditorPart part = (MapEditorPart) mapEditor;
partSize = part.getComposite().getSize();
}
else if( mapEditor instanceof MapEditorWithPalette){
MapEditorWithPalette part = (MapEditorWithPalette) mapEditor;
partSize = part.getComposite().getSize();
}
else {
//java.awt.Dimension size = map.getRenderManager().getMapDisplay().getDisplaySize();
//Point partSize = new Point(size.width,size.height);
partSize = new Point(500,500);