}
protected Dimension calculateContentSize(final NodeView view) {
final JComponent content = view.getContent();
final ModeController modeController = view.getMap().getModeController();
final NodeStyleController nsc = NodeStyleController.getController(modeController);
Dimension contentSize;
if (content instanceof ZoomableLabel){
int maxNodeWidth = nsc.getMaxWidth(view.getModel());
contentSize= ((ZoomableLabel)content).getPreferredSize(maxNodeWidth);
}
else{
contentSize= content.getPreferredSize();
}
int minNodeWidth = nsc.getMinWidth(view.getModel());
int contentWidth = Math.max(view.getZoomed(minNodeWidth),contentSize.width);
int contentHeight = contentSize.height;
final Dimension contentProfSize = new Dimension(contentWidth, contentHeight);
return contentProfSize;
}