jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsInternalFrameTitlePane.java
equal
deleted
inserted
replaced
39 import java.beans.PropertyVetoException; |
39 import java.beans.PropertyVetoException; |
40 |
40 |
41 import static com.sun.java.swing.plaf.windows.TMSchema.*; |
41 import static com.sun.java.swing.plaf.windows.TMSchema.*; |
42 import static com.sun.java.swing.plaf.windows.XPStyle.Skin; |
42 import static com.sun.java.swing.plaf.windows.XPStyle.Skin; |
43 |
43 |
|
44 @SuppressWarnings("serial") // Superclass is not serializable across versions |
44 public class WindowsInternalFrameTitlePane extends BasicInternalFrameTitlePane { |
45 public class WindowsInternalFrameTitlePane extends BasicInternalFrameTitlePane { |
45 private Color selectedTitleGradientColor; |
46 private Color selectedTitleGradientColor; |
46 private Color notSelectedTitleGradientColor; |
47 private Color notSelectedTitleGradientColor; |
47 private JPopupMenu systemPopupMenu; |
48 private JPopupMenu systemPopupMenu; |
48 private JLabel systemLabel; |
49 private JLabel systemLabel; |
265 |
266 |
266 protected void assembleSystemMenu() { |
267 protected void assembleSystemMenu() { |
267 systemPopupMenu = new JPopupMenu(); |
268 systemPopupMenu = new JPopupMenu(); |
268 addSystemMenuItems(systemPopupMenu); |
269 addSystemMenuItems(systemPopupMenu); |
269 enableActions(); |
270 enableActions(); |
270 systemLabel = new JLabel(frame.getFrameIcon()) { |
271 @SuppressWarnings("serial") // anonymous class |
|
272 JLabel tmp = new JLabel(frame.getFrameIcon()) { |
271 protected void paintComponent(Graphics g) { |
273 protected void paintComponent(Graphics g) { |
272 int x = 0; |
274 int x = 0; |
273 int y = 0; |
275 int y = 0; |
274 int w = getWidth(); |
276 int w = getWidth(); |
275 int h = getHeight(); |
277 int h = getHeight(); |
301 icon.paintIcon(this, g, 0, 0); |
303 icon.paintIcon(this, g, 0, 0); |
302 } |
304 } |
303 g.dispose(); |
305 g.dispose(); |
304 } |
306 } |
305 }; |
307 }; |
|
308 systemLabel = tmp; |
306 systemLabel.addMouseListener(new MouseAdapter() { |
309 systemLabel.addMouseListener(new MouseAdapter() { |
307 public void mouseClicked(MouseEvent e) { |
310 public void mouseClicked(MouseEvent e) { |
308 if (e.getClickCount() == 2 && frame.isClosable() && |
311 if (e.getClickCount() == 2 && frame.isClosable() && |
309 !frame.isIcon()) { |
312 !frame.isIcon()) { |
310 systemPopupMenu.setVisible(false); |
313 systemPopupMenu.setVisible(false); |