436 |
int newWidth, int newHeight) |
int newWidth, int newHeight) |
437 |
{ |
{ |
438 |
dragCache.setBounds(newX, newY, newWidth, newHeight); |
dragCache.setBounds(newX, newY, newWidth, newHeight); |
|
dragCache = findMinimum(dragCache, component); |
|
439 |
|
|
440 |
if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) |
if (currentDragMode == JDesktopPane.OUTLINE_DRAG_MODE) |
441 |
{ |
{ |
627 |
{ |
{ |
628 |
return frame.getWasIcon(); |
return frame.getWasIcon(); |
629 |
} // wasIcon() |
} // wasIcon() |
|
|
|
|
/** |
|
|
* This is a helper method that determines the minimum size a |
|
|
* JInternalFrame can be resized to. |
|
|
* |
|
|
* @param r The desired size. |
|
|
* @param c The JComponent to find a minimum size for. |
|
|
* |
|
|
* @return The minimum size a JInternalFrame can be resized to. |
|
|
*/ |
|
|
private Rectangle findMinimum(Rectangle r, JComponent c) |
|
|
{ |
|
|
if (r != null && c != null) |
|
|
{ |
|
|
Dimension d = c.getPreferredSize(); |
|
|
if (d != null) |
|
|
{ |
|
|
r.width = Math.max(d.width, r.width); |
|
|
r.height = Math.max(d.height, r.height); |
|
|
} |
|
|
} |
|
|
return r; |
|
|
} |
|
630 |
} // DefaultDesktopManager |
} // DefaultDesktopManager |