author | sundar |
Mon, 31 Aug 2015 17:51:02 +0530 | |
changeset 32434 | 769b3d81ae69 |
parent 25859 | 3317bb8137f4 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
14342
8435a30053c1
7197491: update copyright year to match last edit in jdk8 jdk repository
alanb
parents:
12851
diff
changeset
|
2 |
* Copyright (c) 2004, 2012, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.tools.jconsole; |
|
27 |
||
28 |
import java.awt.*; |
|
12851
3334e1c781d0
7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents:
5506
diff
changeset
|
29 |
import javax.swing.*; |
2 | 30 |
|
31 |
||
32 |
import static sun.tools.jconsole.Utilities.*; |
|
33 |
||
34 |
@SuppressWarnings("serial") |
|
35 |
public class VMInternalFrame extends MaximizableInternalFrame { |
|
36 |
private VMPanel vmPanel; |
|
37 |
||
38 |
public VMInternalFrame(VMPanel vmPanel) { |
|
39 |
super("", true, true, true, true); |
|
40 |
||
41 |
this.vmPanel = vmPanel; |
|
42 |
setAccessibleDescription(this, |
|
12851
3334e1c781d0
7017818: NLS: JConsoleResources.java cannot be handled by translation team
egahlin
parents:
5506
diff
changeset
|
43 |
Messages.VMINTERNAL_FRAME_ACCESSIBLE_DESCRIPTION); |
2 | 44 |
getContentPane().add(vmPanel, BorderLayout.CENTER); |
45 |
pack(); |
|
46 |
vmPanel.updateFrameTitle(); |
|
47 |
} |
|
48 |
||
49 |
public VMPanel getVMPanel() { |
|
50 |
return vmPanel; |
|
51 |
} |
|
52 |
||
53 |
public Dimension getPreferredSize() { |
|
54 |
Dimension d = super.getPreferredSize(); |
|
55 |
JDesktopPane desktop = getDesktopPane(); |
|
56 |
if (desktop != null) { |
|
57 |
Dimension desktopSize = desktop.getSize(); |
|
58 |
if (desktopSize.width > 0 && desktopSize.height > 0) { |
|
59 |
d.width = Math.min(desktopSize.width - 40, d.width); |
|
60 |
d.height = Math.min(desktopSize.height - 40, d.height); |
|
61 |
} |
|
62 |
} |
|
63 |
return d; |
|
64 |
} |
|
65 |
} |