@Override
	public Dimension getPreferredSize() {
		if (isMaximized()) {
			return new Dimension(getParent().getWidth(), getParent().getHeight());
		}
		
		int scrollBarWidth = Outliner.jsp.getVerticalScrollBar().getWidth();
		int maxWidth = getParent().getWidth() - scrollBarWidth;
		int maxHeight = getParent().getHeight() - scrollBarWidth;
		
		Component[] children = getComponents();
		
		for (int i = 0; i < children.length; i++) {
			Component component = children[i];
			
			if (component instanceof JInternalFrame) {
				if (!((JInternalFrame) component).isIcon()) {
					Point p = component.getLocation();
					int x = component.getWidth() + p.x;
					int y = component.getHeight() + p.y;
					
					if (x > maxWidth) {
						maxWidth = x;
					}
					
					if (y > maxHeight) {
						maxHeight = y;
					}
				}
			}
		}
		//System.out.println(maxWidth + " : " + maxHeight);
		return new Dimension(maxWidth, maxHeight);
	}