1.1 --- a/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java Mon May 12 18:06:23 2008 -0700
1.2 +++ b/src/share/classes/com/sun/imageio/plugins/gif/GIFImageReader.java Fri May 16 12:25:57 2008 -0700
1.3 @@ -504,7 +504,7 @@
1.4 }
1.5
1.6 // Found position of metadata for image 0
1.7 - imageStartPosition.add(new Long(stream.getStreamPosition()));
1.8 + imageStartPosition.add(Long.valueOf(stream.getStreamPosition()));
1.9 } catch (IOException e) {
1.10 throw new IIOException("I/O error reading header!", e);
1.11 }
2.1 --- a/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java Mon May 12 18:06:23 2008 -0700
2.2 +++ b/src/share/classes/com/sun/imageio/plugins/gif/GIFWritableImageMetadata.java Fri May 16 12:25:57 2008 -0700
2.3 @@ -98,7 +98,7 @@
2.4 try {
2.5 return data.getBytes("ISO-8859-1");
2.6 } catch (UnsupportedEncodingException e) {
2.7 - return (new String("")).getBytes();
2.8 + return "".getBytes();
2.9 }
2.10 }
2.11
3.1 --- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java Mon May 12 18:06:23 2008 -0700
3.2 +++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKColorChooserPanel.java Fri May 16 12:25:57 2008 -0700
3.3 @@ -328,7 +328,7 @@
3.4 setHSB(hue, saturation, brightness);
3.5 if (update) {
3.6 settingColor = true;
3.7 - hueSpinner.setValue(new Integer((int)(hue * 360)));
3.8 + hueSpinner.setValue(Integer.valueOf((int)(hue * 360)));
3.9 settingColor = false;
3.10 }
3.11 }
3.12 @@ -376,8 +376,8 @@
3.13 setHSB(hue, s, b);
3.14 if (update) {
3.15 settingColor = true;
3.16 - saturationSpinner.setValue(new Integer((int)(s * 255)));
3.17 - valueSpinner.setValue(new Integer((int)(b * 255)));
3.18 + saturationSpinner.setValue(Integer.valueOf((int)(s * 255)));
3.19 + valueSpinner.setValue(Integer.valueOf((int)(b * 255)));
3.20 settingColor = false;
3.21 }
3.22 }
3.23 @@ -391,9 +391,9 @@
3.24 setColor(color, false, true, true);
3.25
3.26 settingColor = true;
3.27 - hueSpinner.setValue(new Integer((int)(hue * 360)));
3.28 - saturationSpinner.setValue(new Integer((int)(saturation * 255)));
3.29 - valueSpinner.setValue(new Integer((int)(brightness * 255)));
3.30 + hueSpinner.setValue(Integer.valueOf((int)(hue * 360)));
3.31 + saturationSpinner.setValue(Integer.valueOf((int)(saturation * 255)));
3.32 + valueSpinner.setValue(Integer.valueOf((int)(brightness * 255)));
3.33 settingColor = false;
3.34 }
3.35
3.36 @@ -409,9 +409,9 @@
3.37 setColor(color, false, false, true);
3.38
3.39 settingColor = true;
3.40 - redSpinner.setValue(new Integer(color.getRed()));
3.41 - greenSpinner.setValue(new Integer(color.getGreen()));
3.42 - blueSpinner.setValue(new Integer(color.getBlue()));
3.43 + redSpinner.setValue(Integer.valueOf(color.getRed()));
3.44 + greenSpinner.setValue(Integer.valueOf(color.getGreen()));
3.45 + blueSpinner.setValue(Integer.valueOf(color.getBlue()));
3.46 settingColor = false;
3.47 }
3.48
3.49 @@ -454,13 +454,13 @@
3.50 colorNameTF.setText("#" + hexString.substring(1));
3.51
3.52 if (updateSpinners) {
3.53 - redSpinner.setValue(new Integer(color.getRed()));
3.54 - greenSpinner.setValue(new Integer(color.getGreen()));
3.55 - blueSpinner.setValue(new Integer(color.getBlue()));
3.56 + redSpinner.setValue(Integer.valueOf(color.getRed()));
3.57 + greenSpinner.setValue(Integer.valueOf(color.getGreen()));
3.58 + blueSpinner.setValue(Integer.valueOf(color.getBlue()));
3.59
3.60 - hueSpinner.setValue(new Integer((int)(hue * 360)));
3.61 - saturationSpinner.setValue(new Integer((int)(saturation * 255)));
3.62 - valueSpinner.setValue(new Integer((int)(brightness * 255)));
3.63 + hueSpinner.setValue(Integer.valueOf((int)(hue * 360)));
3.64 + saturationSpinner.setValue(Integer.valueOf((int)(saturation * 255)));
3.65 + valueSpinner.setValue(Integer.valueOf((int)(brightness * 255)));
3.66 }
3.67 settingColor = false;
3.68 }
4.1 --- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java Mon May 12 18:06:23 2008 -0700
4.2 +++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKFileChooserUI.java Fri May 16 12:25:57 2008 -0700
4.3 @@ -97,14 +97,11 @@
4.4 private static final Dimension hstrut3 = new Dimension(3, 1);
4.5 private static final Dimension vstrut10 = new Dimension(1, 10);
4.6
4.7 - private static final Insets insets = new Insets(10, 10, 10, 10);
4.8 -
4.9 private static Dimension prefListSize = new Dimension(75, 150);
4.10
4.11 private static Dimension PREF_SIZE = new Dimension(435, 360);
4.12 private static Dimension MIN_SIZE = new Dimension(200, 300);
4.13
4.14 - private static Dimension PREF_ACC_SIZE = new Dimension(10, 10);
4.15 private static Dimension ZERO_ACC_SIZE = new Dimension(1, 1);
4.16
4.17 private static Dimension MAX_SIZE = new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
4.18 @@ -125,7 +122,6 @@
4.19 private JPanel bottomButtonPanel;
4.20 private GTKDirectoryModel model = null;
4.21 private Action newFolderAction;
4.22 - private JPanel interior;
4.23 private boolean readOnly;
4.24 private boolean showDirectoryIcons;
4.25 private boolean showFileIcons;
4.26 @@ -710,15 +706,19 @@
4.27 bottomButtonPanel.setName("GTKFileChooser.bottomButtonPanel");
4.28 align(bottomButtonPanel);
4.29
4.30 + JPanel pnButtons = new JPanel(new GridLayout(1, 2, 5, 0));
4.31 +
4.32 JButton cancelButton = getCancelButton(fc);
4.33 align(cancelButton);
4.34 cancelButton.setMargin(buttonMargin);
4.35 - bottomButtonPanel.add(cancelButton);
4.36 + pnButtons.add(cancelButton);
4.37
4.38 - JButton approveButton = getApproveButton(fc);;
4.39 + JButton approveButton = getApproveButton(fc);
4.40 align(approveButton);
4.41 approveButton.setMargin(buttonMargin);
4.42 - bottomButtonPanel.add(approveButton);
4.43 + pnButtons.add(approveButton);
4.44 +
4.45 + bottomButtonPanel.add(pnButtons);
4.46
4.47 if (fc.getControlButtonsAreShown()) {
4.48 fc.add(bottomButtonPanel, BorderLayout.SOUTH);
4.49 @@ -1108,7 +1108,7 @@
4.50 // Get the canonical (full) path. This has the side
4.51 // benefit of removing extraneous chars from the path,
4.52 // for example /foo/bar/ becomes /foo/bar
4.53 - File canonical = null;
4.54 + File canonical;
4.55 try {
4.56 canonical = fsv.createFileObject(ShellFolder.getNormalizedFile(directory).getPath());
4.57 } catch (IOException e) {
5.1 --- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Mon May 12 18:06:23 2008 -0700
5.2 +++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java Fri May 16 12:25:57 2008 -0700
5.3 @@ -336,7 +336,7 @@
5.4 // populate the table with the values from basic.
5.5 super.initComponentDefaults(table);
5.6
5.7 - Integer zero = new Integer(0);
5.8 + Integer zero = Integer.valueOf(0);
5.9 Object zeroBorder = new sun.swing.SwingLazyValue(
5.10 "javax.swing.plaf.BorderUIResource$EmptyBorderUIResource",
5.11 new Object[] {zero, zero, zero, zero});
5.12 @@ -371,7 +371,7 @@
5.13 int vProgWidth = 22 - (progXThickness * 2);
5.14 int vProgHeight = 80 - (progYThickness * 2);
5.15
5.16 - Integer caretBlinkRate = new Integer(500);
5.17 + Integer caretBlinkRate = Integer.valueOf(500);
5.18 Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0);
5.19
5.20 Double defaultCaretAspectRatio = new Double(0.025);
5.21 @@ -540,7 +540,7 @@
5.22 }
5.23
5.24 Object[] defaults = new Object[] {
5.25 - "ArrowButton.size", new Integer(13),
5.26 + "ArrowButton.size", Integer.valueOf(13),
5.27
5.28
5.29 "Button.defaultButtonFollowsFocus", Boolean.FALSE,
5.30 @@ -893,8 +893,8 @@
5.31
5.32
5.33 "ScrollBar.squareButtons", Boolean.FALSE,
5.34 - "ScrollBar.thumbHeight", new Integer(14),
5.35 - "ScrollBar.width", new Integer(16),
5.36 + "ScrollBar.thumbHeight", Integer.valueOf(14),
5.37 + "ScrollBar.width", Integer.valueOf(16),
5.38 "ScrollBar.minimumThumbSize", new Dimension(8, 8),
5.39 "ScrollBar.maximumThumbSize", new Dimension(4096, 4096),
5.40 "ScrollBar.allowsAbsolutePositioning", Boolean.TRUE,
5.41 @@ -954,12 +954,12 @@
5.42
5.43
5.44 "Separator.insets", zeroInsets,
5.45 - "Separator.thickness", new Integer(2),
5.46 + "Separator.thickness", Integer.valueOf(2),
5.47
5.48
5.49 "Slider.paintValue", Boolean.TRUE,
5.50 - "Slider.thumbWidth", new Integer(30),
5.51 - "Slider.thumbHeight", new Integer(14),
5.52 + "Slider.thumbWidth", Integer.valueOf(30),
5.53 + "Slider.thumbHeight", Integer.valueOf(14),
5.54 "Slider.focusInputMap",
5.55 new UIDefaults.LazyInputMap(new Object[] {
5.56 "RIGHT", "positiveUnitIncrement",
5.57 @@ -982,7 +982,7 @@
5.58 "LEFT", "positiveUnitIncrement",
5.59 "KP_LEFT", "positiveUnitIncrement",
5.60 }),
5.61 -
5.62 + "Slider.onlyLeftMouseButtonDrag", Boolean.FALSE,
5.63
5.64 "Spinner.ancestorInputMap",
5.65 new UIDefaults.LazyInputMap(new Object[] {
5.66 @@ -1013,9 +1013,9 @@
5.67 }),
5.68
5.69
5.70 - "SplitPane.size", new Integer(7),
5.71 - "SplitPane.oneTouchOffset", new Integer(2),
5.72 - "SplitPane.oneTouchButtonSize", new Integer(5),
5.73 + "SplitPane.size", Integer.valueOf(7),
5.74 + "SplitPane.oneTouchOffset", Integer.valueOf(2),
5.75 + "SplitPane.oneTouchButtonSize", Integer.valueOf(5),
5.76 "SplitPane.supportsOneTouchButtons", Boolean.FALSE,
5.77
5.78
5.79 @@ -1223,13 +1223,13 @@
5.80
5.81 "ToolTip.font", new FontLazyValue(Region.TOOL_TIP),
5.82
5.83 - "Tree.padding", new Integer(4),
5.84 + "Tree.padding", Integer.valueOf(4),
5.85 "Tree.background", tableBg,
5.86 "Tree.drawHorizontalLines", Boolean.FALSE,
5.87 "Tree.drawVerticalLines", Boolean.FALSE,
5.88 - "Tree.rowHeight", new Integer(-1),
5.89 + "Tree.rowHeight", Integer.valueOf(-1),
5.90 "Tree.scrollsOnExpand", Boolean.FALSE,
5.91 - "Tree.expanderSize", new Integer(10),
5.92 + "Tree.expanderSize", Integer.valueOf(10),
5.93 "Tree.repaintWholeRow", Boolean.TRUE,
5.94 "Tree.closedIcon", null,
5.95 "Tree.leafIcon", null,
5.96 @@ -1240,8 +1240,8 @@
5.97 "Tree.collapsedIcon", new GTKStyle.GTKLazyValue(
5.98 "com.sun.java.swing.plaf.gtk.GTKIconFactory",
5.99 "getTreeCollapsedIcon"),
5.100 - "Tree.leftChildIndent", new Integer(2),
5.101 - "Tree.rightChildIndent", new Integer(12),
5.102 + "Tree.leftChildIndent", Integer.valueOf(2),
5.103 + "Tree.rightChildIndent", Integer.valueOf(12),
5.104 "Tree.scrollsHorizontallyAndVertically", Boolean.FALSE,
5.105 "Tree.drawsFocusBorder", Boolean.TRUE,
5.106 "Tree.focusInputMap",
6.1 --- a/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Mon May 12 18:06:23 2008 -0700
6.2 +++ b/src/share/classes/com/sun/java/swing/plaf/gtk/GTKStyle.java Fri May 16 12:25:57 2008 -0700
6.3 @@ -851,7 +851,7 @@
6.4 int focusLineWidth = getClassSpecificIntValue(context,
6.5 "focus-line-width", 0);
6.6 if (value == null && focusLineWidth > 0) {
6.7 - value = new Integer(16 + 2 * focusLineWidth);
6.8 + value = Integer.valueOf(16 + 2 * focusLineWidth);
6.9 }
6.10 }
6.11 return value;
6.12 @@ -975,12 +975,12 @@
6.13
6.14 private static void initIconTypeMap() {
6.15 ICON_TYPE_MAP = new HashMap<String,Integer>();
6.16 - ICON_TYPE_MAP.put("gtk-menu", new Integer(1));
6.17 - ICON_TYPE_MAP.put("gtk-small-toolbar", new Integer(2));
6.18 - ICON_TYPE_MAP.put("gtk-large-toolbar", new Integer(3));
6.19 - ICON_TYPE_MAP.put("gtk-button", new Integer(4));
6.20 - ICON_TYPE_MAP.put("gtk-dnd", new Integer(5));
6.21 - ICON_TYPE_MAP.put("gtk-dialog", new Integer(6));
6.22 + ICON_TYPE_MAP.put("gtk-menu", Integer.valueOf(1));
6.23 + ICON_TYPE_MAP.put("gtk-small-toolbar", Integer.valueOf(2));
6.24 + ICON_TYPE_MAP.put("gtk-large-toolbar", Integer.valueOf(3));
6.25 + ICON_TYPE_MAP.put("gtk-button", Integer.valueOf(4));
6.26 + ICON_TYPE_MAP.put("gtk-dnd", Integer.valueOf(5));
6.27 + ICON_TYPE_MAP.put("gtk-dialog", Integer.valueOf(6));
6.28 }
6.29
6.30 }
7.1 --- a/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Mon May 12 18:06:23 2008 -0700
7.2 +++ b/src/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java Fri May 16 12:25:57 2008 -0700
7.3 @@ -178,7 +178,7 @@
7.4 name = child.getNodeName();
7.5 Object value = null;
7.6 if ("distance".equals(name)) {
7.7 - value = new Integer(getIntAttr(child, "value", 0));
7.8 + value = Integer.valueOf(getIntAttr(child, "value", 0));
7.9 } else if ("border".equals(name)) {
7.10 value = new Insets(getIntAttr(child, "top", 0),
7.11 getIntAttr(child, "left", 0),
7.12 @@ -808,7 +808,7 @@
7.13 protected void setFrameGeometry(JComponent titlePane, Map gm) {
7.14 this.frameGeometry = gm;
7.15 if (getInt("top_height") == 0 && titlePane != null) {
7.16 - gm.put("top_height", new Integer(titlePane.getHeight()));
7.17 + gm.put("top_height", Integer.valueOf(titlePane.getHeight()));
7.18 }
7.19 }
7.20
8.1 --- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java Mon May 12 18:06:23 2008 -0700
8.2 +++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifGraphicsUtils.java Fri May 16 12:25:57 2008 -0700
8.3 @@ -225,15 +225,15 @@
8.4 if(b.getIcon() != null) {
8.5 Icon icon;
8.6 if(!model.isEnabled()) {
8.7 - icon = (Icon) b.getDisabledIcon();
8.8 + icon = b.getDisabledIcon();
8.9 } else if(model.isPressed() && model.isArmed()) {
8.10 - icon = (Icon) b.getPressedIcon();
8.11 + icon = b.getPressedIcon();
8.12 if(icon == null) {
8.13 // Use default icon
8.14 - icon = (Icon) b.getIcon();
8.15 + icon = b.getIcon();
8.16 }
8.17 } else {
8.18 - icon = (Icon) b.getIcon();
8.19 + icon = b.getIcon();
8.20 }
8.21
8.22 if (icon!=null) {
9.1 --- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java Mon May 12 18:06:23 2008 -0700
9.2 +++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifInternalFrameTitlePane.java Fri May 16 12:25:57 2008 -0700
9.3 @@ -86,18 +86,18 @@
9.4
9.5 protected void assembleSystemMenu() {
9.6 systemMenu = new JPopupMenu();
9.7 - JMenuItem mi = (JMenuItem)systemMenu.add(new JMenuItem(restoreAction));
9.8 + JMenuItem mi = systemMenu.add(new JMenuItem(restoreAction));
9.9 mi.setMnemonic('R');
9.10 - mi = (JMenuItem) systemMenu.add(new JMenuItem(moveAction));
9.11 + mi = systemMenu.add(new JMenuItem(moveAction));
9.12 mi.setMnemonic('M');
9.13 - mi = (JMenuItem) systemMenu.add(new JMenuItem(sizeAction));
9.14 + mi = systemMenu.add(new JMenuItem(sizeAction));
9.15 mi.setMnemonic('S');
9.16 - mi = (JMenuItem) systemMenu.add(new JMenuItem(iconifyAction));
9.17 + mi = systemMenu.add(new JMenuItem(iconifyAction));
9.18 mi.setMnemonic('n');
9.19 - mi = (JMenuItem) systemMenu.add(new JMenuItem(maximizeAction));
9.20 + mi = systemMenu.add(new JMenuItem(maximizeAction));
9.21 mi.setMnemonic('x');
9.22 systemMenu.add(new JSeparator());
9.23 - mi = (JMenuItem) systemMenu.add(new JMenuItem(closeAction));
9.24 + mi = systemMenu.add(new JMenuItem(closeAction));
9.25 mi.setMnemonic('C');
9.26
9.27 systemButton = new SystemButton();
9.28 @@ -157,7 +157,7 @@
9.29 }
9.30
9.31 public void propertyChange(PropertyChangeEvent evt) {
9.32 - String prop = (String)evt.getPropertyName();
9.33 + String prop = evt.getPropertyName();
9.34 JInternalFrame f = (JInternalFrame)evt.getSource();
9.35 boolean value = false;
9.36 if (JInternalFrame.IS_SELECTED_PROPERTY.equals(prop)) {
10.1 --- a/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java Mon May 12 18:06:23 2008 -0700
10.2 +++ b/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java Fri May 16 12:25:57 2008 -0700
10.3 @@ -290,7 +290,7 @@
10.4
10.5 Object unselectedTabBackground = new UIDefaults.LazyValue() {
10.6 public Object createValue(UIDefaults table) {
10.7 - Color c = (Color)table.getColor("control");
10.8 + Color c = table.getColor("control");
10.9 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
10.10 Math.max((int)(c.getGreen()*.85),0),
10.11 Math.max((int)(c.getBlue()*.85),0));
10.12 @@ -299,7 +299,7 @@
10.13
10.14 Object unselectedTabForeground = new UIDefaults.LazyValue() {
10.15 public Object createValue(UIDefaults table) {
10.16 - Color c = (Color)table.getColor("controlText");
10.17 + Color c = table.getColor("controlText");
10.18 return new ColorUIResource(Math.max((int)(c.getRed()*.85),0),
10.19 Math.max((int)(c.getGreen()*.85),0),
10.20 Math.max((int)(c.getBlue()*.85),0));
10.21 @@ -308,7 +308,7 @@
10.22
10.23 Object unselectedTabShadow = new UIDefaults.LazyValue() {
10.24 public Object createValue(UIDefaults table) {
10.25 - Color c = (Color)table.getColor("control");
10.26 + Color c = table.getColor("control");
10.27 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
10.28 Math.max((int)(c.getGreen()*.85),0),
10.29 Math.max((int)(c.getBlue()*.85),0));
10.30 @@ -318,7 +318,7 @@
10.31
10.32 Object unselectedTabHighlight = new UIDefaults.LazyValue() {
10.33 public Object createValue(UIDefaults table) {
10.34 - Color c = (Color)table.getColor("control");
10.35 + Color c = table.getColor("control");
10.36 Color base = new Color(Math.max((int)(c.getRed()*.85),0),
10.37 Math.max((int)(c.getGreen()*.85),0),
10.38 Math.max((int)(c.getBlue()*.85),0));
10.39 @@ -567,7 +567,7 @@
10.40 "ProgressBar.selectionBackground", table.get("controlText"),
10.41 "ProgressBar.border", loweredBevelBorder,
10.42 "ProgressBar.cellLength", new Integer(6),
10.43 - "ProgressBar.cellSpacing", new Integer(0),
10.44 + "ProgressBar.cellSpacing", Integer.valueOf(0),
10.45
10.46 // Buttons
10.47 "Button.margin", new InsetsUIResource(2, 4, 2, 4),
10.48 @@ -859,7 +859,7 @@
10.49 "SplitPane.background", table.get("control"),
10.50 "SplitPane.highlight", table.get("controlHighlight"),
10.51 "SplitPane.shadow", table.get("controlShadow"),
10.52 - "SplitPane.dividerSize", new Integer(20),
10.53 + "SplitPane.dividerSize", Integer.valueOf(20),
10.54 "SplitPane.activeThumb", table.get("activeCaptionBorder"),
10.55 "SplitPane.ancestorInputMap",
10.56 new UIDefaults.LazyInputMap(new Object[] {
10.57 @@ -1160,7 +1160,7 @@
10.58 }),
10.59
10.60 "TextField.caretForeground", black,
10.61 - "TextField.caretBlinkRate", new Integer(500),
10.62 + "TextField.caretBlinkRate", Integer.valueOf(500),
10.63 "TextField.inactiveForeground", table.get("textInactiveText"),
10.64 "TextField.selectionBackground", table.get("textHighlight"),
10.65 "TextField.selectionForeground", table.get("textHighlightText"),
10.66 @@ -1171,7 +1171,7 @@
10.67 "TextField.focusInputMap", fieldInputMap,
10.68
10.69 "PasswordField.caretForeground", black,
10.70 - "PasswordField.caretBlinkRate", new Integer(500),
10.71 + "PasswordField.caretBlinkRate", Integer.valueOf(500),
10.72 "PasswordField.inactiveForeground", table.get("textInactiveText"),
10.73 "PasswordField.selectionBackground", table.get("textHighlight"),
10.74 "PasswordField.selectionForeground", table.get("textHighlightText"),
10.75 @@ -1182,7 +1182,7 @@
10.76 "PasswordField.focusInputMap", passwordInputMap,
10.77
10.78 "TextArea.caretForeground", black,
10.79 - "TextArea.caretBlinkRate", new Integer(500),
10.80 + "TextArea.caretBlinkRate", Integer.valueOf(500),
10.81 "TextArea.inactiveForeground", table.get("textInactiveText"),
10.82 "TextArea.selectionBackground", table.get("textHighlight"),
10.83 "TextArea.selectionForeground", table.get("textHighlightText"),
10.84 @@ -1193,7 +1193,7 @@
10.85 "TextArea.focusInputMap", multilineInputMap,
10.86
10.87 "TextPane.caretForeground", black,
10.88 - "TextPane.caretBlinkRate", new Integer(500),
10.89 + "TextPane.caretBlinkRate", Integer.valueOf(500),
10.90 "TextPane.inactiveForeground", table.get("textInactiveText"),
10.91 "TextPane.selectionBackground", lightGray,
10.92 "TextPane.selectionForeground", table.get("textHighlightText"),
10.93 @@ -1204,7 +1204,7 @@
10.94 "TextPane.focusInputMap", multilineInputMap,
10.95
10.96 "EditorPane.caretForeground", red,
10.97 - "EditorPane.caretBlinkRate", new Integer(500),
10.98 + "EditorPane.caretBlinkRate", Integer.valueOf(500),
10.99 "EditorPane.inactiveForeground", table.get("textInactiveText"),
10.100 "EditorPane.selectionBackground", lightGray,
10.101 "EditorPane.selectionForeground", table.get("textHighlightText"),
11.1 --- a/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java Mon May 12 18:06:23 2008 -0700
11.2 +++ b/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java Fri May 16 12:25:57 2008 -0700
11.3 @@ -299,9 +299,9 @@
11.4 initResourceBundle(table);
11.5
11.6 // *** Shared Fonts
11.7 - Integer twelve = new Integer(12);
11.8 - Integer fontPlain = new Integer(Font.PLAIN);
11.9 - Integer fontBold = new Integer(Font.BOLD);
11.10 + Integer twelve = Integer.valueOf(12);
11.11 + Integer fontPlain = Integer.valueOf(Font.PLAIN);
11.12 + Integer fontBold = Integer.valueOf(Font.BOLD);
11.13
11.14 Object dialogPlain12 = new SwingLazyValue(
11.15 "javax.swing.plaf.FontUIResource",
11.16 @@ -522,19 +522,19 @@
11.17 toolkit);
11.18 Object WindowBorderWidth = new DesktopProperty(
11.19 "win.frame.sizingBorderWidth",
11.20 - new Integer(1),
11.21 + Integer.valueOf(1),
11.22 toolkit);
11.23 Object TitlePaneHeight = new DesktopProperty(
11.24 "win.frame.captionHeight",
11.25 - new Integer(18),
11.26 + Integer.valueOf(18),
11.27 toolkit);
11.28 Object TitleButtonWidth = new DesktopProperty(
11.29 "win.frame.captionButtonWidth",
11.30 - new Integer(16),
11.31 + Integer.valueOf(16),
11.32 toolkit);
11.33 Object TitleButtonHeight = new DesktopProperty(
11.34 "win.frame.captionButtonHeight",
11.35 - new Integer(16),
11.36 + Integer.valueOf(16),
11.37 toolkit);
11.38 Object InactiveTextColor = new DesktopProperty(
11.39 "win.text.grayedTextColor",
11.40 @@ -567,7 +567,7 @@
11.41 Object IconFont = ControlFont;
11.42
11.43 Object scrollBarWidth = new DesktopProperty("win.scrollbar.width",
11.44 - new Integer(16), toolkit);
11.45 + Integer.valueOf(16), toolkit);
11.46
11.47 Object menuBarHeight = new DesktopProperty("win.menu.height",
11.48 null, toolkit);
11.49 @@ -673,12 +673,12 @@
11.50 "Button.disabledForeground", InactiveTextColor,
11.51 "Button.disabledShadow", ControlHighlightColor,
11.52 "Button.focus", black,
11.53 - "Button.dashedRectGapX", new XPValue(new Integer(3), new Integer(5)),
11.54 - "Button.dashedRectGapY", new XPValue(new Integer(3), new Integer(4)),
11.55 - "Button.dashedRectGapWidth", new XPValue(new Integer(6), new Integer(10)),
11.56 - "Button.dashedRectGapHeight", new XPValue(new Integer(6), new Integer(8)),
11.57 - "Button.textShiftOffset", new XPValue(new Integer(0),
11.58 - new Integer(1)),
11.59 + "Button.dashedRectGapX", new XPValue(Integer.valueOf(3), Integer.valueOf(5)),
11.60 + "Button.dashedRectGapY", new XPValue(Integer.valueOf(3), Integer.valueOf(4)),
11.61 + "Button.dashedRectGapWidth", new XPValue(Integer.valueOf(6), Integer.valueOf(10)),
11.62 + "Button.dashedRectGapHeight", new XPValue(Integer.valueOf(6), Integer.valueOf(8)),
11.63 + "Button.textShiftOffset", new XPValue(Integer.valueOf(0),
11.64 + Integer.valueOf(1)),
11.65 // W2K keyboard navigation hidding.
11.66 "Button.showMnemonics", showMnemonics,
11.67 "Button.focusInputMap",
11.68 @@ -780,7 +780,7 @@
11.69 }),
11.70
11.71 // DesktopIcon
11.72 - "DesktopIcon.width", new Integer(160),
11.73 + "DesktopIcon.width", Integer.valueOf(160),
11.74
11.75 "EditorPane.font", ControlFont,
11.76 "EditorPane.background", WindowBackgroundColor,
11.77 @@ -814,9 +814,9 @@
11.78 "icons/NewFolder.gif"),
11.79 "FileChooser.useSystemExtensionHiding", Boolean.TRUE,
11.80
11.81 - "FileChooser.lookInLabelMnemonic", new Integer(KeyEvent.VK_I),
11.82 - "FileChooser.fileNameLabelMnemonic", new Integer(KeyEvent.VK_N),
11.83 - "FileChooser.filesOfTypeLabelMnemonic", new Integer(KeyEvent.VK_T),
11.84 + "FileChooser.lookInLabelMnemonic", Integer.valueOf(KeyEvent.VK_I),
11.85 + "FileChooser.fileNameLabelMnemonic", Integer.valueOf(KeyEvent.VK_N),
11.86 + "FileChooser.filesOfTypeLabelMnemonic", Integer.valueOf(KeyEvent.VK_T),
11.87 "FileChooser.usesSingleFilePane", Boolean.TRUE,
11.88 "FileChooser.noPlacesBar", new DesktopProperty("win.comdlg.noPlacesBar",
11.89 Boolean.FALSE, toolkit),
11.90 @@ -1021,10 +1021,10 @@
11.91 "Menu.selectionBackground", SelectionBackgroundColor,
11.92 "Menu.acceleratorForeground", MenuTextColor,
11.93 "Menu.acceleratorSelectionForeground", SelectionTextColor,
11.94 - "Menu.menuPopupOffsetX", new Integer(0),
11.95 - "Menu.menuPopupOffsetY", new Integer(0),
11.96 - "Menu.submenuPopupOffsetX", new Integer(-4),
11.97 - "Menu.submenuPopupOffsetY", new Integer(-3),
11.98 + "Menu.menuPopupOffsetX", Integer.valueOf(0),
11.99 + "Menu.menuPopupOffsetY", Integer.valueOf(0),
11.100 + "Menu.submenuPopupOffsetX", Integer.valueOf(-4),
11.101 + "Menu.submenuPopupOffsetY", Integer.valueOf(-3),
11.102 "Menu.crossMenuMnemonic", Boolean.FALSE,
11.103 "Menu.preserveTopLevelSelection", Boolean.TRUE,
11.104
11.105 @@ -1184,8 +1184,8 @@
11.106 "ProgressBar.highlight", ControlHighlightColor,
11.107 "ProgressBar.selectionForeground", ControlBackgroundColor,
11.108 "ProgressBar.selectionBackground", SelectionBackgroundColor,
11.109 - "ProgressBar.cellLength", new Integer(7),
11.110 - "ProgressBar.cellSpacing", new Integer(2),
11.111 + "ProgressBar.cellLength", Integer.valueOf(7),
11.112 + "ProgressBar.cellSpacing", Integer.valueOf(2),
11.113 "ProgressBar.indeterminateInsets", new Insets(3, 3, 3, 3),
11.114
11.115 // *** RootPane.
11.116 @@ -1292,7 +1292,7 @@
11.117 "SplitPane.highlight", ControlHighlightColor,
11.118 "SplitPane.shadow", ControlShadowColor,
11.119 "SplitPane.darkShadow", ControlDarkShadowColor,
11.120 - "SplitPane.dividerSize", new Integer(5),
11.121 + "SplitPane.dividerSize", Integer.valueOf(5),
11.122 "SplitPane.ancestorInputMap",
11.123 new UIDefaults.LazyInputMap(new Object[] {
11.124 "UP", "negativeIncrement",
11.125 @@ -1496,7 +1496,7 @@
11.126 "ToggleButton.light", ControlLightColor,
11.127 "ToggleButton.highlight", ControlHighlightColor,
11.128 "ToggleButton.focus", ControlTextColor,
11.129 - "ToggleButton.textShiftOffset", new Integer(1),
11.130 + "ToggleButton.textShiftOffset", Integer.valueOf(1),
11.131 "ToggleButton.focusInputMap",
11.132 new UIDefaults.LazyInputMap(new Object[] {
11.133 "SPACE", "pressed",
11.134 @@ -1548,8 +1548,8 @@
11.135 "Tree.background", WindowBackgroundColor,
11.136 "Tree.foreground", WindowTextColor,
11.137 "Tree.hash", gray,
11.138 - "Tree.leftChildIndent", new Integer(8),
11.139 - "Tree.rightChildIndent", new Integer(11),
11.140 + "Tree.leftChildIndent", Integer.valueOf(8),
11.141 + "Tree.rightChildIndent", Integer.valueOf(11),
11.142 "Tree.textForeground", WindowTextColor,
11.143 "Tree.textBackground", WindowBackgroundColor,
11.144 "Tree.selectionForeground", SelectionTextColor,
11.145 @@ -2488,18 +2488,18 @@
11.146 private int direction;
11.147
11.148 XPDLUValue(int xpdlu, int classicdlu, int direction) {
11.149 - super(new Integer(xpdlu), new Integer(classicdlu));
11.150 + super(Integer.valueOf(xpdlu), Integer.valueOf(classicdlu));
11.151 this.direction = direction;
11.152 }
11.153
11.154 public Object getXPValue(UIDefaults table) {
11.155 int px = dluToPixels(((Integer)xpValue).intValue(), direction);
11.156 - return new Integer(px);
11.157 + return Integer.valueOf(px);
11.158 }
11.159
11.160 public Object getClassicValue(UIDefaults table) {
11.161 int px = dluToPixels(((Integer)classicValue).intValue(), direction);
11.162 - return new Integer(px);
11.163 + return Integer.valueOf(px);
11.164 }
11.165 }
11.166
12.1 --- a/src/share/classes/com/sun/tools/hat/Main.java Mon May 12 18:06:23 2008 -0700
12.2 +++ b/src/share/classes/com/sun/tools/hat/Main.java Fri May 16 12:25:57 2008 -0700
12.3 @@ -23,18 +23,10 @@
12.4 * have any questions.
12.5 */
12.6
12.7 -
12.8 /*
12.9 - * The contents of this file are subject to the Sun Public License
12.10 - * Version 1.0 (the "License"); you may not use this file except in
12.11 - * compliance with the License. A copy of the License is available at
12.12 - * http://www.sun.com/, and in the file LICENSE.html in the
12.13 - * doc directory.
12.14 - *
12.15 * The Original Code is HAT. The Initial Developer of the
12.16 * Original Code is Bill Foote, with contributions from others
12.17 - * at JavaSoft/Sun. Portions created by Bill Foote and others
12.18 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
12.19 + * at JavaSoft/Sun.
12.20 */
12.21
12.22 package com.sun.tools.hat;
13.1 --- a/src/share/classes/com/sun/tools/hat/build.xml Mon May 12 18:06:23 2008 -0700
13.2 +++ b/src/share/classes/com/sun/tools/hat/build.xml Fri May 16 12:25:57 2008 -0700
13.3 @@ -27,19 +27,9 @@
13.4
13.5 <!--
13.6
13.7 - The contents of this file are subject to the Sun Public License
13.8 - Version 1.0 (the "License"); you may not use this file except in
13.9 - compliance with the License. A copy of the License is available at
13.10 - http://www.sun.com/, and in the file LICENSE.html in the
13.11 - doc directory.
13.12 -
13.13 The Original Code is HAT. The Initial Developer of the
13.14 Original Code is Bill Foote, with contributions from others
13.15 - at JavaSoft/Sun. Portions created by Bill Foote and others
13.16 - at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
13.17 -
13.18 - In addition to the formal license, I ask that you don't
13.19 - change the history or donations files without permission.
13.20 + at JavaSoft/Sun.
13.21
13.22 -->
13.23
14.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/AbstractJavaHeapObjectVisitor.java Mon May 12 18:06:23 2008 -0700
14.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/AbstractJavaHeapObjectVisitor.java Fri May 16 12:25:57 2008 -0700
14.3 @@ -1,5 +1,5 @@
14.4 /*
14.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
14.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
14.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
14.8 *
14.9 * This code is free software; you can redistribute it and/or modify it
14.10 @@ -25,20 +25,9 @@
14.11
14.12
14.13 /*
14.14 - * The contents of this file are subject to the Sun Public License
14.15 - * Version 1.0 (the "License"); you may not use this file except in
14.16 - * compliance with the License. A copy of the License is available at
14.17 - * http://www.sun.com/, and in the file LICENSE.html in the
14.18 - * doc directory.
14.19 - *
14.20 * The Original Code is HAT. The Initial Developer of the
14.21 * Original Code is Bill Foote, with contributions from others
14.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
14.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
14.24 - *
14.25 - * In addition to the formal license, I ask that you don't
14.26 - * change the history or donations files without permission.
14.27 - *
14.28 + * at JavaSoft/Sun.
14.29 */
14.30
14.31 package com.sun.tools.hat.internal.model;
15.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/ArrayTypeCodes.java Mon May 12 18:06:23 2008 -0700
15.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/ArrayTypeCodes.java Fri May 16 12:25:57 2008 -0700
15.3 @@ -1,5 +1,5 @@
15.4 /*
15.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
15.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
15.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
15.8 *
15.9 * This code is free software; you can redistribute it and/or modify it
15.10 @@ -25,20 +25,9 @@
15.11
15.12
15.13 /*
15.14 - * The contents of this file are subject to the Sun Public License
15.15 - * Version 1.0 (the "License"); you may not use this file except in
15.16 - * compliance with the License. A copy of the License is available at
15.17 - * http://www.sun.com/, and in the file LICENSE.html in the
15.18 - * doc directory.
15.19 - *
15.20 * The Original Code is HAT. The Initial Developer of the
15.21 * Original Code is Bill Foote, with contributions from others
15.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
15.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
15.24 - *
15.25 - * In addition to the formal license, I ask that you don't
15.26 - * change the history or donations files without permission.
15.27 - *
15.28 + * at JavaSoft/Sun.
15.29 */
15.30
15.31 package com.sun.tools.hat.internal.model;
16.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/HackJavaValue.java Mon May 12 18:06:23 2008 -0700
16.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/HackJavaValue.java Fri May 16 12:25:57 2008 -0700
16.3 @@ -1,5 +1,5 @@
16.4 /*
16.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
16.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
16.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
16.8 *
16.9 * This code is free software; you can redistribute it and/or modify it
16.10 @@ -25,20 +25,9 @@
16.11
16.12
16.13 /*
16.14 - * The contents of this file are subject to the Sun Public License
16.15 - * Version 1.0 (the "License"); you may not use this file except in
16.16 - * compliance with the License. A copy of the License is available at
16.17 - * http://www.sun.com/, and in the file LICENSE.html in the
16.18 - * doc directory.
16.19 - *
16.20 * The Original Code is HAT. The Initial Developer of the
16.21 * Original Code is Bill Foote, with contributions from others
16.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
16.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
16.24 - *
16.25 - * In addition to the formal license, I ask that you don't
16.26 - * change the history or donations files without permission.
16.27 - *
16.28 + * at JavaSoft/Sun.
16.29 */
16.30
16.31 package com.sun.tools.hat.internal.model;
17.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaBoolean.java Mon May 12 18:06:23 2008 -0700
17.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaBoolean.java Fri May 16 12:25:57 2008 -0700
17.3 @@ -1,5 +1,5 @@
17.4 /*
17.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
17.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
17.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
17.8 *
17.9 * This code is free software; you can redistribute it and/or modify it
17.10 @@ -25,20 +25,9 @@
17.11
17.12
17.13 /*
17.14 - * The contents of this file are subject to the Sun Public License
17.15 - * Version 1.0 (the "License"); you may not use this file except in
17.16 - * compliance with the License. A copy of the License is available at
17.17 - * http://www.sun.com/, and in the file LICENSE.html in the
17.18 - * doc directory.
17.19 - *
17.20 * The Original Code is HAT. The Initial Developer of the
17.21 * Original Code is Bill Foote, with contributions from others
17.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
17.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
17.24 - *
17.25 - * In addition to the formal license, I ask that you don't
17.26 - * change the history or donations files without permission.
17.27 - *
17.28 + * at JavaSoft/Sun.
17.29 */
17.30
17.31 package com.sun.tools.hat.internal.model;
18.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaByte.java Mon May 12 18:06:23 2008 -0700
18.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaByte.java Fri May 16 12:25:57 2008 -0700
18.3 @@ -1,5 +1,5 @@
18.4 /*
18.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
18.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
18.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
18.8 *
18.9 * This code is free software; you can redistribute it and/or modify it
18.10 @@ -25,20 +25,9 @@
18.11
18.12
18.13 /*
18.14 - * The contents of this file are subject to the Sun Public License
18.15 - * Version 1.0 (the "License"); you may not use this file except in
18.16 - * compliance with the License. A copy of the License is available at
18.17 - * http://www.sun.com/, and in the file LICENSE.html in the
18.18 - * doc directory.
18.19 - *
18.20 * The Original Code is HAT. The Initial Developer of the
18.21 * Original Code is Bill Foote, with contributions from others
18.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
18.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
18.24 - *
18.25 - * In addition to the formal license, I ask that you don't
18.26 - * change the history or donations files without permission.
18.27 - *
18.28 + * at JavaSoft/Sun.
18.29 */
18.30
18.31 package com.sun.tools.hat.internal.model;
19.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaChar.java Mon May 12 18:06:23 2008 -0700
19.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaChar.java Fri May 16 12:25:57 2008 -0700
19.3 @@ -1,5 +1,5 @@
19.4 /*
19.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
19.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
19.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
19.8 *
19.9 * This code is free software; you can redistribute it and/or modify it
19.10 @@ -25,20 +25,9 @@
19.11
19.12
19.13 /*
19.14 - * The contents of this file are subject to the Sun Public License
19.15 - * Version 1.0 (the "License"); you may not use this file except in
19.16 - * compliance with the License. A copy of the License is available at
19.17 - * http://www.sun.com/, and in the file LICENSE.html in the
19.18 - * doc directory.
19.19 - *
19.20 * The Original Code is HAT. The Initial Developer of the
19.21 * Original Code is Bill Foote, with contributions from others
19.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
19.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
19.24 - *
19.25 - * In addition to the formal license, I ask that you don't
19.26 - * change the history or donations files without permission.
19.27 - *
19.28 + * at JavaSoft/Sun.
19.29 */
19.30
19.31 package com.sun.tools.hat.internal.model;
20.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java Mon May 12 18:06:23 2008 -0700
20.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaClass.java Fri May 16 12:25:57 2008 -0700
20.3 @@ -1,5 +1,5 @@
20.4 /*
20.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
20.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
20.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
20.8 *
20.9 * This code is free software; you can redistribute it and/or modify it
20.10 @@ -25,20 +25,9 @@
20.11
20.12
20.13 /*
20.14 - * The contents of this file are subject to the Sun Public License
20.15 - * Version 1.0 (the "License"); you may not use this file except in
20.16 - * compliance with the License. A copy of the License is available at
20.17 - * http://www.sun.com/, and in the file LICENSE.html in the
20.18 - * doc directory.
20.19 - *
20.20 * The Original Code is HAT. The Initial Developer of the
20.21 * Original Code is Bill Foote, with contributions from others
20.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
20.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
20.24 - *
20.25 - * In addition to the formal license, I ask that you don't
20.26 - * change the history or donations files without permission.
20.27 - *
20.28 + * at JavaSoft/Sun.
20.29 */
20.30
20.31 package com.sun.tools.hat.internal.model;
21.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaDouble.java Mon May 12 18:06:23 2008 -0700
21.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaDouble.java Fri May 16 12:25:57 2008 -0700
21.3 @@ -1,5 +1,5 @@
21.4 /*
21.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
21.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
21.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
21.8 *
21.9 * This code is free software; you can redistribute it and/or modify it
21.10 @@ -25,20 +25,9 @@
21.11
21.12
21.13 /*
21.14 - * The contents of this file are subject to the Sun Public License
21.15 - * Version 1.0 (the "License"); you may not use this file except in
21.16 - * compliance with the License. A copy of the License is available at
21.17 - * http://www.sun.com/, and in the file LICENSE.html in the
21.18 - * doc directory.
21.19 - *
21.20 * The Original Code is HAT. The Initial Developer of the
21.21 * Original Code is Bill Foote, with contributions from others
21.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
21.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
21.24 - *
21.25 - * In addition to the formal license, I ask that you don't
21.26 - * change the history or donations files without permission.
21.27 - *
21.28 + * at JavaSoft/Sun.
21.29 */
21.30
21.31 package com.sun.tools.hat.internal.model;
22.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaField.java Mon May 12 18:06:23 2008 -0700
22.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaField.java Fri May 16 12:25:57 2008 -0700
22.3 @@ -1,5 +1,5 @@
22.4 /*
22.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
22.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
22.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
22.8 *
22.9 * This code is free software; you can redistribute it and/or modify it
22.10 @@ -25,20 +25,9 @@
22.11
22.12
22.13 /*
22.14 - * The contents of this file are subject to the Sun Public License
22.15 - * Version 1.0 (the "License"); you may not use this file except in
22.16 - * compliance with the License. A copy of the License is available at
22.17 - * http://www.sun.com/, and in the file LICENSE.html in the
22.18 - * doc directory.
22.19 - *
22.20 * The Original Code is HAT. The Initial Developer of the
22.21 * Original Code is Bill Foote, with contributions from others
22.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
22.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
22.24 - *
22.25 - * In addition to the formal license, I ask that you don't
22.26 - * change the history or donations files without permission.
22.27 - *
22.28 + * at JavaSoft/Sun.
22.29 */
22.30
22.31 package com.sun.tools.hat.internal.model;
23.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaFloat.java Mon May 12 18:06:23 2008 -0700
23.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaFloat.java Fri May 16 12:25:57 2008 -0700
23.3 @@ -1,5 +1,5 @@
23.4 /*
23.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
23.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
23.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
23.8 *
23.9 * This code is free software; you can redistribute it and/or modify it
23.10 @@ -25,20 +25,9 @@
23.11
23.12
23.13 /*
23.14 - * The contents of this file are subject to the Sun Public License
23.15 - * Version 1.0 (the "License"); you may not use this file except in
23.16 - * compliance with the License. A copy of the License is available at
23.17 - * http://www.sun.com/, and in the file LICENSE.html in the
23.18 - * doc directory.
23.19 - *
23.20 * The Original Code is HAT. The Initial Developer of the
23.21 * Original Code is Bill Foote, with contributions from others
23.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
23.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
23.24 - *
23.25 - * In addition to the formal license, I ask that you don't
23.26 - * change the history or donations files without permission.
23.27 - *
23.28 + * at JavaSoft/Sun.
23.29 */
23.30
23.31 package com.sun.tools.hat.internal.model;
24.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java Mon May 12 18:06:23 2008 -0700
24.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObject.java Fri May 16 12:25:57 2008 -0700
24.3 @@ -1,5 +1,5 @@
24.4 /*
24.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
24.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
24.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
24.8 *
24.9 * This code is free software; you can redistribute it and/or modify it
24.10 @@ -25,20 +25,9 @@
24.11
24.12
24.13 /*
24.14 - * The contents of this file are subject to the Sun Public License
24.15 - * Version 1.0 (the "License"); you may not use this file except in
24.16 - * compliance with the License. A copy of the License is available at
24.17 - * http://www.sun.com/, and in the file LICENSE.html in the
24.18 - * doc directory.
24.19 - *
24.20 * The Original Code is HAT. The Initial Developer of the
24.21 * Original Code is Bill Foote, with contributions from others
24.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
24.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
24.24 - *
24.25 - * In addition to the formal license, I ask that you don't
24.26 - * change the history or donations files without permission.
24.27 - *
24.28 + * at JavaSoft/Sun.
24.29 */
24.30
24.31 package com.sun.tools.hat.internal.model;
25.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObjectVisitor.java Mon May 12 18:06:23 2008 -0700
25.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaHeapObjectVisitor.java Fri May 16 12:25:57 2008 -0700
25.3 @@ -1,5 +1,5 @@
25.4 /*
25.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
25.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
25.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
25.8 *
25.9 * This code is free software; you can redistribute it and/or modify it
25.10 @@ -25,20 +25,9 @@
25.11
25.12
25.13 /*
25.14 - * The contents of this file are subject to the Sun Public License
25.15 - * Version 1.0 (the "License"); you may not use this file except in
25.16 - * compliance with the License. A copy of the License is available at
25.17 - * http://www.sun.com/, and in the file LICENSE.html in the
25.18 - * doc directory.
25.19 - *
25.20 * The Original Code is HAT. The Initial Developer of the
25.21 * Original Code is Bill Foote, with contributions from others
25.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
25.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
25.24 - *
25.25 - * In addition to the formal license, I ask that you don't
25.26 - * change the history or donations files without permission.
25.27 - *
25.28 + * at JavaSoft/Sun.
25.29 */
25.30
25.31 package com.sun.tools.hat.internal.model;
26.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaInt.java Mon May 12 18:06:23 2008 -0700
26.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaInt.java Fri May 16 12:25:57 2008 -0700
26.3 @@ -1,5 +1,5 @@
26.4 /*
26.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
26.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
26.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
26.8 *
26.9 * This code is free software; you can redistribute it and/or modify it
26.10 @@ -25,20 +25,9 @@
26.11
26.12
26.13 /*
26.14 - * The contents of this file are subject to the Sun Public License
26.15 - * Version 1.0 (the "License"); you may not use this file except in
26.16 - * compliance with the License. A copy of the License is available at
26.17 - * http://www.sun.com/, and in the file LICENSE.html in the
26.18 - * doc directory.
26.19 - *
26.20 * The Original Code is HAT. The Initial Developer of the
26.21 * Original Code is Bill Foote, with contributions from others
26.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
26.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
26.24 - *
26.25 - * In addition to the formal license, I ask that you don't
26.26 - * change the history or donations files without permission.
26.27 - *
26.28 + * at JavaSoft/Sun.
26.29 */
26.30
26.31 package com.sun.tools.hat.internal.model;
27.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java Mon May 12 18:06:23 2008 -0700
27.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaLazyReadObject.java Fri May 16 12:25:57 2008 -0700
27.3 @@ -1,5 +1,5 @@
27.4 /*
27.5 - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
27.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
27.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
27.8 *
27.9 * This code is free software; you can redistribute it and/or modify it
27.10 @@ -25,20 +25,9 @@
27.11
27.12
27.13 /*
27.14 - * The contents of this file are subject to the Sun Public License
27.15 - * Version 1.0 (the "License"); you may not use this file except in
27.16 - * compliance with the License. A copy of the License is available at
27.17 - * http://www.sun.com/, and in the file LICENSE.html in the
27.18 - * doc directory.
27.19 - *
27.20 * The Original Code is HAT. The Initial Developer of the
27.21 * Original Code is Bill Foote, with contributions from others
27.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
27.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
27.24 - *
27.25 - * In addition to the formal license, I ask that you don't
27.26 - * change the history or donations files without permission.
27.27 - *
27.28 + * at JavaSoft/Sun.
27.29 */
27.30
27.31 package com.sun.tools.hat.internal.model;
28.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaLong.java Mon May 12 18:06:23 2008 -0700
28.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaLong.java Fri May 16 12:25:57 2008 -0700
28.3 @@ -1,5 +1,5 @@
28.4 /*
28.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
28.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
28.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
28.8 *
28.9 * This code is free software; you can redistribute it and/or modify it
28.10 @@ -25,20 +25,9 @@
28.11
28.12
28.13 /*
28.14 - * The contents of this file are subject to the Sun Public License
28.15 - * Version 1.0 (the "License"); you may not use this file except in
28.16 - * compliance with the License. A copy of the License is available at
28.17 - * http://www.sun.com/, and in the file LICENSE.html in the
28.18 - * doc directory.
28.19 - *
28.20 * The Original Code is HAT. The Initial Developer of the
28.21 * Original Code is Bill Foote, with contributions from others
28.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
28.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
28.24 - *
28.25 - * In addition to the formal license, I ask that you don't
28.26 - * change the history or donations files without permission.
28.27 - *
28.28 + * at JavaSoft/Sun.
28.29 */
28.30
28.31 package com.sun.tools.hat.internal.model;
29.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaObject.java Mon May 12 18:06:23 2008 -0700
29.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaObject.java Fri May 16 12:25:57 2008 -0700
29.3 @@ -1,5 +1,5 @@
29.4 /*
29.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
29.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
29.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
29.8 *
29.9 * This code is free software; you can redistribute it and/or modify it
29.10 @@ -25,20 +25,9 @@
29.11
29.12
29.13 /*
29.14 - * The contents of this file are subject to the Sun Public License
29.15 - * Version 1.0 (the "License"); you may not use this file except in
29.16 - * compliance with the License. A copy of the License is available at
29.17 - * http://www.sun.com/, and in the file LICENSE.html in the
29.18 - * doc directory.
29.19 - *
29.20 * The Original Code is HAT. The Initial Developer of the
29.21 * Original Code is Bill Foote, with contributions from others
29.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
29.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
29.24 - *
29.25 - * In addition to the formal license, I ask that you don't
29.26 - * change the history or donations files without permission.
29.27 - *
29.28 + * at JavaSoft/Sun.
29.29 */
29.30
29.31 package com.sun.tools.hat.internal.model;
30.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaObjectArray.java Mon May 12 18:06:23 2008 -0700
30.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaObjectArray.java Fri May 16 12:25:57 2008 -0700
30.3 @@ -1,5 +1,5 @@
30.4 /*
30.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
30.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
30.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
30.8 *
30.9 * This code is free software; you can redistribute it and/or modify it
30.10 @@ -25,20 +25,9 @@
30.11
30.12
30.13 /*
30.14 - * The contents of this file are subject to the Sun Public License
30.15 - * Version 1.0 (the "License"); you may not use this file except in
30.16 - * compliance with the License. A copy of the License is available at
30.17 - * http://www.sun.com/, and in the file LICENSE.html in the
30.18 - * doc directory.
30.19 - *
30.20 * The Original Code is HAT. The Initial Developer of the
30.21 * Original Code is Bill Foote, with contributions from others
30.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
30.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
30.24 - *
30.25 - * In addition to the formal license, I ask that you don't
30.26 - * change the history or donations files without permission.
30.27 - *
30.28 + * at JavaSoft/Sun.
30.29 */
30.30
30.31 package com.sun.tools.hat.internal.model;
31.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaObjectRef.java Mon May 12 18:06:23 2008 -0700
31.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaObjectRef.java Fri May 16 12:25:57 2008 -0700
31.3 @@ -1,5 +1,5 @@
31.4 /*
31.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
31.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
31.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
31.8 *
31.9 * This code is free software; you can redistribute it and/or modify it
31.10 @@ -25,20 +25,9 @@
31.11
31.12
31.13 /*
31.14 - * The contents of this file are subject to the Sun Public License
31.15 - * Version 1.0 (the "License"); you may not use this file except in
31.16 - * compliance with the License. A copy of the License is available at
31.17 - * http://www.sun.com/, and in the file LICENSE.html in the
31.18 - * doc directory.
31.19 - *
31.20 * The Original Code is HAT. The Initial Developer of the
31.21 * Original Code is Bill Foote, with contributions from others
31.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
31.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
31.24 - *
31.25 - * In addition to the formal license, I ask that you don't
31.26 - * change the history or donations files without permission.
31.27 - *
31.28 + * at JavaSoft/Sun.
31.29 */
31.30
31.31 package com.sun.tools.hat.internal.model;
32.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaShort.java Mon May 12 18:06:23 2008 -0700
32.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaShort.java Fri May 16 12:25:57 2008 -0700
32.3 @@ -1,5 +1,5 @@
32.4 /*
32.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
32.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
32.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
32.8 *
32.9 * This code is free software; you can redistribute it and/or modify it
32.10 @@ -25,20 +25,9 @@
32.11
32.12
32.13 /*
32.14 - * The contents of this file are subject to the Sun Public License
32.15 - * Version 1.0 (the "License"); you may not use this file except in
32.16 - * compliance with the License. A copy of the License is available at
32.17 - * http://www.sun.com/, and in the file LICENSE.html in the
32.18 - * doc directory.
32.19 - *
32.20 * The Original Code is HAT. The Initial Developer of the
32.21 * Original Code is Bill Foote, with contributions from others
32.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
32.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
32.24 - *
32.25 - * In addition to the formal license, I ask that you don't
32.26 - * change the history or donations files without permission.
32.27 - *
32.28 + * at JavaSoft/Sun.
32.29 */
32.30
32.31 package com.sun.tools.hat.internal.model;
33.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java Mon May 12 18:06:23 2008 -0700
33.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaStatic.java Fri May 16 12:25:57 2008 -0700
33.3 @@ -1,5 +1,5 @@
33.4 /*
33.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
33.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
33.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
33.8 *
33.9 * This code is free software; you can redistribute it and/or modify it
33.10 @@ -25,20 +25,9 @@
33.11
33.12
33.13 /*
33.14 - * The contents of this file are subject to the Sun Public License
33.15 - * Version 1.0 (the "License"); you may not use this file except in
33.16 - * compliance with the License. A copy of the License is available at
33.17 - * http://www.sun.com/, and in the file LICENSE.html in the
33.18 - * doc directory.
33.19 - *
33.20 * The Original Code is HAT. The Initial Developer of the
33.21 * Original Code is Bill Foote, with contributions from others
33.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
33.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
33.24 - *
33.25 - * In addition to the formal license, I ask that you don't
33.26 - * change the history or donations files without permission.
33.27 - *
33.28 + * at JavaSoft/Sun.
33.29 */
33.30
33.31 package com.sun.tools.hat.internal.model;
34.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaThing.java Mon May 12 18:06:23 2008 -0700
34.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaThing.java Fri May 16 12:25:57 2008 -0700
34.3 @@ -1,5 +1,5 @@
34.4 /*
34.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
34.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
34.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
34.8 *
34.9 * This code is free software; you can redistribute it and/or modify it
34.10 @@ -25,20 +25,9 @@
34.11
34.12
34.13 /*
34.14 - * The contents of this file are subject to the Sun Public License
34.15 - * Version 1.0 (the "License"); you may not use this file except in
34.16 - * compliance with the License. A copy of the License is available at
34.17 - * http://www.sun.com/, and in the file LICENSE.html in the
34.18 - * doc directory.
34.19 - *
34.20 * The Original Code is HAT. The Initial Developer of the
34.21 * Original Code is Bill Foote, with contributions from others
34.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
34.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
34.24 - *
34.25 - * In addition to the formal license, I ask that you don't
34.26 - * change the history or donations files without permission.
34.27 - *
34.28 + * at JavaSoft/Sun.
34.29 */
34.30
34.31 package com.sun.tools.hat.internal.model;
35.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValue.java Mon May 12 18:06:23 2008 -0700
35.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValue.java Fri May 16 12:25:57 2008 -0700
35.3 @@ -1,5 +1,5 @@
35.4 /*
35.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
35.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
35.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
35.8 *
35.9 * This code is free software; you can redistribute it and/or modify it
35.10 @@ -25,20 +25,9 @@
35.11
35.12
35.13 /*
35.14 - * The contents of this file are subject to the Sun Public License
35.15 - * Version 1.0 (the "License"); you may not use this file except in
35.16 - * compliance with the License. A copy of the License is available at
35.17 - * http://www.sun.com/, and in the file LICENSE.html in the
35.18 - * doc directory.
35.19 - *
35.20 * The Original Code is HAT. The Initial Developer of the
35.21 * Original Code is Bill Foote, with contributions from others
35.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
35.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
35.24 - *
35.25 - * In addition to the formal license, I ask that you don't
35.26 - * change the history or donations files without permission.
35.27 - *
35.28 + * at JavaSoft/Sun.
35.29 */
35.30
35.31 package com.sun.tools.hat.internal.model;
36.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Mon May 12 18:06:23 2008 -0700
36.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/JavaValueArray.java Fri May 16 12:25:57 2008 -0700
36.3 @@ -1,5 +1,5 @@
36.4 /*
36.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
36.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
36.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
36.8 *
36.9 * This code is free software; you can redistribute it and/or modify it
36.10 @@ -25,20 +25,9 @@
36.11
36.12
36.13 /*
36.14 - * The contents of this file are subject to the Sun Public License
36.15 - * Version 1.0 (the "License"); you may not use this file except in
36.16 - * compliance with the License. A copy of the License is available at
36.17 - * http://www.sun.com/, and in the file LICENSE.html in the
36.18 - * doc directory.
36.19 - *
36.20 * The Original Code is HAT. The Initial Developer of the
36.21 * Original Code is Bill Foote, with contributions from others
36.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
36.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
36.24 - *
36.25 - * In addition to the formal license, I ask that you don't
36.26 - * change the history or donations files without permission.
36.27 - *
36.28 + * at JavaSoft/Sun.
36.29 */
36.30
36.31 package com.sun.tools.hat.internal.model;
37.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludes.java Mon May 12 18:06:23 2008 -0700
37.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludes.java Fri May 16 12:25:57 2008 -0700
37.3 @@ -1,5 +1,5 @@
37.4 /*
37.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
37.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
37.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
37.8 *
37.9 * This code is free software; you can redistribute it and/or modify it
37.10 @@ -25,20 +25,9 @@
37.11
37.12
37.13 /*
37.14 - * The contents of this file are subject to the Sun Public License
37.15 - * Version 1.0 (the "License"); you may not use this file except in
37.16 - * compliance with the License. A copy of the License is available at
37.17 - * http://www.sun.com/, and in the file LICENSE.html in the
37.18 - * doc directory.
37.19 - *
37.20 * The Original Code is HAT. The Initial Developer of the
37.21 * Original Code is Bill Foote, with contributions from others
37.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
37.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
37.24 - *
37.25 - * In addition to the formal license, I ask that you don't
37.26 - * change the history or donations files without permission.
37.27 - *
37.28 + * at JavaSoft/Sun.
37.29 */
37.30
37.31 package com.sun.tools.hat.internal.model;
38.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java Mon May 12 18:06:23 2008 -0700
38.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/ReachableExcludesImpl.java Fri May 16 12:25:57 2008 -0700
38.3 @@ -1,5 +1,5 @@
38.4 /*
38.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
38.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
38.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
38.8 *
38.9 * This code is free software; you can redistribute it and/or modify it
38.10 @@ -25,20 +25,9 @@
38.11
38.12
38.13 /*
38.14 - * The contents of this file are subject to the Sun Public License
38.15 - * Version 1.0 (the "License"); you may not use this file except in
38.16 - * compliance with the License. A copy of the License is available at
38.17 - * http://www.sun.com/, and in the file LICENSE.html in the
38.18 - * doc directory.
38.19 - *
38.20 * The Original Code is HAT. The Initial Developer of the
38.21 * Original Code is Bill Foote, with contributions from others
38.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
38.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
38.24 - *
38.25 - * In addition to the formal license, I ask that you don't
38.26 - * change the history or donations files without permission.
38.27 - *
38.28 + * at JavaSoft/Sun.
38.29 */
38.30
38.31 package com.sun.tools.hat.internal.model;
39.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java Mon May 12 18:06:23 2008 -0700
39.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/ReachableObjects.java Fri May 16 12:25:57 2008 -0700
39.3 @@ -1,5 +1,5 @@
39.4 /*
39.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
39.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
39.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
39.8 *
39.9 * This code is free software; you can redistribute it and/or modify it
39.10 @@ -25,20 +25,9 @@
39.11
39.12
39.13 /*
39.14 - * The contents of this file are subject to the Sun Public License
39.15 - * Version 1.0 (the "License"); you may not use this file except in
39.16 - * compliance with the License. A copy of the License is available at
39.17 - * http://www.sun.com/, and in the file LICENSE.html in the
39.18 - * doc directory.
39.19 - *
39.20 * The Original Code is HAT. The Initial Developer of the
39.21 * Original Code is Bill Foote, with contributions from others
39.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
39.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
39.24 - *
39.25 - * In addition to the formal license, I ask that you don't
39.26 - * change the history or donations files without permission.
39.27 - *
39.28 + * at JavaSoft/Sun.
39.29 */
39.30
39.31 package com.sun.tools.hat.internal.model;
40.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/ReferenceChain.java Mon May 12 18:06:23 2008 -0700
40.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/ReferenceChain.java Fri May 16 12:25:57 2008 -0700
40.3 @@ -1,5 +1,5 @@
40.4 /*
40.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
40.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
40.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
40.8 *
40.9 * This code is free software; you can redistribute it and/or modify it
40.10 @@ -25,20 +25,9 @@
40.11
40.12
40.13 /*
40.14 - * The contents of this file are subject to the Sun Public License
40.15 - * Version 1.0 (the "License"); you may not use this file except in
40.16 - * compliance with the License. A copy of the License is available at
40.17 - * http://www.sun.com/, and in the file LICENSE.html in the
40.18 - * doc directory.
40.19 - *
40.20 * The Original Code is HAT. The Initial Developer of the
40.21 * Original Code is Bill Foote, with contributions from others
40.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
40.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
40.24 - *
40.25 - * In addition to the formal license, I ask that you don't
40.26 - * change the history or donations files without permission.
40.27 - *
40.28 + * at JavaSoft/Sun.
40.29 */
40.30
40.31 package com.sun.tools.hat.internal.model;
41.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/Root.java Mon May 12 18:06:23 2008 -0700
41.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/Root.java Fri May 16 12:25:57 2008 -0700
41.3 @@ -1,5 +1,5 @@
41.4 /*
41.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
41.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
41.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
41.8 *
41.9 * This code is free software; you can redistribute it and/or modify it
41.10 @@ -25,20 +25,9 @@
41.11
41.12
41.13 /*
41.14 - * The contents of this file are subject to the Sun Public License
41.15 - * Version 1.0 (the "License"); you may not use this file except in
41.16 - * compliance with the License. A copy of the License is available at
41.17 - * http://www.sun.com/, and in the file LICENSE.html in the
41.18 - * doc directory.
41.19 - *
41.20 * The Original Code is HAT. The Initial Developer of the
41.21 * Original Code is Bill Foote, with contributions from others
41.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
41.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
41.24 - *
41.25 - * In addition to the formal license, I ask that you don't
41.26 - * change the history or donations files without permission.
41.27 - *
41.28 + * at JavaSoft/Sun.
41.29 */
41.30
41.31 package com.sun.tools.hat.internal.model;
42.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java Mon May 12 18:06:23 2008 -0700
42.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/Snapshot.java Fri May 16 12:25:57 2008 -0700
42.3 @@ -1,5 +1,5 @@
42.4 /*
42.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
42.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
42.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
42.8 *
42.9 * This code is free software; you can redistribute it and/or modify it
42.10 @@ -25,20 +25,9 @@
42.11
42.12
42.13 /*
42.14 - * The contents of this file are subject to the Sun Public License
42.15 - * Version 1.0 (the "License"); you may not use this file except in
42.16 - * compliance with the License. A copy of the License is available at
42.17 - * http://www.sun.com/, and in the file LICENSE.html in the
42.18 - * doc directory.
42.19 - *
42.20 * The Original Code is HAT. The Initial Developer of the
42.21 * Original Code is Bill Foote, with contributions from others
42.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
42.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
42.24 - *
42.25 - * In addition to the formal license, I ask that you don't
42.26 - * change the history or donations files without permission.
42.27 - *
42.28 + * at JavaSoft/Sun.
42.29 */
42.30
42.31 package com.sun.tools.hat.internal.model;
43.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/StackFrame.java Mon May 12 18:06:23 2008 -0700
43.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/StackFrame.java Fri May 16 12:25:57 2008 -0700
43.3 @@ -1,5 +1,5 @@
43.4 /*
43.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
43.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
43.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
43.8 *
43.9 * This code is free software; you can redistribute it and/or modify it
43.10 @@ -25,20 +25,9 @@
43.11
43.12
43.13 /*
43.14 - * The contents of this file are subject to the Sun Public License
43.15 - * Version 1.0 (the "License"); you may not use this file except in
43.16 - * compliance with the License. A copy of the License is available at
43.17 - * http://www.sun.com/, and in the file LICENSE.html in the
43.18 - * doc directory.
43.19 - *
43.20 * The Original Code is HAT. The Initial Developer of the
43.21 * Original Code is Bill Foote, with contributions from others
43.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
43.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
43.24 - *
43.25 - * In addition to the formal license, I ask that you don't
43.26 - * change the history or donations files without permission.
43.27 - *
43.28 + * at JavaSoft/Sun.
43.29 */
43.30
43.31 package com.sun.tools.hat.internal.model;
44.1 --- a/src/share/classes/com/sun/tools/hat/internal/model/StackTrace.java Mon May 12 18:06:23 2008 -0700
44.2 +++ b/src/share/classes/com/sun/tools/hat/internal/model/StackTrace.java Fri May 16 12:25:57 2008 -0700
44.3 @@ -1,5 +1,5 @@
44.4 /*
44.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
44.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
44.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44.8 *
44.9 * This code is free software; you can redistribute it and/or modify it
44.10 @@ -25,20 +25,9 @@
44.11
44.12
44.13 /*
44.14 - * The contents of this file are subject to the Sun Public License
44.15 - * Version 1.0 (the "License"); you may not use this file except in
44.16 - * compliance with the License. A copy of the License is available at
44.17 - * http://www.sun.com/, and in the file LICENSE.html in the
44.18 - * doc directory.
44.19 - *
44.20 * The Original Code is HAT. The Initial Developer of the
44.21 * Original Code is Bill Foote, with contributions from others
44.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
44.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
44.24 - *
44.25 - * In addition to the formal license, I ask that you don't
44.26 - * change the history or donations files without permission.
44.27 - *
44.28 + * at JavaSoft/Sun.
44.29 */
44.30
44.31 package com.sun.tools.hat.internal.model;
45.1 --- a/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java Mon May 12 18:06:23 2008 -0700
45.2 +++ b/src/share/classes/com/sun/tools/hat/internal/oql/OQLEngine.java Fri May 16 12:25:57 2008 -0700
45.3 @@ -1,5 +1,5 @@
45.4 /*
45.5 - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
45.6 + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
45.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45.8 *
45.9 * This code is free software; you can redistribute it and/or modify it
45.10 @@ -25,20 +25,9 @@
45.11
45.12
45.13 /*
45.14 - * The contents of this file are subject to the Sun Public License
45.15 - * Version 1.0 (the "License"); you may not use this file except in
45.16 - * compliance with the License. A copy of the License is available at
45.17 - * http://www.sun.com/, and in the file LICENSE.html in the
45.18 - * doc directory.
45.19 - *
45.20 * The Original Code is HAT. The Initial Developer of the
45.21 * Original Code is Bill Foote, with contributions from others
45.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
45.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
45.24 - *
45.25 - * In addition to the formal license, I ask that you don't
45.26 - * change the history or donations files without permission.
45.27 - *
45.28 + * at JavaSoft/Sun.
45.29 */
45.30
45.31 package com.sun.tools.hat.internal.oql;
46.1 --- a/src/share/classes/com/sun/tools/hat/internal/oql/OQLException.java Mon May 12 18:06:23 2008 -0700
46.2 +++ b/src/share/classes/com/sun/tools/hat/internal/oql/OQLException.java Fri May 16 12:25:57 2008 -0700
46.3 @@ -1,5 +1,5 @@
46.4 /*
46.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
46.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
46.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
46.8 *
46.9 * This code is free software; you can redistribute it and/or modify it
46.10 @@ -25,20 +25,9 @@
46.11
46.12
46.13 /*
46.14 - * The contents of this file are subject to the Sun Public License
46.15 - * Version 1.0 (the "License"); you may not use this file except in
46.16 - * compliance with the License. A copy of the License is available at
46.17 - * http://www.sun.com/, and in the file LICENSE.html in the
46.18 - * doc directory.
46.19 - *
46.20 * The Original Code is HAT. The Initial Developer of the
46.21 * Original Code is Bill Foote, with contributions from others
46.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
46.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
46.24 - *
46.25 - * In addition to the formal license, I ask that you don't
46.26 - * change the history or donations files without permission.
46.27 - *
46.28 + * at JavaSoft/Sun.
46.29 */
46.30
46.31 package com.sun.tools.hat.internal.oql;
47.1 --- a/src/share/classes/com/sun/tools/hat/internal/oql/OQLQuery.java Mon May 12 18:06:23 2008 -0700
47.2 +++ b/src/share/classes/com/sun/tools/hat/internal/oql/OQLQuery.java Fri May 16 12:25:57 2008 -0700
47.3 @@ -1,5 +1,5 @@
47.4 /*
47.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
47.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
47.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
47.8 *
47.9 * This code is free software; you can redistribute it and/or modify it
47.10 @@ -25,20 +25,9 @@
47.11
47.12
47.13 /*
47.14 - * The contents of this file are subject to the Sun Public License
47.15 - * Version 1.0 (the "License"); you may not use this file except in
47.16 - * compliance with the License. A copy of the License is available at
47.17 - * http://www.sun.com/, and in the file LICENSE.html in the
47.18 - * doc directory.
47.19 - *
47.20 * The Original Code is HAT. The Initial Developer of the
47.21 * Original Code is Bill Foote, with contributions from others
47.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
47.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
47.24 - *
47.25 - * In addition to the formal license, I ask that you don't
47.26 - * change the history or donations files without permission.
47.27 - *
47.28 + * at JavaSoft/Sun.
47.29 */
47.30
47.31 package com.sun.tools.hat.internal.oql;
48.1 --- a/src/share/classes/com/sun/tools/hat/internal/oql/ObjectVisitor.java Mon May 12 18:06:23 2008 -0700
48.2 +++ b/src/share/classes/com/sun/tools/hat/internal/oql/ObjectVisitor.java Fri May 16 12:25:57 2008 -0700
48.3 @@ -1,5 +1,5 @@
48.4 /*
48.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
48.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
48.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
48.8 *
48.9 * This code is free software; you can redistribute it and/or modify it
48.10 @@ -25,20 +25,9 @@
48.11
48.12
48.13 /*
48.14 - * The contents of this file are subject to the Sun Public License
48.15 - * Version 1.0 (the "License"); you may not use this file except in
48.16 - * compliance with the License. A copy of the License is available at
48.17 - * http://www.sun.com/, and in the file LICENSE.html in the
48.18 - * doc directory.
48.19 - *
48.20 * The Original Code is HAT. The Initial Developer of the
48.21 * Original Code is Bill Foote, with contributions from others
48.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
48.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
48.24 - *
48.25 - * In addition to the formal license, I ask that you don't
48.26 - * change the history or donations files without permission.
48.27 - *
48.28 + * at JavaSoft/Sun.
48.29 */
48.30
48.31 package com.sun.tools.hat.internal.oql;
49.1 --- a/src/share/classes/com/sun/tools/hat/internal/parser/FileReadBuffer.java Mon May 12 18:06:23 2008 -0700
49.2 +++ b/src/share/classes/com/sun/tools/hat/internal/parser/FileReadBuffer.java Fri May 16 12:25:57 2008 -0700
49.3 @@ -1,5 +1,5 @@
49.4 /*
49.5 - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
49.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
49.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
49.8 *
49.9 * This code is free software; you can redistribute it and/or modify it
49.10 @@ -25,20 +25,9 @@
49.11
49.12
49.13 /*
49.14 - * The contents of this file are subject to the Sun Public License
49.15 - * Version 1.0 (the "License"); you may not use this file except in
49.16 - * compliance with the License. A copy of the License is available at
49.17 - * http://www.sun.com/, and in the file LICENSE.html in the
49.18 - * doc directory.
49.19 - *
49.20 * The Original Code is HAT. The Initial Developer of the
49.21 * Original Code is Bill Foote, with contributions from others
49.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
49.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
49.24 - *
49.25 - * In addition to the formal license, I ask that you don't
49.26 - * change the history or donations files without permission.
49.27 - *
49.28 + * at JavaSoft/Sun.
49.29 */
49.30
49.31 package com.sun.tools.hat.internal.parser;
50.1 --- a/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java Mon May 12 18:06:23 2008 -0700
50.2 +++ b/src/share/classes/com/sun/tools/hat/internal/parser/HprofReader.java Fri May 16 12:25:57 2008 -0700
50.3 @@ -1,5 +1,5 @@
50.4 /*
50.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
50.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
50.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
50.8 *
50.9 * This code is free software; you can redistribute it and/or modify it
50.10 @@ -23,21 +23,11 @@
50.11 * have any questions.
50.12 */
50.13
50.14 +
50.15 /*
50.16 - * The contents of this file are subject to the Sun Public License
50.17 - * Version 1.0 (the "License"); you may not use this file except in
50.18 - * compliance with the License. A copy of the License is available at
50.19 - * http://www.sun.com/, and in the file LICENSE.html in the
50.20 - * doc directory.
50.21 - *
50.22 * The Original Code is HAT. The Initial Developer of the
50.23 * Original Code is Bill Foote, with contributions from others
50.24 - * at JavaSoft/Sun. Portions created by Bill Foote and others
50.25 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
50.26 - *
50.27 - * In addition to the formal license, I ask that you don't
50.28 - * change the history or donations files without permission.
50.29 - *
50.30 + * at JavaSoft/Sun.
50.31 */
50.32
50.33 package com.sun.tools.hat.internal.parser;
51.1 --- a/src/share/classes/com/sun/tools/hat/internal/parser/MappedReadBuffer.java Mon May 12 18:06:23 2008 -0700
51.2 +++ b/src/share/classes/com/sun/tools/hat/internal/parser/MappedReadBuffer.java Fri May 16 12:25:57 2008 -0700
51.3 @@ -1,5 +1,5 @@
51.4 /*
51.5 - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
51.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
51.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
51.8 *
51.9 * This code is free software; you can redistribute it and/or modify it
51.10 @@ -23,21 +23,11 @@
51.11 * have any questions.
51.12 */
51.13
51.14 +
51.15 /*
51.16 - * The contents of this file are subject to the Sun Public License
51.17 - * Version 1.0 (the "License"); you may not use this file except in
51.18 - * compliance with the License. A copy of the License is available at
51.19 - * http://www.sun.com/, and in the file LICENSE.html in the
51.20 - * doc directory.
51.21 - *
51.22 * The Original Code is HAT. The Initial Developer of the
51.23 * Original Code is Bill Foote, with contributions from others
51.24 - * at JavaSoft/Sun. Portions created by Bill Foote and others
51.25 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
51.26 - *
51.27 - * In addition to the formal license, I ask that you don't
51.28 - * change the history or donations files without permission.
51.29 - *
51.30 + * at JavaSoft/Sun.
51.31 */
51.32
51.33 package com.sun.tools.hat.internal.parser;
52.1 --- a/src/share/classes/com/sun/tools/hat/internal/parser/PositionDataInputStream.java Mon May 12 18:06:23 2008 -0700
52.2 +++ b/src/share/classes/com/sun/tools/hat/internal/parser/PositionDataInputStream.java Fri May 16 12:25:57 2008 -0700
52.3 @@ -1,5 +1,5 @@
52.4 /*
52.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
52.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
52.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
52.8 *
52.9 * This code is free software; you can redistribute it and/or modify it
52.10 @@ -25,20 +25,9 @@
52.11
52.12
52.13 /*
52.14 - * The contents of this file are subject to the Sun Public License
52.15 - * Version 1.0 (the "License"); you may not use this file except in
52.16 - * compliance with the License. A copy of the License is available at
52.17 - * http://www.sun.com/, and in the file LICENSE.html in the
52.18 - * doc directory.
52.19 - *
52.20 * The Original Code is HAT. The Initial Developer of the
52.21 * Original Code is Bill Foote, with contributions from others
52.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
52.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
52.24 - *
52.25 - * In addition to the formal license, I ask that you don't
52.26 - * change the history or donations files without permission.
52.27 - *
52.28 + * at JavaSoft/Sun.
52.29 */
52.30
52.31 package com.sun.tools.hat.internal.parser;
53.1 --- a/src/share/classes/com/sun/tools/hat/internal/parser/PositionInputStream.java Mon May 12 18:06:23 2008 -0700
53.2 +++ b/src/share/classes/com/sun/tools/hat/internal/parser/PositionInputStream.java Fri May 16 12:25:57 2008 -0700
53.3 @@ -1,5 +1,5 @@
53.4 /*
53.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
53.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
53.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
53.8 *
53.9 * This code is free software; you can redistribute it and/or modify it
53.10 @@ -25,20 +25,9 @@
53.11
53.12
53.13 /*
53.14 - * The contents of this file are subject to the Sun Public License
53.15 - * Version 1.0 (the "License"); you may not use this file except in
53.16 - * compliance with the License. A copy of the License is available at
53.17 - * http://www.sun.com/, and in the file LICENSE.html in the
53.18 - * doc directory.
53.19 - *
53.20 * The Original Code is HAT. The Initial Developer of the
53.21 * Original Code is Bill Foote, with contributions from others
53.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
53.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
53.24 - *
53.25 - * In addition to the formal license, I ask that you don't
53.26 - * change the history or donations files without permission.
53.27 - *
53.28 + * at JavaSoft/Sun.
53.29 */
53.30
53.31 package com.sun.tools.hat.internal.parser;
54.1 --- a/src/share/classes/com/sun/tools/hat/internal/parser/ReadBuffer.java Mon May 12 18:06:23 2008 -0700
54.2 +++ b/src/share/classes/com/sun/tools/hat/internal/parser/ReadBuffer.java Fri May 16 12:25:57 2008 -0700
54.3 @@ -1,5 +1,5 @@
54.4 /*
54.5 - * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved.
54.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
54.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
54.8 *
54.9 * This code is free software; you can redistribute it and/or modify it
54.10 @@ -25,20 +25,9 @@
54.11
54.12
54.13 /*
54.14 - * The contents of this file are subject to the Sun Public License
54.15 - * Version 1.0 (the "License"); you may not use this file except in
54.16 - * compliance with the License. A copy of the License is available at
54.17 - * http://www.sun.com/, and in the file LICENSE.html in the
54.18 - * doc directory.
54.19 - *
54.20 * The Original Code is HAT. The Initial Developer of the
54.21 * Original Code is Bill Foote, with contributions from others
54.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
54.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
54.24 - *
54.25 - * In addition to the formal license, I ask that you don't
54.26 - * change the history or donations files without permission.
54.27 - *
54.28 + * at JavaSoft/Sun.
54.29 */
54.30
54.31 package com.sun.tools.hat.internal.parser;
55.1 --- a/src/share/classes/com/sun/tools/hat/internal/parser/Reader.java Mon May 12 18:06:23 2008 -0700
55.2 +++ b/src/share/classes/com/sun/tools/hat/internal/parser/Reader.java Fri May 16 12:25:57 2008 -0700
55.3 @@ -1,5 +1,5 @@
55.4 /*
55.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
55.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
55.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
55.8 *
55.9 * This code is free software; you can redistribute it and/or modify it
55.10 @@ -25,20 +25,9 @@
55.11
55.12
55.13 /*
55.14 - * The contents of this file are subject to the Sun Public License
55.15 - * Version 1.0 (the "License"); you may not use this file except in
55.16 - * compliance with the License. A copy of the License is available at
55.17 - * http://www.sun.com/, and in the file LICENSE.html in the
55.18 - * doc directory.
55.19 - *
55.20 * The Original Code is HAT. The Initial Developer of the
55.21 * Original Code is Bill Foote, with contributions from others
55.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
55.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
55.24 - *
55.25 - * In addition to the formal license, I ask that you don't
55.26 - * change the history or donations files without permission.
55.27 - *
55.28 + * at JavaSoft/Sun.
55.29 */
55.30
55.31 package com.sun.tools.hat.internal.parser;
56.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java Mon May 12 18:06:23 2008 -0700
56.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/AllClassesQuery.java Fri May 16 12:25:57 2008 -0700
56.3 @@ -1,5 +1,5 @@
56.4 /*
56.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
56.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
56.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
56.8 *
56.9 * This code is free software; you can redistribute it and/or modify it
56.10 @@ -25,20 +25,9 @@
56.11
56.12
56.13 /*
56.14 - * The contents of this file are subject to the Sun Public License
56.15 - * Version 1.0 (the "License"); you may not use this file except in
56.16 - * compliance with the License. A copy of the License is available at
56.17 - * http://www.sun.com/, and in the file LICENSE.html in the
56.18 - * doc directory.
56.19 - *
56.20 * The Original Code is HAT. The Initial Developer of the
56.21 * Original Code is Bill Foote, with contributions from others
56.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
56.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
56.24 - *
56.25 - * In addition to the formal license, I ask that you don't
56.26 - * change the history or donations files without permission.
56.27 - *
56.28 + * at JavaSoft/Sun.
56.29 */
56.30
56.31 package com.sun.tools.hat.internal.server;
57.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/AllRootsQuery.java Mon May 12 18:06:23 2008 -0700
57.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/AllRootsQuery.java Fri May 16 12:25:57 2008 -0700
57.3 @@ -1,5 +1,5 @@
57.4 /*
57.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
57.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
57.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
57.8 *
57.9 * This code is free software; you can redistribute it and/or modify it
57.10 @@ -25,20 +25,9 @@
57.11
57.12
57.13 /*
57.14 - * The contents of this file are subject to the Sun Public License
57.15 - * Version 1.0 (the "License"); you may not use this file except in
57.16 - * compliance with the License. A copy of the License is available at
57.17 - * http://www.sun.com/, and in the file LICENSE.html in the
57.18 - * doc directory.
57.19 - *
57.20 * The Original Code is HAT. The Initial Developer of the
57.21 * Original Code is Bill Foote, with contributions from others
57.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
57.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
57.24 - *
57.25 - * In addition to the formal license, I ask that you don't
57.26 - * change the history or donations files without permission.
57.27 - *
57.28 + * at JavaSoft/Sun.
57.29 */
57.30
57.31 package com.sun.tools.hat.internal.server;
58.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java Mon May 12 18:06:23 2008 -0700
58.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/ClassQuery.java Fri May 16 12:25:57 2008 -0700
58.3 @@ -1,5 +1,5 @@
58.4 /*
58.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
58.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
58.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
58.8 *
58.9 * This code is free software; you can redistribute it and/or modify it
58.10 @@ -25,20 +25,9 @@
58.11
58.12
58.13 /*
58.14 - * The contents of this file are subject to the Sun Public License
58.15 - * Version 1.0 (the "License"); you may not use this file except in
58.16 - * compliance with the License. A copy of the License is available at
58.17 - * http://www.sun.com/, and in the file LICENSE.html in the
58.18 - * doc directory.
58.19 - *
58.20 * The Original Code is HAT. The Initial Developer of the
58.21 * Original Code is Bill Foote, with contributions from others
58.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
58.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
58.24 - *
58.25 - * In addition to the formal license, I ask that you don't
58.26 - * change the history or donations files without permission.
58.27 - *
58.28 + * at JavaSoft/Sun.
58.29 */
58.30
58.31 package com.sun.tools.hat.internal.server;
59.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java Mon May 12 18:06:23 2008 -0700
59.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/FinalizerObjectsQuery.java Fri May 16 12:25:57 2008 -0700
59.3 @@ -1,5 +1,5 @@
59.4 /*
59.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
59.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
59.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
59.8 *
59.9 * This code is free software; you can redistribute it and/or modify it
59.10 @@ -25,20 +25,9 @@
59.11
59.12
59.13 /*
59.14 - * The contents of this file are subject to the Sun Public License
59.15 - * Version 1.0 (the "License"); you may not use this file except in
59.16 - * compliance with the License. A copy of the License is available at
59.17 - * http://www.sun.com/, and in the file LICENSE.html in the
59.18 - * doc directory.
59.19 - *
59.20 * The Original Code is HAT. The Initial Developer of the
59.21 * Original Code is Bill Foote, with contributions from others
59.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
59.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
59.24 - *
59.25 - * In addition to the formal license, I ask that you don't
59.26 - * change the history or donations files without permission.
59.27 - *
59.28 + * at JavaSoft/Sun.
59.29 */
59.30
59.31 package com.sun.tools.hat.internal.server;
60.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java Mon May 12 18:06:23 2008 -0700
60.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/FinalizerSummaryQuery.java Fri May 16 12:25:57 2008 -0700
60.3 @@ -1,5 +1,5 @@
60.4 /*
60.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
60.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
60.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
60.8 *
60.9 * This code is free software; you can redistribute it and/or modify it
60.10 @@ -25,20 +25,9 @@
60.11
60.12
60.13 /*
60.14 - * The contents of this file are subject to the Sun Public License
60.15 - * Version 1.0 (the "License"); you may not use this file except in
60.16 - * compliance with the License. A copy of the License is available at
60.17 - * http://www.sun.com/, and in the file LICENSE.html in the
60.18 - * doc directory.
60.19 - *
60.20 * The Original Code is HAT. The Initial Developer of the
60.21 * Original Code is Bill Foote, with contributions from others
60.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
60.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
60.24 - *
60.25 - * In addition to the formal license, I ask that you don't
60.26 - * change the history or donations files without permission.
60.27 - *
60.28 + * at JavaSoft/Sun.
60.29 */
60.30
60.31 package com.sun.tools.hat.internal.server;
61.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/HistogramQuery.java Mon May 12 18:06:23 2008 -0700
61.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/HistogramQuery.java Fri May 16 12:25:57 2008 -0700
61.3 @@ -1,5 +1,5 @@
61.4 /*
61.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
61.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
61.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
61.8 *
61.9 * This code is free software; you can redistribute it and/or modify it
61.10 @@ -25,20 +25,9 @@
61.11
61.12
61.13 /*
61.14 - * The contents of this file are subject to the Sun Public License
61.15 - * Version 1.0 (the "License"); you may not use this file except in
61.16 - * compliance with the License. A copy of the License is available at
61.17 - * http://www.sun.com/, and in the file LICENSE.html in the
61.18 - * doc directory.
61.19 - *
61.20 * The Original Code is HAT. The Initial Developer of the
61.21 * Original Code is Bill Foote, with contributions from others
61.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
61.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
61.24 - *
61.25 - * In addition to the formal license, I ask that you don't
61.26 - * change the history or donations files without permission.
61.27 - *
61.28 + * at JavaSoft/Sun.
61.29 */
61.30
61.31 package com.sun.tools.hat.internal.server;
62.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java Mon May 12 18:06:23 2008 -0700
62.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/HttpReader.java Fri May 16 12:25:57 2008 -0700
62.3 @@ -1,5 +1,5 @@
62.4 /*
62.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
62.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
62.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
62.8 *
62.9 * This code is free software; you can redistribute it and/or modify it
62.10 @@ -25,20 +25,9 @@
62.11
62.12
62.13 /*
62.14 - * The contents of this file are subject to the Sun Public License
62.15 - * Version 1.0 (the "License"); you may not use this file except in
62.16 - * compliance with the License. A copy of the License is available at
62.17 - * http://www.sun.com/, and in the file LICENSE.html in the
62.18 - * doc directory.
62.19 - *
62.20 * The Original Code is HAT. The Initial Developer of the
62.21 * Original Code is Bill Foote, with contributions from others
62.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
62.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
62.24 - *
62.25 - * In addition to the formal license, I ask that you don't
62.26 - * change the history or donations files without permission.
62.27 - *
62.28 + * at JavaSoft/Sun.
62.29 */
62.30
62.31 package com.sun.tools.hat.internal.server;
63.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java Mon May 12 18:06:23 2008 -0700
63.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/InstancesCountQuery.java Fri May 16 12:25:57 2008 -0700
63.3 @@ -1,5 +1,5 @@
63.4 /*
63.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
63.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
63.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
63.8 *
63.9 * This code is free software; you can redistribute it and/or modify it
63.10 @@ -24,19 +24,10 @@
63.11 */
63.12
63.13
63.14 -/* The contents of this file are subject to the Sun Public License
63.15 - * Version 1.0 (the "License"); you may not use this file except in
63.16 - * compliance with the License. A copy of the License is available at
63.17 - * http://www.sun.com/, and in the file LICENSE.html in the
63.18 - * doc directory.
63.19 - *
63.20 +/*
63.21 * The Original Code is HAT. The Initial Developer of the
63.22 * Original Code is Bill Foote, with contributions from others
63.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
63.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
63.25 - *
63.26 - * In addition to the formal license, I ask that you don't
63.27 - * change the history or donations files without permission.
63.28 + * at JavaSoft/Sun.
63.29 */
63.30
63.31 package com.sun.tools.hat.internal.server;
64.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java Mon May 12 18:06:23 2008 -0700
64.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/InstancesQuery.java Fri May 16 12:25:57 2008 -0700
64.3 @@ -1,5 +1,5 @@
64.4 /*
64.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
64.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
64.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
64.8 *
64.9 * This code is free software; you can redistribute it and/or modify it
64.10 @@ -24,19 +24,10 @@
64.11 */
64.12
64.13
64.14 -/* The contents of this file are subject to the Sun Public License
64.15 - * Version 1.0 (the "License"); you may not use this file except in
64.16 - * compliance with the License. A copy of the License is available at
64.17 - * http://www.sun.com/, and in the file LICENSE.html in the
64.18 - * doc directory.
64.19 - *
64.20 +/*
64.21 * The Original Code is HAT. The Initial Developer of the
64.22 * Original Code is Bill Foote, with contributions from others
64.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
64.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
64.25 - *
64.26 - * In addition to the formal license, I ask that you don't
64.27 - * change the history or donations files without permission.
64.28 + * at JavaSoft/Sun.
64.29 */
64.30
64.31 package com.sun.tools.hat.internal.server;
65.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java Mon May 12 18:06:23 2008 -0700
65.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/OQLHelp.java Fri May 16 12:25:57 2008 -0700
65.3 @@ -1,5 +1,5 @@
65.4 /*
65.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
65.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
65.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
65.8 *
65.9 * This code is free software; you can redistribute it and/or modify it
65.10 @@ -25,20 +25,9 @@
65.11
65.12
65.13 /*
65.14 - * The contents of this file are subject to the Sun Public License
65.15 - * Version 1.0 (the "License"); you may not use this file except in
65.16 - * compliance with the License. A copy of the License is available at
65.17 - * http://www.sun.com/, and in the file LICENSE.html in the
65.18 - * doc directory.
65.19 - *
65.20 * The Original Code is HAT. The Initial Developer of the
65.21 * Original Code is Bill Foote, with contributions from others
65.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
65.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
65.24 - *
65.25 - * In addition to the formal license, I ask that you don't
65.26 - * change the history or donations files without permission.
65.27 - *
65.28 + * at JavaSoft/Sun.
65.29 */
65.30
65.31 package com.sun.tools.hat.internal.server;
66.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java Mon May 12 18:06:23 2008 -0700
66.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/OQLQuery.java Fri May 16 12:25:57 2008 -0700
66.3 @@ -1,5 +1,5 @@
66.4 /*
66.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
66.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
66.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
66.8 *
66.9 * This code is free software; you can redistribute it and/or modify it
66.10 @@ -25,20 +25,9 @@
66.11
66.12
66.13 /*
66.14 - * The contents of this file are subject to the Sun Public License
66.15 - * Version 1.0 (the "License"); you may not use this file except in
66.16 - * compliance with the License. A copy of the License is available at
66.17 - * http://www.sun.com/, and in the file LICENSE.html in the
66.18 - * doc directory.
66.19 - *
66.20 * The Original Code is HAT. The Initial Developer of the
66.21 * Original Code is Bill Foote, with contributions from others
66.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
66.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
66.24 - *
66.25 - * In addition to the formal license, I ask that you don't
66.26 - * change the history or donations files without permission.
66.27 - *
66.28 + * at JavaSoft/Sun.
66.29 */
66.30
66.31 package com.sun.tools.hat.internal.server;
67.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/ObjectQuery.java Mon May 12 18:06:23 2008 -0700
67.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/ObjectQuery.java Fri May 16 12:25:57 2008 -0700
67.3 @@ -1,5 +1,5 @@
67.4 /*
67.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
67.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
67.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
67.8 *
67.9 * This code is free software; you can redistribute it and/or modify it
67.10 @@ -24,19 +24,10 @@
67.11 */
67.12
67.13
67.14 -/* The contents of this file are subject to the Sun Public License
67.15 - * Version 1.0 (the "License"); you may not use this file except in
67.16 - * compliance with the License. A copy of the License is available at
67.17 - * http://www.sun.com/, and in the file LICENSE.html in the
67.18 - * doc directory.
67.19 - *
67.20 +/*
67.21 * The Original Code is HAT. The Initial Developer of the
67.22 * Original Code is Bill Foote, with contributions from others
67.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
67.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
67.25 - *
67.26 - * In addition to the formal license, I ask that you don't
67.27 - * change the history or donations files without permission.
67.28 + * at JavaSoft/Sun.
67.29 */
67.30
67.31 package com.sun.tools.hat.internal.server;
68.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/PlatformClasses.java Mon May 12 18:06:23 2008 -0700
68.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/PlatformClasses.java Fri May 16 12:25:57 2008 -0700
68.3 @@ -1,5 +1,5 @@
68.4 /*
68.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
68.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
68.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
68.8 *
68.9 * This code is free software; you can redistribute it and/or modify it
68.10 @@ -24,19 +24,10 @@
68.11 */
68.12
68.13
68.14 -/* The contents of this file are subject to the Sun Public License
68.15 - * Version 1.0 (the "License"); you may not use this file except in
68.16 - * compliance with the License. A copy of the License is available at
68.17 - * http://www.sun.com/, and in the file LICENSE.html in the
68.18 - * doc directory.
68.19 - *
68.20 +/*
68.21 * The Original Code is HAT. The Initial Developer of the
68.22 * Original Code is Bill Foote, with contributions from others
68.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
68.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
68.25 - *
68.26 - * In addition to the formal license, I ask that you don't
68.27 - * change the history or donations files without permission.
68.28 + * at JavaSoft/Sun.
68.29 */
68.30
68.31 package com.sun.tools.hat.internal.server;
69.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java Mon May 12 18:06:23 2008 -0700
69.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/QueryHandler.java Fri May 16 12:25:57 2008 -0700
69.3 @@ -1,5 +1,5 @@
69.4 /*
69.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
69.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
69.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
69.8 *
69.9 * This code is free software; you can redistribute it and/or modify it
69.10 @@ -24,20 +24,10 @@
69.11 */
69.12
69.13
69.14 -
69.15 -/* The contents of this file are subject to the Sun Public License
69.16 - * Version 1.0 (the "License"); you may not use this file except in
69.17 - * compliance with the License. A copy of the License is available at
69.18 - * http://www.sun.com/, and in the file LICENSE.html in the
69.19 - * doc directory.
69.20 - *
69.21 +/*
69.22 * The Original Code is HAT. The Initial Developer of the
69.23 * Original Code is Bill Foote, with contributions from others
69.24 - * at JavaSoft/Sun. Portions created by Bill Foote and others
69.25 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
69.26 - *
69.27 - * In addition to the formal license, I ask that you don't
69.28 - * change the history or donations files without permission.
69.29 + * at JavaSoft/Sun.
69.30 */
69.31
69.32 package com.sun.tools.hat.internal.server;
70.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/QueryListener.java Mon May 12 18:06:23 2008 -0700
70.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/QueryListener.java Fri May 16 12:25:57 2008 -0700
70.3 @@ -1,5 +1,5 @@
70.4 /*
70.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
70.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
70.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
70.8 *
70.9 * This code is free software; you can redistribute it and/or modify it
70.10 @@ -24,19 +24,10 @@
70.11 */
70.12
70.13
70.14 -/* The contents of this file are subject to the Sun Public License
70.15 - * Version 1.0 (the "License"); you may not use this file except in
70.16 - * compliance with the License. A copy of the License is available at
70.17 - * http://www.sun.com/, and in the file LICENSE.html in the
70.18 - * doc directory.
70.19 - *
70.20 +/*
70.21 * The Original Code is HAT. The Initial Developer of the
70.22 * Original Code is Bill Foote, with contributions from others
70.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
70.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
70.25 - *
70.26 - * In addition to the formal license, I ask that you don't
70.27 - * change the history or donations files without permission.
70.28 + * at JavaSoft/Sun.
70.29 */
70.30
70.31 package com.sun.tools.hat.internal.server;
71.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/ReachableQuery.java Mon May 12 18:06:23 2008 -0700
71.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/ReachableQuery.java Fri May 16 12:25:57 2008 -0700
71.3 @@ -1,5 +1,5 @@
71.4 /*
71.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
71.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
71.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
71.8 *
71.9 * This code is free software; you can redistribute it and/or modify it
71.10 @@ -24,20 +24,10 @@
71.11 */
71.12
71.13
71.14 -
71.15 -/* The contents of this file are subject to the Sun Public License
71.16 - * Version 1.0 (the "License"); you may not use this file except in
71.17 - * compliance with the License. A copy of the License is available at
71.18 - * http://www.sun.com/, and in the file LICENSE.html in the
71.19 - * doc directory.
71.20 - *
71.21 +/*
71.22 * The Original Code is HAT. The Initial Developer of the
71.23 * Original Code is Bill Foote, with contributions from others
71.24 - * at JavaSoft/Sun. Portions created by Bill Foote and others
71.25 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
71.26 - *
71.27 - * In addition to the formal license, I ask that you don't
71.28 - * change the history or donations files without permission.
71.29 + * at JavaSoft/Sun.
71.30 */
71.31
71.32 package com.sun.tools.hat.internal.server;
72.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java Mon May 12 18:06:23 2008 -0700
72.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/RefsByTypeQuery.java Fri May 16 12:25:57 2008 -0700
72.3 @@ -1,5 +1,5 @@
72.4 /*
72.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
72.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
72.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
72.8 *
72.9 * This code is free software; you can redistribute it and/or modify it
72.10 @@ -25,20 +25,9 @@
72.11
72.12
72.13 /*
72.14 - * The contents of this file are subject to the Sun Public License
72.15 - * Version 1.0 (the "License"); you may not use this file except in
72.16 - * compliance with the License. A copy of the License is available at
72.17 - * http://www.sun.com/, and in the file LICENSE.html in the
72.18 - * doc directory.
72.19 - *
72.20 * The Original Code is HAT. The Initial Developer of the
72.21 * Original Code is Bill Foote, with contributions from others
72.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
72.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
72.24 - *
72.25 - * In addition to the formal license, I ask that you don't
72.26 - * change the history or donations files without permission.
72.27 - *
72.28 + * at JavaSoft/Sun.
72.29 */
72.30
72.31 package com.sun.tools.hat.internal.server;
73.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/RootStackQuery.java Mon May 12 18:06:23 2008 -0700
73.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/RootStackQuery.java Fri May 16 12:25:57 2008 -0700
73.3 @@ -1,5 +1,5 @@
73.4 /*
73.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
73.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
73.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
73.8 *
73.9 * This code is free software; you can redistribute it and/or modify it
73.10 @@ -24,19 +24,10 @@
73.11 */
73.12
73.13
73.14 -/* The contents of this file are subject to the Sun Public License
73.15 - * Version 1.0 (the "License"); you may not use this file except in
73.16 - * compliance with the License. A copy of the License is available at
73.17 - * http://www.sun.com/, and in the file LICENSE.html in the
73.18 - * doc directory.
73.19 - *
73.20 +/*
73.21 * The Original Code is HAT. The Initial Developer of the
73.22 * Original Code is Bill Foote, with contributions from others
73.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
73.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
73.25 - *
73.26 - * In addition to the formal license, I ask that you don't
73.27 - * change the history or donations files without permission.
73.28 + * at JavaSoft/Sun.
73.29 */
73.30
73.31 package com.sun.tools.hat.internal.server;
74.1 --- a/src/share/classes/com/sun/tools/hat/internal/server/RootsQuery.java Mon May 12 18:06:23 2008 -0700
74.2 +++ b/src/share/classes/com/sun/tools/hat/internal/server/RootsQuery.java Fri May 16 12:25:57 2008 -0700
74.3 @@ -1,5 +1,5 @@
74.4 /*
74.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
74.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
74.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
74.8 *
74.9 * This code is free software; you can redistribute it and/or modify it
74.10 @@ -24,19 +24,10 @@
74.11 */
74.12
74.13
74.14 -/* The contents of this file are subject to the Sun Public License
74.15 - * Version 1.0 (the "License"); you may not use this file except in
74.16 - * compliance with the License. A copy of the License is available at
74.17 - * http://www.sun.com/, and in the file LICENSE.html in the
74.18 - * doc directory.
74.19 - *
74.20 +/*
74.21 * The Original Code is HAT. The Initial Developer of the
74.22 * Original Code is Bill Foote, with contributions from others
74.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
74.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
74.25 - *
74.26 - * In addition to the formal license, I ask that you don't
74.27 - * change the history or donations files without permission.
74.28 + * at JavaSoft/Sun.
74.29 */
74.30
74.31 package com.sun.tools.hat.internal.server;
75.1 --- a/src/share/classes/com/sun/tools/hat/internal/util/ArraySorter.java Mon May 12 18:06:23 2008 -0700
75.2 +++ b/src/share/classes/com/sun/tools/hat/internal/util/ArraySorter.java Fri May 16 12:25:57 2008 -0700
75.3 @@ -1,5 +1,5 @@
75.4 /*
75.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
75.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
75.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
75.8 *
75.9 * This code is free software; you can redistribute it and/or modify it
75.10 @@ -24,19 +24,10 @@
75.11 */
75.12
75.13
75.14 -/* The contents of this file are subject to the Sun Public License
75.15 - * Version 1.0 (the "License"); you may not use this file except in
75.16 - * compliance with the License. A copy of the License is available at
75.17 - * http://www.sun.com/, and in the file LICENSE.html in the
75.18 - * doc directory.
75.19 - *
75.20 +/*
75.21 * The Original Code is HAT. The Initial Developer of the
75.22 * Original Code is Bill Foote, with contributions from others
75.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
75.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
75.25 - *
75.26 - * In addition to the formal license, I ask that you don't
75.27 - * change the history or donations files without permission.
75.28 + * at JavaSoft/Sun.
75.29 */
75.30
75.31 package com.sun.tools.hat.internal.util;
76.1 --- a/src/share/classes/com/sun/tools/hat/internal/util/Comparer.java Mon May 12 18:06:23 2008 -0700
76.2 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Comparer.java Fri May 16 12:25:57 2008 -0700
76.3 @@ -1,5 +1,5 @@
76.4 /*
76.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
76.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
76.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
76.8 *
76.9 * This code is free software; you can redistribute it and/or modify it
76.10 @@ -24,19 +24,10 @@
76.11 */
76.12
76.13
76.14 -/* The contents of this file are subject to the Sun Public License
76.15 - * Version 1.0 (the "License"); you may not use this file except in
76.16 - * compliance with the License. A copy of the License is available at
76.17 - * http://www.sun.com/, and in the file LICENSE.html in the
76.18 - * doc directory.
76.19 - *
76.20 +/*
76.21 * The Original Code is HAT. The Initial Developer of the
76.22 * Original Code is Bill Foote, with contributions from others
76.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
76.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
76.25 - *
76.26 - * In addition to the formal license, I ask that you don't
76.27 - * change the history or donations files without permission.
76.28 + * at JavaSoft/Sun.
76.29 */
76.30
76.31 package com.sun.tools.hat.internal.util;
77.1 --- a/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java Mon May 12 18:06:23 2008 -0700
77.2 +++ b/src/share/classes/com/sun/tools/hat/internal/util/CompositeEnumeration.java Fri May 16 12:25:57 2008 -0700
77.3 @@ -1,5 +1,5 @@
77.4 /*
77.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
77.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
77.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
77.8 *
77.9 * This code is free software; you can redistribute it and/or modify it
77.10 @@ -25,20 +25,9 @@
77.11
77.12
77.13 /*
77.14 - * The contents of this file are subject to the Sun Public License
77.15 - * Version 1.0 (the "License"); you may not use this file except in
77.16 - * compliance with the License. A copy of the License is available at
77.17 - * http://www.sun.com/, and in the file LICENSE.html in the
77.18 - * doc directory.
77.19 - *
77.20 * The Original Code is HAT. The Initial Developer of the
77.21 * Original Code is Bill Foote, with contributions from others
77.22 - * at JavaSoft/Sun. Portions created by Bill Foote and others
77.23 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
77.24 - *
77.25 - * In addition to the formal license, I ask that you don't
77.26 - * change the history or donations files without permission.
77.27 - *
77.28 + * at JavaSoft/Sun.
77.29 */
77.30
77.31 package com.sun.tools.hat.internal.util;
78.1 --- a/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Mon May 12 18:06:23 2008 -0700
78.2 +++ b/src/share/classes/com/sun/tools/hat/internal/util/Misc.java Fri May 16 12:25:57 2008 -0700
78.3 @@ -1,5 +1,5 @@
78.4 /*
78.5 - * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved.
78.6 + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
78.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
78.8 *
78.9 * This code is free software; you can redistribute it and/or modify it
78.10 @@ -24,19 +24,10 @@
78.11 */
78.12
78.13
78.14 -/* The contents of this file are subject to the Sun Public License
78.15 - * Version 1.0 (the "License"); you may not use this file except in
78.16 - * compliance with the License. A copy of the License is available at
78.17 - * http://www.sun.com/, and in the file LICENSE.html in the
78.18 - * doc directory.
78.19 - *
78.20 +/*
78.21 * The Original Code is HAT. The Initial Developer of the
78.22 * Original Code is Bill Foote, with contributions from others
78.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
78.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
78.25 - *
78.26 - * In addition to the formal license, I ask that you don't
78.27 - * change the history or donations files without permission.
78.28 + * at JavaSoft/Sun.
78.29 */
78.30
78.31 package com.sun.tools.hat.internal.util;
79.1 --- a/src/share/classes/com/sun/tools/hat/internal/util/VectorSorter.java Mon May 12 18:06:23 2008 -0700
79.2 +++ b/src/share/classes/com/sun/tools/hat/internal/util/VectorSorter.java Fri May 16 12:25:57 2008 -0700
79.3 @@ -1,5 +1,5 @@
79.4 /*
79.5 - * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
79.6 + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
79.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
79.8 *
79.9 * This code is free software; you can redistribute it and/or modify it
79.10 @@ -24,19 +24,10 @@
79.11 */
79.12
79.13
79.14 -/* The contents of this file are subject to the Sun Public License
79.15 - * Version 1.0 (the "License"); you may not use this file except in
79.16 - * compliance with the License. A copy of the License is available at
79.17 - * http://www.sun.com/, and in the file LICENSE.html in the
79.18 - * doc directory.
79.19 - *
79.20 +/*
79.21 * The Original Code is HAT. The Initial Developer of the
79.22 * Original Code is Bill Foote, with contributions from others
79.23 - * at JavaSoft/Sun. Portions created by Bill Foote and others
79.24 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
79.25 - *
79.26 - * In addition to the formal license, I ask that you don't
79.27 - * change the history or donations files without permission.
79.28 + * at JavaSoft/Sun.
79.29 */
79.30
79.31 package com.sun.tools.hat.internal.util;
80.1 --- a/src/share/classes/com/sun/tools/hat/resources/hat.js Mon May 12 18:06:23 2008 -0700
80.2 +++ b/src/share/classes/com/sun/tools/hat/resources/hat.js Fri May 16 12:25:57 2008 -0700
80.3 @@ -23,22 +23,10 @@
80.4 * have any questions.
80.5 */
80.6
80.7 -
80.8 /*
80.9 - * The contents of this file are subject to the Sun Public License
80.10 - * Version 1.0 (the "License"); you may not use this file except in
80.11 - * compliance with the License. A copy of the License is available at
80.12 - * http://www.sun.com/, and in the file LICENSE.html in the
80.13 - * doc directory.
80.14 - *
80.15 * The Original Code is HAT. The Initial Developer of the
80.16 * Original Code is Bill Foote, with contributions from others
80.17 - * at JavaSoft/Sun. Portions created by Bill Foote and others
80.18 - * at Javasoft/Sun are Copyright (C) 1997-2004. All Rights Reserved.
80.19 - *
80.20 - * In addition to the formal license, I ask that you don't
80.21 - * change the history or donations files without permission.
80.22 - *
80.23 + * at JavaSoft/Sun.
80.24 */
80.25
80.26 var hatPkg = Packages.com.sun.tools.hat.internal;
81.1 --- a/src/share/classes/java/awt/Button.java Mon May 12 18:06:23 2008 -0700
81.2 +++ b/src/share/classes/java/awt/Button.java Fri May 16 12:25:57 2008 -0700
81.3 @@ -597,7 +597,7 @@
81.4 public String getAccessibleActionDescription(int i) {
81.5 if (i == 0) {
81.6 // [[[PENDING: WDW -- need to provide a localized string]]]
81.7 - return new String("click");
81.8 + return "click";
81.9 } else {
81.10 return null;
81.11 }
82.1 --- a/src/share/classes/java/awt/Color.java Mon May 12 18:06:23 2008 -0700
82.2 +++ b/src/share/classes/java/awt/Color.java Fri May 16 12:25:57 2008 -0700
82.3 @@ -51,6 +51,7 @@
82.4 * http://www.w3.org/pub/WWW/Graphics/Color/sRGB.html
82.5 * </A>.
82.6 * <p>
82.7 + * @version 10 Feb 1997
82.8 * @author Sami Shaio
82.9 * @author Arthur van Hoff
82.10 * @see ColorSpace
82.11 @@ -1176,23 +1177,32 @@
82.12 }
82.13
82.14 /**
82.15 - * Creates and returns a {@link PaintContext} used to generate a solid
82.16 - * color pattern. This enables a <code>Color</code> object to be used
82.17 - * as an argument to any method requiring an object implementing the
82.18 - * {@link Paint} interface.
82.19 - * The same <code>PaintContext</code> is returned, regardless of
82.20 - * whether or not <code>r</code>, <code>r2d</code>,
82.21 - * <code>xform</code>, or <code>hints</code> are <code>null</code>.
82.22 - * @param cm the specified <code>ColorModel</code>
82.23 - * @param r the specified {@link Rectangle}
82.24 - * @param r2d the specified {@link Rectangle2D}
82.25 - * @param xform the specified {@link AffineTransform}
82.26 - * @param hints the specified {@link RenderingHints}
82.27 - * @return a <code>PaintContext</code> that is used to generate a
82.28 - * solid color pattern.
82.29 + * Creates and returns a {@link PaintContext} used to
82.30 + * generate a solid color field pattern.
82.31 + * See the {@link Paint#createContext specification} of the
82.32 + * method in the {@link Paint} interface for information
82.33 + * on null parameter handling.
82.34 + *
82.35 + * @param cm the preferred {@link ColorModel} which represents the most convenient
82.36 + * format for the caller to receive the pixel data, or {@code null}
82.37 + * if there is no preference.
82.38 + * @param r the device space bounding box
82.39 + * of the graphics primitive being rendered.
82.40 + * @param r2d the user space bounding box
82.41 + * of the graphics primitive being rendered.
82.42 + * @param xform the {@link AffineTransform} from user
82.43 + * space into device space.
82.44 + * @param hints the set of hints that the context object can use to
82.45 + * choose between rendering alternatives.
82.46 + * @return the {@code PaintContext} for
82.47 + * generating color patterns.
82.48 * @see Paint
82.49 * @see PaintContext
82.50 - * @see Graphics2D#setPaint
82.51 + * @see ColorModel
82.52 + * @see Rectangle
82.53 + * @see Rectangle2D
82.54 + * @see AffineTransform
82.55 + * @see RenderingHints
82.56 */
82.57 public synchronized PaintContext createContext(ColorModel cm, Rectangle r,
82.58 Rectangle2D r2d,
83.1 --- a/src/share/classes/java/awt/Component.java Mon May 12 18:06:23 2008 -0700
83.2 +++ b/src/share/classes/java/awt/Component.java Fri May 16 12:25:57 2008 -0700
83.3 @@ -1,5 +1,5 @@
83.4 /*
83.5 - * Copyright 1995-2007 Sun Microsystems, Inc. All Rights Reserved.
83.6 + * Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
83.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
83.8 *
83.9 * This code is free software; you can redistribute it and/or modify it
83.10 @@ -49,6 +49,7 @@
83.11 import java.io.IOException;
83.12 import java.beans.PropertyChangeListener;
83.13 import java.beans.PropertyChangeSupport;
83.14 +import java.beans.Transient;
83.15 import java.awt.event.InputMethodListener;
83.16 import java.awt.event.InputMethodEvent;
83.17 import java.awt.im.InputContext;
83.18 @@ -634,7 +635,9 @@
83.19 */
83.20 private PropertyChangeSupport changeSupport;
83.21
83.22 - private transient final Object changeSupportLock = new Object();
83.23 + // Note: this field is considered final, though readObject() prohibits
83.24 + // initializing final fields.
83.25 + private transient Object changeSupportLock = new Object();
83.26 private Object getChangeSupportLock() {
83.27 return changeSupportLock;
83.28 }
83.29 @@ -1003,7 +1006,7 @@
83.30
83.31 /**
83.32 * Gets this component's locking object (the object that owns the thread
83.33 - * sychronization monitor) for AWT component-tree and layout
83.34 + * synchronization monitor) for AWT component-tree and layout
83.35 * operations.
83.36 * @return this component's locking object
83.37 */
83.38 @@ -1100,6 +1103,7 @@
83.39 * @see #setVisible
83.40 * @since JDK1.0
83.41 */
83.42 + @Transient
83.43 public boolean isVisible() {
83.44 return isVisible_NoClientCode();
83.45 }
83.46 @@ -1325,12 +1329,15 @@
83.47 KeyboardFocusManager.clearMostRecentFocusOwner(this);
83.48 synchronized (getTreeLock()) {
83.49 enabled = false;
83.50 - if (isFocusOwner()) {
83.51 + // A disabled lw container is allowed to contain a focus owner.
83.52 + if ((isFocusOwner() || (containsFocus() && !isLightweight())) &&
83.53 + KeyboardFocusManager.isAutoFocusTransferEnabled())
83.54 + {
83.55 // Don't clear the global focus owner. If transferFocus
83.56 // fails, we want the focus to stay on the disabled
83.57 // Component so that keyboard traversal, et. al. still
83.58 // makes sense to the user.
83.59 - autoTransferFocus(false);
83.60 + transferFocus(false);
83.61 }
83.62 ComponentPeer peer = this.peer;
83.63 if (peer != null) {
83.64 @@ -1491,8 +1498,8 @@
83.65 synchronized (getTreeLock()) {
83.66 visible = false;
83.67 mixOnHiding(isLightweight());
83.68 - if (containsFocus()) {
83.69 - autoTransferFocus(true);
83.70 + if (containsFocus() && KeyboardFocusManager.isAutoFocusTransferEnabled()) {
83.71 + transferFocus(true);
83.72 }
83.73 ComponentPeer peer = this.peer;
83.74 if (peer != null) {
83.75 @@ -1531,6 +1538,7 @@
83.76 * @beaninfo
83.77 * bound: true
83.78 */
83.79 + @Transient
83.80 public Color getForeground() {
83.81 Color foreground = this.foreground;
83.82 if (foreground != null) {
83.83 @@ -1585,6 +1593,7 @@
83.84 * @see #setBackground
83.85 * @since JDK1.0
83.86 */
83.87 + @Transient
83.88 public Color getBackground() {
83.89 Color background = this.background;
83.90 if (background != null) {
83.91 @@ -1644,6 +1653,7 @@
83.92 * @see #setFont
83.93 * @since JDK1.0
83.94 */
83.95 + @Transient
83.96 public Font getFont() {
83.97 return getFont_NoClientCode();
83.98 }
83.99 @@ -6576,12 +6586,8 @@
83.100 }
83.101
83.102 synchronized (getTreeLock()) {
83.103 - if (isFocusOwner()
83.104 - && KeyboardFocusManager.isAutoFocusTransferEnabled()
83.105 - && !nextFocusHelper())
83.106 - {
83.107 - KeyboardFocusManager.getCurrentKeyboardFocusManager().
83.108 - clearGlobalFocusOwner();
83.109 + if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
83.110 + transferFocus(true);
83.111 }
83.112
83.113 if (getContainer() != null && isAddNotifyComplete) {
83.114 @@ -6716,8 +6722,8 @@
83.115
83.116 firePropertyChange("focusable", oldFocusable, focusable);
83.117 if (oldFocusable && !focusable) {
83.118 - if (isFocusOwner()) {
83.119 - autoTransferFocus(true);
83.120 + if (isFocusOwner() && KeyboardFocusManager.isAutoFocusTransferEnabled()) {
83.121 + transferFocus(true);
83.122 }
83.123 KeyboardFocusManager.clearMostRecentFocusOwner(this);
83.124 }
83.125 @@ -7371,69 +7377,6 @@
83.126 }
83.127 }
83.128
83.129 - private void autoTransferFocus(boolean clearOnFailure) {
83.130 - Component toTest = KeyboardFocusManager.
83.131 - getCurrentKeyboardFocusManager().getFocusOwner();
83.132 - if (toTest != this) {
83.133 - if (toTest != null) {
83.134 - toTest.autoTransferFocus(clearOnFailure);
83.135 - }
83.136 - return;
83.137 - }
83.138 -
83.139 - // Check if there are pending focus requests. We shouldn't do
83.140 - // auto-transfer if user has already took care of this
83.141 - // component becoming ineligible to hold focus.
83.142 - if (!KeyboardFocusManager.isAutoFocusTransferEnabled()) {
83.143 - return;
83.144 - }
83.145 -
83.146 - // the following code will execute only if this Component is the focus
83.147 - // owner
83.148 -
83.149 - if (!(isDisplayable() && isVisible() && isEnabled() && isFocusable())) {
83.150 - doAutoTransfer(clearOnFailure);
83.151 - return;
83.152 - }
83.153 -
83.154 - toTest = getParent();
83.155 -
83.156 - while (toTest != null && !(toTest instanceof Window)) {
83.157 - if (!(toTest.isDisplayable() && toTest.isVisible() &&
83.158 - (toTest.isEnabled() || toTest.isLightweight()))) {
83.159 - doAutoTransfer(clearOnFailure);
83.160 - return;
83.161 - }
83.162 - toTest = toTest.getParent();
83.163 - }
83.164 - }
83.165 - private void doAutoTransfer(boolean clearOnFailure) {
83.166 - if (focusLog.isLoggable(Level.FINER)) {
83.167 - focusLog.log(Level.FINER, "this = " + this + ", clearOnFailure = " + clearOnFailure);
83.168 - }
83.169 - if (clearOnFailure) {
83.170 - if (!nextFocusHelper()) {
83.171 - if (focusLog.isLoggable(Level.FINER)) {
83.172 - focusLog.log(Level.FINER, "clear global focus owner");
83.173 - }
83.174 - KeyboardFocusManager.getCurrentKeyboardFocusManager().
83.175 - clearGlobalFocusOwner();
83.176 - }
83.177 - } else {
83.178 - transferFocus();
83.179 - }
83.180 - }
83.181 -
83.182 - /**
83.183 - * Transfers the focus to the next component, as though this Component were
83.184 - * the focus owner.
83.185 - * @see #requestFocus()
83.186 - * @since JDK1.1
83.187 - */
83.188 - public void transferFocus() {
83.189 - nextFocus();
83.190 - }
83.191 -
83.192 /**
83.193 * Returns the Container which is the focus cycle root of this Component's
83.194 * focus traversal cycle. Each focus traversal cycle has only a single
83.195 @@ -7473,31 +7416,51 @@
83.196 return (rootAncestor == container);
83.197 }
83.198
83.199 + Container getTraversalRoot() {
83.200 + return getFocusCycleRootAncestor();
83.201 + }
83.202 +
83.203 + /**
83.204 + * Transfers the focus to the next component, as though this Component were
83.205 + * the focus owner.
83.206 + * @see #requestFocus()
83.207 + * @since JDK1.1
83.208 + */
83.209 + public void transferFocus() {
83.210 + nextFocus();
83.211 + }
83.212 +
83.213 /**
83.214 * @deprecated As of JDK version 1.1,
83.215 * replaced by transferFocus().
83.216 */
83.217 @Deprecated
83.218 public void nextFocus() {
83.219 - nextFocusHelper();
83.220 - }
83.221 -
83.222 - private boolean nextFocusHelper() {
83.223 - Component toFocus = preNextFocusHelper();
83.224 + transferFocus(false);
83.225 + }
83.226 +
83.227 + boolean transferFocus(boolean clearOnFailure) {
83.228 if (focusLog.isLoggable(Level.FINER)) {
83.229 - focusLog.log(Level.FINER, "toFocus = " + toFocus);
83.230 - }
83.231 - if (isFocusOwner() && toFocus == this) {
83.232 - return false;
83.233 - }
83.234 - return postNextFocusHelper(toFocus, CausedFocusEvent.Cause.TRAVERSAL_FORWARD);
83.235 - }
83.236 -
83.237 - Container getTraversalRoot() {
83.238 - return getFocusCycleRootAncestor();
83.239 - }
83.240 -
83.241 - final Component preNextFocusHelper() {
83.242 + focusLog.finer("clearOnFailure = " + clearOnFailure);
83.243 + }
83.244 + Component toFocus = getNextFocusCandidate();
83.245 + boolean res = false;
83.246 + if (toFocus != null && !toFocus.isFocusOwner() && toFocus != this) {
83.247 + res = toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_FORWARD);
83.248 + }
83.249 + if (clearOnFailure && !res) {
83.250 + if (focusLog.isLoggable(Level.FINER)) {
83.251 + focusLog.finer("clear global focus owner");
83.252 + }
83.253 + KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
83.254 + }
83.255 + if (focusLog.isLoggable(Level.FINER)) {
83.256 + focusLog.finer("returning result: " + res);
83.257 + }
83.258 + return res;
83.259 + }
83.260 +
83.261 + final Component getNextFocusCandidate() {
83.262 Container rootAncestor = getTraversalRoot();
83.263 Component comp = this;
83.264 while (rootAncestor != null &&
83.265 @@ -7509,18 +7472,19 @@
83.266 rootAncestor = comp.getFocusCycleRootAncestor();
83.267 }
83.268 if (focusLog.isLoggable(Level.FINER)) {
83.269 - focusLog.log(Level.FINER, "comp = " + comp + ", root = " + rootAncestor);
83.270 - }
83.271 + focusLog.finer("comp = " + comp + ", root = " + rootAncestor);
83.272 + }
83.273 + Component candidate = null;
83.274 if (rootAncestor != null) {
83.275 FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
83.276 Component toFocus = policy.getComponentAfter(rootAncestor, comp);
83.277 if (focusLog.isLoggable(Level.FINER)) {
83.278 - focusLog.log(Level.FINER, "component after is " + toFocus);
83.279 + focusLog.finer("component after is " + toFocus);
83.280 }
83.281 if (toFocus == null) {
83.282 toFocus = policy.getDefaultComponent(rootAncestor);
83.283 if (focusLog.isLoggable(Level.FINER)) {
83.284 - focusLog.log(Level.FINER, "default component is " + toFocus);
83.285 + focusLog.finer("default component is " + toFocus);
83.286 }
83.287 }
83.288 if (toFocus == null) {
83.289 @@ -7529,23 +7493,12 @@
83.290 toFocus = applet;
83.291 }
83.292 }
83.293 - return toFocus;
83.294 - }
83.295 - return null;
83.296 - }
83.297 -
83.298 - static boolean postNextFocusHelper(Component toFocus, CausedFocusEvent.Cause cause) {
83.299 - if (toFocus != null) {
83.300 - if (focusLog.isLoggable(Level.FINER)) {
83.301 - focusLog.log(Level.FINER, "Next component " + toFocus);
83.302 - }
83.303 - boolean res = toFocus.requestFocusInWindow(cause);
83.304 - if (focusLog.isLoggable(Level.FINER)) {
83.305 - focusLog.log(Level.FINER, "Request focus returned " + res);
83.306 - }
83.307 - return res;
83.308 - }
83.309 - return false;
83.310 + candidate = toFocus;
83.311 + }
83.312 + if (focusLog.isLoggable(Level.FINER)) {
83.313 + focusLog.finer("Focus transfer candidate: " + candidate);
83.314 + }
83.315 + return candidate;
83.316 }
83.317
83.318 /**
83.319 @@ -7555,6 +7508,10 @@
83.320 * @since 1.4
83.321 */
83.322 public void transferFocusBackward() {
83.323 + transferFocusBackward(false);
83.324 + }
83.325 +
83.326 + boolean transferFocusBackward(boolean clearOnFailure) {
83.327 Container rootAncestor = getTraversalRoot();
83.328 Component comp = this;
83.329 while (rootAncestor != null &&
83.330 @@ -7565,6 +7522,7 @@
83.331 comp = rootAncestor;
83.332 rootAncestor = comp.getFocusCycleRootAncestor();
83.333 }
83.334 + boolean res = false;
83.335 if (rootAncestor != null) {
83.336 FocusTraversalPolicy policy = rootAncestor.getFocusTraversalPolicy();
83.337 Component toFocus = policy.getComponentBefore(rootAncestor, comp);
83.338 @@ -7572,9 +7530,19 @@
83.339 toFocus = policy.getDefaultComponent(rootAncestor);
83.340 }
83.341 if (toFocus != null) {
83.342 - toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_BACKWARD);
83.343 - }
83.344 - }
83.345 + res = toFocus.requestFocusInWindow(CausedFocusEvent.Cause.TRAVERSAL_BACKWARD);
83.346 + }
83.347 + }
83.348 + if (!res) {
83.349 + if (focusLog.isLoggable(Level.FINER)) {
83.350 + focusLog.finer("clear global focus owner");
83.351 + }
83.352 + KeyboardFocusManager.getCurrentKeyboardFocusManager().clearGlobalFocusOwner();
83.353 + }
83.354 + if (focusLog.isLoggable(Level.FINER)) {
83.355 + focusLog.finer("returning result: " + res);
83.356 + }
83.357 + return res;
83.358 }
83.359
83.360 /**
83.361 @@ -7649,6 +7617,20 @@
83.362 return hasFocus();
83.363 }
83.364
83.365 + /*
83.366 + * Used to disallow auto-focus-transfer on disposal of the focus owner
83.367 + * in the process of disposing its parent container.
83.368 + */
83.369 + private boolean autoFocusTransferOnDisposal = true;
83.370 +
83.371 + void setAutoFocusTransferOnDisposal(boolean value) {
83.372 + autoFocusTransferOnDisposal = value;
83.373 + }
83.374 +
83.375 + boolean isAutoFocusTransferOnDisposal() {
83.376 + return autoFocusTransferOnDisposal;
83.377 + }
83.378 +
83.379 /**
83.380 * Adds the specified popup menu to the component.
83.381 * @param popup the popup menu to be added to the component.
83.382 @@ -8310,6 +8292,8 @@
83.383 private void readObject(ObjectInputStream s)
83.384 throws ClassNotFoundException, IOException
83.385 {
83.386 + changeSupportLock = new Object();
83.387 +
83.388 s.defaultReadObject();
83.389
83.390 appContext = AppContext.getAppContext();
84.1 --- a/src/share/classes/java/awt/Container.java Mon May 12 18:06:23 2008 -0700
84.2 +++ b/src/share/classes/java/awt/Container.java Fri May 16 12:25:57 2008 -0700
84.3 @@ -2660,9 +2660,26 @@
84.4 synchronized (getTreeLock()) {
84.5 int ncomponents = this.ncomponents;
84.6 Component component[] = this.component;
84.7 - for (int i = ncomponents-1 ; i >= 0 ; i--) {
84.8 - if( component[i] != null )
84.9 - component[i].removeNotify();
84.10 + for (int i = ncomponents - 1; i >= 0; i--) {
84.11 + if( component[i] != null ) {
84.12 + // Fix for 6607170.
84.13 + // We want to suppress focus change on disposal
84.14 + // of the focused component. But because of focus
84.15 + // is asynchronous, we should suppress focus change
84.16 + // on every component in case it receives native focus
84.17 + // in the process of disposal.
84.18 + component[i].setAutoFocusTransferOnDisposal(false);
84.19 + component[i].removeNotify();
84.20 + component[i].setAutoFocusTransferOnDisposal(true);
84.21 + }
84.22 + }
84.23 + // If some of the children had focus before disposal then it still has.
84.24 + // Auto-transfer focus to the next (or previous) component if auto-transfer
84.25 + // is enabled.
84.26 + if (containsFocus() && KeyboardFocusManager.isAutoFocusTransferEnabledFor(this)) {
84.27 + if (!transferFocus(false)) {
84.28 + transferFocusBackward(true);
84.29 + }
84.30 }
84.31 if ( dispatcher != null ) {
84.32 dispatcher.dispose();
85.1 --- a/src/share/classes/java/awt/DefaultKeyboardFocusManager.java Mon May 12 18:06:23 2008 -0700
85.2 +++ b/src/share/classes/java/awt/DefaultKeyboardFocusManager.java Fri May 16 12:25:57 2008 -0700
85.3 @@ -155,12 +155,13 @@
85.4 boolean clearOnFailure)
85.5 {
85.6 if (toFocus != vetoedComponent && toFocus.isShowing() && toFocus.isFocusable() &&
85.7 - toFocus.requestFocus(false, CausedFocusEvent.Cause.ROLLBACK)) {
85.8 + toFocus.requestFocus(false, CausedFocusEvent.Cause.ROLLBACK))
85.9 + {
85.10 return true;
85.11 } else {
85.12 - Component nextFocus = toFocus.preNextFocusHelper();
85.13 - if (nextFocus != vetoedComponent
85.14 - && Component.postNextFocusHelper(nextFocus, CausedFocusEvent.Cause.ROLLBACK))
85.15 + Component nextFocus = toFocus.getNextFocusCandidate();
85.16 + if (nextFocus != null && nextFocus != vetoedComponent &&
85.17 + nextFocus.requestFocusInWindow(CausedFocusEvent.Cause.ROLLBACK))
85.18 {
85.19 return true;
85.20 } else if (clearOnFailure) {
85.21 @@ -504,9 +505,16 @@
85.22 {
85.23 // we should not accept focus on such component, so reject it.
85.24 dequeueKeyEvents(-1, newFocusOwner);
85.25 - if (KeyboardFocusManager.isAutoFocusTransferEnabled())
85.26 - {
85.27 - restoreFocus(fe, newFocusedWindow);
85.28 + if (KeyboardFocusManager.isAutoFocusTransferEnabled()) {
85.29 + // If FOCUS_GAINED is for a disposed component (however
85.30 + // it shouldn't happen) its toplevel parent is null. In this
85.31 + // case we have to try to restore focus in the current focused
85.32 + // window (for the details: 6607170).
85.33 + if (newFocusedWindow == null) {
85.34 + restoreFocus(fe, currentFocusedWindow);
85.35 + } else {
85.36 + restoreFocus(fe, newFocusedWindow);
85.37 + }
85.38 }
85.39 break;
85.40 }
85.41 @@ -1078,6 +1086,9 @@
85.42 focusNextComponent(focusedComponent);
85.43 }
85.44 return;
85.45 + } else if (e.getID() == KeyEvent.KEY_PRESSED) {
85.46 + // Fix for 6637607: consumeNextKeyTyped should be reset.
85.47 + consumeNextKeyTyped = false;
85.48 }
85.49
85.50 toTest = focusedComponent.getFocusTraversalKeys(
86.1 --- a/src/share/classes/java/awt/Dimension.java Mon May 12 18:06:23 2008 -0700
86.2 +++ b/src/share/classes/java/awt/Dimension.java Fri May 16 12:25:57 2008 -0700
86.3 @@ -1,5 +1,5 @@
86.4 /*
86.5 - * Copyright 1995-2006 Sun Microsystems, Inc. All Rights Reserved.
86.6 + * Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
86.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
86.8 *
86.9 * This code is free software; you can redistribute it and/or modify it
86.10 @@ -26,6 +26,7 @@
86.11 package java.awt;
86.12
86.13 import java.awt.geom.Dimension2D;
86.14 +import java.beans.Transient;
86.15
86.16 /**
86.17 * The <code>Dimension</code> class encapsulates the width and
86.18 @@ -165,6 +166,7 @@
86.19 * @see java.awt.Component#getSize
86.20 * @since 1.1
86.21 */
86.22 + @Transient
86.23 public Dimension getSize() {
86.24 return new Dimension(width, height);
86.25 }
87.1 --- a/src/share/classes/java/awt/GradientPaint.java Mon May 12 18:06:23 2008 -0700
87.2 +++ b/src/share/classes/java/awt/GradientPaint.java Fri May 16 12:25:57 2008 -0700
87.3 @@ -53,6 +53,7 @@
87.4 *
87.5 * @see Paint
87.6 * @see Graphics2D#setPaint
87.7 + * @version 10 Feb 1997
87.8 */
87.9
87.10 public class GradientPaint implements Paint {
87.11 @@ -223,19 +224,32 @@
87.12 }
87.13
87.14 /**
87.15 - * Creates and returns a context used to generate the color pattern.
87.16 - * @param cm {@link ColorModel} that receives
87.17 - * the <code>Paint</code> data. This is used only as a hint.
87.18 - * @param deviceBounds the device space bounding box of the
87.19 - * graphics primitive being rendered
87.20 - * @param userBounds the user space bounding box of the
87.21 - * graphics primitive being rendered
87.22 + * Creates and returns a {@link PaintContext} used to
87.23 + * generate a linear color gradient pattern.
87.24 + * See the {@link Paint#createContext specification} of the
87.25 + * method in the {@link Paint} interface for information
87.26 + * on null parameter handling.
87.27 + *
87.28 + * @param cm the preferred {@link ColorModel} which represents the most convenient
87.29 + * format for the caller to receive the pixel data, or {@code null}
87.30 + * if there is no preference.
87.31 + * @param deviceBounds the device space bounding box
87.32 + * of the graphics primitive being rendered.
87.33 + * @param userBounds the user space bounding box
87.34 + * of the graphics primitive being rendered.
87.35 * @param xform the {@link AffineTransform} from user
87.36 - * space into device space
87.37 - * @param hints the hints that the context object uses to choose
87.38 - * between rendering alternatives
87.39 - * @return the {@link PaintContext} that generates color patterns.
87.40 + * space into device space.
87.41 + * @param hints the set of hints that the context object can use to
87.42 + * choose between rendering alternatives.
87.43 + * @return the {@code PaintContext} for
87.44 + * generating color patterns.
87.45 + * @see Paint
87.46 * @see PaintContext
87.47 + * @see ColorModel
87.48 + * @see Rectangle
87.49 + * @see Rectangle2D
87.50 + * @see AffineTransform
87.51 + * @see RenderingHints
87.52 */
87.53 public PaintContext createContext(ColorModel cm,
87.54 Rectangle deviceBounds,
88.1 --- a/src/share/classes/java/awt/KeyboardFocusManager.java Mon May 12 18:06:23 2008 -0700
88.2 +++ b/src/share/classes/java/awt/KeyboardFocusManager.java Fri May 16 12:25:57 2008 -0700
88.3 @@ -2578,6 +2578,10 @@
88.4 }
88.5 }
88.6
88.7 + static boolean isAutoFocusTransferEnabledFor(Component comp) {
88.8 + return isAutoFocusTransferEnabled() && comp.isAutoFocusTransferOnDisposal();
88.9 + }
88.10 +
88.11 /*
88.12 * Used to process exceptions in dispatching focus event (in focusLost/focusGained callbacks).
88.13 * @param ex previously caught exception that may be processed right here, or null
89.1 --- a/src/share/classes/java/awt/LinearGradientPaint.java Mon May 12 18:06:23 2008 -0700
89.2 +++ b/src/share/classes/java/awt/LinearGradientPaint.java Fri May 16 12:25:57 2008 -0700
89.3 @@ -296,7 +296,32 @@
89.4 }
89.5
89.6 /**
89.7 - * {@inheritDoc}
89.8 + * Creates and returns a {@link PaintContext} used to
89.9 + * generate a linear color gradient pattern.
89.10 + * See the {@link Paint#createContext specification} of the
89.11 + * method in the {@link Paint} interface for information
89.12 + * on null parameter handling.
89.13 + *
89.14 + * @param cm the preferred {@link ColorModel} which represents the most convenient
89.15 + * format for the caller to receive the pixel data, or {@code null}
89.16 + * if there is no preference.
89.17 + * @param deviceBounds the device space bounding box
89.18 + * of the graphics primitive being rendered.
89.19 + * @param userBounds the user space bounding box
89.20 + * of the graphics primitive being rendered.
89.21 + * @param transform the {@link AffineTransform} from user
89.22 + * space into device space.
89.23 + * @param hints the set of hints that the context object can use to
89.24 + * choose between rendering alternatives.
89.25 + * @return the {@code PaintContext} for
89.26 + * generating color patterns.
89.27 + * @see Paint
89.28 + * @see PaintContext
89.29 + * @see ColorModel
89.30 + * @see Rectangle
89.31 + * @see Rectangle2D
89.32 + * @see AffineTransform
89.33 + * @see RenderingHints
89.34 */
89.35 public PaintContext createContext(ColorModel cm,
89.36 Rectangle deviceBounds,
90.1 --- a/src/share/classes/java/awt/MenuItem.java Mon May 12 18:06:23 2008 -0700
90.2 +++ b/src/share/classes/java/awt/MenuItem.java Fri May 16 12:25:57 2008 -0700
90.3 @@ -847,7 +847,7 @@
90.4 public String getAccessibleActionDescription(int i) {
90.5 if (i == 0) {
90.6 // [[[PENDING: WDW -- need to provide a localized string]]]
90.7 - return new String("click");
90.8 + return "click";
90.9 } else {
90.10 return null;
90.11 }
91.1 --- a/src/share/classes/java/awt/Paint.java Mon May 12 18:06:23 2008 -0700
91.2 +++ b/src/share/classes/java/awt/Paint.java Fri May 16 12:25:57 2008 -0700
91.3 @@ -46,42 +46,58 @@
91.4 * @see GradientPaint
91.5 * @see TexturePaint
91.6 * @see Graphics2D#setPaint
91.7 + * @version 1.36, 06/05/07
91.8 */
91.9
91.10 public interface Paint extends Transparency {
91.11 /**
91.12 * Creates and returns a {@link PaintContext} used to
91.13 * generate the color pattern.
91.14 - * Since the ColorModel argument to createContext is only a
91.15 - * hint, implementations of Paint should accept a null argument
91.16 - * for ColorModel. Note that if the application does not
91.17 - * prefer a specific ColorModel, the null ColorModel argument
91.18 - * will give the Paint implementation full leeway in using the
91.19 - * most efficient ColorModel it prefers for its raster processing.
91.20 - * <p>
91.21 - * Since the API documentation was not specific about this in
91.22 - * releases before 1.4, there may be implementations of
91.23 - * <code>Paint</code> that do not accept a null
91.24 - * <code>ColorModel</code> argument.
91.25 - * If a developer is writing code which passes a null
91.26 - * <code>ColorModel</code> argument to the
91.27 - * <code>createContext</code> method of <code>Paint</code>
91.28 - * objects from arbitrary sources it would be wise to code defensively
91.29 - * by manufacturing a non-null <code>ColorModel</code> for those
91.30 - * objects which throw a <code>NullPointerException</code>.
91.31 - * @param cm the {@link ColorModel} that receives the
91.32 - * <code>Paint</code> data. This is used only as a hint.
91.33 + * The arguments to this method convey additional information
91.34 + * about the rendering operation that may be
91.35 + * used or ignored on various implementations of the {@code Paint} interface.
91.36 + * A caller must pass non-{@code null} values for all of the arguments
91.37 + * except for the {@code ColorModel} argument which may be {@code null} to
91.38 + * indicate that no specific {@code ColorModel} type is preferred.
91.39 + * Implementations of the {@code Paint} interface are allowed to use or ignore
91.40 + * any of the arguments as makes sense for their function, and are
91.41 + * not constrained to use the specified {@code ColorModel} for the returned
91.42 + * {@code PaintContext}, even if it is not {@code null}.
91.43 + * Implementations are allowed to throw {@code NullPointerException} for
91.44 + * any {@code null} argument other than the {@code ColorModel} argument,
91.45 + * but are not required to do so.
91.46 + *
91.47 + * @param cm the preferred {@link ColorModel} which represents the most convenient
91.48 + * format for the caller to receive the pixel data, or {@code null}
91.49 + * if there is no preference.
91.50 * @param deviceBounds the device space bounding box
91.51 - * of the graphics primitive being rendered
91.52 + * of the graphics primitive being rendered.
91.53 + * Implementations of the {@code Paint} interface
91.54 + * are allowed to throw {@code NullPointerException}
91.55 + * for a {@code null} {@code deviceBounds}.
91.56 * @param userBounds the user space bounding box
91.57 - * of the graphics primitive being rendered
91.58 + * of the graphics primitive being rendered.
91.59 + * Implementations of the {@code Paint} interface
91.60 + * are allowed to throw {@code NullPointerException}
91.61 + * for a {@code null} {@code userBounds}.
91.62 * @param xform the {@link AffineTransform} from user
91.63 - * space into device space
91.64 - * @param hints the hint that the context object uses to
91.65 - * choose between rendering alternatives
91.66 - * @return the <code>PaintContext</code> for
91.67 - * generating color patterns
91.68 + * space into device space.
91.69 + * Implementations of the {@code Paint} interface
91.70 + * are allowed to throw {@code NullPointerException}
91.71 + * for a {@code null} {@code xform}.
91.72 + * @param hints the set of hints that the context object can use to
91.73 + * choose between rendering alternatives.
91.74 + * Implementations of the {@code Paint} interface
91.75 + * are allowed to throw {@code NullPointerException}
91.76 + * for a {@code null} {@code hints}.
91.77 + * @return the {@code PaintContext} for
91.78 + * generating color patterns.
91.79 * @see PaintContext
91.80 + * @see ColorModel
91.81 + * @see Rectangle
91.82 + * @see Rectangle2D
91.83 + * @see AffineTransform
91.84 + * @see RenderingHints
91.85 */
91.86 public PaintContext createContext(ColorModel cm,
91.87 Rectangle deviceBounds,
92.1 --- a/src/share/classes/java/awt/Point.java Mon May 12 18:06:23 2008 -0700
92.2 +++ b/src/share/classes/java/awt/Point.java Fri May 16 12:25:57 2008 -0700
92.3 @@ -1,5 +1,5 @@
92.4 /*
92.5 - * Copyright 1995-2006 Sun Microsystems, Inc. All Rights Reserved.
92.6 + * Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
92.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
92.8 *
92.9 * This code is free software; you can redistribute it and/or modify it
92.10 @@ -26,6 +26,7 @@
92.11 package java.awt;
92.12
92.13 import java.awt.geom.Point2D;
92.14 +import java.beans.Transient;
92.15
92.16 /**
92.17 * A point representing a location in {@code (x,y)} coordinate space,
92.18 @@ -119,6 +120,7 @@
92.19 * @see java.awt.Point#setLocation(int, int)
92.20 * @since 1.1
92.21 */
92.22 + @Transient
92.23 public Point getLocation() {
92.24 return new Point(x, y);
92.25 }
93.1 --- a/src/share/classes/java/awt/RadialGradientPaint.java Mon May 12 18:06:23 2008 -0700
93.2 +++ b/src/share/classes/java/awt/RadialGradientPaint.java Fri May 16 12:25:57 2008 -0700
93.3 @@ -543,7 +543,31 @@
93.4 }
93.5
93.6 /**
93.7 - * {@inheritDoc}
93.8 + * Creates and returns a {@link PaintContext} used to
93.9 + * generate a circular radial color gradient pattern.
93.10 + * See the description of the {@link Paint#createContext createContext} method
93.11 + * for information on null parameter handling.
93.12 + *
93.13 + * @param cm the preferred {@link ColorModel} which represents the most convenient
93.14 + * format for the caller to receive the pixel data, or {@code null}
93.15 + * if there is no preference.
93.16 + * @param deviceBounds the device space bounding box
93.17 + * of the graphics primitive being rendered.
93.18 + * @param userBounds the user space bounding box
93.19 + * of the graphics primitive being rendered.
93.20 + * @param transform the {@link AffineTransform} from user
93.21 + * space into device space.
93.22 + * @param hints the set of hints that the context object can use to
93.23 + * choose between rendering alternatives.
93.24 + * @return the {@code PaintContext} for
93.25 + * generating color patterns.
93.26 + * @see Paint
93.27 + * @see PaintContext
93.28 + * @see ColorModel
93.29 + * @see Rectangle
93.30 + * @see Rectangle2D
93.31 + * @see AffineTransform
93.32 + * @see RenderingHints
93.33 */
93.34 public PaintContext createContext(ColorModel cm,
93.35 Rectangle deviceBounds,
94.1 --- a/src/share/classes/java/awt/Rectangle.java Mon May 12 18:06:23 2008 -0700
94.2 +++ b/src/share/classes/java/awt/Rectangle.java Fri May 16 12:25:57 2008 -0700
94.3 @@ -1,5 +1,5 @@
94.4 /*
94.5 - * Copyright 1995-2006 Sun Microsystems, Inc. All Rights Reserved.
94.6 + * Copyright 1995-2008 Sun Microsystems, Inc. All Rights Reserved.
94.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
94.8 *
94.9 * This code is free software; you can redistribute it and/or modify it
94.10 @@ -26,6 +26,7 @@
94.11 package java.awt;
94.12
94.13 import java.awt.geom.Rectangle2D;
94.14 +import java.beans.Transient;
94.15
94.16 /**
94.17 * A <code>Rectangle</code> specifies an area in a coordinate space that is
94.18 @@ -308,6 +309,7 @@
94.19 * @see #setBounds(int, int, int, int)
94.20 * @since 1.1
94.21 */
94.22 + @Transient
94.23 public Rectangle getBounds() {
94.24 return new Rectangle(x, y, width, height);
94.25 }
95.1 --- a/src/share/classes/java/awt/ScrollPane.java Mon May 12 18:06:23 2008 -0700
95.2 +++ b/src/share/classes/java/awt/ScrollPane.java Fri May 16 12:25:57 2008 -0700
95.3 @@ -1,5 +1,5 @@
95.4 /*
95.5 - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved.
95.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
95.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
95.8 *
95.9 * This code is free software; you can redistribute it and/or modify it
95.10 @@ -32,6 +32,7 @@
95.11 import sun.awt.SunToolkit;
95.12
95.13 import java.beans.ConstructorProperties;
95.14 +import java.beans.Transient;
95.15 import java.io.ObjectInputStream;
95.16 import java.io.ObjectOutputStream;
95.17 import java.io.IOException;
95.18 @@ -390,6 +391,7 @@
95.19 * @throws NullPointerException if the scrollpane does not contain
95.20 * a child
95.21 */
95.22 + @Transient
95.23 public Point getScrollPosition() {
95.24 if (ncomponents <= 0) {
95.25 throw new NullPointerException("child is null");
96.1 --- a/src/share/classes/java/awt/TexturePaint.java Mon May 12 18:06:23 2008 -0700
96.2 +++ b/src/share/classes/java/awt/TexturePaint.java Fri May 16 12:25:57 2008 -0700
96.3 @@ -45,6 +45,7 @@
96.4 * replicated <code>Rectangle2D</code>.
96.5 * @see Paint
96.6 * @see Graphics2D#setPaint
96.7 + * @version 1.48, 06/05/07
96.8 */
96.9
96.10 public class TexturePaint implements Paint {
96.11 @@ -93,20 +94,32 @@
96.12 }
96.13
96.14 /**
96.15 - * Creates and returns a context used to generate the color pattern.
96.16 - * @param cm the {@link ColorModel} that receives the
96.17 - * <code>Paint</code> data. This is used only as a hint.
96.18 - * @param deviceBounds the device space bounding box of the graphics
96.19 - * primitive being rendered
96.20 - * @param userBounds the user space bounding box of the graphics
96.21 - * primitive being rendered
96.22 - * @param xform the {@link AffineTransform} from user space
96.23 - * into device space
96.24 - * @param hints a {@link RenderingHints} object that can be used to
96.25 - * specify how the pattern is ultimately rendered
96.26 - * @return the {@link PaintContext} used for generating color
96.27 - * patterns.
96.28 + * Creates and returns a {@link PaintContext} used to
96.29 + * generate a tiled image pattern.
96.30 + * See the {@link Paint#createContext specification} of the
96.31 + * method in the {@link Paint} interface for information
96.32 + * on null parameter handling.
96.33 + *
96.34 + * @param cm the preferred {@link ColorModel} which represents the most convenient
96.35 + * format for the caller to receive the pixel data, or {@code null}
96.36 + * if there is no preference.
96.37 + * @param deviceBounds the device space bounding box
96.38 + * of the graphics primitive being rendered.
96.39 + * @param userBounds the user space bounding box
96.40 + * of the graphics primitive being rendered.
96.41 + * @param xform the {@link AffineTransform} from user
96.42 + * space into device space.
96.43 + * @param hints the set of hints that the context object can use to
96.44 + * choose between rendering alternatives.
96.45 + * @return the {@code PaintContext} for
96.46 + * generating color patterns.
96.47 + * @see Paint
96.48 * @see PaintContext
96.49 + * @see ColorModel
96.50 + * @see Rectangle
96.51 + * @see Rectangle2D
96.52 + * @see AffineTransform
96.53 + * @see RenderingHints
96.54 */
96.55 public PaintContext createContext(ColorModel cm,
96.56 Rectangle deviceBounds,
97.1 --- a/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java Mon May 12 18:06:23 2008 -0700
97.2 +++ b/src/share/classes/java/awt/datatransfer/SystemFlavorMap.java Fri May 16 12:25:57 2008 -0700
97.3 @@ -298,7 +298,7 @@
97.4 while (continueLine(line)) {
97.5 String nextLine = in.readLine();
97.6 if (nextLine == null) {
97.7 - nextLine = new String("");
97.8 + nextLine = "";
97.9 }
97.10 String loppedLine =
97.11 line.substring(0, line.length() - 1);
97.12 @@ -313,7 +313,7 @@
97.13 }
97.14 nextLine = nextLine.substring(startIndex,
97.15 nextLine.length());
97.16 - line = new String(loppedLine+nextLine);
97.17 + line = loppedLine+nextLine;
97.18 }
97.19
97.20 // Find start of key
98.1 --- a/src/share/classes/java/awt/dnd/DragGestureEvent.java Mon May 12 18:06:23 2008 -0700
98.2 +++ b/src/share/classes/java/awt/dnd/DragGestureEvent.java Fri May 16 12:25:57 2008 -0700
98.3 @@ -1,5 +1,5 @@
98.4 /*
98.5 - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
98.6 + * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
98.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
98.8 *
98.9 * This code is free software; you can redistribute it and/or modify it
98.10 @@ -55,9 +55,19 @@
98.11 * platform dependent drag initiating gesture has occurred
98.12 * on the <code>Component</code> that it is tracking.
98.13 *
98.14 + * The {@code action} field of any {@code DragGestureEvent} instance should take one of the following
98.15 + * values:
98.16 + * <ul>
98.17 + * <li> {@code DnDConstants.ACTION_COPY}
98.18 + * <li> {@code DnDConstants.ACTION_MOVE}
98.19 + * <li> {@code DnDConstants.ACTION_LINK}
98.20 + * </ul>
98.21 + * Assigning the value different from listed above will cause an unspecified behavior.
98.22 + *
98.23 * @see java.awt.dnd.DragGestureRecognizer
98.24 * @see java.awt.dnd.DragGestureListener
98.25 * @see java.awt.dnd.DragSource
98.26 + * @see java.awt.dnd.DnDConstants
98.27 */
98.28
98.29 public class DragGestureEvent extends EventObject {
98.30 @@ -65,19 +75,25 @@
98.31 private static final long serialVersionUID = 9080172649166731306L;
98.32
98.33 /**
98.34 - * Constructs a <code>DragGestureEvent</code> given the
98.35 - * <code>DragGestureRecognizer</code> firing this event,
98.36 - * an <code>int</code> representing
98.37 - * the user's preferred action, a <code>Point</code>
98.38 - * indicating the origin of the drag, and a <code>List</code>
98.39 - * of events that comprise the gesture.
98.40 + * Constructs a <code>DragGestureEvent</code> object given by the
98.41 + * <code>DragGestureRecognizer</code> instance firing this event,
98.42 + * an {@code act} parameter representing
98.43 + * the user's preferred action, an {@code ori} parameter
98.44 + * indicating the origin of the drag, and a {@code List} of
98.45 + * events that comprise the gesture({@code evs} parameter).
98.46 * <P>
98.47 * @param dgr The <code>DragGestureRecognizer</code> firing this event
98.48 - * @param act The the user's preferred action
98.49 + * @param act The user's preferred action.
98.50 + * For information on allowable values, see
98.51 + * the class description for {@link DragGestureEvent}
98.52 * @param ori The origin of the drag
98.53 * @param evs The <code>List</code> of events that comprise the gesture
98.54 * <P>
98.55 - * @throws IllegalArgumentException if input parameters are {@code null}
98.56 + * @throws IllegalArgumentException if any parameter equals {@code null}
98.57 + * @throws IllegalArgumentException if the act parameter does not comply with
98.58 + * the values given in the class
98.59 + * description for {@link DragGestureEvent}
98.60 + * @see java.awt.dnd.DnDConstants
98.61 */
98.62
98.63 public DragGestureEvent(DragGestureRecognizer dgr, int act, Point ori,
99.1 --- a/src/share/classes/java/awt/dnd/DropTargetEvent.java Mon May 12 18:06:23 2008 -0700
99.2 +++ b/src/share/classes/java/awt/dnd/DropTargetEvent.java Fri May 16 12:25:57 2008 -0700
99.3 @@ -45,10 +45,13 @@
99.4 private static final long serialVersionUID = 2821229066521922993L;
99.5
99.6 /**
99.7 - * Construct a <code>DropTargetEvent</code> with
99.8 - * a specified <code>DropTargetContext</code>.
99.9 + * Construct a <code>DropTargetEvent</code> object with
99.10 + * the specified <code>DropTargetContext</code>.
99.11 * <P>
99.12 - * @param dtc the <code>DropTargetContext</code>
99.13 + * @param dtc The <code>DropTargetContext</code>
99.14 + * @throws NullPointerException if {@code dtc} equals {@code null}.
99.15 + * @see #getSource()
99.16 + * @see #getDropTargetContext()
99.17 */
99.18
99.19 public DropTargetEvent(DropTargetContext dtc) {
100.1 --- a/src/share/classes/java/awt/event/ActionEvent.java Mon May 12 18:06:23 2008 -0700
100.2 +++ b/src/share/classes/java/awt/event/ActionEvent.java Fri May 16 12:25:57 2008 -0700
100.3 @@ -1,5 +1,5 @@
100.4 /*
100.5 - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved.
100.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
100.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
100.8 *
100.9 * This code is free software; you can redistribute it and/or modify it
100.10 @@ -45,6 +45,10 @@
100.11 * is therefore spared the details of processing individual mouse movements
100.12 * and mouse clicks, and can instead process a "meaningful" (semantic)
100.13 * event like "button pressed".
100.14 + * <p>
100.15 + * An unspecified behavior will be caused if the {@code id} parameter
100.16 + * of any particular {@code ActionEvent} instance is not
100.17 + * in the range from {@code ACTION_FIRST} to {@code ACTION_LAST}.
100.18 *
100.19 * @see ActionListener
100.20 * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/eventmodel.html">Tutorial: Java 1.1 Event Model</a>
100.21 @@ -134,18 +138,22 @@
100.22 /**
100.23 * Constructs an <code>ActionEvent</code> object.
100.24 * <p>
100.25 - * Note that passing in an invalid <code>id</code> results in
100.26 - * unspecified behavior. This method throws an
100.27 + * This method throws an
100.28 * <code>IllegalArgumentException</code> if <code>source</code>
100.29 * is <code>null</code>.
100.30 * A <code>null</code> <code>command</code> string is legal,
100.31 * but not recommended.
100.32 *
100.33 - * @param source the object that originated the event
100.34 - * @param id an integer that identifies the event
100.35 - * @param command a string that may specify a command (possibly one
100.36 + * @param source The object that originated the event
100.37 + * @param id An integer that identifies the event.
100.38 + * For information on allowable values, see
100.39 + * the class description for {@link ActionEvent}
100.40 + * @param command A string that may specify a command (possibly one
100.41 * of several) associated with the event
100.42 * @throws IllegalArgumentException if <code>source</code> is null
100.43 + * @see #getSource()
100.44 + * @see #getID()
100.45 + * @see #getActionCommand()
100.46 */
100.47 public ActionEvent(Object source, int id, String command) {
100.48 this(source, id, command, 0);
100.49 @@ -154,19 +162,27 @@
100.50 /**
100.51 * Constructs an <code>ActionEvent</code> object with modifier keys.
100.52 * <p>
100.53 - * Note that passing in an invalid <code>id</code> results in
100.54 - * unspecified behavior. This method throws an
100.55 + * This method throws an
100.56 * <code>IllegalArgumentException</code> if <code>source</code>
100.57 * is <code>null</code>.
100.58 * A <code>null</code> <code>command</code> string is legal,
100.59 * but not recommended.
100.60 *
100.61 - * @param source the object that originated the event
100.62 - * @param id an integer that identifies the event
100.63 - * @param command a string that may specify a command (possibly one
100.64 - * of several) associated with the event
100.65 - * @param modifiers the modifier keys held down during this action
100.66 + * @param source The object that originated the event
100.67 + * @param id An integer that identifies the event.
100.68 + * For information on allowable values, see
100.69 + * the class description for {@link ActionEvent}
100.70 + * @param command A string that may specify a command (possibly one
100.71 + * of several) associated with the event
100.72 + * @param modifiers The modifier keys down during event
100.73 + * (shift, ctrl, alt, meta).
100.74 + * Passing negative parameter is not recommended.
100.75 + * Zero value means that no modifiers were passed
100.76 * @throws IllegalArgumentException if <code>source</code> is null
100.77 + * @see #getSource()
100.78 + * @see #getID()
100.79 + * @see #getActionCommand()
100.80 + * @see #getModifiers()
100.81 */
100.82 public ActionEvent(Object source, int id, String command, int modifiers) {
100.83 this(source, id, command, 0, modifiers);
100.84 @@ -176,20 +192,31 @@
100.85 * Constructs an <code>ActionEvent</code> object with the specified
100.86 * modifier keys and timestamp.
100.87 * <p>
100.88 - * Note that passing in an invalid <code>id</code> results in
100.89 - * unspecified behavior. This method throws an
100.90 + * This method throws an
100.91 * <code>IllegalArgumentException</code> if <code>source</code>
100.92 * is <code>null</code>.
100.93 * A <code>null</code> <code>command</code> string is legal,
100.94 * but not recommended.
100.95 *
100.96 - * @param source the object that originated the event
100.97 - * @param id an integer that identifies the event
100.98 - * @param command a string that may specify a command (possibly one
100.99 - * of several) associated with the event
100.100 - * @param when the time the event occurred
100.101 - * @param modifiers the modifier keys held down during this action
100.102 + * @param source The object that originated the event
100.103 + * @param id An integer that identifies the event.
100.104 + * For information on allowable values, see
100.105 + * the class description for {@link ActionEvent}
100.106 + * @param command A string that may specify a command (possibly one
100.107 + * of several) associated with the event
100.108 + * @param modifiers The modifier keys down during event
100.109 + * (shift, ctrl, alt, meta).
100.110 + * Passing negative parameter is not recommended.
100.111 + * Zero value means that no modifiers were passed
100.112 + * @param when A long that gives the time the event occurred.
100.113 + * Passing negative or zero value
100.114 + * is not recommended
100.115 * @throws IllegalArgumentException if <code>source</code> is null
100.116 + * @see #getSource()
100.117 + * @see #getID()
100.118 + * @see #getActionCommand()
100.119 + * @see #getModifiers()
100.120 + * @see #getWhen()
100.121 *
100.122 * @since 1.4
100.123 */
101.1 --- a/src/share/classes/java/awt/event/AdjustmentEvent.java Mon May 12 18:06:23 2008 -0700
101.2 +++ b/src/share/classes/java/awt/event/AdjustmentEvent.java Fri May 16 12:25:57 2008 -0700
101.3 @@ -29,7 +29,25 @@
101.4 import java.awt.AWTEvent;
101.5
101.6 /**
101.7 - * The adjustment event emitted by Adjustable objects.
101.8 + * The adjustment event emitted by Adjustable objects like
101.9 + * {@link java.awt.Scrollbar} and {@link java.awt.ScrollPane}.
101.10 + * When the user changes the value of the scrolling component,
101.11 + * it receives an instance of {@code AdjustmentEvent}.
101.12 + * <p>
101.13 + * An unspecified behavior will be caused if the {@code id} parameter
101.14 + * of any particular {@code AdjustmentEvent} instance is not
101.15 + * in the range from {@code ADJUSTMENT_FIRST} to {@code ADJUSTMENT_LAST}.
101.16 + * <p>
101.17 + * The {@code type} of any {@code AdjustmentEvent} instance takes one of the following
101.18 + * values:
101.19 + * <ul>
101.20 + * <li> {@code UNIT_INCREMENT}
101.21 + * <li> {@code UNIT_DECREMENT}
101.22 + * <li> {@code BLOCK_INCREMENT}
101.23 + * <li> {@code BLOCK_DECREMENT}
101.24 + * <li> {@code TRACK}
101.25 + * </ul>
101.26 + * Assigning the value different from listed above will cause an unspecified behavior.
101.27 * @see java.awt.Adjustable
101.28 * @see AdjustmentListener
101.29 *
101.30 @@ -130,17 +148,24 @@
101.31 * Constructs an <code>AdjustmentEvent</code> object with the
101.32 * specified <code>Adjustable</code> source, event type,
101.33 * adjustment type, and value.
101.34 - * <p>Note that passing in an invalid <code>id</code> results in
101.35 - * unspecified behavior. This method throws an
101.36 + * <p> This method throws an
101.37 * <code>IllegalArgumentException</code> if <code>source</code>
101.38 * is <code>null</code>.
101.39 *
101.40 - * @param source the <code>Adjustable</code> object where the
101.41 + * @param source The <code>Adjustable</code> object where the
101.42 * event originated
101.43 - * @param id the event type
101.44 - * @param type the adjustment type
101.45 - * @param value the current value of the adjustment
101.46 + * @param id An integer indicating the type of event.
101.47 + * For information on allowable values, see
101.48 + * the class description for {@link AdjustmentEvent}
101.49 + * @param type An integer indicating the adjustment type.
101.50 + * For information on allowable values, see
101.51 + * the class description for {@link AdjustmentEvent}
101.52 + * @param value The current value of the adjustment
101.53 * @throws IllegalArgumentException if <code>source</code> is null
101.54 + * @see #getSource()
101.55 + * @see #getID()
101.56 + * @see #getAdjustmentType()
101.57 + * @see #getValue()
101.58 */
101.59 public AdjustmentEvent(Adjustable source, int id, int type, int value) {
101.60 this(source, id, type, value, false);
101.61 @@ -149,22 +174,29 @@
101.62 /**
101.63 * Constructs an <code>AdjustmentEvent</code> object with the
101.64 * specified Adjustable source, event type, adjustment type, and value.
101.65 - * <p>Note that passing in an invalid <code>id</code> results in
101.66 - * unspecified behavior. This method throws an
101.67 + * <p> This method throws an
101.68 * <code>IllegalArgumentException</code> if <code>source</code>
101.69 * is <code>null</code>.
101.70 -
101.71 *
101.72 - * @param source the <code>Adjustable</code> object where the
101.73 + * @param source The <code>Adjustable</code> object where the
101.74 * event originated
101.75 - * @param id the event type
101.76 - * @param type the adjustment type
101.77 - * @param value the current value of the adjustment
101.78 - * @param isAdjusting <code>true</code> if the event is one
101.79 + * @param id An integer indicating the type of event.
101.80 + * For information on allowable values, see
101.81 + * the class description for {@link AdjustmentEvent}
101.82 + * @param type An integer indicating the adjustment type.
101.83 + * For information on allowable values, see
101.84 + * the class description for {@link AdjustmentEvent}
101.85 + * @param value The current value of the adjustment
101.86 + * @param isAdjusting A boolean that equals <code>true</code> if the event is one
101.87 * of a series of multiple adjusting events,
101.88 * otherwise <code>false</code>
101.89 * @throws IllegalArgumentException if <code>source</code> is null
101.90 * @since 1.4
101.91 + * @see #getSource()
101.92 + * @see #getID()
101.93 + * @see #getAdjustmentType()
101.94 + * @see #getValue()
101.95 + * @see #getValueIsAdjusting()
101.96 */
101.97 public AdjustmentEvent(Adjustable source, int id, int type, int value, boolean isAdjusting) {
101.98 super(source, id);
102.1 --- a/src/share/classes/java/awt/event/ComponentEvent.java Mon May 12 18:06:23 2008 -0700
102.2 +++ b/src/share/classes/java/awt/event/ComponentEvent.java Fri May 16 12:25:57 2008 -0700
102.3 @@ -52,6 +52,10 @@
102.4 * (<code>ComponentAdapter</code> objects implement the
102.5 * <code>ComponentListener</code> interface.) Each such listener object
102.6 * gets this <code>ComponentEvent</code> when the event occurs.
102.7 + * <p>
102.8 + * An unspecified behavior will be caused if the {@code id} parameter
102.9 + * of any particular {@code ComponentEvent} instance is not
102.10 + * in the range from {@code COMPONENT_FIRST} to {@code COMPONENT_LAST}.
102.11 *
102.12 * @see ComponentAdapter
102.13 * @see ComponentListener
102.14 @@ -99,14 +103,17 @@
102.15
102.16 /**
102.17 * Constructs a <code>ComponentEvent</code> object.
102.18 - * <p>Note that passing in an invalid <code>id</code> results in
102.19 - * unspecified behavior. This method throws an
102.20 + * <p> This method throws an
102.21 * <code>IllegalArgumentException</code> if <code>source</code>
102.22 * is <code>null</code>.
102.23 *
102.24 - * @param source the <code>Component</code> that originated the event
102.25 - * @param id an integer indicating the type of event
102.26 + * @param source The <code>Component</code> that originated the event
102.27 + * @param id An integer indicating the type of event.
102.28 + * For information on allowable values, see
102.29 + * the class description for {@link ComponentEvent}
102.30 * @throws IllegalArgumentException if <code>source</code> is null
102.31 + * @see #getComponent()
102.32 + * @see #getID()
102.33 */
102.34 public ComponentEvent(Component source, int id) {
102.35 super(source, id);
103.1 --- a/src/share/classes/java/awt/event/ContainerEvent.java Mon May 12 18:06:23 2008 -0700
103.2 +++ b/src/share/classes/java/awt/event/ContainerEvent.java Fri May 16 12:25:57 2008 -0700
103.3 @@ -45,6 +45,10 @@
103.4 * (<code>ContainerAdapter</code> objects implement the
103.5 * <code>ContainerListener</code> interface.) Each such listener object
103.6 * gets this <code>ContainerEvent</code> when the event occurs.
103.7 + * <p>
103.8 + * An unspecified behavior will be caused if the {@code id} parameter
103.9 + * of any particular {@code ContainerEvent} instance is not
103.10 + * in the range from {@code CONTAINER_FIRST} to {@code CONTAINER_LAST}.
103.11 *
103.12 * @see ContainerAdapter
103.13 * @see ContainerListener
103.14 @@ -92,16 +96,20 @@
103.15
103.16 /**
103.17 * Constructs a <code>ContainerEvent</code> object.
103.18 - * <p>Note that passing in an invalid <code>id</code> results in
103.19 - * unspecified behavior. This method throws an
103.20 + * <p> This method throws an
103.21 * <code>IllegalArgumentException</code> if <code>source</code>
103.22 * is <code>null</code>.
103.23 *
103.24 - * @param source the <code>Component</code> object (container)
103.25 + * @param source The <code>Component</code> object (container)
103.26 * that originated the event
103.27 - * @param id an integer indicating the type of event
103.28 + * @param id An integer indicating the type of event.
103.29 + * For information on allowable values, see
103.30 + * the class description for {@link ContainerEvent}
103.31 * @param child the component that was added or removed
103.32 * @throws IllegalArgumentException if <code>source</code> is null
103.33 + * @see #getContainer()
103.34 + * @see #getID()
103.35 + * @see #getChild()
103.36 */
103.37 public ContainerEvent(Component source, int id, Component child) {
103.38 super(source, id);
104.1 --- a/src/share/classes/java/awt/event/FocusEvent.java Mon May 12 18:06:23 2008 -0700
104.2 +++ b/src/share/classes/java/awt/event/FocusEvent.java Fri May 16 12:25:57 2008 -0700
104.3 @@ -50,6 +50,10 @@
104.4 * reactivated. Both permanent and temporary focus events are delivered using
104.5 * the FOCUS_GAINED and FOCUS_LOST event ids; the level may be distinguished in
104.6 * the event using the isTemporary() method.
104.7 + * <p>
104.8 + * An unspecified behavior will be caused if the {@code id} parameter
104.9 + * of any particular {@code FocusEvent} instance is not
104.10 + * in the range from {@code FOCUS_FIRST} to {@code FOCUS_LAST}.
104.11 *
104.12 * @see FocusAdapter
104.13 * @see FocusListener
104.14 @@ -121,18 +125,23 @@
104.15 * application, with a Java application in a different VM,
104.16 * or with no other <code>Component</code>, then the opposite
104.17 * <code>Component</code> is <code>null</code>.
104.18 - * <p>Note that passing in an invalid <code>id</code> results in
104.19 - * unspecified behavior. This method throws an
104.20 + * <p> This method throws an
104.21 * <code>IllegalArgumentException</code> if <code>source</code>
104.22 * is <code>null</code>.
104.23 *
104.24 - * @param source the <code>Component</code> that originated the event
104.25 - * @param id <code>FOCUS_GAINED</code> or <code>FOCUS_LOST</code>
104.26 - * @param temporary <code>true</code> if the focus change is temporary;
104.27 + * @param source The <code>Component</code> that originated the event
104.28 + * @param id An integer indicating the type of event.
104.29 + * For information on allowable values, see
104.30 + * the class description for {@link FocusEvent}
104.31 + * @param temporary Equals <code>true</code> if the focus change is temporary;
104.32 * <code>false</code> otherwise
104.33 - * @param opposite the other Component involved in the focus change,
104.34 + * @param opposite The other Component involved in the focus change,
104.35 * or <code>null</code>
104.36 - * @throws IllegalArgumentException if <code>source</code> is null
104.37 + * @throws IllegalArgumentException if <code>source</code> equals {@code null}
104.38 + * @see #getSource()
104.39 + * @see #getID()
104.40 + * @see #isTemporary()
104.41 + * @see #getOppositeComponent()
104.42 * @since 1.4
104.43 */
104.44 public FocusEvent(Component source, int id, boolean temporary,
104.45 @@ -145,16 +154,20 @@
104.46 /**
104.47 * Constructs a <code>FocusEvent</code> object and identifies
104.48 * whether or not the change is temporary.
104.49 - * <p>Note that passing in an invalid <code>id</code> results in
104.50 - * unspecified behavior. This method throws an
104.51 + * <p> This method throws an
104.52 * <code>IllegalArgumentException</code> if <code>source</code>
104.53 * is <code>null</code>.
104.54 *
104.55 - * @param source the <code>Component</code> that originated the event
104.56 - * @param id an integer indicating the type of event
104.57 - * @param temporary <code>true</code> if the focus change is temporary;
104.58 + * @param source The <code>Component</code> that originated the event
104.59 + * @param id An integer indicating the type of event.
104.60 + * For information on allowable values, see
104.61 + * the class description for {@link FocusEvent}
104.62 + * @param temporary Equals <code>true</code> if the focus change is temporary;
104.63 * <code>false</code> otherwise
104.64 - * @throws IllegalArgumentException if <code>source</code> is null
104.65 + * @throws IllegalArgumentException if <code>source</code> equals {@code null}
104.66 + * @see #getSource()
104.67 + * @see #getID()
104.68 + * @see #isTemporary()
104.69 */
104.70 public FocusEvent(Component source, int id, boolean temporary) {
104.71 this(source, id, temporary, null);
104.72 @@ -163,14 +176,17 @@
104.73 /**
104.74 * Constructs a <code>FocusEvent</code> object and identifies it
104.75 * as a permanent change in focus.
104.76 - * <p>Note that passing in an invalid <code>id</code> results in
104.77 - * unspecified behavior. This method throws an
104.78 + * <p> This method throws an
104.79 * <code>IllegalArgumentException</code> if <code>source</code>
104.80 * is <code>null</code>.
104.81 *
104.82 - * @param source the <code>Component</code> that originated the event
104.83 - * @param id an integer indicating the type of event
104.84 - * @throws IllegalArgumentException if <code>source</code> is null
104.85 + * @param source The <code>Component</code> that originated the event
104.86 + * @param id An integer indicating the type of event.
104.87 + * For information on allowable values, see
104.88 + * the class description for {@link FocusEvent}
104.89 + * @throws IllegalArgumentException if <code>source</code> equals {@code null}
104.90 + * @see #getSource()
104.91 + * @see #getID()
104.92 */
104.93 public FocusEvent(Component source, int id) {
104.94 this(source, id, false);
105.1 --- a/src/share/classes/java/awt/event/HierarchyEvent.java Mon May 12 18:06:23 2008 -0700
105.2 +++ b/src/share/classes/java/awt/event/HierarchyEvent.java Fri May 16 12:25:57 2008 -0700
105.3 @@ -1,5 +1,5 @@
105.4 /*
105.5 - * Copyright 1999-2004 Sun Microsystems, Inc. All Rights Reserved.
105.6 + * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
105.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
105.8 *
105.9 * This code is free software; you can redistribute it and/or modify it
105.10 @@ -31,7 +31,7 @@
105.11
105.12 /**
105.13 * An event which indicates a change to the <code>Component</code>
105.14 - * hierarchy to which a <code>Component</code> belongs.
105.15 + * hierarchy to which <code>Component</code> belongs.
105.16 * <ul>
105.17 * <li>Hierarchy Change Events (HierarchyListener)
105.18 * <ul>
105.19 @@ -58,16 +58,30 @@
105.20 * Container is added, removed, moved, or resized, and passed down the
105.21 * hierarchy. It is also generated by a Component object when that object's
105.22 * <code>addNotify</code>, <code>removeNotify</code>, <code>show</code>, or
105.23 - * <code>hide</code> method is called. ANCESTOR_MOVED and ANCESTOR_RESIZED
105.24 + * <code>hide</code> method is called. The {@code ANCESTOR_MOVED} and
105.25 + * {@code ANCESTOR_RESIZED}
105.26 * events are dispatched to every <code>HierarchyBoundsListener</code> or
105.27 * <code>HierarchyBoundsAdapter</code> object which registered to receive
105.28 * such events using the Component's <code>addHierarchyBoundsListener</code>
105.29 * method. (<code>HierarchyBoundsAdapter</code> objects implement the <code>
105.30 - * HierarchyBoundsListener</code> interface.) HIERARCHY_CHANGED events are
105.31 + * HierarchyBoundsListener</code> interface.) The {@code HIERARCHY_CHANGED} events are
105.32 * dispatched to every <code>HierarchyListener</code> object which registered
105.33 * to receive such events using the Component's <code>addHierarchyListener
105.34 * </code> method. Each such listener object gets this <code>HierarchyEvent
105.35 * </code> when the event occurs.
105.36 + * <p>
105.37 + * An unspecified behavior will be caused if the {@code id} parameter
105.38 + * of any particular {@code HierarchyEvent} instance is not
105.39 + * in the range from {@code HIERARCHY_FIRST} to {@code HIERARCHY_LAST}.
105.40 + * <br>
105.41 + * The {@code changeFlags} parameter of any {@code HierarchyEvent} instance takes one of the following
105.42 + * values:
105.43 + * <ul>
105.44 + * <li> {@code HierarchyEvent.PARENT_CHANGED}
105.45 + * <li> {@code HierarchyEvent.DISPLAYABILITY_CHANGED}
105.46 + * <li> {@code HierarchyEvent.SHOWING_CHANGED}
105.47 + * </ul>
105.48 + * Assigning the value different from listed above will cause unspecified behavior.
105.49 *
105.50 * @author David Mendenhall
105.51 * @see HierarchyListener
105.52 @@ -108,20 +122,20 @@
105.53 public static final int HIERARCHY_LAST = ANCESTOR_RESIZED;
105.54
105.55 /**
105.56 - * Indicates that the <code>HIERARCHY_CHANGED</code> event
105.57 + * A change flag indicates that the <code>HIERARCHY_CHANGED</code> event
105.58 * was generated by a reparenting operation.
105.59 */
105.60 public static final int PARENT_CHANGED = 0x1;
105.61
105.62 /**
105.63 - * Indicates that the <code>HIERARCHY_CHANGED</code> event
105.64 - * was generated due to a change in the displayability
105.65 - * of the hierarchy. To discern the
105.66 - * current displayability of the hierarchy, call
105.67 - * <code>Component.isDisplayable</code>. Displayability changes occur
105.68 - * in response to explicit or implicit calls to
105.69 + * A change flag indicates that the <code>HIERARCHY_CHANGED</code> event
105.70 + * was generated due to the changing of the hierarchy displayability.
105.71 + * To discern the
105.72 + * current displayability of the hierarchy, call the
105.73 + * <code>Component.isDisplayable</code> method. Displayability changes occur
105.74 + * in response to explicit or implicit calls of the
105.75 * <code>Component.addNotify</code> and
105.76 - * <code>Component.removeNotify</code>.
105.77 + * <code>Component.removeNotify</code> methods.
105.78 *
105.79 * @see java.awt.Component#isDisplayable()
105.80 * @see java.awt.Component#addNotify()
105.81 @@ -130,15 +144,15 @@
105.82 public static final int DISPLAYABILITY_CHANGED = 0x2;
105.83
105.84 /**
105.85 - * Indicates that the <code>HIERARCHY_CHANGED</code> event
105.86 - * was generated due to a change in the showing state
105.87 - * of the hierarchy. To discern the
105.88 - * current showing state of the hierarchy, call
105.89 - * <code>Component.isShowing</code>. Showing state changes occur
105.90 + * A change flag indicates that the <code>HIERARCHY_CHANGED</code> event
105.91 + * was generated due to the changing of the hierarchy showing state.
105.92 + * To discern the
105.93 + * current showing state of the hierarchy, call the
105.94 + * <code>Component.isShowing</code> method. Showing state changes occur
105.95 * when either the displayability or visibility of the
105.96 * hierarchy occurs. Visibility changes occur in response to explicit
105.97 - * or implicit calls to <code>Component.show</code> and
105.98 - * <code>Component.hide</code>.
105.99 + * or implicit calls of the <code>Component.show</code> and
105.100 + * <code>Component.hide</code> methods.
105.101 *
105.102 * @see java.awt.Component#isShowing()
105.103 * @see java.awt.Component#addNotify()
105.104 @@ -155,20 +169,26 @@
105.105 /**
105.106 * Constructs an <code>HierarchyEvent</code> object to identify a
105.107 * change in the <code>Component</code> hierarchy.
105.108 - * <p>Note that passing in an invalid <code>id</code> results in
105.109 - * unspecified behavior. This method throws an
105.110 + * <p>This method throws an
105.111 * <code>IllegalArgumentException</code> if <code>source</code>
105.112 * is <code>null</code>.
105.113 *
105.114 - * @param source the <code>Component</code> object that
105.115 + * @param source The <code>Component</code> object that
105.116 * originated the event
105.117 - * @param id an integer indicating the type of event
105.118 - * @param changed the <code>Component</code> at the top of
105.119 + * @param id An integer indicating the type of event.
105.120 + * For information on allowable values, see
105.121 + * the class description for {@link HierarchyEvent}
105.122 + * @param changed The <code>Component</code> at the top of
105.123 * the hierarchy which was changed
105.124 - * @param changedParent the parent of <code>changed</code>; this
105.125 + * @param changedParent The parent of the <code>changed</code> component.
105.126 + * This
105.127 * may be the parent before or after the
105.128 * change, depending on the type of change
105.129 - * @throws IllegalArgumentException if <code>source</code> is null
105.130 + * @throws IllegalArgumentException if <code>source</code> is {@code null}
105.131 + * @see #getSource()
105.132 + * @see #getID()
105.133 + * @see #getChanged()
105.134 + * @see #getChangedParent()
105.135 */
105.136 public HierarchyEvent(Component source, int id, Component changed,
105.137 Container changedParent) {
105.138 @@ -180,23 +200,32 @@
105.139 /**
105.140 * Constructs an <code>HierarchyEvent</code> object to identify
105.141 * a change in the <code>Component</code> hierarchy.
105.142 - * <p>Note that passing in an invalid <code>id</code> results in
105.143 - * unspecified behavior. This method throws an
105.144 + * <p> This method throws an
105.145 * <code>IllegalArgumentException</code> if <code>source</code>
105.146 * is <code>null</code>.
105.147 *
105.148 - * @param source the <code>Component</code> object that
105.149 + * @param source The <code>Component</code> object that
105.150 * originated the event
105.151 - * @param id an integer indicating the type of event
105.152 - * @param changed the <code>Component</code> at the top
105.153 + * @param id An integer indicating the type of event.
105.154 + * For information on allowable values, see
105.155 + * the class description for {@link HierarchyEvent}
105.156 + * @param changed The <code>Component</code> at the top
105.157 * of the hierarchy which was changed
105.158 - * @param changedParent the parent of <code>changed</code>; this
105.159 + * @param changedParent The parent of the <code>changed</code> component.
105.160 + * This
105.161 * may be the parent before or after the
105.162 * change, depending on the type of change
105.163 - * @param changeFlags a bitmask which indicates the type(s) of
105.164 - * <code>HIERARCHY_CHANGED</code> events
105.165 - * represented in this event object
105.166 + * @param changeFlags A bitmask which indicates the type(s) of
105.167 + * the <code>HIERARCHY_CHANGED</code> events
105.168 + * represented in this event object.
105.169 + * For information on allowable values, see
105.170 + * the class description for {@link HierarchyEvent}
105.171 * @throws IllegalArgumentException if <code>source</code> is null
105.172 + * @see #getSource()
105.173 + * @see #getID()
105.174 + * @see #getChanged()
105.175 + * @see #getChangedParent()
105.176 + * @see #getChangeFlags()
105.177 */
105.178 public HierarchyEvent(Component source, int id, Component changed,
105.179 Container changedParent, long changeFlags) {
106.1 --- a/src/share/classes/java/awt/event/InputEvent.java Mon May 12 18:06:23 2008 -0700
106.2 +++ b/src/share/classes/java/awt/event/InputEvent.java Fri May 16 12:25:57 2008 -0700
106.3 @@ -208,17 +208,32 @@
106.4 /**
106.5 * Constructs an InputEvent object with the specified source component,
106.6 * modifiers, and type.
106.7 - * <p>Note that passing in an invalid <code>id</code> results in
106.8 - * unspecified behavior. This method throws an
106.9 + * <p> This method throws an
106.10 * <code>IllegalArgumentException</code> if <code>source</code>
106.11 * is <code>null</code>.
106.12 *
106.13 * @param source the object where the event originated
106.14 - * @param id the event type
106.15 - * @param when the time the event occurred
106.16 - * @param modifiers represents the modifier keys and mouse buttons down
106.17 - * while the event occurred
106.18 + * @param id the integer that identifies the event type.
106.19 + * It is allowed to pass as parameter any value that
106.20 + * allowed for some subclass of {@code InputEvent} class.
106.21 + * Passing in the value different from those values result
106.22 + * in unspecified behavior
106.23 + * @param when a long int that gives the time the event occurred.
106.24 + * Passing negative or zero value
106.25 + * is not recommended
106.26 + * @param modifiers the modifier keys down during event (e.g. shift, ctrl,
106.27 + * alt, meta)
106.28 + * Passing negative parameter is not recommended.
106.29 + * Zero value means no modifiers.
106.30 + * Either extended _DOWN_MASK or old _MASK modifiers
106.31 + * should be used, but both models should not be mixed
106.32 + * in one event. Use of the extended modifiers is
106.33 + * preferred
106.34 * @throws IllegalArgumentException if <code>source</code> is null
106.35 + * @see #getSource()
106.36 + * @see #getID()
106.37 + * @see #getWhen()
106.38 + * @see #getModifiers()
106.39 */
106.40 InputEvent(Component source, int id, long when, int modifiers) {
106.41 super(source, id);
106.42 @@ -285,7 +300,8 @@
106.43 }
106.44
106.45 /**
106.46 - * Returns the timestamp of when this event occurred.
106.47 + * Returns the difference in milliseconds between the timestamp of when this event occurred and
106.48 + * midnight, January 1, 1970 UTC.
106.49 */
106.50 public long getWhen() {
106.51 return when;
106.52 @@ -358,7 +374,12 @@
106.53 * Returns a String describing the extended modifier keys and
106.54 * mouse buttons, such as "Shift", "Button1", or "Ctrl+Shift".
106.55 * These strings can be localized by changing the
106.56 - * awt.properties file.
106.57 + * <code>awt.properties</code> file.
106.58 + * <p>
106.59 + * Note that passing negative parameter is incorrect,
106.60 + * and will cause the returning an unspecified string.
106.61 + * Zero parameter means that no modifiers were passed and will
106.62 + * cause the returning an empty string.
106.63 *
106.64 * @param modifiers a modifier mask describing the extended
106.65 * modifier keys and mouse buttons for the event
107.1 --- a/src/share/classes/java/awt/event/InvocationEvent.java Mon May 12 18:06:23 2008 -0700
107.2 +++ b/src/share/classes/java/awt/event/InvocationEvent.java Fri May 16 12:25:57 2008 -0700
107.3 @@ -1,5 +1,5 @@
107.4 /*
107.5 - * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved.
107.6 + * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
107.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
107.8 *
107.9 * This code is free software; you can redistribute it and/or modify it
107.10 @@ -39,6 +39,10 @@
107.11 * can use this fact to write replacement functions for <code>invokeLater
107.12 * </code> and <code>invokeAndWait</code> without writing special-case code
107.13 * in any <code>AWTEventListener</code> objects.
107.14 + * <p>
107.15 + * An unspecified behavior will be caused if the {@code id} parameter
107.16 + * of any particular {@code InvocationEvent} instance is not
107.17 + * in the range from {@code INVOCATION_FIRST} to {@code INVOCATION_LAST}.
107.18 *
107.19 * @author Fred Ecks
107.20 * @author David Mendenhall
107.21 @@ -123,12 +127,13 @@
107.22 * <p> This method throws an <code>IllegalArgumentException</code>
107.23 * if <code>source</code> is <code>null</code>.
107.24 *
107.25 - * @param source the <code>Object</code> that originated the event
107.26 - * @param runnable the <code>Runnable</code> whose <code>run</code>
107.27 + * @param source The <code>Object</code> that originated the event
107.28 + * @param runnable The <code>Runnable</code> whose <code>run</code>
107.29 * method will be executed
107.30 * @throws IllegalArgumentException if <code>source</code> is null
107.31 *
107.32 - * @see #InvocationEvent(Object, Runnable, Object, boolean)
107.33 + * @see #getSource()
107.34 + * @see #InvocationEvent(Object, Runnable, Object, boolean)
107.35 */
107.36 public InvocationEvent(Object source, Runnable runnable) {
107.37 this(source, runnable, null, false);
107.38 @@ -147,15 +152,15 @@
107.39 * <p>This method throws an <code>IllegalArgumentException</code>
107.40 * if <code>source</code> is <code>null</code>.
107.41 *
107.42 - * @param source the <code>Object</code> that originated
107.43 + * @param source The <code>Object</code> that originated
107.44 * the event
107.45 - * @param runnable the <code>Runnable</code> whose
107.46 + * @param runnable The <code>Runnable</code> whose
107.47 * <code>run</code> method will be
107.48 * executed
107.49 - * @param notifier the Object whose <code>notifyAll</code>
107.50 + * @param notifier The {@code Object} whose <code>notifyAll</code>
107.51 * method will be called after
107.52 * <code>Runnable.run</code> has returned
107.53 - * @param catchThrowables specifies whether <code>dispatch</code>
107.54 + * @param catchThrowables Specifies whether <code>dispatch</code>
107.55 * should catch Throwable when executing
107.56 * the <code>Runnable</code>'s <code>run</code>
107.57 * method, or should instead propagate those
107.58 @@ -163,6 +168,7 @@
107.59 * dispatch loop
107.60 * @throws IllegalArgumentException if <code>source</code> is null
107.61 *
107.62 + * @see #getSource()
107.63 * @see #InvocationEvent(Object, int, Runnable, Object, boolean)
107.64 */
107.65 public InvocationEvent(Object source, Runnable runnable, Object notifier,
107.66 @@ -176,26 +182,29 @@
107.67 * method when dispatched. If notifier is non-<code>null</code>,
107.68 * <code>notifyAll</code> will be called on it
107.69 * immediately after <code>run</code> returns.
107.70 - * <p>Note that passing in an invalid <code>id</code> results in
107.71 - * unspecified behavior. This method throws an
107.72 + * <p>This method throws an
107.73 * <code>IllegalArgumentException</code> if <code>source</code>
107.74 * is <code>null</code>.
107.75 *
107.76 - * @param source the <code>Object</code> that originated
107.77 + * @param source The <code>Object</code> that originated
107.78 * the event
107.79 - * @param id the ID for the event
107.80 - * @param runnable the <code>Runnable</code> whose
107.81 + * @param id An integer indicating the type of event.
107.82 + * For information on allowable values, see
107.83 + * the class description for {@link InvocationEvent}
107.84 + * @param runnable The <code>Runnable</code> whose
107.85 * <code>run</code> method will be executed
107.86 - * @param notifier the <code>Object</code> whose <code>notifyAll</code>
107.87 + * @param notifier The <code>Object</code> whose <code>notifyAll</code>
107.88 * method will be called after
107.89 * <code>Runnable.run</code> has returned
107.90 - * @param catchThrowables specifies whether <code>dispatch</code>
107.91 + * @param catchThrowables Specifies whether <code>dispatch</code>
107.92 * should catch Throwable when executing the
107.93 * <code>Runnable</code>'s <code>run</code>
107.94 * method, or should instead propagate those
107.95 * Throwables to the EventDispatchThread's
107.96 * dispatch loop
107.97 * @throws IllegalArgumentException if <code>source</code> is null
107.98 + * @see #getSource()
107.99 + * @see #getID()
107.100 */
107.101 protected InvocationEvent(Object source, int id, Runnable runnable,
107.102 Object notifier, boolean catchThrowables) {
108.1 --- a/src/share/classes/java/awt/event/ItemEvent.java Mon May 12 18:06:23 2008 -0700
108.2 +++ b/src/share/classes/java/awt/event/ItemEvent.java Fri May 16 12:25:57 2008 -0700
108.3 @@ -41,6 +41,18 @@
108.4 * spared the details of processing individual mouse movements and mouse
108.5 * clicks, and can instead process a "meaningful" (semantic) event like
108.6 * "item selected" or "item deselected".
108.7 + * <p>
108.8 + * An unspecified behavior will be caused if the {@code id} parameter
108.9 + * of any particular {@code ItemEvent} instance is not
108.10 + * in the range from {@code ITEM_FIRST} to {@code ITEM_LAST}.
108.11 + * <p>
108.12 + * The {@code stateChange} of any {@code ItemEvent} instance takes one of the following
108.13 + * values:
108.14 + * <ul>
108.15 + * <li> {@code ItemEvent.SELECTED}
108.16 + * <li> {@code ItemEvent.DESELECTED}
108.17 + * </ul>
108.18 + * Assigning the value different from listed above will cause an unspecified behavior.
108.19 *
108.20 * @author Carl Quinn
108.21 *
108.22 @@ -101,19 +113,24 @@
108.23
108.24 /**
108.25 * Constructs an <code>ItemEvent</code> object.
108.26 - * <p>Note that passing in an invalid <code>id</code> results in
108.27 - * unspecified behavior. This method throws an
108.28 + * <p> This method throws an
108.29 * <code>IllegalArgumentException</code> if <code>source</code>
108.30 * is <code>null</code>.
108.31 *
108.32 - * @param source the <code>ItemSelectable</code> object
108.33 + * @param source The <code>ItemSelectable</code> object
108.34 * that originated the event
108.35 - * @param id an integer that identifies the event type
108.36 - * @param item an object -- the item affected by the event
108.37 - * @param stateChange
108.38 - * an integer that indicates whether the item was
108.39 - * selected or deselected
108.40 + * @param id The integer that identifies the event type.
108.41 + * For information on allowable values, see
108.42 + * the class description for {@link ItemEvent}
108.43 + * @param item An object -- the item affected by the event
108.44 + * @param stateChange An integer that indicates whether the item was
108.45 + * selected or deselected.
108.46 + * For information on allowable values, see
108.47 + * the class description for {@link ItemEvent}
108.48 * @throws IllegalArgumentException if <code>source</code> is null
108.49 + * @see #getItemSelectable()
108.50 + * @see #getID()
108.51 + * @see #getStateChange()
108.52 */
108.53 public ItemEvent(ItemSelectable source, int id, Object item, int stateChange) {
108.54 super(source, id);
109.1 --- a/src/share/classes/java/awt/event/KeyEvent.java Mon May 12 18:06:23 2008 -0700
109.2 +++ b/src/share/classes/java/awt/event/KeyEvent.java Fri May 16 12:25:57 2008 -0700
109.3 @@ -1,5 +1,5 @@
109.4 /*
109.5 - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved.
109.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
109.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
109.8 *
109.9 * This code is free software; you can redistribute it and/or modify it
109.10 @@ -128,6 +128,10 @@
109.11 * (VK_ENTER, VK_BACK_SPACE, and VK_TAB), do not rely on the values of the VK_
109.12 * constants. Sun reserves the right to change these values as needed
109.13 * to accomodate a wider range of keyboards in the future.
109.14 + * <p>
109.15 + * An unspecified behavior will be caused if the {@code id} parameter
109.16 + * of any particular {@code KeyEvent} instance is not
109.17 + * in the range from {@code KEY_FIRST} to {@code KEY_LAST}.
109.18 *
109.19 * @author Carl Quinn
109.20 * @author Amy Fowler
109.21 @@ -914,27 +918,32 @@
109.22
109.23 /**
109.24 * Constructs a <code>KeyEvent</code> object.
109.25 - * <p>Note that passing in an invalid <code>id</code> results in
109.26 - * unspecified behavior. This method throws an
109.27 + * <p>This method throws an
109.28 * <code>IllegalArgumentException</code> if <code>source</code>
109.29 * is <code>null</code>.
109.30 *
109.31 - * @param source the <code>Component</code> that originated the event
109.32 - * @param id an integer identifying the type of event
109.33 - * @param when a long integer that specifies the time the event
109.34 - * occurred
109.35 - * @param modifiers the modifier keys down during event (shift, ctrl,
109.36 - * alt, meta)
109.37 - * Either extended _DOWN_MASK or old _MASK modifiers
109.38 - * should be used, but both models should not be mixed
109.39 - * in one event. Use of the extended modifiers is
109.40 - * preferred.
109.41 - * @param keyCode the integer code for an actual key, or VK_UNDEFINED
109.42 + * @param source The <code>Component</code> that originated the event
109.43 + * @param id An integer indicating the type of event.
109.44 + * For information on allowable values, see
109.45 + * the class description for {@link KeyEvent}
109.46 + * @param when A long integer that specifies the time the event
109.47 + * occurred.
109.48 + * Passing negative or zero value
109.49 + * is not recommended
109.50 + * @param modifiers The modifier keys down during event (shift, ctrl,
109.51 + * alt, meta).
109.52 + * Passing negative value
109.53 + * is not recommended.
109.54 + * Zero value means that no modifiers were passed.
109.55 + * Use either an extended _DOWN_MASK or old _MASK modifiers,
109.56 + * however do not mix models in the one event.
109.57 + * The extended modifiers are preferred for using
109.58 + * @param keyCode The integer code for an actual key, or VK_UNDEFINED
109.59 * (for a key-typed event)
109.60 - * @param keyChar the Unicode character generated by this event, or
109.61 + * @param keyChar The Unicode character generated by this event, or
109.62 * CHAR_UNDEFINED (for key-pressed and key-released
109.63 * events which do not map to a valid Unicode character)
109.64 - * @param keyLocation identifies the key location. The only legal
109.65 + * @param keyLocation Identifies the key location. The only legal
109.66 * values are <code>KEY_LOCATION_UNKNOWN</code>,
109.67 * <code>KEY_LOCATION_STANDARD</code>, <code>KEY_LOCATION_LEFT</code>,
109.68 * <code>KEY_LOCATION_RIGHT</code>, and <code>KEY_LOCATION_NUMPAD</code>.
109.69 @@ -948,6 +957,13 @@
109.70 * or if <code>keyLocation</code> is not one of the legal
109.71 * values enumerated above.
109.72 * @throws IllegalArgumentException if <code>source</code> is null
109.73 + * @see #getSource()
109.74 + * @see #getID()
109.75 + * @see #getWhen()
109.76 + * @see #getModifiers()
109.77 + * @see #getKeyCode()
109.78 + * @see #getKeyChar()
109.79 + * @see #getKeyLocation()
109.80 * @since 1.4
109.81 */
109.82 public KeyEvent(Component source, int id, long when, int modifiers,
109.83 @@ -982,24 +998,29 @@
109.84
109.85 /**
109.86 * Constructs a <code>KeyEvent</code> object.
109.87 - * <p>Note that passing in an invalid <code>id</code> results in
109.88 - * unspecified behavior. This method throws an
109.89 + * <p> This method throws an
109.90 * <code>IllegalArgumentException</code> if <code>source</code>
109.91 * is <code>null</code>.
109.92 *
109.93 - * @param source the <code>Component</code> that originated the event
109.94 - * @param id an integer identifying the type of event
109.95 - * @param when a long integer that specifies the time the event
109.96 - * occurred
109.97 - * @param modifiers the modifier keys down during event (shift, ctrl,
109.98 - * alt, meta)
109.99 - * Either extended _DOWN_MASK or old _MASK modifiers
109.100 - * should be used, but both models should not be mixed
109.101 - * in one event. Use of the extended modifiers is
109.102 - * preferred.
109.103 - * @param keyCode the integer code for an actual key, or VK_UNDEFINED
109.104 + * @param source The <code>Component</code> that originated the event
109.105 + * @param id An integer indicating the type of event.
109.106 + * For information on allowable values, see
109.107 + * the class description for {@link KeyEvent}
109.108 + * @param when A long integer that specifies the time the event
109.109 + * occurred.
109.110 + * Passing negative or zero value
109.111 + * is not recommended
109.112 + * @param modifiers The modifier keys down during event (shift, ctrl,
109.113 + * alt, meta).
109.114 + * Passing negative value
109.115 + * is not recommended.
109.116 + * Zero value means that no modifiers were passed.
109.117 + * Use either an extended _DOWN_MASK or old _MASK modifiers,
109.118 + * however do not mix models in the one event.
109.119 + * The extended modifiers are preferred for using
109.120 + * @param keyCode The integer code for an actual key, or VK_UNDEFINED
109.121 * (for a key-typed event)
109.122 - * @param keyChar the Unicode character generated by this event, or
109.123 + * @param keyChar The Unicode character generated by this event, or
109.124 * CHAR_UNDEFINED (for key-pressed and key-released
109.125 * events which do not map to a valid Unicode character)
109.126 * @throws IllegalArgumentException if <code>id</code> is
109.127 @@ -1008,6 +1029,12 @@
109.128 * <code>KEY_TYPED</code> and <code>keyCode</code> is not
109.129 * <code>VK_UNDEFINED</code>
109.130 * @throws IllegalArgumentException if <code>source</code> is null
109.131 + * @see #getSource()
109.132 + * @see #getID()
109.133 + * @see #getWhen()
109.134 + * @see #getModifiers()
109.135 + * @see #getKeyCode()
109.136 + * @see #getKeyChar()
109.137 */
109.138 public KeyEvent(Component source, int id, long when, int modifiers,
109.139 int keyCode, char keyChar) {
110.1 --- a/src/share/classes/java/awt/event/MouseEvent.java Mon May 12 18:06:23 2008 -0700
110.2 +++ b/src/share/classes/java/awt/event/MouseEvent.java Fri May 16 12:25:57 2008 -0700
110.3 @@ -159,6 +159,11 @@
110.4 * The reported coordinates for mouse drag events are clipped to fit within the
110.5 * bounds of the virtual device associated with the <code>Component</code>.
110.6 * </ul>
110.7 + * <p>
110.8 + * An unspecified behavior will be caused if the {@code id} parameter
110.9 + * of any particular {@code MouseEvent} instance is not
110.10 + * in the range from {@code MOUSE_FIRST} to {@code MOUSE_LAST}-1
110.11 + * ({@code MOUSE_WHEEL} is not acceptable).
110.12 *
110.13 * @author Carl Quinn
110.14 *
110.15 @@ -418,8 +423,7 @@
110.16 * specified source component,
110.17 * type, modifiers, coordinates, and click count.
110.18 * <p>
110.19 - * Note that passing in an invalid <code>id</code> results in
110.20 - * unspecified behavior. Creating an invalid event (such
110.21 + * Creating an invalid event (such
110.22 * as by using more than one of the old _MASKs, or modifier/button
110.23 * values which don't match) results in unspecified behavior.
110.24 * An invocation of the form
110.25 @@ -435,28 +439,44 @@
110.26 * <code>IllegalArgumentException</code> if <code>source</code>
110.27 * is <code>null</code>.
110.28 *
110.29 - * @param source the <code>Component</code> that originated the event
110.30 - * @param id the integer that identifies the event
110.31 - * @param when a long int that gives the time the event occurred
110.32 - * @param modifiers the modifier keys down during event (e.g. shift, ctrl,
110.33 + * @param source The <code>Component</code> that originated the event
110.34 + * @param id An integer indicating the type of event.
110.35 + * For information on allowable values, see
110.36 + * the class description for {@link MouseEvent}
110.37 + * @param when A long integer that gives the time the event occurred.
110.38 + * Passing negative or zero value
110.39 + * is not recommended
110.40 + * @param modifiers The modifier keys down during event (e.g. shift, ctrl,
110.41 * alt, meta)
110.42 - * Either extended _DOWN_MASK or old _MASK modifiers
110.43 - * should be used, but both models should not be mixed
110.44 - * in one event. Use of the extended modifiers is
110.45 - * preferred.
110.46 - * @param x the horizontal x coordinate for the mouse location
110.47 - * @param y the vertical y coordinate for the mouse location
110.48 - * @param clickCount the number of mouse clicks associated with event
110.49 - * @param popupTrigger a boolean, true if this event is a trigger for a
110.50 - * popup menu
110.51 - * @param button which of the mouse buttons has changed state.
110.52 - * <code>NOBUTTON</code>,
110.53 - * <code>BUTTON1</code>,
110.54 - * <code>BUTTON2</code> or
110.55 - * <code>BUTTON3</code>.
110.56 + * Passing negative parameter
110.57 + * is not recommended.
110.58 + * Zero value means that no modifiers were passed.
110.59 + * Use either an extended _DOWN_MASK or old _MASK modifiers,
110.60 + * however do not mix models in the one event.
110.61 + * The extended modifiers are preferred for using
110.62 + * @param x The horizontal x coordinate for the mouse location.
110.63 + * It is allowed to pass negative values
110.64 + * @param y The vertical y coordinate for the mouse location.
110.65 + * It is allowed to pass negative values
110.66 + * @param clickCount The number of mouse clicks associated with event.
110.67 + * Passing negative value
110.68 + * is not recommended
110.69 + * @param popupTrigger A boolean that equals {@code true} if this event
110.70 + * is a trigger for a popup menu
110.71 + * @param button An integer that indicates, which of the mouse buttons has
110.72 + * changed its state
110.73 * @throws IllegalArgumentException if an invalid <code>button</code>
110.74 * value is passed in
110.75 * @throws IllegalArgumentException if <code>source</code> is null
110.76 + * @see #getSource()
110.77 + * @see #getID()
110.78 + * @see #getWhen()
110.79 + * @see #getModifiers()
110.80 + * @see #getX()
110.81 + * @see #getY()
110.82 + * @see #getClickCount()
110.83 + * @see #isPopupTrigger()
110.84 + * @see #getButton()
110.85 * @since 1.4
110.86 */
110.87 public MouseEvent(Component source, int id, long when, int modifiers,
110.88 @@ -479,8 +499,6 @@
110.89 * Constructs a <code>MouseEvent</code> object with the
110.90 * specified source component,
110.91 * type, modifiers, coordinates, and click count.
110.92 - * <p>Note that passing in an invalid <code>id</code> results in
110.93 - * unspecified behavior.
110.94 * An invocation of the form
110.95 * <tt>MouseEvent(source, id, when, modifiers, x, y, clickCount, popupTrigger)</tt>
110.96 * behaves in exactly the same way as the invocation
110.97 @@ -493,21 +511,39 @@
110.98 * This method throws an <code>IllegalArgumentException</code>
110.99 * if <code>source</code> is <code>null</code>.
110.100 *
110.101 - * @param source the <code>Component</code> that originated the event
110.102 - * @param id the integer that identifies the event
110.103 - * @param when a long int that gives the time the event occurred
110.104 - * @param modifiers the modifier keys down during event (e.g. shift, ctrl,
110.105 + * @param source The <code>Component</code> that originated the event
110.106 + * @param id An integer indicating the type of event.
110.107 + * For information on allowable values, see
110.108 + * the class description for {@link MouseEvent}
110.109 + * @param when A long integer that gives the time the event occurred.
110.110 + * Passing negative or zero value
110.111 + * is not recommended
110.112 + * @param modifiers The modifier keys down during event (e.g. shift, ctrl,
110.113 * alt, meta)
110.114 - * Either extended _DOWN_MASK or old _MASK modifiers
110.115 - * should be used, but both models should not be mixed
110.116 - * in one event. Use of the extended modifiers is
110.117 - * preferred.
110.118 - * @param x the horizontal x coordinate for the mouse location
110.119 - * @param y the vertical y coordinate for the mouse location
110.120 - * @param clickCount the number of mouse clicks associated with event
110.121 - * @param popupTrigger a boolean, true if this event is a trigger for a
110.122 - * popup menu
110.123 + * Passing negative parameter
110.124 + * is not recommended.
110.125 + * Zero value means that no modifiers were passed.
110.126 + * Use either an extended _DOWN_MASK or old _MASK modifiers,
110.127 + * however do not mix models in the one event.
110.128 + * The extended modifiers are preferred for using
110.129 + * @param x The horizontal x coordinate for the mouse location.
110.130 + * It is allowed to pass negative values
110.131 + * @param y The vertical y coordinate for the mouse location.
110.132 + * It is allowed to pass negative values
110.133 + * @param clickCount The number of mouse clicks associated with event.
110.134 + * Passing negative value
110.135 + * is not recommended
110.136 + * @param popupTrigger A boolean that equals {@code true} if this event
110.137 + * is a trigger for a popup menu
110.138 * @throws IllegalArgumentException if <code>source</code> is null
110.139 + * @see #getSource()
110.140 + * @see #getID()
110.141 + * @see #getWhen()
110.142 + * @see #getModifiers()
110.143 + * @see #getX()
110.144 + * @see #getY()
110.145 + * @see #getClickCount()
110.146 + * @see #isPopupTrigger()
110.147 */
110.148 public MouseEvent(Component source, int id, long when, int modifiers,
110.149 int x, int y, int clickCount, boolean popupTrigger) {
110.150 @@ -520,8 +556,7 @@
110.151 * specified source component,
110.152 * type, modifiers, coordinates, absolute coordinates, and click count.
110.153 * <p>
110.154 - * Note that passing in an invalid <code>id</code> results in
110.155 - * unspecified behavior. Creating an invalid event (such
110.156 + * Creating an invalid event (such
110.157 * as by using more than one of the old _MASKs, or modifier/button
110.158 * values which don't match) results in unspecified behavior.
110.159 * Even if inconsistent values for relative and absolute coordinates are
110.160 @@ -531,30 +566,50 @@
110.161 * <code>IllegalArgumentException</code> if <code>source</code>
110.162 * is <code>null</code>.
110.163 *
110.164 - * @param source the <code>Component</code> that originated the event
110.165 - * @param id the integer that identifies the event
110.166 - * @param when a long int that gives the time the event occurred
110.167 - * @param modifiers the modifier keys down during event (e.g. shift, ctrl,
110.168 + * @param source The <code>Component</code> that originated the event
110.169 + * @param id An integer indicating the type of event.
110.170 + * For information on allowable values, see
110.171 + * the class description for {@link MouseEvent}
110.172 + * @param when A long integer that gives the time the event occurred.
110.173 + * Passing negative or zero value
110.174 + * is not recommended
110.175 + * @param modifiers The modifier keys down during event (e.g. shift, ctrl,
110.176 * alt, meta)
110.177 - * Either extended _DOWN_MASK or old _MASK modifiers
110.178 - * should be used, but both models should not be mixed
110.179 - * in one event. Use of the extended modifiers is
110.180 - * preferred.
110.181 - * @param x the horizontal x coordinate for the mouse location
110.182 - * @param y the vertical y coordinate for the mouse location
110.183 - * @param xAbs the absolute horizontal x coordinate for the mouse location
110.184 - * @param yAbs the absolute vertical y coordinate for the mouse location
110.185 - * @param clickCount the number of mouse clicks associated with event
110.186 - * @param popupTrigger a boolean, true if this event is a trigger for a
110.187 - * popup menu
110.188 - * @param button which of the mouse buttons has changed state.
110.189 - * <code>NOBUTTON</code>,
110.190 - * <code>BUTTON1</code>,
110.191 - * <code>BUTTON2</code> or
110.192 - * <code>BUTTON3</code>.
110.193 + * Passing negative parameter
110.194 + * is not recommended.
110.195 + * Zero value means that no modifiers were passed.
110.196 + * Use either an extended _DOWN_MASK or old _MASK modifiers,
110.197 + * however do not mix models in the one event.
110.198 + * The extended modifiers are preferred for using
110.199 + * @param x The horizontal x coordinate for the mouse location.
110.200 + * It is allowed to pass negative values
110.201 + * @param y The vertical y coordinate for the mouse location.
110.202 + * It is allowed to pass negative values
110.203 + * @param xAbs The absolute horizontal x coordinate for the mouse location
110.204 + * It is allowed to pass negative values
110.205 + * @param yAbs The absolute vertical y coordinate for the mouse location
110.206 + * It is allowed to pass negative values
110.207 + * @param clickCount The number of mouse clicks associated with event.
110.208 + * Passing negative value
110.209 + * is not recommended
110.210 + * @param popupTrigger A boolean that equals {@code true} if this event
110.211 + * is a trigger for a popup menu
110.212 + * @param button An integer that indicates, which of the mouse buttons has
110.213 + * changed its state
110.214 * @throws IllegalArgumentException if an invalid <code>button</code>
110.215 * value is passed in
110.216 * @throws IllegalArgumentException if <code>source</code> is null
110.217 + * @see #getSource()
110.218 + * @see #getID()
110.219 + * @see #getWhen()
110.220 + * @see #getModifiers()
110.221 + * @see #getX()
110.222 + * @see #getY()
110.223 + * @see #getXOnScreen()
110.224 + * @see #getYOnScreen()
110.225 + * @see #getClickCount()
110.226 + * @see #isPopupTrigger()
110.227 + * @see #getButton()
110.228 * @since 1.6
110.229 */
110.230 public MouseEvent(Component source, int id, long when, int modifiers,
110.231 @@ -675,21 +730,26 @@
110.232 }
110.233
110.234 /**
110.235 - * Returns a <code>String</code> describing the modifier keys and
110.236 + * Returns a <code>String</code> instance describing the modifier keys and
110.237 * mouse buttons that were down during the event, such as "Shift",
110.238 * or "Ctrl+Shift". These strings can be localized by changing
110.239 * the <code>awt.properties</code> file.
110.240 * <p>
110.241 - * Note that <code>InputEvent.ALT_MASK</code> and
110.242 - * <code>InputEvent.BUTTON2_MASK</code> have the same value,
110.243 - * so the string "Alt" is returned for both modifiers. Likewise,
110.244 - * <code>InputEvent.META_MASK</code> and
110.245 - * <code>InputEvent.BUTTON3_MASK</code> have the same value,
110.246 - * so the string "Meta" is returned for both modifiers.
110.247 + * Note that the <code>InputEvent.ALT_MASK</code> and
110.248 + * <code>InputEvent.BUTTON2_MASK</code> have equal values,
110.249 + * so the "Alt" string is returned for both modifiers. Likewise,
110.250 + * the <code>InputEvent.META_MASK</code> and
110.251 + * <code>InputEvent.BUTTON3_MASK</code> have equal values,
110.252 + * so the "Meta" string is returned for both modifiers.
110.253 + * <p>
110.254 + * Note that passing negative parameter is incorrect,
110.255 + * and will cause the returning an unspecified string.
110.256 + * Zero parameter means that no modifiers were passed and will
110.257 + * cause the returning an empty string.
110.258 *
110.259 - * @param modifiers a modifier mask describing the modifier keys and
110.260 + * @param modifiers A modifier mask describing the modifier keys and
110.261 * mouse buttons that were down during the event
110.262 - * @return string a text description of the combination of modifier
110.263 + * @return string string text description of the combination of modifier
110.264 * keys and mouse buttons that were down during the event
110.265 * @see InputEvent#getModifiersExText(int)
110.266 * @since 1.4
111.1 --- a/src/share/classes/java/awt/event/MouseWheelEvent.java Mon May 12 18:06:23 2008 -0700
111.2 +++ b/src/share/classes/java/awt/event/MouseWheelEvent.java Fri May 16 12:25:57 2008 -0700
111.3 @@ -1,5 +1,5 @@
111.4 /*
111.5 - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.
111.6 + * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
111.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
111.8 *
111.9 * This code is free software; you can redistribute it and/or modify it
112.1 --- a/src/share/classes/java/awt/event/PaintEvent.java Mon May 12 18:06:23 2008 -0700
112.2 +++ b/src/share/classes/java/awt/event/PaintEvent.java Fri May 16 12:25:57 2008 -0700
112.3 @@ -36,6 +36,10 @@
112.4 * designed to be used with the Event Listener model; programs
112.5 * should continue to override paint/update methods in order
112.6 * render themselves properly.
112.7 + * <p>
112.8 + * An unspecified behavior will be caused if the {@code id} parameter
112.9 + * of any particular {@code PaintEvent} instance is not
112.10 + * in the range from {@code PAINT_FIRST} to {@code PAINT_LAST}.
112.11 *
112.12 * @author Amy Fowler
112.13 * @since 1.1
112.14 @@ -82,15 +86,19 @@
112.15 /**
112.16 * Constructs a <code>PaintEvent</code> object with the specified
112.17 * source component and type.
112.18 - * <p>Note that passing in an invalid <code>id</code> results in
112.19 - * unspecified behavior. This method throws an
112.20 + * <p> This method throws an
112.21 * <code>IllegalArgumentException</code> if <code>source</code>
112.22 * is <code>null</code>.
112.23 *
112.24 - * @param source the object where the event originated
112.25 - * @param id the event type
112.26 - * @param updateRect the rectangle area which needs to be repainted
112.27 + * @param source The object where the event originated
112.28 + * @param id The integer that identifies the event type.
112.29 + * For information on allowable values, see
112.30 + * the class description for {@link PaintEvent}
112.31 + * @param updateRect The rectangle area which needs to be repainted
112.32 * @throws IllegalArgumentException if <code>source</code> is null
112.33 + * @see #getSource()
112.34 + * @see #getID()
112.35 + * @see #getUpdateRect()
112.36 */
112.37 public PaintEvent(Component source, int id, Rectangle updateRect) {
112.38 super(source, id);
113.1 --- a/src/share/classes/java/awt/event/TextEvent.java Mon May 12 18:06:23 2008 -0700
113.2 +++ b/src/share/classes/java/awt/event/TextEvent.java Fri May 16 12:25:57 2008 -0700
113.3 @@ -1,5 +1,5 @@
113.4 /*
113.5 - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved.
113.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
113.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
113.8 *
113.9 * This code is free software; you can redistribute it and/or modify it
113.10 @@ -38,12 +38,15 @@
113.11 * this <code>TextEvent</code> when the event occurs. The listener is
113.12 * spared the details of processing individual mouse movements and key strokes
113.13 * Instead, it can process a "meaningful" (semantic) event like "text changed".
113.14 + * <p>
113.15 + * An unspecified behavior will be caused if the {@code id} parameter
113.16 + * of any particular {@code TextEvent} instance is not
113.17 + * in the range from {@code TEXT_FIRST} to {@code TEXT_LAST}.
113.18 *
113.19 * @author Georges Saab
113.20 *
113.21 * @see java.awt.TextComponent
113.22 * @see TextListener
113.23 - * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/textlistener.html">Tutorial: Writing a Text Listener</a>
113.24 *
113.25 * @since 1.1
113.26 */
113.27 @@ -72,15 +75,18 @@
113.28
113.29 /**
113.30 * Constructs a <code>TextEvent</code> object.
113.31 - * <p>Note that passing in an invalid <code>id</code> results in
113.32 - * unspecified behavior. This method throws an
113.33 + * <p> This method throws an
113.34 * <code>IllegalArgumentException</code> if <code>source</code>
113.35 * is <code>null</code>.
113.36 *
113.37 - * @param source the (<code>TextComponent</code>) object that
113.38 + * @param source The (<code>TextComponent</code>) object that
113.39 * originated the event
113.40 - * @param id an integer that identifies the event type
113.41 + * @param id An integer that identifies the event type.
113.42 + * For information on allowable values, see
113.43 + * the class description for {@link TextEvent}
113.44 * @throws IllegalArgumentException if <code>source</code> is null
113.45 + * @see #getSource()
113.46 + * @see #getID()
113.47 */
113.48 public TextEvent(Object source, int id) {
113.49 super(source, id);
114.1 --- a/src/share/classes/java/awt/event/TextListener.java Mon May 12 18:06:23 2008 -0700
114.2 +++ b/src/share/classes/java/awt/event/TextListener.java Fri May 16 12:25:57 2008 -0700
114.3 @@ -1,5 +1,5 @@
114.4 /*
114.5 - * Copyright 1996-2006 Sun Microsystems, Inc. All Rights Reserved.
114.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
114.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
114.8 *
114.9 * This code is free software; you can redistribute it and/or modify it
114.10 @@ -40,7 +40,6 @@
114.11 * @author Georges Saab
114.12 *
114.13 * @see TextEvent
114.14 - * @see <a href="http://java.sun.com/docs/books/tutorial/post1.0/ui/textlistener.html">Tutorial: Writing a Text Listener</a>
114.15 *
114.16 * @since 1.1
114.17 */
115.1 --- a/src/share/classes/java/awt/event/WindowEvent.java Mon May 12 18:06:23 2008 -0700
115.2 +++ b/src/share/classes/java/awt/event/WindowEvent.java Fri May 16 12:25:57 2008 -0700
115.3 @@ -41,6 +41,10 @@
115.4 * (<code>WindowAdapter</code> objects implement the
115.5 * <code>WindowListener</code> interface.) Each such listener object
115.6 * gets this <code>WindowEvent</code> when the event occurs.
115.7 + * <p>
115.8 + * An unspecified behavior will be caused if the {@code id} parameter
115.9 + * of any particular {@code WindowEvent} instance is not
115.10 + * in the range from {@code WINDOW_FIRST} to {@code WINDOW_LAST}.
115.11 *
115.12 * @author Carl Quinn
115.13 * @author Amy Fowler
115.14 @@ -170,20 +174,27 @@
115.15
115.16 /**
115.17 * Constructs a <code>WindowEvent</code> object.
115.18 - * <p>Note that passing in an invalid <code>id</code> results in
115.19 - * unspecified behavior. This method throws an
115.20 + * <p>This method throws an
115.21 * <code>IllegalArgumentException</code> if <code>source</code>
115.22 * is <code>null</code>.
115.23 *
115.24 - * @param source the <code>Window</code> object
115.25 + * @param source The <code>Window</code> object
115.26 * that originated the event
115.27 - * @param id an integer indicating the type of event.
115.28 - * @param opposite the other window involved in the focus or activation
115.29 + * @param id An integer indicating the type of event.
115.30 + * For information on allowable values, see
115.31 + * the class description for {@link WindowEvent}
115.32 + * @param opposite The other window involved in the focus or activation
115.33 * change, or <code>null</code>
115.34 - * @param oldState previous state of the window for window state
115.35 - * change event
115.36 - * @param newState new state of the window for window state change event
115.37 + * @param oldState Previous state of the window for window state change event.
115.38 + * See {@code #getOldState()} for allowable values
115.39 + * @param newState New state of the window for window state change event.
115.40 + * See {@code #getNewState()} for allowable values
115.41 * @throws IllegalArgumentException if <code>source</code> is null
115.42 + * @see #getWindow()
115.43 + * @see #getID()
115.44 + * @see #getOppositeWindow()
115.45 + * @see #getOldState()
115.46 + * @see #getNewState()
115.47 * @since 1.4
115.48 */
115.49 public WindowEvent(Window source, int id, Window opposite,
115.50 @@ -209,24 +220,28 @@
115.51 * If this focus change occurs with a native application, with a
115.52 * Java application in a different VM, or with no other
115.53 * <code>Window</code>, then the opposite Window is <code>null</code>.
115.54 - * <p>Note that passing in an invalid <code>id</code> results in
115.55 - * unspecified behavior. This method throws an
115.56 + * <p>This method throws an
115.57 * <code>IllegalArgumentException</code> if <code>source</code>
115.58 * is <code>null</code>.
115.59 *
115.60 - * @param source the <code>Window</code> object that
115.61 + * @param source The <code>Window</code> object that
115.62 * originated the event
115.63 - * @param id <code>WINDOW_ACTIVATED</code>,
115.64 - * <code>WINDOW_DEACTIVATED</code>,
115.65 - * <code>WINDOW_GAINED_FOCUS</code>,
115.66 - * or <code>WINDOW_LOST_FOCUS</code>. It is
115.67 - * expected that this constructor will not be used for
115.68 - * other <code>WindowEvent</code> types because the
115.69 - * opposite <code>Window</code> of such events
115.70 - * will always be <code>null</code>
115.71 - * @param opposite the other <code>Window</code> involved in the
115.72 + * @param id An integer indicating the type of event.
115.73 + * For information on allowable values, see
115.74 + * the class description for {@link WindowEvent}.
115.75 + * It is expected that this constructor will not
115.76 + * be used for other then
115.77 + * {@code WINDOW_ACTIVATED},{@code WINDOW_DEACTIVATED},
115.78 + * {@code WINDOW_GAINED_FOCUS}, or {@code WINDOW_LOST_FOCUS}.
115.79 + * {@code WindowEvent} types,
115.80 + * because the opposite <code>Window</code> of other event types
115.81 + * will always be {@code null}.
115.82 + * @param opposite The other <code>Window</code> involved in the
115.83 * focus or activation change, or <code>null</code>
115.84 * @throws IllegalArgumentException if <code>source</code> is null
115.85 + * @see #getWindow()
115.86 + * @see #getID()
115.87 + * @see #getOppositeWindow()
115.88 * @since 1.4
115.89 */
115.90 public WindowEvent(Window source, int id, Window opposite) {
115.91 @@ -236,21 +251,30 @@
115.92 /**
115.93 * Constructs a <code>WindowEvent</code> object with the specified
115.94 * previous and new window states.
115.95 - * <p>Note that passing in an invalid <code>id</code> results in
115.96 - * unspecified behavior. This method throws an
115.97 + * <p>This method throws an
115.98 * <code>IllegalArgumentException</code> if <code>source</code>
115.99 * is <code>null</code>.
115.100 *
115.101 - * @param source the <code>Window</code> object
115.102 + * @param source The <code>Window</code> object
115.103 * that originated the event
115.104 - * @param id <code>WINDOW_STATE_CHANGED</code> event type.
115.105 + * @param id An integer indicating the type of event.
115.106 + * For information on allowable values, see
115.107 + * the class description for {@link WindowEvent}.
115.108 * It is expected that this constructor will not
115.109 - * be used for other <code>WindowEvent</code>
115.110 + * be used for other then
115.111 + * {@code WINDOW_STATE_CHANGED}
115.112 + * {@code WindowEvent}
115.113 * types, because the previous and new window
115.114 * states are meaningless for other event types.
115.115 - * @param oldState an integer representing the previous window state
115.116 - * @param newState an integer representing the new window state
115.117 + * @param oldState An integer representing the previous window state.
115.118 + * See {@code #getOldState()} for allowable values
115.119 + * @param newState An integer representing the new window state.
115.120 + * See {@code #getNewState()} for allowable values
115.121 * @throws IllegalArgumentException if <code>source</code> is null
115.122 + * @see #getWindow()
115.123 + * @see #getID()
115.124 + * @see #getOldState()
115.125 + * @see #getNewState()
115.126 * @since 1.4
115.127 */
115.128 public WindowEvent(Window source, int id, int oldState, int newState) {
115.129 @@ -259,14 +283,17 @@
115.130
115.131 /**
115.132 * Constructs a <code>WindowEvent</code> object.
115.133 - * <p>Note that passing in an invalid <code>id</code> results in
115.134 - * unspecified behavior. This method throws an
115.135 + * <p>This method throws an
115.136 * <code>IllegalArgumentException</code> if <code>source</code>
115.137 * is <code>null</code>.
115.138 *
115.139 - * @param source the <code>Window</code> object that originated the event
115.140 - * @param id an integer indicating the type of event
115.141 + * @param source The <code>Window</code> object that originated the event
115.142 + * @param id An integer indicating the type of event.
115.143 + * For information on allowable values, see
115.144 + * the class description for {@link WindowEvent}.
115.145 * @throws IllegalArgumentException if <code>source</code> is null
115.146 + * @see #getWindow()
115.147 + * @see #getID()
115.148 */
115.149 public WindowEvent(Window source, int id) {
115.150 this(source, id, null, 0, 0);
116.1 --- a/src/share/classes/java/awt/geom/RectangularShape.java Mon May 12 18:06:23 2008 -0700
116.2 +++ b/src/share/classes/java/awt/geom/RectangularShape.java Fri May 16 12:25:57 2008 -0700
116.3 @@ -1,5 +1,5 @@
116.4 /*
116.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
116.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
116.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
116.8 *
116.9 * This code is free software; you can redistribute it and/or modify it
116.10 @@ -27,6 +27,7 @@
116.11
116.12 import java.awt.Shape;
116.13 import java.awt.Rectangle;
116.14 +import java.beans.Transient;
116.15
116.16 /**
116.17 * <code>RectangularShape</code> is the base class for a number of
116.18 @@ -171,6 +172,7 @@
116.19 * @see #setFrame(Rectangle2D)
116.20 * @since 1.2
116.21 */
116.22 + @Transient
116.23 public Rectangle2D getFrame() {
116.24 return new Rectangle2D.Double(getX(), getY(), getWidth(), getHeight());
116.25 }
117.1 --- a/src/share/classes/java/awt/im/InputContext.java Mon May 12 18:06:23 2008 -0700
117.2 +++ b/src/share/classes/java/awt/im/InputContext.java Fri May 16 12:25:57 2008 -0700
117.3 @@ -1,5 +1,5 @@
117.4 /*
117.5 - * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved.
117.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
117.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
117.8 *
117.9 * This code is free software; you can redistribute it and/or modify it
117.10 @@ -28,6 +28,7 @@
117.11 import java.awt.Component;
117.12 import java.util.Locale;
117.13 import java.awt.AWTEvent;
117.14 +import java.beans.Transient;
117.15 import java.lang.Character.Subset;
117.16 import sun.awt.im.InputMethodContext;
117.17
117.18 @@ -231,6 +232,7 @@
117.19 * @see #setCompositionEnabled
117.20 * @since 1.3
117.21 */
117.22 + @Transient
117.23 public boolean isCompositionEnabled() {
117.24 // real implementation is in sun.awt.im.InputContext
117.25 return false;
118.1 --- a/src/share/classes/java/awt/image/BufferedImage.java Mon May 12 18:06:23 2008 -0700
118.2 +++ b/src/share/classes/java/awt/image/BufferedImage.java Fri May 16 12:25:57 2008 -0700
118.3 @@ -1210,9 +1210,9 @@
118.4 * <code>BufferedImage</code>.
118.5 */
118.6 public String toString() {
118.7 - return new String("BufferedImage@"+Integer.toHexString(hashCode())
118.8 - +": type = "+imageType
118.9 - +" "+colorModel+" "+raster);
118.10 + return "BufferedImage@"+Integer.toHexString(hashCode())
118.11 + +": type = "+imageType
118.12 + +" "+colorModel+" "+raster;
118.13 }
118.14
118.15 /**
119.1 --- a/src/share/classes/java/beans/DefaultPersistenceDelegate.java Mon May 12 18:06:23 2008 -0700
119.2 +++ b/src/share/classes/java/beans/DefaultPersistenceDelegate.java Fri May 16 12:25:57 2008 -0700
119.3 @@ -1,5 +1,5 @@
119.4 /*
119.5 - * Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
119.6 + * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
119.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
119.8 *
119.9 * This code is free software; you can redistribute it and/or modify it
119.10 @@ -164,53 +164,19 @@
119.11 return new Expression(oldInstance, oldInstance.getClass(), "new", constructorArgs);
119.12 }
119.13
119.14 - private Method findMethod(Class type, String property) throws IntrospectionException {
119.15 + private Method findMethod(Class type, String property) {
119.16 if (property == null) {
119.17 throw new IllegalArgumentException("Property name is null");
119.18 }
119.19 - BeanInfo info = Introspector.getBeanInfo(type);
119.20 - for (PropertyDescriptor pd : info.getPropertyDescriptors()) {
119.21 - if (property.equals(pd.getName())) {
119.22 - Method method = pd.getReadMethod();
119.23 - if (method != null) {
119.24 - return method;
119.25 - }
119.26 - throw new IllegalStateException("Could not find getter for the property " + property);
119.27 - }
119.28 + PropertyDescriptor pd = getPropertyDescriptor(type, property);
119.29 + if (pd == null) {
119.30 + throw new IllegalStateException("Could not find property by the name " + property);
119.31 }
119.32 - throw new IllegalStateException("Could not find property by the name " + property);
119.33 - }
119.34 -
119.35 - // This is a workaround for a bug in the introspector.
119.36 - // PropertyDescriptors are not shared amongst subclasses.
119.37 - private boolean isTransient(Class type, PropertyDescriptor pd) {
119.38 - if (type == null) {
119.39 - return false;
119.40 + Method method = pd.getReadMethod();
119.41 + if (method == null) {
119.42 + throw new IllegalStateException("Could not find getter for the property " + property);
119.43 }
119.44 - // This code was mistakenly deleted - it may be fine and
119.45 - // is more efficient than the code below. This should
119.46 - // all disappear anyway when property descriptors are shared
119.47 - // by the introspector.
119.48 - /*
119.49 - Method getter = pd.getReadMethod();
119.50 - Class declaringClass = getter.getDeclaringClass();
119.51 - if (declaringClass == type) {
119.52 - return Boolean.TRUE.equals(pd.getValue("transient"));
119.53 - }
119.54 - */
119.55 - String pName = pd.getName();
119.56 - BeanInfo info = MetaData.getBeanInfo(type);
119.57 - PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
119.58 - for (int i = 0; i < propertyDescriptors.length; ++i ) {
119.59 - PropertyDescriptor pd2 = propertyDescriptors[i];
119.60 - if (pName.equals(pd2.getName())) {
119.61 - Object value = pd2.getValue("transient");
119.62 - if (value != null) {
119.63 - return Boolean.TRUE.equals(value);
119.64 - }
119.65 - }
119.66 - }
119.67 - return isTransient(type.getSuperclass(), pd);
119.68 + return method;
119.69 }
119.70
119.71 private static boolean equals(Object o1, Object o2) {
119.72 @@ -221,7 +187,7 @@
119.73 Method getter = pd.getReadMethod();
119.74 Method setter = pd.getWriteMethod();
119.75
119.76 - if (getter != null && setter != null && !isTransient(type, pd)) {
119.77 + if (getter != null && setter != null) {
119.78 Expression oldGetExp = new Expression(oldInstance, getter.getName(), new Object[]{});
119.79 Expression newGetExp = new Expression(newInstance, getter.getName(), new Object[]{});
119.80 Object oldValue = oldGetExp.getValue();
119.81 @@ -254,14 +220,19 @@
119.82
119.83 // Write out the properties of this instance.
119.84 private void initBean(Class type, Object oldInstance, Object newInstance, Encoder out) {
119.85 - // System.out.println("initBean: " + oldInstance);
119.86 - BeanInfo info = MetaData.getBeanInfo(type);
119.87 -
119.88 + BeanInfo info;
119.89 + try {
119.90 + info = Introspector.getBeanInfo(type);
119.91 + } catch (IntrospectionException exception) {
119.92 + return;
119.93 + }
119.94 // Properties
119.95 - PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
119.96 - for (int i = 0; i < propertyDescriptors.length; ++i ) {
119.97 + for (PropertyDescriptor d : info.getPropertyDescriptors()) {
119.98 + if (d.isTransient()) {
119.99 + continue;
119.100 + }
119.101 try {
119.102 - doProperty(type, propertyDescriptors[i], oldInstance, newInstance, out);
119.103 + doProperty(type, d, oldInstance, newInstance, out);
119.104 }
119.105 catch (Exception e) {
119.106 out.getExceptionListener().exceptionThrown(e);
119.107 @@ -295,9 +266,10 @@
119.108 if (!java.awt.Component.class.isAssignableFrom(type)) {
119.109 return; // Just handle the listeners of Components for now.
119.110 }
119.111 - EventSetDescriptor[] eventSetDescriptors = info.getEventSetDescriptors();
119.112 - for (int e = 0; e < eventSetDescriptors.length; e++) {
119.113 - EventSetDescriptor d = eventSetDescriptors[e];
119.114 + for (EventSetDescriptor d : info.getEventSetDescriptors()) {
119.115 + if (d.isTransient()) {
119.116 + continue;
119.117 + }
119.118 Class listenerType = d.getListenerType();
119.119
119.120
119.121 @@ -408,4 +380,15 @@
119.122 initBean(type, oldInstance, newInstance, out);
119.123 }
119.124 }
119.125 +
119.126 + private static PropertyDescriptor getPropertyDescriptor(Class type, String property) {
119.127 + try {
119.128 + for (PropertyDescriptor pd : Introspector.getBeanInfo(type).getPropertyDescriptors()) {
119.129 + if (property.equals(pd.getName()))
119.130 + return pd;
119.131 + }
119.132 + } catch (IntrospectionException exception) {
119.133 + }
119.134 + return null;
119.135 + }
119.136 }
120.1 --- a/src/share/classes/java/beans/EventSetDescriptor.java Mon May 12 18:06:23 2008 -0700
120.2 +++ b/src/share/classes/java/beans/EventSetDescriptor.java Fri May 16 12:25:57 2008 -0700
120.3 @@ -1,5 +1,5 @@
120.4 /*
120.5 - * Copyright 1996-2005 Sun Microsystems, Inc. All Rights Reserved.
120.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
120.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
120.8 *
120.9 * This code is free software; you can redistribute it and/or modify it
120.10 @@ -369,6 +369,7 @@
120.11 setClass0(method.getDeclaringClass());
120.12 }
120.13 addMethodDescriptor = new MethodDescriptor(method);
120.14 + setTransient(method.getAnnotation(Transient.class));
120.15 }
120.16
120.17 /**
120.18 @@ -389,6 +390,7 @@
120.19 setClass0(method.getDeclaringClass());
120.20 }
120.21 removeMethodDescriptor = new MethodDescriptor(method);
120.22 + setTransient(method.getAnnotation(Transient.class));
120.23 }
120.24
120.25 /**
120.26 @@ -411,6 +413,7 @@
120.27 setClass0(method.getDeclaringClass());
120.28 }
120.29 getMethodDescriptor = new MethodDescriptor(method);
120.30 + setTransient(method.getAnnotation(Transient.class));
120.31 }
120.32
120.33 /**
121.1 --- a/src/share/classes/java/beans/FeatureDescriptor.java Mon May 12 18:06:23 2008 -0700
121.2 +++ b/src/share/classes/java/beans/FeatureDescriptor.java Fri May 16 12:25:57 2008 -0700
121.3 @@ -1,5 +1,5 @@
121.4 /*
121.5 - * Copyright 1996-2004 Sun Microsystems, Inc. All Rights Reserved.
121.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
121.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
121.8 *
121.9 * This code is free software; you can redistribute it and/or modify it
121.10 @@ -32,7 +32,9 @@
121.11 import java.lang.ref.SoftReference;
121.12
121.13 import java.lang.reflect.Method;
121.14 -import java.lang.reflect.Type;
121.15 +
121.16 +import java.util.Enumeration;
121.17 +import java.util.Hashtable;
121.18
121.19 /**
121.20 * The FeatureDescriptor class is the common baseclass for PropertyDescriptor,
121.21 @@ -46,6 +48,7 @@
121.22 */
121.23
121.24 public class FeatureDescriptor {
121.25 + private static final String TRANSIENT = "transient";
121.26
121.27 private Reference<Class> classRef;
121.28
121.29 @@ -187,10 +190,7 @@
121.30 * @param value The value.
121.31 */
121.32 public void setValue(String attributeName, Object value) {
121.33 - if (table == null) {
121.34 - table = new java.util.Hashtable();
121.35 - }
121.36 - table.put(attributeName, value);
121.37 + getTable().put(attributeName, value);
121.38 }
121.39
121.40 /**
121.41 @@ -201,10 +201,9 @@
121.42 * the attribute is unknown.
121.43 */
121.44 public Object getValue(String attributeName) {
121.45 - if (table == null) {
121.46 - return null;
121.47 - }
121.48 - return table.get(attributeName);
121.49 + return (this.table != null)
121.50 + ? this.table.get(attributeName)
121.51 + : null;
121.52 }
121.53
121.54 /**
121.55 @@ -214,11 +213,8 @@
121.56 * @return An enumeration of the locale-independent names of any
121.57 * attributes that have been registered with setValue.
121.58 */
121.59 - public java.util.Enumeration<String> attributeNames() {
121.60 - if (table == null) {
121.61 - table = new java.util.Hashtable();
121.62 - }
121.63 - return table.keys();
121.64 + public Enumeration<String> attributeNames() {
121.65 + return getTable().keys();
121.66 }
121.67
121.68 /**
121.69 @@ -268,16 +264,54 @@
121.70 addTable(old.table);
121.71 }
121.72
121.73 - private void addTable(java.util.Hashtable t) {
121.74 - if (t == null) {
121.75 - return;
121.76 + /**
121.77 + * Copies all values from the specified attribute table.
121.78 + * If some attribute is exist its value should be overridden.
121.79 + *
121.80 + * @param table the attribute table with new values
121.81 + */
121.82 + private void addTable(Hashtable<String, Object> table) {
121.83 + if ((table != null) && !table.isEmpty()) {
121.84 + getTable().putAll(table);
121.85 }
121.86 - java.util.Enumeration keys = t.keys();
121.87 - while (keys.hasMoreElements()) {
121.88 - String key = (String)keys.nextElement();
121.89 - Object value = t.get(key);
121.90 - setValue(key, value);
121.91 + }
121.92 +
121.93 + /**
121.94 + * Returns the initialized attribute table.
121.95 + *
121.96 + * @return the initialized attribute table
121.97 + */
121.98 + private Hashtable<String, Object> getTable() {
121.99 + if (this.table == null) {
121.100 + this.table = new Hashtable<String, Object>();
121.101 }
121.102 + return this.table;
121.103 + }
121.104 +
121.105 + /**
121.106 + * Sets the "transient" attribute according to the annotation.
121.107 + * If the "transient" attribute is already set
121.108 + * it should not be changed.
121.109 + *
121.110 + * @param annotation the annotation of the element of the feature
121.111 + */
121.112 + void setTransient(Transient annotation) {
121.113 + if ((annotation != null) && (null == getValue(TRANSIENT))) {
121.114 + setValue(TRANSIENT, annotation.value());
121.115 + }
121.116 + }
121.117 +
121.118 + /**
121.119 + * Indicates whether the feature is transient.
121.120 + *
121.121 + * @return {@code true} if the feature is transient,
121.122 + * {@code false} otherwise
121.123 + */
121.124 + boolean isTransient() {
121.125 + Object value = getValue(TRANSIENT);
121.126 + return (value instanceof Boolean)
121.127 + ? (Boolean) value
121.128 + : false;
121.129 }
121.130
121.131 // Package private methods for recreating the weak/soft referent
121.132 @@ -293,39 +327,6 @@
121.133 }
121.134
121.135 /**
121.136 - * Create a Reference wrapper for the object.
121.137 - *
121.138 - * @param obj object that will be wrapped
121.139 - * @param soft true if a SoftReference should be created; otherwise Soft
121.140 - * @return a Reference or null if obj is null.
121.141 - */
121.142 - static Reference createReference(Object obj, boolean soft) {
121.143 - Reference ref = null;
121.144 - if (obj != null) {
121.145 - if (soft) {
121.146 - ref = new SoftReference(obj);
121.147 - } else {
121.148 - ref = new WeakReference(obj);
121.149 - }
121.150 - }
121.151 - return ref;
121.152 - }
121.153 -
121.154 - // Convenience method which creates a WeakReference.
121.155 - static Reference createReference(Object obj) {
121.156 - return createReference(obj, false);
121.157 - }
121.158 -
121.159 - /**
121.160 - * Returns an object from a Reference wrapper.
121.161 - *
121.162 - * @return the Object in a wrapper or null.
121.163 - */
121.164 - static Object getObject(Reference ref) {
121.165 - return (ref == null) ? null : (Object)ref.get();
121.166 - }
121.167 -
121.168 - /**
121.169 * Creates a new soft reference that refers to the given object.
121.170 *
121.171 * @return a new soft reference or <code>null</code> if object is <code>null</code>
121.172 @@ -391,5 +392,5 @@
121.173 private String shortDescription;
121.174 private String name;
121.175 private String displayName;
121.176 - private java.util.Hashtable table;
121.177 + private Hashtable<String, Object> table;
121.178 }
122.1 --- a/src/share/classes/java/beans/IndexedPropertyDescriptor.java Mon May 12 18:06:23 2008 -0700
122.2 +++ b/src/share/classes/java/beans/IndexedPropertyDescriptor.java Fri May 16 12:25:57 2008 -0700
122.3 @@ -1,5 +1,5 @@
122.4 /*
122.5 - * Copyright 1996-2004 Sun Microsystems, Inc. All Rights Reserved.
122.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
122.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
122.8 *
122.9 * This code is free software; you can redistribute it and/or modify it
122.10 @@ -231,6 +231,7 @@
122.11
122.12 indexedReadMethodName = readMethod.getName();
122.13 this.indexedReadMethodRef = getSoftReference(readMethod);
122.14 + setTransient(readMethod.getAnnotation(Transient.class));
122.15 }
122.16
122.17
122.18 @@ -303,6 +304,7 @@
122.19
122.20 indexedWriteMethodName = writeMethod.getName();
122.21 this.indexedWriteMethodRef = getSoftReference(writeMethod);
122.22 + setTransient(writeMethod.getAnnotation(Transient.class));
122.23 }
122.24
122.25 /**
123.1 --- a/src/share/classes/java/beans/MetaData.java Mon May 12 18:06:23 2008 -0700
123.2 +++ b/src/share/classes/java/beans/MetaData.java Fri May 16 12:25:57 2008 -0700
123.3 @@ -1,5 +1,5 @@
123.4 /*
123.5 - * Copyright 2000-2007 Sun Microsystems, Inc. All Rights Reserved.
123.6 + * Copyright 2000-2008 Sun Microsystems, Inc. All Rights Reserved.
123.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
123.8 *
123.9 * This code is free software; you can redistribute it and/or modify it
123.10 @@ -1352,7 +1352,6 @@
123.11
123.12 class MetaData {
123.13 private static Hashtable internalPersistenceDelegates = new Hashtable();
123.14 - private static Hashtable transientProperties = new Hashtable();
123.15
123.16 private static PersistenceDelegate nullPersistenceDelegate = new NullPersistenceDelegate();
123.17 private static PersistenceDelegate enumPersistenceDelegate = new EnumPersistenceDelegate();
123.18 @@ -1383,94 +1382,6 @@
123.19
123.20 internalPersistenceDelegates.put("java.util.JumboEnumSet", new java_util_EnumSet_PersistenceDelegate());
123.21 internalPersistenceDelegates.put("java.util.RegularEnumSet", new java_util_EnumSet_PersistenceDelegate());
123.22 -
123.23 -// Transient properties
123.24 -
123.25 - // awt
123.26 -
123.27 - // Infinite graphs.
123.28 - removeProperty("java.awt.geom.RectangularShape", "frame");
123.29 - // removeProperty("java.awt.Rectangle2D", "frame");
123.30 - // removeProperty("java.awt.Rectangle", "frame");
123.31 -
123.32 - removeProperty("java.awt.Rectangle", "bounds");
123.33 - removeProperty("java.awt.Dimension", "size");
123.34 - removeProperty("java.awt.Point", "location");
123.35 -
123.36 - // The color and font properties in Component need special treatment, see above.
123.37 - removeProperty("java.awt.Component", "foreground");
123.38 - removeProperty("java.awt.Component", "background");
123.39 - removeProperty("java.awt.Component", "font");
123.40 -
123.41 - // The visible property of Component needs special treatment because of Windows.
123.42 - removeProperty("java.awt.Component", "visible");
123.43 -
123.44 - // This property throws an exception if accessed when there is no child.
123.45 - removeProperty("java.awt.ScrollPane", "scrollPosition");
123.46 -
123.47 - // 4917458 this should be removed for XAWT since it may throw
123.48 - // an unsupported exception if there isn't any input methods.
123.49 - // This shouldn't be a problem since these are added behind
123.50 - // the scenes automatically.
123.51 - removeProperty("java.awt.im.InputContext", "compositionEnabled");
123.52 -
123.53 - // swing
123.54 -
123.55 - // The size properties in JComponent need special treatment, see above.
123.56 - removeProperty("javax.swing.JComponent", "minimumSize");
123.57 - removeProperty("javax.swing.JComponent", "preferredSize");
123.58 - removeProperty("javax.swing.JComponent", "maximumSize");
123.59 -
123.60 - // These properties have platform specific implementations
123.61 - // and should not appear in archives.
123.62 - removeProperty("javax.swing.ImageIcon", "image");
123.63 - removeProperty("javax.swing.ImageIcon", "imageObserver");
123.64 -
123.65 - // This property unconditionally throws a "not implemented" exception.
123.66 - removeProperty("javax.swing.JMenuBar", "helpMenu");
123.67 -
123.68 - // The scrollBars in a JScrollPane are dynamic and should not
123.69 - // be archived. The row and columns headers are changed by
123.70 - // components like JTable on "addNotify".
123.71 - removeProperty("javax.swing.JScrollPane", "verticalScrollBar");
123.72 - removeProperty("javax.swing.JScrollPane", "horizontalScrollBar");
123.73 - removeProperty("javax.swing.JScrollPane", "rowHeader");
123.74 - removeProperty("javax.swing.JScrollPane", "columnHeader");
123.75 -
123.76 - removeProperty("javax.swing.JViewport", "extentSize");
123.77 -
123.78 - // Renderers need special treatment, since their properties
123.79 - // change during rendering.
123.80 - removeProperty("javax.swing.table.JTableHeader", "defaultRenderer");
123.81 - removeProperty("javax.swing.JList", "cellRenderer");
123.82 -
123.83 - removeProperty("javax.swing.JList", "selectedIndices");
123.84 -
123.85 - // The lead and anchor selection indexes are best ignored.
123.86 - // Selection is rarely something that should persist from
123.87 - // development to deployment.
123.88 - removeProperty("javax.swing.DefaultListSelectionModel", "leadSelectionIndex");
123.89 - removeProperty("javax.swing.DefaultListSelectionModel", "anchorSelectionIndex");
123.90 -
123.91 - // The selection must come after the text itself.
123.92 - removeProperty("javax.swing.JComboBox", "selectedIndex");
123.93 -
123.94 - // All selection information should come after the JTabbedPane is built
123.95 - removeProperty("javax.swing.JTabbedPane", "selectedIndex");
123.96 - removeProperty("javax.swing.JTabbedPane", "selectedComponent");
123.97 -
123.98 - // PENDING: The "disabledIcon" property is often computed from the icon property.
123.99 - removeProperty("javax.swing.AbstractButton", "disabledIcon");
123.100 - removeProperty("javax.swing.JLabel", "disabledIcon");
123.101 -
123.102 - // The caret property throws errors when it it set beyond
123.103 - // the extent of the text. We could just set it after the
123.104 - // text, but this is probably not something we want to archive anyway.
123.105 - removeProperty("javax.swing.text.JTextComponent", "caret");
123.106 - removeProperty("javax.swing.text.JTextComponent", "caretPosition");
123.107 - // The selectionStart must come after the text itself.
123.108 - removeProperty("javax.swing.text.JTextComponent", "selectionStart");
123.109 - removeProperty("javax.swing.text.JTextComponent", "selectionEnd");
123.110 }
123.111
123.112 /*pp*/ static boolean equals(Object o1, Object o2) {
123.113 @@ -1509,18 +1420,6 @@
123.114 // }
123.115
123.116 String typeName = type.getName();
123.117 -
123.118 - // Check to see if there are properties that have been lazily registered for removal.
123.119 - if (getBeanAttribute(type, "transient_init") == null) {
123.120 - Vector tp = (Vector)transientProperties.get(typeName);
123.121 - if (tp != null) {
123.122 - for(int i = 0; i < tp.size(); i++) {
123.123 - setPropertyAttribute(type, (String)tp.get(i), "transient", Boolean.TRUE);
123.124 - }
123.125 - }
123.126 - setBeanAttribute(type, "transient_init", Boolean.TRUE);
123.127 - }
123.128 -
123.129 PersistenceDelegate pd = (PersistenceDelegate)getBeanAttribute(type, "persistenceDelegate");
123.130 if (pd == null) {
123.131 pd = (PersistenceDelegate)internalPersistenceDelegates.get(typeName);
123.132 @@ -1583,55 +1482,11 @@
123.133 return true;
123.134 }
123.135
123.136 - // Wrapper for Introspector.getBeanInfo to handle exception handling.
123.137 - // Note: this relys on new 1.4 Introspector semantics which cache the BeanInfos
123.138 - public static BeanInfo getBeanInfo(Class type) {
123.139 - BeanInfo info = null;
123.140 + private static Object getBeanAttribute(Class type, String attribute) {
123.141 try {
123.142 - info = Introspector.getBeanInfo(type);
123.143 - } catch (Throwable e) {
123.144 - e.printStackTrace();
123.145 + return Introspector.getBeanInfo(type).getBeanDescriptor().getValue(attribute);
123.146 + } catch (IntrospectionException exception) {
123.147 + return null;
123.148 }
123.149 -
123.150 - return info;
123.151 - }
123.152 -
123.153 - private static PropertyDescriptor getPropertyDescriptor(Class type, String propertyName) {
123.154 - BeanInfo info = getBeanInfo(type);
123.155 - PropertyDescriptor[] propertyDescriptors = info.getPropertyDescriptors();
123.156 - // System.out.println("Searching for: " + propertyName + " in " + type);
123.157 - for(int i = 0; i < propertyDescriptors.length; i++) {
123.158 - PropertyDescriptor pd = propertyDescriptors[i];
123.159 - if (propertyName.equals(pd.getName())) {
123.160 - return pd;
123.161 - }
123.162 - }
123.163 - return null;
123.164 - }
123.165 -
123.166 - private static void setPropertyAttribute(Class type, String property, String attribute, Object value) {
123.167 - PropertyDescriptor pd = getPropertyDescriptor(type, property);
123.168 - if (pd == null) {
123.169 - System.err.println("Warning: property " + property + " is not defined on " + type);
123.170 - return;
123.171 - }
123.172 - pd.setValue(attribute, value);
123.173 - }
123.174 -
123.175 - private static void setBeanAttribute(Class type, String attribute, Object value) {
123.176 - getBeanInfo(type).getBeanDescriptor().setValue(attribute, value);
123.177 - }
123.178 -
123.179 - private static Object getBeanAttribute(Class type, String attribute) {
123.180 - return getBeanInfo(type).getBeanDescriptor().getValue(attribute);
123.181 - }
123.182 -
123.183 - private static void removeProperty(String typeName, String property) {
123.184 - Vector tp = (Vector)transientProperties.get(typeName);
123.185 - if (tp == null) {
123.186 - tp = new Vector();
123.187 - transientProperties.put(typeName, tp);
123.188 - }
123.189 - tp.add(property);
123.190 }
123.191 }
124.1 --- a/src/share/classes/java/beans/PropertyDescriptor.java Mon May 12 18:06:23 2008 -0700
124.2 +++ b/src/share/classes/java/beans/PropertyDescriptor.java Fri May 16 12:25:57 2008 -0700
124.3 @@ -1,5 +1,5 @@
124.4 /*
124.5 - * Copyright 1996-2004 Sun Microsystems, Inc. All Rights Reserved.
124.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
124.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
124.8 *
124.9 * This code is free software; you can redistribute it and/or modify it
124.10 @@ -256,6 +256,7 @@
124.11
124.12 readMethodName = readMethod.getName();
124.13 this.readMethodRef = getSoftReference(readMethod);
124.14 + setTransient(readMethod.getAnnotation(Transient.class));
124.15 }
124.16
124.17 /**
124.18 @@ -320,7 +321,7 @@
124.19
124.20 writeMethodName = writeMethod.getName();
124.21 this.writeMethodRef = getSoftReference(writeMethod);
124.22 -
124.23 + setTransient(writeMethod.getAnnotation(Transient.class));
124.24 }
124.25
124.26 private Method getReadMethod0() {
125.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
125.2 +++ b/src/share/classes/java/beans/Transient.java Fri May 16 12:25:57 2008 -0700
125.3 @@ -0,0 +1,68 @@
125.4 +/*
125.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
125.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
125.7 + *
125.8 + * This code is free software; you can redistribute it and/or modify it
125.9 + * under the terms of the GNU General Public License version 2 only, as
125.10 + * published by the Free Software Foundation. Sun designates this
125.11 + * particular file as subject to the "Classpath" exception as provided
125.12 + * by Sun in the LICENSE file that accompanied this code.
125.13 + *
125.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
125.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
125.16 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
125.17 + * version 2 for more details (a copy is included in the LICENSE file that
125.18 + * accompanied this code).
125.19 + *
125.20 + * You should have received a copy of the GNU General Public License version
125.21 + * 2 along with this work; if not, write to the Free Software Foundation,
125.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
125.23 + *
125.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
125.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
125.26 + * have any questions.
125.27 + */
125.28 +
125.29 +package java.beans;
125.30 +
125.31 +import java.lang.annotation.Retention;
125.32 +import java.lang.annotation.Target;
125.33 +
125.34 +import static java.lang.annotation.ElementType.METHOD;
125.35 +import static java.lang.annotation.RetentionPolicy.RUNTIME;
125.36 +
125.37 +/**
125.38 + * Indicates that an attribute called "transient"
125.39 + * should be declared with the given {@code value}
125.40 + * when the {@link Introspector} constructs
125.41 + * a {@link PropertyDescriptor} or {@link EventSetDescriptor}
125.42 + * classes associated with the annotated code element.
125.43 + * A {@code true} value for the "transient" attribute
125.44 + * indicates to encoders derived from {@link Encoder}
125.45 + * that this feature should be ignored.
125.46 + * <p/>
125.47 + * The {@code Transient} annotation may be be used
125.48 + * in any of the methods that are involved
125.49 + * in a {@link FeatureDescriptor} subclass
125.50 + * to identify the transient feature in the annotated class and its subclasses.
125.51 + * Normally, the method that starts with "get" is the best place
125.52 + * to put the annotation and it is this declaration
125.53 + * that takes precedence in the case of multiple annotations
125.54 + * being defined for the same feature.
125.55 + * <p/>
125.56 + * To declare a feature non-transient in a class
125.57 + * whose superclass declares it transient,
125.58 + * use {@code @Transient(false)}.
125.59 + * In all cases, the {@link Introspector} decides
125.60 + * if a feature is transient by referring to the annotation
125.61 + * on the most specific superclass.
125.62 + * If no {@code Transient} annotation is present
125.63 + * in any superclass the feature is not transient.
125.64 + *
125.65 + * @since 1.7
125.66 + */
125.67 +@Target({METHOD})
125.68 +@Retention(RUNTIME)
125.69 +public @interface Transient {
125.70 + boolean value() default true;
125.71 +}
126.1 --- a/src/share/classes/java/text/DictionaryBasedBreakIterator.java Mon May 12 18:06:23 2008 -0700
126.2 +++ b/src/share/classes/java/text/DictionaryBasedBreakIterator.java Fri May 16 12:25:57 2008 -0700
126.3 @@ -384,7 +384,7 @@
126.4 // on the last character of a legal word. Push that position onto
126.5 // the possible-break-positions stack
126.6 if (dictionary.getNextState(state, 0) == -1) {
126.7 - possibleBreakPositions.push(new Integer(text.getIndex()));
126.8 + possibleBreakPositions.push(Integer.valueOf(text.getIndex()));
126.9 }
126.10
126.11 // look up the new state to transition to in the dictionary
126.12 @@ -395,7 +395,7 @@
126.13 // and we've successfully traversed the whole range. Drop out
126.14 // of the loop.
126.15 if (state == -1) {
126.16 - currentBreakPositions.push(new Integer(text.getIndex()));
126.17 + currentBreakPositions.push(Integer.valueOf(text.getIndex()));
126.18 break;
126.19 }
126.20
126.21 @@ -496,7 +496,7 @@
126.22 if (!currentBreakPositions.isEmpty()) {
126.23 currentBreakPositions.pop();
126.24 }
126.25 - currentBreakPositions.push(new Integer(endPos));
126.26 + currentBreakPositions.push(Integer.valueOf(endPos));
126.27
126.28 // create a regular array to hold the break positions and copy
126.29 // the break positions from the stack to the array (in addition,
127.1 --- a/src/share/classes/java/text/MessageFormat.java Mon May 12 18:06:23 2008 -0700
127.2 +++ b/src/share/classes/java/text/MessageFormat.java Fri May 16 12:25:57 2008 -0700
127.3 @@ -1286,7 +1286,7 @@
127.4 characterIterators.add(
127.5 createAttributedCharacterIterator(
127.6 subIterator, Field.ARGUMENT,
127.7 - new Integer(argumentNumber)));
127.8 + Integer.valueOf(argumentNumber)));
127.9 last = result.length();
127.10 }
127.11 arg = null;
127.12 @@ -1296,7 +1296,7 @@
127.13 characterIterators.add(
127.14 createAttributedCharacterIterator(
127.15 arg, Field.ARGUMENT,
127.16 - new Integer(argumentNumber)));
127.17 + Integer.valueOf(argumentNumber)));
127.18 last = result.length();
127.19 }
127.20 }
128.1 --- a/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java Mon May 12 18:06:23 2008 -0700
128.2 +++ b/src/share/classes/javax/imageio/stream/ImageInputStreamImpl.java Fri May 16 12:25:57 2008 -0700
128.3 @@ -778,8 +778,8 @@
128.4 */
128.5 public void mark() {
128.6 try {
128.7 - markByteStack.push(new Long(getStreamPosition()));
128.8 - markBitStack.push(new Integer(getBitOffset()));
128.9 + markByteStack.push(Long.valueOf(getStreamPosition()));
128.10 + markBitStack.push(Integer.valueOf(getBitOffset()));
128.11 } catch (IOException e) {
128.12 }
128.13 }
129.1 --- a/src/share/classes/javax/swing/AbstractButton.java Mon May 12 18:06:23 2008 -0700
129.2 +++ b/src/share/classes/javax/swing/AbstractButton.java Fri May 16 12:25:57 2008 -0700
129.3 @@ -1,5 +1,5 @@
129.4 /*
129.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
129.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
129.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
129.8 *
129.9 * This code is free software; you can redistribute it and/or modify it
129.10 @@ -29,7 +29,9 @@
129.11 import java.awt.image.*;
129.12 import java.text.*;
129.13 import java.awt.geom.*;
129.14 -import java.beans.*;
129.15 +import java.beans.PropertyChangeEvent;
129.16 +import java.beans.PropertyChangeListener;
129.17 +import java.beans.Transient;
129.18 import java.util.Enumeration;
129.19 import java.util.Vector;
129.20 import java.io.Serializable;
129.21 @@ -645,6 +647,7 @@
129.22 * @see #setDisabledIcon
129.23 * @see javax.swing.LookAndFeel#getDisabledIcon
129.24 */
129.25 + @Transient
129.26 public Icon getDisabledIcon() {
129.27 if (disabledIcon == null) {
129.28 disabledIcon = UIManager.getLookAndFeel().getDisabledIcon(this, getIcon());
129.29 @@ -2047,14 +2050,14 @@
129.30 null, AccessibleState.SELECTED);
129.31 accessibleContext.firePropertyChange(
129.32 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
129.33 - new Integer(0), new Integer(1));
129.34 + Integer.valueOf(0), Integer.valueOf(1));
129.35 } else {
129.36 accessibleContext.firePropertyChange(
129.37 AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
129.38 AccessibleState.SELECTED, null);
129.39 accessibleContext.firePropertyChange(
129.40 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
129.41 - new Integer(1), new Integer(0));
129.42 + Integer.valueOf(1), Integer.valueOf(0));
129.43 }
129.44 }
129.45 }
129.46 @@ -2552,9 +2555,9 @@
129.47 */
129.48 public Number getCurrentAccessibleValue() {
129.49 if (isSelected()) {
129.50 - return new Integer(1);
129.51 + return Integer.valueOf(1);
129.52 } else {
129.53 - return new Integer(0);
129.54 + return Integer.valueOf(0);
129.55 }
129.56 }
129.57
129.58 @@ -2583,7 +2586,7 @@
129.59 * @return an Integer of 0.
129.60 */
129.61 public Number getMinimumAccessibleValue() {
129.62 - return new Integer(0);
129.63 + return Integer.valueOf(0);
129.64 }
129.65
129.66 /**
129.67 @@ -2592,7 +2595,7 @@
129.68 * @return An Integer of 1.
129.69 */
129.70 public Number getMaximumAccessibleValue() {
129.71 - return new Integer(1);
129.72 + return Integer.valueOf(1);
129.73 }
129.74
129.75
130.1 --- a/src/share/classes/javax/swing/DebugGraphicsInfo.java Mon May 12 18:06:23 2008 -0700
130.2 +++ b/src/share/classes/javax/swing/DebugGraphicsInfo.java Fri May 16 12:25:57 2008 -0700
130.3 @@ -49,7 +49,7 @@
130.4 componentToDebug = new Hashtable();
130.5 }
130.6 if (debug > 0) {
130.7 - componentToDebug.put(component, new Integer(debug));
130.8 + componentToDebug.put(component, Integer.valueOf(debug));
130.9 } else {
130.10 componentToDebug.remove(component);
130.11 }
131.1 --- a/src/share/classes/javax/swing/DefaultListSelectionModel.java Mon May 12 18:06:23 2008 -0700
131.2 +++ b/src/share/classes/javax/swing/DefaultListSelectionModel.java Fri May 16 12:25:57 2008 -0700
131.3 @@ -1,5 +1,5 @@
131.4 /*
131.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
131.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
131.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
131.8 *
131.9 * This code is free software; you can redistribute it and/or modify it
131.10 @@ -28,6 +28,7 @@
131.11 import java.util.EventListener;
131.12 import java.util.BitSet;
131.13 import java.io.Serializable;
131.14 +import java.beans.Transient;
131.15
131.16 import javax.swing.event.*;
131.17
131.18 @@ -714,11 +715,13 @@
131.19 }
131.20
131.21 /** {@inheritDoc} */
131.22 + @Transient
131.23 public int getAnchorSelectionIndex() {
131.24 return anchorIndex;
131.25 }
131.26
131.27 /** {@inheritDoc} */
131.28 + @Transient
131.29 public int getLeadSelectionIndex() {
131.30 return leadIndex;
131.31 }
132.1 --- a/src/share/classes/javax/swing/ImageIcon.java Mon May 12 18:06:23 2008 -0700
132.2 +++ b/src/share/classes/javax/swing/ImageIcon.java Fri May 16 12:25:57 2008 -0700
132.3 @@ -1,5 +1,5 @@
132.4 /*
132.5 - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
132.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
132.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
132.8 *
132.9 * This code is free software; you can redistribute it and/or modify it
132.10 @@ -27,6 +27,7 @@
132.11 import java.awt.*;
132.12 import java.awt.image.*;
132.13 import java.beans.ConstructorProperties;
132.14 +import java.beans.Transient;
132.15 import java.net.URL;
132.16
132.17 import java.io.Serializable;
132.18 @@ -336,6 +337,7 @@
132.19 * Returns this icon's <code>Image</code>.
132.20 * @return the <code>Image</code> object for this <code>ImageIcon</code>
132.21 */
132.22 + @Transient
132.23 public Image getImage() {
132.24 return image;
132.25 }
132.26 @@ -436,6 +438,7 @@
132.27 *
132.28 * @return the image observer, which may be null
132.29 */
132.30 + @Transient
132.31 public ImageObserver getImageObserver() {
132.32 return imageObserver;
132.33 }
133.1 --- a/src/share/classes/javax/swing/JComboBox.java Mon May 12 18:06:23 2008 -0700
133.2 +++ b/src/share/classes/javax/swing/JComboBox.java Fri May 16 12:25:57 2008 -0700
133.3 @@ -1,5 +1,5 @@
133.4 /*
133.5 - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
133.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
133.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
133.8 *
133.9 * This code is free software; you can redistribute it and/or modify it
133.10 @@ -24,7 +24,9 @@
133.11 */
133.12 package javax.swing;
133.13
133.14 -import java.beans.*;
133.15 +import java.beans.PropertyChangeEvent;
133.16 +import java.beans.PropertyChangeListener;
133.17 +import java.beans.Transient;
133.18 import java.util.*;
133.19
133.20 import java.awt.*;
133.21 @@ -636,6 +638,7 @@
133.22 * or -1 if no item is selected or if
133.23 * the currently selected item is not in the list
133.24 */
133.25 + @Transient
133.26 public int getSelectedIndex() {
133.27 Object sObject = dataModel.getSelectedItem();
133.28 int i,c;
134.1 --- a/src/share/classes/javax/swing/JComponent.java Mon May 12 18:06:23 2008 -0700
134.2 +++ b/src/share/classes/javax/swing/JComponent.java Fri May 16 12:25:57 2008 -0700
134.3 @@ -1,5 +1,5 @@
134.4 /*
134.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
134.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
134.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
134.8 *
134.9 * This code is free software; you can redistribute it and/or modify it
134.10 @@ -43,7 +43,10 @@
134.11 import java.awt.peer.LightweightPeer;
134.12 import java.awt.dnd.DropTarget;
134.13 import java.awt.font.FontRenderContext;
134.14 -import java.beans.*;
134.15 +import java.beans.PropertyChangeListener;
134.16 +import java.beans.VetoableChangeListener;
134.17 +import java.beans.VetoableChangeSupport;
134.18 +import java.beans.Transient;
134.19
134.20 import java.applet.Applet;
134.21
134.22 @@ -1634,6 +1637,7 @@
134.23 * @see #setPreferredSize
134.24 * @see ComponentUI
134.25 */
134.26 + @Transient
134.27 public Dimension getPreferredSize() {
134.28 if (isPreferredSizeSet()) {
134.29 return super.getPreferredSize();
134.30 @@ -1675,6 +1679,7 @@
134.31 * @see #setMaximumSize
134.32 * @see ComponentUI
134.33 */
134.34 + @Transient
134.35 public Dimension getMaximumSize() {
134.36 if (isMaximumSizeSet()) {
134.37 return super.getMaximumSize();
134.38 @@ -1714,6 +1719,7 @@
134.39 * @see #setMinimumSize
134.40 * @see ComponentUI
134.41 */
134.42 + @Transient
134.43 public Dimension getMinimumSize() {
134.44 if (isMinimumSizeSet()) {
134.45 return super.getMinimumSize();
135.1 --- a/src/share/classes/javax/swing/JEditorPane.java Mon May 12 18:06:23 2008 -0700
135.2 +++ b/src/share/classes/javax/swing/JEditorPane.java Fri May 16 12:25:57 2008 -0700
135.3 @@ -429,9 +429,8 @@
135.4 // different url or POST method, load the new content
135.5
135.6 int p = getAsynchronousLoadPriority(getDocument());
135.7 - if ((postData == null) || (p < 0)) {
135.8 - // Either we do not have POST data, or should submit the data
135.9 - // synchronously.
135.10 + if (p < 0) {
135.11 + // open stream synchronously
135.12 InputStream in = getStream(page);
135.13 if (kit != null) {
135.14 Document doc = initializeModel(kit, page);
135.15 @@ -440,22 +439,13 @@
135.16 // view notifications slowing it down (i.e. best synchronous
135.17 // behavior) or set the model and start to feed it on a separate
135.18 // thread (best asynchronous behavior).
135.19 - synchronized(this) {
135.20 - if (loading != null) {
135.21 - // we are loading asynchronously, so we need to cancel
135.22 - // the old stream.
135.23 - loading.cancel();
135.24 - loading = null;
135.25 - }
135.26 - }
135.27 p = getAsynchronousLoadPriority(doc);
135.28 if (p >= 0) {
135.29 // load asynchronously
135.30 setDocument(doc);
135.31 synchronized(this) {
135.32 - loading = new PageStream(in);
135.33 - Thread pl = new PageLoader(doc, loading, p, loaded, page);
135.34 - pl.start();
135.35 + pageLoader = new PageLoader(doc, in, loaded, page);
135.36 + pageLoader.execute();
135.37 }
135.38 return;
135.39 }
135.40 @@ -464,11 +454,15 @@
135.41 reloaded = true;
135.42 }
135.43 } else {
135.44 - // We have POST data and should send it asynchronously.
135.45 - // Send (and subsequentally read) data in separate thread.
135.46 + // we may need to cancel background loading
135.47 + if (pageLoader != null) {
135.48 + pageLoader.cancel(true);
135.49 + }
135.50 +
135.51 + // Do everything in a background thread.
135.52 // Model initialization is deferred to that thread, too.
135.53 - Thread pl = new PageLoader(null, null, p, loaded, page);
135.54 - pl.start();
135.55 + pageLoader = new PageLoader(null, null, loaded, page);
135.56 + pageLoader.execute();
135.57 return;
135.58 }
135.59 }
135.60 @@ -604,44 +598,38 @@
135.61
135.62
135.63 /**
135.64 - * Thread to load a stream into the text document model.
135.65 + * Loads a stream into the text document model.
135.66 */
135.67 - class PageLoader extends Thread {
135.68 + class PageLoader extends SwingWorker<URL, Object> {
135.69
135.70 /**
135.71 * Construct an asynchronous page loader.
135.72 */
135.73 - PageLoader(Document doc, InputStream in, int priority, URL old,
135.74 - URL page) {
135.75 - setPriority(priority);
135.76 + PageLoader(Document doc, InputStream in, URL old, URL page) {
135.77 this.in = in;
135.78 this.old = old;
135.79 this.page = page;
135.80 this.doc = doc;
135.81 }
135.82
135.83 - boolean pageLoaded = false;
135.84 -
135.85 /**
135.86 * Try to load the document, then scroll the view
135.87 * to the reference (if specified). When done, fire
135.88 * a page property change event.
135.89 */
135.90 - public void run() {
135.91 + protected URL doInBackground() {
135.92 + boolean pageLoaded = false;
135.93 try {
135.94 if (in == null) {
135.95 in = getStream(page);
135.96 if (kit == null) {
135.97 // We received document of unknown content type.
135.98 - UIManager.getLookAndFeel().provideErrorFeedback(
135.99 - JEditorPane.this);
135.100 - return;
135.101 - }
135.102 - // Access to <code>loading</code> should be synchronized.
135.103 - synchronized(JEditorPane.this) {
135.104 - in = loading = new PageStream(in);
135.105 + UIManager.getLookAndFeel().
135.106 + provideErrorFeedback(JEditorPane.this);
135.107 + return old;
135.108 }
135.109 }
135.110 +
135.111 if (doc == null) {
135.112 try {
135.113 SwingUtilities.invokeAndWait(new Runnable() {
135.114 @@ -653,11 +641,11 @@
135.115 } catch (InvocationTargetException ex) {
135.116 UIManager.getLookAndFeel().provideErrorFeedback(
135.117 JEditorPane.this);
135.118 - return;
135.119 + return old;
135.120 } catch (InterruptedException ex) {
135.121 UIManager.getLookAndFeel().provideErrorFeedback(
135.122 JEditorPane.this);
135.123 - return;
135.124 + return old;
135.125 }
135.126 }
135.127
135.128 @@ -682,16 +670,14 @@
135.129 } catch (IOException ioe) {
135.130 UIManager.getLookAndFeel().provideErrorFeedback(JEditorPane.this);
135.131 } finally {
135.132 - synchronized(JEditorPane.this) {
135.133 - loading = null;
135.134 + if (pageLoaded) {
135.135 + SwingUtilities.invokeLater(new Runnable() {
135.136 + public void run() {
135.137 + JEditorPane.this.firePropertyChange("page", old, page);
135.138 + }
135.139 + });
135.140 }
135.141 - SwingUtilities.invokeLater(new Runnable() {
135.142 - public void run() {
135.143 - if (pageLoaded) {
135.144 - firePropertyChange("page", old, page);
135.145 - }
135.146 - }
135.147 - });
135.148 + return (pageLoaded ? page : old);
135.149 }
135.150 }
135.151
135.152 @@ -718,51 +704,6 @@
135.153 Document doc;
135.154 }
135.155
135.156 - static class PageStream extends FilterInputStream {
135.157 -
135.158 - boolean canceled;
135.159 -
135.160 - public PageStream(InputStream i) {
135.161 - super(i);
135.162 - canceled = false;
135.163 - }
135.164 -
135.165 - /**
135.166 - * Cancel the loading of the stream by throwing
135.167 - * an IOException on the next request.
135.168 - */
135.169 - public synchronized void cancel() {
135.170 - canceled = true;
135.171 - }
135.172 -
135.173 - protected synchronized void checkCanceled() throws IOException {
135.174 - if (canceled) {
135.175 - throw new IOException("page canceled");
135.176 - }
135.177 - }
135.178 -
135.179 - public int read() throws IOException {
135.180 - checkCanceled();
135.181 - return super.read();
135.182 - }
135.183 -
135.184 - public long skip(long n) throws IOException {
135.185 - checkCanceled();
135.186 - return super.skip(n);
135.187 - }
135.188 -
135.189 - public int available() throws IOException {
135.190 - checkCanceled();
135.191 - return super.available();
135.192 - }
135.193 -
135.194 - public void reset() throws IOException {
135.195 - checkCanceled();
135.196 - super.reset();
135.197 - }
135.198 -
135.199 - }
135.200 -
135.201 /**
135.202 * Fetches a stream for the given URL, which is about to
135.203 * be loaded by the <code>setPage</code> method. By
135.204 @@ -1179,11 +1120,6 @@
135.205 * current selection. The replacement text will have the
135.206 * attributes currently defined for input. If the component is not
135.207 * editable, beep and return.
135.208 - * <p>
135.209 - * This method is thread safe, although most Swing methods
135.210 - * are not. Please see
135.211 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
135.212 - * to Use Threads</A> for more information.
135.213 *
135.214 * @param content the content to replace the selection with. This
135.215 * value can be <code>null</code>
135.216 @@ -1454,11 +1390,6 @@
135.217 * create a StringReader and call the read method. In this case the model
135.218 * would be replaced after it was initialized with the contents of the
135.219 * string.
135.220 - * <p>
135.221 - * This method is thread safe, although most Swing methods
135.222 - * are not. Please see
135.223 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
135.224 - * to Use Threads</A> for more information.
135.225 *
135.226 * @param t the new text to be set; if <code>null</code> the old
135.227 * text will be deleted
135.228 @@ -1573,11 +1504,7 @@
135.229
135.230 // --- variables ---------------------------------------
135.231
135.232 - /**
135.233 - * Stream currently loading asynchronously (potentially cancelable).
135.234 - * Access to this variable should be synchronized.
135.235 - */
135.236 - PageStream loading;
135.237 + private SwingWorker<URL, Object> pageLoader;
135.238
135.239 /**
135.240 * Current content binding of the editor.
136.1 --- a/src/share/classes/javax/swing/JInternalFrame.java Mon May 12 18:06:23 2008 -0700
136.2 +++ b/src/share/classes/javax/swing/JInternalFrame.java Fri May 16 12:25:57 2008 -0700
136.3 @@ -1285,7 +1285,7 @@
136.4 * description: Specifies what desktop layer is used.
136.5 */
136.6 public void setLayer(int layer) {
136.7 - this.setLayer(new Integer(layer));
136.8 + this.setLayer(Integer.valueOf(layer));
136.9 }
136.10
136.11 /**
136.12 @@ -2092,7 +2092,7 @@
136.13 * have a value
136.14 */
136.15 public Number getCurrentAccessibleValue() {
136.16 - return new Integer(getLayer());
136.17 + return Integer.valueOf(getLayer());
136.18 }
136.19
136.20 /**
136.21 @@ -2116,7 +2116,7 @@
136.22 * have a minimum value
136.23 */
136.24 public Number getMinimumAccessibleValue() {
136.25 - return new Integer(Integer.MIN_VALUE);
136.26 + return Integer.MIN_VALUE;
136.27 }
136.28
136.29 /**
136.30 @@ -2126,7 +2126,7 @@
136.31 * have a maximum value
136.32 */
136.33 public Number getMaximumAccessibleValue() {
136.34 - return new Integer(Integer.MAX_VALUE);
136.35 + return Integer.MAX_VALUE;
136.36 }
136.37
136.38 } // AccessibleJInternalFrame
137.1 --- a/src/share/classes/javax/swing/JLabel.java Mon May 12 18:06:23 2008 -0700
137.2 +++ b/src/share/classes/javax/swing/JLabel.java Fri May 16 12:25:57 2008 -0700
137.3 @@ -1,5 +1,5 @@
137.4 /*
137.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
137.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
137.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
137.8 *
137.9 * This code is free software; you can redistribute it and/or modify it
137.10 @@ -31,6 +31,7 @@
137.11 import java.awt.*;
137.12 import java.text.*;
137.13 import java.awt.geom.*;
137.14 +import java.beans.Transient;
137.15
137.16 import java.io.ObjectOutputStream;
137.17 import java.io.ObjectInputStream;
137.18 @@ -422,6 +423,7 @@
137.19 * @see javax.swing.LookAndFeel#getDisabledIcon
137.20 * @see ImageIcon
137.21 */
137.22 + @Transient
137.23 public Icon getDisabledIcon() {
137.24 if (!disabledIconSet && disabledIcon == null && defaultIcon != null) {
137.25 disabledIcon = UIManager.getLookAndFeel().getDisabledIcon(this, defaultIcon);
138.1 --- a/src/share/classes/javax/swing/JList.java Mon May 12 18:06:23 2008 -0700
138.2 +++ b/src/share/classes/javax/swing/JList.java Fri May 16 12:25:57 2008 -0700
138.3 @@ -1,5 +1,5 @@
138.4 /*
138.5 - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
138.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
138.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
138.8 *
138.9 * This code is free software; you can redistribute it and/or modify it
138.10 @@ -31,7 +31,9 @@
138.11 import java.util.Vector;
138.12 import java.util.Locale;
138.13
138.14 -import java.beans.*;
138.15 +import java.beans.PropertyChangeEvent;
138.16 +import java.beans.PropertyChangeListener;
138.17 +import java.beans.Transient;
138.18
138.19 import javax.swing.event.*;
138.20 import javax.accessibility.*;
138.21 @@ -724,6 +726,7 @@
138.22 * @return the value of the {@code cellRenderer} property
138.23 * @see #setCellRenderer
138.24 */
138.25 + @Transient
138.26 public ListCellRenderer getCellRenderer() {
138.27 return cellRenderer;
138.28 }
138.29 @@ -2153,6 +2156,7 @@
138.30 * @see #removeSelectionInterval
138.31 * @see #addListSelectionListener
138.32 */
138.33 + @Transient
138.34 public int[] getSelectedIndices() {
138.35 ListSelectionModel sm = getSelectionModel();
138.36 int iMin = sm.getMinSelectionIndex();
139.1 --- a/src/share/classes/javax/swing/JMenuBar.java Mon May 12 18:06:23 2008 -0700
139.2 +++ b/src/share/classes/javax/swing/JMenuBar.java Fri May 16 12:25:57 2008 -0700
139.3 @@ -1,5 +1,5 @@
139.4 /*
139.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
139.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
139.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
139.8 *
139.9 * This code is free software; you can redistribute it and/or modify it
139.10 @@ -32,6 +32,7 @@
139.11 import java.awt.Point;
139.12 import java.awt.Rectangle;
139.13 import java.awt.event.*;
139.14 +import java.beans.Transient;
139.15 import java.util.Vector;
139.16 import java.util.Enumeration;
139.17
139.18 @@ -236,6 +237,7 @@
139.19 *
139.20 * @return the <code>JMenu</code> that delivers help to the user
139.21 */
139.22 + @Transient
139.23 public JMenu getHelpMenu() {
139.24 throw new Error("getHelpMenu() not yet implemented.");
139.25 }
140.1 --- a/src/share/classes/javax/swing/JOptionPane.java Mon May 12 18:06:23 2008 -0700
140.2 +++ b/src/share/classes/javax/swing/JOptionPane.java Fri May 16 12:25:57 2008 -0700
140.3 @@ -1512,7 +1512,7 @@
140.4
140.5 iFrame.putClientProperty("JInternalFrame.frameType", "optionDialog");
140.6 iFrame.putClientProperty("JInternalFrame.messageType",
140.7 - new Integer(getMessageType()));
140.8 + Integer.valueOf(getMessageType()));
140.9
140.10 iFrame.addInternalFrameListener(new InternalFrameAdapter() {
140.11 public void internalFrameClosing(InternalFrameEvent e) {
141.1 --- a/src/share/classes/javax/swing/JProgressBar.java Mon May 12 18:06:23 2008 -0700
141.2 +++ b/src/share/classes/javax/swing/JProgressBar.java Fri May 16 12:25:57 2008 -0700
141.3 @@ -775,9 +775,9 @@
141.4 accessibleContext.firePropertyChange(
141.5 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
141.6 (oldModel== null
141.7 - ? null : new Integer(oldModel.getValue())),
141.8 + ? null : Integer.valueOf(oldModel.getValue())),
141.9 (newModel== null
141.10 - ? null : new Integer(newModel.getValue())));
141.11 + ? null : Integer.valueOf(newModel.getValue())));
141.12 }
141.13
141.14 if (model != null) {
141.15 @@ -850,8 +850,8 @@
141.16 if (accessibleContext != null) {
141.17 accessibleContext.firePropertyChange(
141.18 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
141.19 - new Integer(oldValue),
141.20 - new Integer(brm.getValue()));
141.21 + Integer.valueOf(oldValue),
141.22 + Integer.valueOf(brm.getValue()));
141.23 }
141.24 }
141.25
141.26 @@ -1087,7 +1087,7 @@
141.27 * @return the current value of this object
141.28 */
141.29 public Number getCurrentAccessibleValue() {
141.30 - return new Integer(getValue());
141.31 + return Integer.valueOf(getValue());
141.32 }
141.33
141.34 /**
141.35 @@ -1110,7 +1110,7 @@
141.36 * @return the minimum value of this object
141.37 */
141.38 public Number getMinimumAccessibleValue() {
141.39 - return new Integer(getMinimum());
141.40 + return Integer.valueOf(getMinimum());
141.41 }
141.42
141.43 /**
141.44 @@ -1120,7 +1120,7 @@
141.45 */
141.46 public Number getMaximumAccessibleValue() {
141.47 // TIGER - 4422362
141.48 - return new Integer(model.getMaximum() - model.getExtent());
141.49 + return Integer.valueOf(model.getMaximum() - model.getExtent());
141.50 }
141.51
141.52 } // AccessibleJProgressBar
142.1 --- a/src/share/classes/javax/swing/JScrollBar.java Mon May 12 18:06:23 2008 -0700
142.2 +++ b/src/share/classes/javax/swing/JScrollBar.java Fri May 16 12:25:57 2008 -0700
142.3 @@ -314,7 +314,7 @@
142.4 BoundedRangeModel oldModel = model;
142.5 if (model != null) {
142.6 model.removeChangeListener(fwdAdjustmentEvents);
142.7 - oldValue = new Integer(model.getValue());
142.8 + oldValue = Integer.valueOf(model.getValue());
142.9 }
142.10 model = newModel;
142.11 if (model != null) {
142.12 @@ -465,8 +465,8 @@
142.13 if (accessibleContext != null) {
142.14 accessibleContext.firePropertyChange(
142.15 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
142.16 - new Integer(oldValue),
142.17 - new Integer(m.getValue()));
142.18 + Integer.valueOf(oldValue),
142.19 + Integer.valueOf(m.getValue()));
142.20 }
142.21 }
142.22
142.23 @@ -611,8 +611,8 @@
142.24 if (accessibleContext != null) {
142.25 accessibleContext.firePropertyChange(
142.26 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
142.27 - new Integer(oldValue),
142.28 - new Integer(m.getValue()));
142.29 + Integer.valueOf(oldValue),
142.30 + Integer.valueOf(m.getValue()));
142.31 }
142.32 }
142.33
142.34 @@ -880,7 +880,7 @@
142.35 * @return The current value of this object.
142.36 */
142.37 public Number getCurrentAccessibleValue() {
142.38 - return new Integer(getValue());
142.39 + return Integer.valueOf(getValue());
142.40 }
142.41
142.42 /**
142.43 @@ -903,7 +903,7 @@
142.44 * @return The minimum value of this object.
142.45 */
142.46 public Number getMinimumAccessibleValue() {
142.47 - return new Integer(getMinimum());
142.48 + return Integer.valueOf(getMinimum());
142.49 }
142.50
142.51 /**
143.1 --- a/src/share/classes/javax/swing/JScrollPane.java Mon May 12 18:06:23 2008 -0700
143.2 +++ b/src/share/classes/javax/swing/JScrollPane.java Fri May 16 12:25:57 2008 -0700
143.3 @@ -1,5 +1,5 @@
143.4 /*
143.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
143.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
143.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
143.8 *
143.9 * This code is free software; you can redistribute it and/or modify it
143.10 @@ -43,8 +43,9 @@
143.11 import java.io.ObjectInputStream;
143.12 import java.io.IOException;
143.13
143.14 -import java.beans.*;
143.15 -
143.16 +import java.beans.PropertyChangeEvent;
143.17 +import java.beans.PropertyChangeListener;
143.18 +import java.beans.Transient;
143.19
143.20 /**
143.21 * Provides a scrollable view of a lightweight component.
143.22 @@ -822,6 +823,7 @@
143.23 * @return the <code>horizontalScrollBar</code> property
143.24 * @see #setHorizontalScrollBar
143.25 */
143.26 + @Transient
143.27 public JScrollBar getHorizontalScrollBar() {
143.28 return horizontalScrollBar;
143.29 }
143.30 @@ -880,6 +882,7 @@
143.31 * @return the <code>verticalScrollBar</code> property
143.32 * @see #setVerticalScrollBar
143.33 */
143.34 + @Transient
143.35 public JScrollBar getVerticalScrollBar() {
143.36 return verticalScrollBar;
143.37 }
143.38 @@ -1012,6 +1015,7 @@
143.39 * @return the <code>rowHeader</code> property
143.40 * @see #setRowHeader
143.41 */
143.42 + @Transient
143.43 public JViewport getRowHeader() {
143.44 return rowHeader;
143.45 }
143.46 @@ -1081,6 +1085,7 @@
143.47 * @return the <code>columnHeader</code> property
143.48 * @see #setColumnHeader
143.49 */
143.50 + @Transient
143.51 public JViewport getColumnHeader() {
143.52 return columnHeader;
143.53 }
144.1 --- a/src/share/classes/javax/swing/JSlider.java Mon May 12 18:06:23 2008 -0700
144.2 +++ b/src/share/classes/javax/swing/JSlider.java Fri May 16 12:25:57 2008 -0700
144.3 @@ -485,9 +485,9 @@
144.4 accessibleContext.firePropertyChange(
144.5 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
144.6 (oldModel == null
144.7 - ? null : new Integer(oldModel.getValue())),
144.8 + ? null : Integer.valueOf(oldModel.getValue())),
144.9 (newModel == null
144.10 - ? null : new Integer(newModel.getValue())));
144.11 + ? null : Integer.valueOf(newModel.getValue())));
144.12 }
144.13 }
144.14
144.15 @@ -538,8 +538,8 @@
144.16 if (accessibleContext != null) {
144.17 accessibleContext.firePropertyChange(
144.18 AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
144.19 - new Integer(oldValue),
144.20 - new Integer(m.getValue()));
144.21 + Integer.valueOf(oldValue),
144.22 + Integer.valueOf(m.getValue()));
144.23 }
144.24 }
144.25
144.26 @@ -581,7 +581,7 @@
144.27 public void setMinimum(int minimum) {
144.28 int oldMin = getModel().getMinimum();
144.29 getModel().setMinimum(minimum);
144.30 - firePropertyChange( "minimum", new Integer( oldMin ), new Integer( minimum ) );
144.31 + firePropertyChange( "minimum", Integer.valueOf( oldMin ), Integer.valueOf( minimum ) );
144.32 }
144.33
144.34
144.35 @@ -622,7 +622,7 @@
144.36 public void setMaximum(int maximum) {
144.37 int oldMax = getModel().getMaximum();
144.38 getModel().setMaximum(maximum);
144.39 - firePropertyChange( "maximum", new Integer( oldMax ), new Integer( maximum ) );
144.40 + firePropertyChange( "maximum", Integer.valueOf( oldMax ), Integer.valueOf( maximum ) );
144.41 }
144.42
144.43
144.44 @@ -989,7 +989,7 @@
144.45
144.46 void createLabels() {
144.47 for ( int labelIndex = start; labelIndex <= getMaximum(); labelIndex += increment ) {
144.48 - put( new Integer( labelIndex ), new LabelUIResource( ""+labelIndex, JLabel.CENTER ) );
144.49 + put( Integer.valueOf( labelIndex ), new LabelUIResource( ""+labelIndex, JLabel.CENTER ) );
144.50 }
144.51 }
144.52 }
144.53 @@ -1463,7 +1463,7 @@
144.54 * @return The current value of this object.
144.55 */
144.56 public Number getCurrentAccessibleValue() {
144.57 - return new Integer(getValue());
144.58 + return Integer.valueOf(getValue());
144.59 }
144.60
144.61 /**
144.62 @@ -1486,7 +1486,7 @@
144.63 * @return The minimum value of this object.
144.64 */
144.65 public Number getMinimumAccessibleValue() {
144.66 - return new Integer(getMinimum());
144.67 + return Integer.valueOf(getMinimum());
144.68 }
144.69
144.70 /**
144.71 @@ -1497,7 +1497,7 @@
144.72 public Number getMaximumAccessibleValue() {
144.73 // TIGER - 4422362
144.74 BoundedRangeModel model = JSlider.this.getModel();
144.75 - return new Integer(model.getMaximum() - model.getExtent());
144.76 + return Integer.valueOf(model.getMaximum() - model.getExtent());
144.77 }
144.78 } // AccessibleJSlider
144.79 }
145.1 --- a/src/share/classes/javax/swing/JSplitPane.java Mon May 12 18:06:23 2008 -0700
145.2 +++ b/src/share/classes/javax/swing/JSplitPane.java Fri May 16 12:25:57 2008 -0700
145.3 @@ -1195,7 +1195,7 @@
145.4 * @return a localized String describing the value of this object
145.5 */
145.6 public Number getCurrentAccessibleValue() {
145.7 - return new Integer(getDividerLocation());
145.8 + return Integer.valueOf(getDividerLocation());
145.9 }
145.10
145.11
145.12 @@ -1220,7 +1220,7 @@
145.13 * @return The minimum value of this object.
145.14 */
145.15 public Number getMinimumAccessibleValue() {
145.16 - return new Integer(getUI().getMinimumDividerLocation(
145.17 + return Integer.valueOf(getUI().getMinimumDividerLocation(
145.18 JSplitPane.this));
145.19 }
145.20
145.21 @@ -1231,7 +1231,7 @@
145.22 * @return The maximum value of this object.
145.23 */
145.24 public Number getMaximumAccessibleValue() {
145.25 - return new Integer(getUI().getMaximumDividerLocation(
145.26 + return Integer.valueOf(getUI().getMaximumDividerLocation(
145.27 JSplitPane.this));
145.28 }
145.29
146.1 --- a/src/share/classes/javax/swing/JTabbedPane.java Mon May 12 18:06:23 2008 -0700
146.2 +++ b/src/share/classes/javax/swing/JTabbedPane.java Fri May 16 12:25:57 2008 -0700
146.3 @@ -1,5 +1,5 @@
146.4 /*
146.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
146.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
146.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
146.8 *
146.9 * This code is free software; you can redistribute it and/or modify it
146.10 @@ -27,7 +27,7 @@
146.11
146.12 import java.awt.*;
146.13 import java.awt.event.*;
146.14 -import java.beans.*;
146.15 +import java.beans.Transient;
146.16 import java.util.*;
146.17 import javax.swing.event.*;
146.18 import javax.swing.plaf.*;
146.19 @@ -563,6 +563,7 @@
146.20 * @return the index of the selected tab
146.21 * @see #setSelectedIndex
146.22 */
146.23 + @Transient
146.24 public int getSelectedIndex() {
146.25 return model.getSelectedIndex();
146.26 }
146.27 @@ -648,6 +649,7 @@
146.28 * @return the component corresponding to the selected tab
146.29 * @see #setSelectedComponent
146.30 */
146.31 + @Transient
146.32 public Component getSelectedComponent() {
146.33 int index = getSelectedIndex();
146.34 if (index == -1) {
146.35 @@ -967,7 +969,7 @@
146.36 // currently no IndexPropertyChangeEvent. Once
146.37 // IndexPropertyChangeEvents have been added this code should be
146.38 // modified to use it.
146.39 - putClientProperty("__index_to_remove__", new Integer(index));
146.40 + putClientProperty("__index_to_remove__", Integer.valueOf(index));
146.41
146.42 /* if the selected tab is after the removal */
146.43 if (selected > index) {
147.1 --- a/src/share/classes/javax/swing/JTable.java Mon May 12 18:06:23 2008 -0700
147.2 +++ b/src/share/classes/javax/swing/JTable.java Fri May 16 12:25:57 2008 -0700
147.3 @@ -7680,7 +7680,7 @@
147.4 */
147.5 public Accessible getAccessibleRowDescription(int r) {
147.6 if (r < 0 || r >= getAccessibleRowCount()) {
147.7 - throw new IllegalArgumentException(new Integer(r).toString());
147.8 + throw new IllegalArgumentException(Integer.toString(r));
147.9 }
147.10 if (rowDescription == null) {
147.11 return null;
147.12 @@ -7698,7 +7698,7 @@
147.13 */
147.14 public void setAccessibleRowDescription(int r, Accessible a) {
147.15 if (r < 0 || r >= getAccessibleRowCount()) {
147.16 - throw new IllegalArgumentException(new Integer(r).toString());
147.17 + throw new IllegalArgumentException(Integer.toString(r));
147.18 }
147.19 if (rowDescription == null) {
147.20 int numRows = getAccessibleRowCount();
147.21 @@ -7716,7 +7716,7 @@
147.22 */
147.23 public Accessible getAccessibleColumnDescription(int c) {
147.24 if (c < 0 || c >= getAccessibleColumnCount()) {
147.25 - throw new IllegalArgumentException(new Integer(c).toString());
147.26 + throw new IllegalArgumentException(Integer.toString(c));
147.27 }
147.28 if (columnDescription == null) {
147.29 return null;
147.30 @@ -7734,7 +7734,7 @@
147.31 */
147.32 public void setAccessibleColumnDescription(int c, Accessible a) {
147.33 if (c < 0 || c >= getAccessibleColumnCount()) {
147.34 - throw new IllegalArgumentException(new Integer(c).toString());
147.35 + throw new IllegalArgumentException(Integer.toString(c));
147.36 }
147.37 if (columnDescription == null) {
147.38 int numColumns = getAccessibleColumnCount();
148.1 --- a/src/share/classes/javax/swing/JTextArea.java Mon May 12 18:06:23 2008 -0700
148.2 +++ b/src/share/classes/javax/swing/JTextArea.java Fri May 16 12:25:57 2008 -0700
148.3 @@ -267,7 +267,7 @@
148.4 Document doc = getDocument();
148.5 if (doc != null) {
148.6 int old = getTabSize();
148.7 - doc.putProperty(PlainDocument.tabSizeAttribute, new Integer(size));
148.8 + doc.putProperty(PlainDocument.tabSizeAttribute, Integer.valueOf(size));
148.9 firePropertyChange("tabSize", old, size);
148.10 }
148.11 }
148.12 @@ -444,11 +444,6 @@
148.13 /**
148.14 * Inserts the specified text at the specified position. Does nothing
148.15 * if the model is null or if the text is null or empty.
148.16 - * <p>
148.17 - * This method is thread safe, although most Swing methods
148.18 - * are not. Please see
148.19 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
148.20 - * to Use Threads</A> for more information.
148.21 *
148.22 * @param str the text to insert
148.23 * @param pos the position at which to insert >= 0
148.24 @@ -471,11 +466,6 @@
148.25 /**
148.26 * Appends the given text to the end of the document. Does nothing if
148.27 * the model is null or the string is null or empty.
148.28 - * <p>
148.29 - * This method is thread safe, although most Swing methods
148.30 - * are not. Please see
148.31 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
148.32 - * to Use Threads</A> for more information.
148.33 *
148.34 * @param str the text to insert
148.35 * @see #insert
148.36 @@ -494,11 +484,6 @@
148.37 * Replaces text from the indicated start to end position with the
148.38 * new text specified. Does nothing if the model is null. Simply
148.39 * does a delete if the new string is null or empty.
148.40 - * <p>
148.41 - * This method is thread safe, although most Swing methods
148.42 - * are not. Please see
148.43 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
148.44 - * to Use Threads</A> for more information.
148.45 *
148.46 * @param str the text to use as the replacement
148.47 * @param start the start position >= 0
149.1 --- a/src/share/classes/javax/swing/JTextPane.java Mon May 12 18:06:23 2008 -0700
149.2 +++ b/src/share/classes/javax/swing/JTextPane.java Fri May 16 12:25:57 2008 -0700
149.3 @@ -167,11 +167,6 @@
149.4 * current selection. The replacement text will have the
149.5 * attributes currently defined for input at the point of
149.6 * insertion. If the document is not editable, beep and return.
149.7 - * <p>
149.8 - * This method is thread safe, although most Swing methods
149.9 - * are not. Please see
149.10 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
149.11 - * to Use Threads</A> for more information.
149.12 *
149.13 * @param content the content to replace the selection with
149.14 */
149.15 @@ -229,11 +224,6 @@
149.16 * a value of <code>0.75</code> will cause 75 percent of the
149.17 * component to be above the baseline, and 25 percent of the
149.18 * component to be below the baseline.
149.19 - * <p>
149.20 - * This method is thread safe, although most Swing methods
149.21 - * are not. Please see
149.22 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
149.23 - * to Use Threads</A> for more information.
149.24 *
149.25 * @param c the component to insert
149.26 */
149.27 @@ -252,11 +242,6 @@
149.28 * current position of the caret. This is represented in
149.29 * the associated document as an attribute of one character
149.30 * of content.
149.31 - * <p>
149.32 - * This method is thread safe, although most Swing methods
149.33 - * are not. Please see
149.34 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
149.35 - * to Use Threads</A> for more information.
149.36 *
149.37 * @param g the icon to insert
149.38 * @see Icon
149.39 @@ -320,11 +305,6 @@
149.40 * through the logical style assigned to the paragraph, which
149.41 * in term may resolve through some hierarchy completely
149.42 * independent of the element hierarchy in the document.
149.43 - * <p>
149.44 - * This method is thread safe, although most Swing methods
149.45 - * are not. Please see
149.46 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
149.47 - * to Use Threads</A> for more information.
149.48 *
149.49 * @param s the logical style to assign to the paragraph,
149.50 * or <code>null</code> for no style
149.51 @@ -367,11 +347,6 @@
149.52 * is no selection, the attributes are applied to
149.53 * the input attribute set which defines the attributes
149.54 * for any new text that gets inserted.
149.55 - * <p>
149.56 - * This method is thread safe, although most Swing methods
149.57 - * are not. Please see
149.58 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
149.59 - * to Use Threads</A> for more information.
149.60 *
149.61 * @param attr the attributes
149.62 * @param replace if true, then replace the existing attributes first
149.63 @@ -412,11 +387,6 @@
149.64 * to the paragraphs that intersect the selection.
149.65 * If there is no selection, the attributes are applied
149.66 * to the paragraph at the current caret position.
149.67 - * <p>
149.68 - * This method is thread safe, although most Swing methods
149.69 - * are not. Please see
149.70 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
149.71 - * to Use Threads</A> for more information.
149.72 *
149.73 * @param attr the non-<code>null</code> attributes
149.74 * @param replace if true, replace the existing attributes first
150.1 --- a/src/share/classes/javax/swing/JViewport.java Mon May 12 18:06:23 2008 -0700
150.2 +++ b/src/share/classes/javax/swing/JViewport.java Fri May 16 12:25:57 2008 -0700
150.3 @@ -1,5 +1,5 @@
150.4 /*
150.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
150.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
150.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
150.8 *
150.9 * This code is free software; you can redistribute it and/or modify it
150.10 @@ -30,6 +30,7 @@
150.11 import java.awt.image.VolatileImage;
150.12 import java.awt.peer.ComponentPeer;
150.13 import java.applet.Applet;
150.14 +import java.beans.Transient;
150.15 import javax.swing.plaf.ViewportUI;
150.16
150.17 import javax.swing.event.*;
150.18 @@ -1257,6 +1258,7 @@
150.19 *
150.20 * @return a <code>Dimension</code> object giving the size of the view
150.21 */
150.22 + @Transient
150.23 public Dimension getExtentSize() {
150.24 return getSize();
150.25 }
151.1 --- a/src/share/classes/javax/swing/MenuSelectionManager.java Mon May 12 18:06:23 2008 -0700
151.2 +++ b/src/share/classes/javax/swing/MenuSelectionManager.java Fri May 16 12:25:57 2008 -0700
151.3 @@ -218,9 +218,9 @@
151.4 int selectionSize;
151.5 p = event.getPoint();
151.6
151.7 - Component source = (Component)event.getSource();
151.8 + Component source = event.getComponent();
151.9
151.10 - if (!source.isShowing()) {
151.11 + if ((source != null) && !source.isShowing()) {
151.12 // This can happen if a mouseReleased removes the
151.13 // containing component -- bug 4146684
151.14 return;
151.15 @@ -236,7 +236,9 @@
151.16 return;
151.17 }
151.18
151.19 - SwingUtilities.convertPointToScreen(p,source);
151.20 + if (source != null) {
151.21 + SwingUtilities.convertPointToScreen(p, source);
151.22 + }
151.23
151.24 screenX = p.x;
151.25 screenY = p.y;
152.1 --- a/src/share/classes/javax/swing/Popup.java Mon May 12 18:06:23 2008 -0700
152.2 +++ b/src/share/classes/javax/swing/Popup.java Fri May 16 12:25:57 2008 -0700
152.3 @@ -229,7 +229,15 @@
152.4 // Popups are typically transient and most likely won't benefit
152.5 // from true double buffering. Turn it off here.
152.6 getRootPane().setUseTrueDoubleBuffering(false);
152.7 - setAlwaysOnTop(true);
152.8 + // Try to set "always-on-top" for the popup window.
152.9 + // Applets usually don't have sufficient permissions to do it.
152.10 + // In this case simply ignore the exception.
152.11 + try {
152.12 + setAlwaysOnTop(true);
152.13 + } catch (SecurityException se) {
152.14 + // setAlwaysOnTop is restricted,
152.15 + // the exception is ignored
152.16 + }
152.17 }
152.18
152.19 public void update(Graphics g) {
153.1 --- a/src/share/classes/javax/swing/ScrollPaneLayout.java Mon May 12 18:06:23 2008 -0700
153.2 +++ b/src/share/classes/javax/swing/ScrollPaneLayout.java Fri May 16 12:25:57 2008 -0700
153.3 @@ -488,10 +488,14 @@
153.4 Dimension viewSize = null;
153.5 Component view = null;
153.6
153.7 - if (viewport != null) {
153.8 + if (viewport != null) {
153.9 extentSize = viewport.getPreferredSize();
153.10 view = viewport.getView();
153.11 - viewSize = view.getPreferredSize();
153.12 + if (view != null) {
153.13 + viewSize = view.getPreferredSize();
153.14 + } else {
153.15 + viewSize = new Dimension(0, 0);
153.16 + }
153.17 }
153.18
153.19 /* If there's a viewport add its preferredSize.
154.1 --- a/src/share/classes/javax/swing/SpinnerNumberModel.java Mon May 12 18:06:23 2008 -0700
154.2 +++ b/src/share/classes/javax/swing/SpinnerNumberModel.java Fri May 16 12:25:57 2008 -0700
154.3 @@ -144,7 +144,7 @@
154.4 * <code>minimum <= value <= maximum</code>
154.5 */
154.6 public SpinnerNumberModel(int value, int minimum, int maximum, int stepSize) {
154.7 - this(new Integer(value), new Integer(minimum), new Integer(maximum), new Integer(stepSize));
154.8 + this(Integer.valueOf(value), Integer.valueOf(minimum), Integer.valueOf(maximum), Integer.valueOf(stepSize));
154.9 }
154.10
154.11
154.12 @@ -171,7 +171,7 @@
154.13 * <code>stepSize</code> equal to one, and an initial value of zero.
154.14 */
154.15 public SpinnerNumberModel() {
154.16 - this(new Integer(0), null, null, new Integer(1));
154.17 + this(Integer.valueOf(0), null, null, Integer.valueOf(1));
154.18 }
154.19
154.20
154.21 @@ -333,16 +333,16 @@
154.22 long v = value.longValue() + (stepSize.longValue() * (long)dir);
154.23
154.24 if (value instanceof Long) {
154.25 - newValue = new Long(v);
154.26 + newValue = Long.valueOf(v);
154.27 }
154.28 else if (value instanceof Integer) {
154.29 - newValue = new Integer((int)v);
154.30 + newValue = Integer.valueOf((int)v);
154.31 }
154.32 else if (value instanceof Short) {
154.33 - newValue = new Short((short)v);
154.34 + newValue = Short.valueOf((short)v);
154.35 }
154.36 else {
154.37 - newValue = new Byte((byte)v);
154.38 + newValue = Byte.valueOf((byte)v);
154.39 }
154.40 }
154.41
155.1 --- a/src/share/classes/javax/swing/TablePrintable.java Mon May 12 18:06:23 2008 -0700
155.2 +++ b/src/share/classes/javax/swing/TablePrintable.java Fri May 16 12:25:57 2008 -0700
155.3 @@ -215,7 +215,7 @@
155.4 }
155.5
155.6 // to pass the page number when formatting the header and footer text
155.7 - Object[] pageNumber = new Object[]{new Integer(pageIndex + 1)};
155.8 + Object[] pageNumber = new Object[]{Integer.valueOf(pageIndex + 1)};
155.9
155.10 // fetch the formatted header text, if any
155.11 String headerText = null;
156.1 --- a/src/share/classes/javax/swing/border/TitledBorder.java Mon May 12 18:06:23 2008 -0700
156.2 +++ b/src/share/classes/javax/swing/border/TitledBorder.java Fri May 16 12:25:57 2008 -0700
156.3 @@ -1,5 +1,5 @@
156.4 /*
156.5 - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
156.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
156.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
156.8 *
156.9 * This code is free software; you can redistribute it and/or modify it
156.10 @@ -642,6 +642,9 @@
156.11 if (c == null) {
156.12 throw new NullPointerException("Must supply non-null component");
156.13 }
156.14 + if (width < 0) {
156.15 + throw new IllegalArgumentException("Width must be >= 0");
156.16 + }
156.17 if (height < 0) {
156.18 throw new IllegalArgumentException("Height must be >= 0");
156.19 }
157.1 --- a/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java Mon May 12 18:06:23 2008 -0700
157.2 +++ b/src/share/classes/javax/swing/colorchooser/AbstractColorChooserPanel.java Fri May 16 12:25:57 2008 -0700
157.3 @@ -1,5 +1,5 @@
157.4 /*
157.5 - * Copyright 1998-2001 Sun Microsystems, Inc. All Rights Reserved.
157.6 + * Copyright 1998-2008 Sun Microsystems, Inc. All Rights Reserved.
157.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
157.8 *
157.9 * This code is free software; you can redistribute it and/or modify it
157.10 @@ -26,9 +26,7 @@
157.11 package javax.swing.colorchooser;
157.12
157.13 import java.awt.*;
157.14 -import java.io.Serializable;
157.15 import javax.swing.*;
157.16 -import javax.swing.event.*;
157.17
157.18 /**
157.19 * This is the abstract superclass for color choosers. If you want to add
157.20 @@ -55,17 +53,6 @@
157.21 private JColorChooser chooser;
157.22
157.23 /**
157.24 - *
157.25 - */
157.26 - private ChangeListener colorListener;
157.27 -
157.28 - /**
157.29 - *
157.30 - */
157.31 - private boolean dirty = true;
157.32 -
157.33 -
157.34 - /**
157.35 * Invoked automatically when the model's state changes.
157.36 * It is also called by <code>installChooserPanel</code> to allow
157.37 * you to set up the initial state of your chooser.
157.38 @@ -157,8 +144,6 @@
157.39 chooser = enclosingChooser;
157.40 buildChooser();
157.41 updateChooser();
157.42 - colorListener = new ModelListener();
157.43 - getColorSelectionModel().addChangeListener(colorListener);
157.44 }
157.45
157.46 /**
157.47 @@ -166,7 +151,6 @@
157.48 * If override this, be sure to call <code>super</code>.
157.49 */
157.50 public void uninstallChooserPanel(JColorChooser enclosingChooser) {
157.51 - getColorSelectionModel().removeChangeListener(colorListener);
157.52 chooser = null;
157.53 }
157.54
157.55 @@ -192,10 +176,6 @@
157.56 * @param g the <code>Graphics</code> object
157.57 */
157.58 public void paint(Graphics g) {
157.59 - if (dirty) {
157.60 - updateChooser();
157.61 - dirty = false;
157.62 - }
157.63 super.paint(g);
157.64 }
157.65
157.66 @@ -222,18 +202,4 @@
157.67 }
157.68 return defaultValue;
157.69 }
157.70 -
157.71 - /**
157.72 - *
157.73 - */
157.74 - class ModelListener implements ChangeListener, Serializable {
157.75 - public void stateChanged(ChangeEvent e) {
157.76 - if (isShowing()) { // isVisible
157.77 - updateChooser();
157.78 - dirty = false;
157.79 - } else {
157.80 - dirty = true;
157.81 - }
157.82 - }
157.83 - }
157.84 }
158.1 --- a/src/share/classes/javax/swing/filechooser/FileSystemView.java Mon May 12 18:06:23 2008 -0700
158.2 +++ b/src/share/classes/javax/swing/filechooser/FileSystemView.java Fri May 16 12:25:57 2008 -0700
158.3 @@ -26,26 +26,18 @@
158.4 package javax.swing.filechooser;
158.5
158.6
158.7 -import javax.swing.event.*;
158.8 import javax.swing.*;
158.9
158.10 import java.awt.Image;
158.11 import java.io.File;
158.12 -import java.io.FileFilter;
158.13 -import java.io.FilenameFilter;
158.14 import java.io.FileNotFoundException;
158.15 import java.io.IOException;
158.16 import java.text.MessageFormat;
158.17 -import java.util.ArrayList;
158.18 -import java.util.Arrays;
158.19 -import java.util.List;
158.20 import java.util.Vector;
158.21 +import java.lang.ref.WeakReference;
158.22 import java.beans.PropertyChangeListener;
158.23 import java.beans.PropertyChangeEvent;
158.24
158.25 -
158.26 -import java.lang.reflect.*;
158.27 -
158.28 import sun.awt.shell.*;
158.29
158.30 /**
158.31 @@ -74,18 +66,11 @@
158.32 static FileSystemView unixFileSystemView = null;
158.33 //static FileSystemView macFileSystemView = null;
158.34 static FileSystemView genericFileSystemView = null;
158.35 - static boolean useSystemExtensionsHiding = false;
158.36 +
158.37 + private boolean useSystemExtensionHiding =
158.38 + UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
158.39
158.40 public static FileSystemView getFileSystemView() {
158.41 - useSystemExtensionsHiding = UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
158.42 - UIManager.addPropertyChangeListener(new PropertyChangeListener() {
158.43 - public void propertyChange(PropertyChangeEvent e) {
158.44 - if (e.getPropertyName().equals("lookAndFeel")) {
158.45 - useSystemExtensionsHiding = UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
158.46 - }
158.47 - }
158.48 - });
158.49 -
158.50 if(File.separatorChar == '\\') {
158.51 if(windowsFileSystemView == null) {
158.52 windowsFileSystemView = new WindowsFileSystemView();
158.53 @@ -113,6 +98,26 @@
158.54 return genericFileSystemView;
158.55 }
158.56
158.57 + public FileSystemView() {
158.58 + final WeakReference<FileSystemView> weakReference = new WeakReference<FileSystemView>(this);
158.59 +
158.60 + UIManager.addPropertyChangeListener(new PropertyChangeListener() {
158.61 + public void propertyChange(PropertyChangeEvent evt) {
158.62 + FileSystemView fileSystemView = weakReference.get();
158.63 +
158.64 + if (fileSystemView == null) {
158.65 + // FileSystemView was destroyed
158.66 + UIManager.removePropertyChangeListener(this);
158.67 + } else {
158.68 + if (evt.getPropertyName().equals("lookAndFeel")) {
158.69 + fileSystemView.useSystemExtensionHiding =
158.70 + UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding");
158.71 + }
158.72 + }
158.73 + }
158.74 + });
158.75 + }
158.76 +
158.77 /**
158.78 * Determines if the given file is a root in the navigatable tree(s).
158.79 * Examples: Windows 98 has one root, the Desktop folder. DOS has one root
158.80 @@ -170,7 +175,7 @@
158.81 if (f != null) {
158.82 name = f.getName();
158.83 if (!name.equals("..") && !name.equals(".") &&
158.84 - (useSystemExtensionsHiding ||
158.85 + (useSystemExtensionHiding ||
158.86 !isFileSystem(f) ||
158.87 isFileSystemRoot(f)) &&
158.88 ((f instanceof ShellFolder) ||
159.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java Mon May 12 18:06:23 2008 -0700
159.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicButtonUI.java Fri May 16 12:25:57 2008 -0700
159.3 @@ -109,7 +109,7 @@
159.4 LookAndFeel.installProperty(b, "rolloverEnabled", rollover);
159.5 }
159.6
159.7 - LookAndFeel.installProperty(b, "iconTextGap", new Integer(4));
159.8 + LookAndFeel.installProperty(b, "iconTextGap", Integer.valueOf(4));
159.9 }
159.10
159.11 protected void installListeners(AbstractButton b) {
160.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java Mon May 12 18:06:23 2008 -0700
160.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicColorChooserUI.java Fri May 16 12:25:57 2008 -0700
160.3 @@ -1,5 +1,5 @@
160.4 /*
160.5 - * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved.
160.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
160.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
160.8 *
160.9 * This code is free software; you can redistribute it and/or modify it
160.10 @@ -30,16 +30,12 @@
160.11 import javax.swing.event.*;
160.12 import javax.swing.border.*;
160.13 import javax.swing.plaf.*;
160.14 -import java.util.*;
160.15 import java.awt.*;
160.16 -import java.awt.image.*;
160.17 import java.awt.event.*;
160.18 import java.beans.PropertyChangeEvent;
160.19 import java.beans.PropertyChangeListener;
160.20 -import java.io.Serializable;
160.21
160.22 import sun.swing.DefaultLookup;
160.23 -import sun.swing.UIAction;
160.24
160.25 /**
160.26 * Provides the basic look and feel for a JColorChooser.
160.27 @@ -212,9 +208,24 @@
160.28 protected void uninstallListeners() {
160.29 chooser.removePropertyChangeListener( propertyChangeListener );
160.30 chooser.getSelectionModel().removeChangeListener(previewListener);
160.31 + previewListener = null;
160.32 previewPanel.removeMouseListener(getHandler());
160.33 }
160.34
160.35 + private void selectionChanged(ColorSelectionModel model) {
160.36 + if (this.previewPanel != null) {
160.37 + this.previewPanel.setForeground(model.getSelectedColor());
160.38 + this.previewPanel.repaint();
160.39 + }
160.40 + AbstractColorChooserPanel[] panels = this.chooser.getChooserPanels();
160.41 + if (panels != null) {
160.42 + for (AbstractColorChooserPanel panel : panels) {
160.43 + if (panel != null) {
160.44 + panel.updateChooser();
160.45 + }
160.46 + }
160.47 + }
160.48 + }
160.49
160.50 private class Handler implements ChangeListener, MouseListener,
160.51 PropertyChangeListener {
160.52 @@ -222,11 +233,7 @@
160.53 // ChangeListener
160.54 //
160.55 public void stateChanged(ChangeEvent evt) {
160.56 - ColorSelectionModel model = (ColorSelectionModel)evt.getSource();
160.57 - if (previewPanel != null) {
160.58 - previewPanel.setForeground(model.getSelectedColor());
160.59 - previewPanel.repaint();
160.60 - }
160.61 + selectionChanged((ColorSelectionModel) evt.getSource());
160.62 }
160.63
160.64 //
160.65 @@ -302,13 +309,19 @@
160.66 newPanels[i].installChooserPanel(chooser);
160.67 }
160.68 }
160.69 -
160.70 - if (prop == JColorChooser.PREVIEW_PANEL_PROPERTY) {
160.71 + else if (prop == JColorChooser.PREVIEW_PANEL_PROPERTY) {
160.72 if (evt.getNewValue() != previewPanel) {
160.73 installPreviewPanel();
160.74 }
160.75 }
160.76 - if (prop == "componentOrientation") {
160.77 + else if (prop == JColorChooser.SELECTION_MODEL_PROPERTY) {
160.78 + ColorSelectionModel oldModel = (ColorSelectionModel) evt.getOldValue();
160.79 + oldModel.removeChangeListener(previewListener);
160.80 + ColorSelectionModel newModel = (ColorSelectionModel) evt.getNewValue();
160.81 + newModel.addChangeListener(previewListener);
160.82 + selectionChanged(newModel);
160.83 + }
160.84 + else if (prop == "componentOrientation") {
160.85 ComponentOrientation o =
160.86 (ComponentOrientation)evt.getNewValue();
160.87 JColorChooser cc = (JColorChooser)evt.getSource();
161.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java Mon May 12 18:06:23 2008 -0700
161.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java Fri May 16 12:25:57 2008 -0700
161.3 @@ -654,7 +654,7 @@
161.4 "javax.swing.plaf.basic.BasicIconFactory",
161.5 "getRadioButtonMenuItemIcon");
161.6
161.7 - Object menuItemAcceleratorDelimiter = new String("+");
161.8 + Object menuItemAcceleratorDelimiter = "+";
161.9
161.10 // *** OptionPane value objects
161.11
161.12 @@ -1364,6 +1364,7 @@
161.13 "LEFT", "positiveUnitIncrement",
161.14 "KP_LEFT", "positiveUnitIncrement",
161.15 }),
161.16 + "Slider.onlyLeftMouseButtonDrag", Boolean.TRUE,
161.17
161.18 // *** Spinner
161.19 "Spinner.font", monospacedPlain12,
162.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Mon May 12 18:06:23 2008 -0700
162.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java Fri May 16 12:25:57 2008 -0700
162.3 @@ -146,7 +146,7 @@
162.4 menuItem.setMargin(UIManager.getInsets(prefix + ".margin"));
162.5 }
162.6
162.7 - LookAndFeel.installProperty(menuItem, "iconTextGap", new Integer(4));
162.8 + LookAndFeel.installProperty(menuItem, "iconTextGap", Integer.valueOf(4));
162.9 defaultTextIconGap = menuItem.getIconTextGap();
162.10
162.11 LookAndFeel.installBorder(menuItem, prefix + ".border");
163.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Mon May 12 18:06:23 2008 -0700
163.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Fri May 16 12:25:57 2008 -0700
163.3 @@ -1195,10 +1195,10 @@
163.4 if (options == null) {
163.5 if (optionType == JOptionPane.OK_CANCEL_OPTION &&
163.6 buttonIndex == 1) {
163.7 - optionPane.setValue(new Integer(2));
163.8 + optionPane.setValue(Integer.valueOf(2));
163.9
163.10 } else {
163.11 - optionPane.setValue(new Integer(buttonIndex));
163.12 + optionPane.setValue(Integer.valueOf(buttonIndex));
163.13 }
163.14 } else {
163.15 optionPane.setValue(options[buttonIndex]);
163.16 @@ -1393,7 +1393,7 @@
163.17 if (getName() == CLOSE) {
163.18 JOptionPane optionPane = (JOptionPane)e.getSource();
163.19
163.20 - optionPane.setValue(new Integer(JOptionPane.CLOSED_OPTION));
163.21 + optionPane.setValue(Integer.valueOf(JOptionPane.CLOSED_OPTION));
163.22 }
163.23 }
163.24 }
164.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java Mon May 12 18:06:23 2008 -0700
164.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicSliderUI.java Fri May 16 12:25:57 2008 -0700
164.3 @@ -552,20 +552,28 @@
164.4 contentRect.height = focusRect.height - (focusInsets.top + focusInsets.bottom);
164.5 }
164.6
164.7 + private int getTickSpacing() {
164.8 + int majorTickSpacing = slider.getMajorTickSpacing();
164.9 + int minorTickSpacing = slider.getMinorTickSpacing();
164.10 +
164.11 + int result;
164.12 +
164.13 + if (minorTickSpacing > 0) {
164.14 + result = minorTickSpacing;
164.15 + } else if (majorTickSpacing > 0) {
164.16 + result = majorTickSpacing;
164.17 + } else {
164.18 + result = 0;
164.19 + }
164.20 +
164.21 + return result;
164.22 + }
164.23 +
164.24 protected void calculateThumbLocation() {
164.25 if ( slider.getSnapToTicks() ) {
164.26 int sliderValue = slider.getValue();
164.27 int snappedValue = sliderValue;
164.28 - int majorTickSpacing = slider.getMajorTickSpacing();
164.29 - int minorTickSpacing = slider.getMinorTickSpacing();
164.30 - int tickSpacing = 0;
164.31 -
164.32 - if ( minorTickSpacing > 0 ) {
164.33 - tickSpacing = minorTickSpacing;
164.34 - }
164.35 - else if ( majorTickSpacing > 0 ) {
164.36 - tickSpacing = majorTickSpacing;
164.37 - }
164.38 + int tickSpacing = getTickSpacing();
164.39
164.40 if ( tickSpacing != 0 ) {
164.41 // If it's not on a tick, change the value
164.42 @@ -1273,28 +1281,34 @@
164.43
164.44 public void scrollByBlock(int direction) {
164.45 synchronized(slider) {
164.46 -
164.47 - int oldValue = slider.getValue();
164.48 int blockIncrement =
164.49 (slider.getMaximum() - slider.getMinimum()) / 10;
164.50 - if (blockIncrement <= 0 &&
164.51 - slider.getMaximum() > slider.getMinimum()) {
164.52 -
164.53 + if (blockIncrement == 0) {
164.54 blockIncrement = 1;
164.55 }
164.56
164.57 + if (slider.getSnapToTicks()) {
164.58 + int tickSpacing = getTickSpacing();
164.59 +
164.60 + if (blockIncrement < tickSpacing) {
164.61 + blockIncrement = tickSpacing;
164.62 + }
164.63 + }
164.64 +
164.65 int delta = blockIncrement * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL);
164.66 - slider.setValue(oldValue + delta);
164.67 + slider.setValue(slider.getValue() + delta);
164.68 }
164.69 }
164.70
164.71 public void scrollByUnit(int direction) {
164.72 synchronized(slider) {
164.73 + int delta = ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL);
164.74
164.75 - int oldValue = slider.getValue();
164.76 - int delta = 1 * ((direction > 0) ? POSITIVE_SCROLL : NEGATIVE_SCROLL);
164.77 + if (slider.getSnapToTicks()) {
164.78 + delta *= getTickSpacing();
164.79 + }
164.80
164.81 - slider.setValue(oldValue + delta);
164.82 + slider.setValue(slider.getValue() + delta);
164.83 }
164.84 }
164.85
164.86 @@ -1573,6 +1587,11 @@
164.87
164.88 // Clicked in the Thumb area?
164.89 if (thumbRect.contains(currentMouseX, currentMouseY)) {
164.90 + if (UIManager.getBoolean("Slider.onlyLeftMouseButtonDrag")
164.91 + && !SwingUtilities.isLeftMouseButton(e)) {
164.92 + return;
164.93 + }
164.94 +
164.95 switch (slider.getOrientation()) {
164.96 case JSlider.VERTICAL:
164.97 offset = currentMouseY - thumbRect.y;
164.98 @@ -1584,6 +1603,11 @@
164.99 isDragging = true;
164.100 return;
164.101 }
164.102 +
164.103 + if (!SwingUtilities.isLeftMouseButton(e)) {
164.104 + return;
164.105 + }
164.106 +
164.107 isDragging = false;
164.108 slider.setValueIsAdjusting(true);
164.109
165.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java Mon May 12 18:06:23 2008 -0700
165.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java Fri May 16 12:25:57 2008 -0700
165.3 @@ -539,7 +539,7 @@
165.4 }
165.5 mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, Event.ALT_MASK),
165.6 "setSelectedIndex");
165.7 - mnemonicToIndexMap.put(new Integer(mnemonic), new Integer(index));
165.8 + mnemonicToIndexMap.put(Integer.valueOf(mnemonic), Integer.valueOf(index));
165.9 }
165.10
165.11 /**
165.12 @@ -2231,7 +2231,7 @@
165.13 mnemonic -= ('a' - 'A');
165.14 }
165.15 Integer index = (Integer)ui.mnemonicToIndexMap.
165.16 - get(new Integer(mnemonic));
165.17 + get(Integer.valueOf(mnemonic));
165.18 if (index != null && pane.isEnabledAt(index.intValue())) {
165.19 pane.setSelectedIndex(index.intValue());
165.20 }
166.1 --- a/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java Mon May 12 18:06:23 2008 -0700
166.2 +++ b/src/share/classes/javax/swing/plaf/basic/BasicToolBarUI.java Fri May 16 12:25:57 2008 -0700
166.3 @@ -178,7 +178,7 @@
166.4 dragWindow = null;
166.5 dockingSource = null;
166.6
166.7 - c.putClientProperty( FOCUSED_COMP_INDEX, new Integer( focusedCompIndex ) );
166.8 + c.putClientProperty( FOCUSED_COMP_INDEX, Integer.valueOf( focusedCompIndex ) );
166.9 }
166.10
166.11 protected void installDefaults( )
167.1 --- a/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java Mon May 12 18:06:23 2008 -0700
167.2 +++ b/src/share/classes/javax/swing/plaf/metal/MetalIconFactory.java Fri May 16 12:25:57 2008 -0700
167.3 @@ -2278,18 +2278,16 @@
167.4 }
167.5
167.6 public void paintIcon( Component c, Graphics g, int x, int y ) {
167.7 - JSlider slider = (JSlider)c;
167.8 -
167.9 - boolean leftToRight = MetalUtils.isLeftToRight(slider);
167.10 + boolean leftToRight = MetalUtils.isLeftToRight(c);
167.11
167.12 g.translate( x, y );
167.13
167.14 // Draw the frame
167.15 - if ( slider.hasFocus() ) {
167.16 + if ( c.hasFocus() ) {
167.17 g.setColor( MetalLookAndFeel.getPrimaryControlInfo() );
167.18 }
167.19 else {
167.20 - g.setColor( slider.isEnabled() ? MetalLookAndFeel.getPrimaryControlInfo() :
167.21 + g.setColor( c.isEnabled() ? MetalLookAndFeel.getPrimaryControlInfo() :
167.22 MetalLookAndFeel.getControlDarkShadow() );
167.23 }
167.24
167.25 @@ -2309,7 +2307,7 @@
167.26 }
167.27
167.28 // Fill in the background
167.29 - if ( slider.hasFocus() ) {
167.30 + if ( c.hasFocus() ) {
167.31 g.setColor( c.getForeground() );
167.32 }
167.33 else {
167.34 @@ -2338,8 +2336,8 @@
167.35
167.36 // Draw the bumps
167.37 int offset = (leftToRight) ? 2 : 8;
167.38 - if ( slider.isEnabled() ) {
167.39 - if ( slider.hasFocus() ) {
167.40 + if ( c.isEnabled() ) {
167.41 + if ( c.hasFocus() ) {
167.42 primaryBumps.paintIcon( c, g, offset, 2 );
167.43 }
167.44 else {
167.45 @@ -2348,8 +2346,8 @@
167.46 }
167.47
167.48 // Draw the highlight
167.49 - if ( slider.isEnabled() ) {
167.50 - g.setColor( slider.hasFocus() ? MetalLookAndFeel.getPrimaryControl()
167.51 + if ( c.isEnabled() ) {
167.52 + g.setColor( c.hasFocus() ? MetalLookAndFeel.getPrimaryControl()
167.53 : MetalLookAndFeel.getControlHighlight() );
167.54 if (leftToRight) {
167.55 g.drawLine( 1, 1, 8, 1 );
167.56 @@ -2389,16 +2387,14 @@
167.57 }
167.58
167.59 public void paintIcon( Component c, Graphics g, int x, int y ) {
167.60 - JSlider slider = (JSlider)c;
167.61 -
167.62 g.translate( x, y );
167.63
167.64 // Draw the frame
167.65 - if ( slider.hasFocus() ) {
167.66 + if ( c.hasFocus() ) {
167.67 g.setColor( MetalLookAndFeel.getPrimaryControlInfo() );
167.68 }
167.69 else {
167.70 - g.setColor( slider.isEnabled() ? MetalLookAndFeel.getPrimaryControlInfo() :
167.71 + g.setColor( c.isEnabled() ? MetalLookAndFeel.getPrimaryControlInfo() :
167.72 MetalLookAndFeel.getControlDarkShadow() );
167.73 }
167.74
167.75 @@ -2409,7 +2405,7 @@
167.76 g.drawLine( 7,15 , 14,8 ); // right slant
167.77
167.78 // Fill in the background
167.79 - if ( slider.hasFocus() ) {
167.80 + if ( c.hasFocus() ) {
167.81 g.setColor( c.getForeground() );
167.82 }
167.83 else {
167.84 @@ -2425,8 +2421,8 @@
167.85 g.drawLine( 7,14 , 7,14 );
167.86
167.87 // Draw the bumps
167.88 - if ( slider.isEnabled() ) {
167.89 - if ( slider.hasFocus() ) {
167.90 + if ( c.isEnabled() ) {
167.91 + if ( c.hasFocus() ) {
167.92 primaryBumps.paintIcon( c, g, 2, 2 );
167.93 }
167.94 else {
167.95 @@ -2435,8 +2431,8 @@
167.96 }
167.97
167.98 // Draw the highlight
167.99 - if ( slider.isEnabled() ) {
167.100 - g.setColor( slider.hasFocus() ? MetalLookAndFeel.getPrimaryControl()
167.101 + if ( c.isEnabled() ) {
167.102 + g.setColor( c.hasFocus() ? MetalLookAndFeel.getPrimaryControl()
167.103 : MetalLookAndFeel.getControlHighlight() );
167.104 g.drawLine( 1, 1, 13, 1 );
167.105 g.drawLine( 1, 1, 1, 8 );
168.1 --- a/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Mon May 12 18:06:23 2008 -0700
168.2 +++ b/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java Fri May 16 12:25:57 2008 -0700
168.3 @@ -455,7 +455,7 @@
168.4
168.5 Insets zeroInsets = new InsetsUIResource(0, 0, 0, 0);
168.6
168.7 - Integer zero = new Integer(0);
168.8 + Integer zero = Integer.valueOf(0);
168.9
168.10 Object textFieldBorder =
168.11 new SwingLazyValue("javax.swing.plaf.metal.MetalBorders",
168.12 @@ -904,7 +904,7 @@
168.13 "ProgressBar.selectionBackground", primaryControlDarkShadow,
168.14 "ProgressBar.border", progressBarBorder,
168.15 "ProgressBar.cellSpacing", zero,
168.16 - "ProgressBar.cellLength", new Integer(1),
168.17 + "ProgressBar.cellLength", Integer.valueOf(1),
168.18
168.19 // Combo Box
168.20 "ComboBox.background", control,
168.21 @@ -971,7 +971,7 @@
168.22 "DesktopIcon.font", controlTextValue,
168.23 "DesktopIcon.foreground", controlTextColor,
168.24 "DesktopIcon.background", control,
168.25 - "DesktopIcon.width", new Integer(160),
168.26 + "DesktopIcon.width", Integer.valueOf(160),
168.27
168.28 "Desktop.ancestorInputMap",
168.29 new UIDefaults.LazyInputMap(new Object[] {
169.1 --- a/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java Mon May 12 18:06:23 2008 -0700
169.2 +++ b/src/share/classes/javax/swing/plaf/synth/SynthArrowButton.java Fri May 16 12:25:57 2008 -0700
169.3 @@ -53,7 +53,7 @@
169.4
169.5 public void setDirection(int dir) {
169.6 direction = dir;
169.7 - putClientProperty("__arrow_direction__", new Integer(dir));
169.8 + putClientProperty("__arrow_direction__", Integer.valueOf(dir));
169.9 repaint();
169.10 }
169.11
170.1 --- a/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java Mon May 12 18:06:23 2008 -0700
170.2 +++ b/src/share/classes/javax/swing/plaf/synth/SynthDesktopPaneUI.java Fri May 16 12:25:57 2008 -0700
170.3 @@ -96,7 +96,7 @@
170.4 }
170.5 taskBar.setBackground(desktop.getBackground());
170.6 desktop.add(taskBar,
170.7 - new Integer(JLayeredPane.PALETTE_LAYER.intValue() + 1));
170.8 + Integer.valueOf(JLayeredPane.PALETTE_LAYER.intValue() + 1));
170.9 if (desktop.isShowing()) {
170.10 taskBar.adjustSize();
170.11 }
171.1 --- a/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java Mon May 12 18:06:23 2008 -0700
171.2 +++ b/src/share/classes/javax/swing/plaf/synth/SynthSplitPaneUI.java Fri May 16 12:25:57 2008 -0700
171.3 @@ -127,7 +127,7 @@
171.4 if (style != oldStyle) {
171.5 Object value = style.get(context, "SplitPane.size");
171.6 if (value == null) {
171.7 - value = new Integer(6);
171.8 + value = Integer.valueOf(6);
171.9 }
171.10 LookAndFeel.installProperty(splitPane, "dividerSize", value);
171.11
172.1 --- a/src/share/classes/javax/swing/table/JTableHeader.java Mon May 12 18:06:23 2008 -0700
172.2 +++ b/src/share/classes/javax/swing/table/JTableHeader.java Fri May 16 12:25:57 2008 -0700
172.3 @@ -1,5 +1,5 @@
172.4 /*
172.5 - * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved.
172.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
172.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
172.8 *
172.9 * This code is free software; you can redistribute it and/or modify it
172.10 @@ -37,6 +37,7 @@
172.11 import javax.accessibility.*;
172.12
172.13 import java.beans.PropertyChangeListener;
172.14 +import java.beans.Transient;
172.15
172.16 import java.io.ObjectOutputStream;
172.17 import java.io.ObjectInputStream;
172.18 @@ -325,6 +326,7 @@
172.19 * @return the default renderer
172.20 * @since 1.3
172.21 */
172.22 + @Transient
172.23 public TableCellRenderer getDefaultRenderer() {
172.24 return defaultRenderer;
172.25 }
173.1 --- a/src/share/classes/javax/swing/table/TableColumn.java Mon May 12 18:06:23 2008 -0700
173.2 +++ b/src/share/classes/javax/swing/table/TableColumn.java Fri May 16 12:25:57 2008 -0700
173.3 @@ -281,7 +281,7 @@
173.4
173.5 private void firePropertyChange(String propertyName, int oldValue, int newValue) {
173.6 if (oldValue != newValue) {
173.7 - firePropertyChange(propertyName, new Integer(oldValue), new Integer(newValue));
173.8 + firePropertyChange(propertyName, Integer.valueOf(oldValue), Integer.valueOf(newValue));
173.9 }
173.10 }
173.11
174.1 --- a/src/share/classes/javax/swing/text/AbstractDocument.java Mon May 12 18:06:23 2008 -0700
174.2 +++ b/src/share/classes/javax/swing/text/AbstractDocument.java Fri May 16 12:25:57 2008 -0700
174.3 @@ -351,7 +351,7 @@
174.4 * loaded asynchronously
174.5 */
174.6 public void setAsynchronousLoadPriority(int p) {
174.7 - Integer loadPriority = (p >= 0) ? new Integer(p) : null;
174.8 + Integer loadPriority = (p >= 0) ? Integer.valueOf(p) : null;
174.9 putProperty(AbstractDocument.AsyncLoadPriority, loadPriority);
174.10 }
174.11
174.12 @@ -2675,7 +2675,7 @@
174.13 */
174.14 BidiElement(Element parent, int start, int end, int level) {
174.15 super(parent, new SimpleAttributeSet(), start, end);
174.16 - addAttribute(StyleConstants.BidiLevel, new Integer(level));
174.17 + addAttribute(StyleConstants.BidiLevel, Integer.valueOf(level));
174.18 //System.out.println("BidiElement: start = " + start
174.19 // + " end = " + end + " level = " + level );
174.20 }
175.1 --- a/src/share/classes/javax/swing/text/JTextComponent.java Mon May 12 18:06:23 2008 -0700
175.2 +++ b/src/share/classes/javax/swing/text/JTextComponent.java Fri May 16 12:25:57 2008 -0700
175.3 @@ -1,5 +1,5 @@
175.4 /*
175.5 - * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved.
175.6 + * Copyright 1997-2008 Sun Microsystems, Inc. All Rights Reserved.
175.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
175.8 *
175.9 * This code is free software; you can redistribute it and/or modify it
175.10 @@ -29,6 +29,7 @@
175.11 import java.security.AccessController;
175.12 import java.security.PrivilegedAction;
175.13
175.14 +import java.beans.Transient;
175.15 import java.util.Collections;
175.16 import java.util.HashMap;
175.17 import java.util.Hashtable;
175.18 @@ -571,6 +572,7 @@
175.19 *
175.20 * @return the caret
175.21 */
175.22 + @Transient
175.23 public Caret getCaret() {
175.24 return caret;
175.25 }
175.26 @@ -1349,11 +1351,6 @@
175.27 * This is the method that is used by the default implementation
175.28 * of the action for inserting content that gets bound to the
175.29 * keymap actions.
175.30 - * <p>
175.31 - * This method is thread safe, although most Swing methods
175.32 - * are not. Please see
175.33 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
175.34 - * to Use Threads</A> for more information.
175.35 *
175.36 * @param content the content to replace the selection with
175.37 */
175.38 @@ -1677,6 +1674,7 @@
175.39 * @return the position of the text insertion caret for the
175.40 * text component >= 0
175.41 */
175.42 + @Transient
175.43 public int getCaretPosition() {
175.44 return caret.getDot();
175.45 }
175.46 @@ -1687,12 +1685,8 @@
175.47 * or empty, has the effect of simply deleting the old text.
175.48 * When text has been inserted, the resulting caret location
175.49 * is determined by the implementation of the caret class.
175.50 + *
175.51 * <p>
175.52 - * This method is thread safe, although most Swing methods
175.53 - * are not. Please see
175.54 - * <A HREF="http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html">How
175.55 - * to Use Threads</A> for more information.
175.56 - *
175.57 * Note that text is not a bound property, so no <code>PropertyChangeEvent
175.58 * </code> is fired when it changes. To listen for changes to the text,
175.59 * use <code>DocumentListener</code>.
175.60 @@ -1806,6 +1800,7 @@
175.61 *
175.62 * @return the start position >= 0
175.63 */
175.64 + @Transient
175.65 public int getSelectionStart() {
175.66 int start = Math.min(caret.getDot(), caret.getMark());
175.67 return start;
175.68 @@ -1838,6 +1833,7 @@
175.69 *
175.70 * @return the end position >= 0
175.71 */
175.72 + @Transient
175.73 public int getSelectionEnd() {
175.74 int end = Math.max(caret.getDot(), caret.getMark());
175.75 return end;
176.1 --- a/src/share/classes/javax/swing/text/NumberFormatter.java Mon May 12 18:06:23 2008 -0700
176.2 +++ b/src/share/classes/javax/swing/text/NumberFormatter.java Fri May 16 12:25:57 2008 -0700
176.3 @@ -173,23 +173,24 @@
176.4 */
176.5 private Object convertValueToValueClass(Object value, Class valueClass) {
176.6 if (valueClass != null && (value instanceof Number)) {
176.7 + Number numberValue = (Number)value;
176.8 if (valueClass == Integer.class) {
176.9 - return new Integer(((Number)value).intValue());
176.10 + return Integer.valueOf(numberValue.intValue());
176.11 }
176.12 else if (valueClass == Long.class) {
176.13 - return new Long(((Number)value).longValue());
176.14 + return Long.valueOf(numberValue.longValue());
176.15 }
176.16 else if (valueClass == Float.class) {
176.17 - return new Float(((Number)value).floatValue());
176.18 + return Float.valueOf(numberValue.floatValue());
176.19 }
176.20 else if (valueClass == Double.class) {
176.21 - return new Double(((Number)value).doubleValue());
176.22 + return Double.valueOf(numberValue.doubleValue());
176.23 }
176.24 else if (valueClass == Byte.class) {
176.25 - return new Byte(((Number)value).byteValue());
176.26 + return Byte.valueOf(numberValue.byteValue());
176.27 }
176.28 else if (valueClass == Short.class) {
176.29 - return new Short(((Number)value).shortValue());
176.30 + return Short.valueOf(numberValue.shortValue());
176.31 }
176.32 }
176.33 return value;
177.1 --- a/src/share/classes/javax/swing/text/PlainDocument.java Mon May 12 18:06:23 2008 -0700
177.2 +++ b/src/share/classes/javax/swing/text/PlainDocument.java Fri May 16 12:25:57 2008 -0700
177.3 @@ -89,7 +89,7 @@
177.4 */
177.5 public PlainDocument(Content c) {
177.6 super(c);
177.7 - putProperty(tabSizeAttribute, new Integer(8));
177.8 + putProperty(tabSizeAttribute, Integer.valueOf(8));
177.9 defaultRoot = createDefaultRoot();
177.10 }
177.11
178.1 --- a/src/share/classes/javax/swing/text/Segment.java Mon May 12 18:06:23 2008 -0700
178.2 +++ b/src/share/classes/javax/swing/text/Segment.java Fri May 16 12:25:57 2008 -0700
178.3 @@ -118,7 +118,7 @@
178.4 if (array != null) {
178.5 return new String(array, offset, count);
178.6 }
178.7 - return new String();
178.8 + return "";
178.9 }
178.10
178.11 // --- CharacterIterator methods -------------------------------------
179.1 --- a/src/share/classes/javax/swing/text/StyleConstants.java Mon May 12 18:06:23 2008 -0700
179.2 +++ b/src/share/classes/javax/swing/text/StyleConstants.java Fri May 16 12:25:57 2008 -0700
179.3 @@ -296,7 +296,7 @@
179.4 * @param o the bidi level value
179.5 */
179.6 public static void setBidiLevel(MutableAttributeSet a, int o) {
179.7 - a.addAttribute(BidiLevel, new Integer(o));
179.8 + a.addAttribute(BidiLevel, Integer.valueOf(o));
179.9 }
179.10
179.11 /**
179.12 @@ -386,7 +386,7 @@
179.13 * @param s the font size
179.14 */
179.15 public static void setFontSize(MutableAttributeSet a, int s) {
179.16 - a.addAttribute(FontSize, new Integer(s));
179.17 + a.addAttribute(FontSize, Integer.valueOf(s));
179.18 }
179.19
179.20 /**
179.21 @@ -753,7 +753,7 @@
179.22 * @param align the alignment value
179.23 */
179.24 public static void setAlignment(MutableAttributeSet a, int align) {
179.25 - a.addAttribute(Alignment, new Integer(align));
179.26 + a.addAttribute(Alignment, Integer.valueOf(align));
179.27 }
179.28
179.29 /**
180.1 --- a/src/share/classes/javax/swing/text/html/AccessibleHTML.java Mon May 12 18:06:23 2008 -0700
180.2 +++ b/src/share/classes/javax/swing/text/html/AccessibleHTML.java Fri May 16 12:25:57 2008 -0700
180.3 @@ -1970,7 +1970,7 @@
180.4
180.5 for (int i = 0; i < nRows; i++) {
180.6 if (isAccessibleRowSelected(i)) {
180.7 - vec.addElement(new Integer(i));
180.8 + vec.addElement(Integer.valueOf(i));
180.9 }
180.10 }
180.11 int retval[] = new int[vec.size()];
180.12 @@ -1995,7 +1995,7 @@
180.13
180.14 for (int i = 0; i < nColumns; i++) {
180.15 if (isAccessibleColumnSelected(i)) {
180.16 - vec.addElement(new Integer(i));
180.17 + vec.addElement(Integer.valueOf(i));
180.18 }
180.19 }
180.20 int retval[] = new int[vec.size()];
180.21 @@ -2139,7 +2139,7 @@
180.22 private int columnCount = 0;
180.23
180.24 public void addHeader(TableCellElementInfo cellInfo, int rowNumber) {
180.25 - Integer rowInteger = new Integer(rowNumber);
180.26 + Integer rowInteger = Integer.valueOf(rowNumber);
180.27 ArrayList list = (ArrayList)headers.get(rowInteger);
180.28 if (list == null) {
180.29 list = new ArrayList();
180.30 @@ -2201,7 +2201,7 @@
180.31 }
180.32
180.33 private TableCellElementInfo getElementInfoAt(int r, int c) {
180.34 - ArrayList list = (ArrayList)headers.get(new Integer(r));
180.35 + ArrayList list = (ArrayList)headers.get(Integer.valueOf(r));
180.36 if (list != null) {
180.37 return (TableCellElementInfo)list.get(c);
180.38 } else {
181.1 --- a/src/share/classes/javax/swing/text/html/CSS.java Mon May 12 18:06:23 2008 -0700
181.2 +++ b/src/share/classes/javax/swing/text/html/CSS.java Fri May 16 12:25:57 2008 -0700
181.3 @@ -1099,7 +1099,7 @@
181.4 */
181.5 static String colorToHex(Color color) {
181.6
181.7 - String colorstr = new String("#");
181.8 + String colorstr = "#";
181.9
181.10 // Red
181.11 String str = Integer.toHexString(color.getRed());
182.1 --- a/src/share/classes/javax/swing/text/html/HTMLEditorKit.java Mon May 12 18:06:23 2008 -0700
182.2 +++ b/src/share/classes/javax/swing/text/html/HTMLEditorKit.java Fri May 16 12:25:57 2008 -0700
182.3 @@ -1899,8 +1899,8 @@
182.4 // assistive technologies listening for such events.
182.5 comp.getAccessibleContext().firePropertyChange(
182.6 AccessibleContext.ACCESSIBLE_HYPERTEXT_OFFSET,
182.7 - new Integer(kit.prevHypertextOffset),
182.8 - new Integer(e.getDot()));
182.9 + Integer.valueOf(kit.prevHypertextOffset),
182.10 + Integer.valueOf(e.getDot()));
182.11 }
182.12 }
182.13 }
183.1 --- a/src/share/classes/javax/swing/text/html/parser/AttributeList.java Mon May 12 18:06:23 2008 -0700
183.2 +++ b/src/share/classes/javax/swing/text/html/parser/AttributeList.java Fri May 16 12:25:57 2008 -0700
183.3 @@ -132,7 +132,7 @@
183.4 static Hashtable attributeTypes = new Hashtable();
183.5
183.6 static void defineAttributeType(String nm, int val) {
183.7 - Integer num = new Integer(val);
183.8 + Integer num = Integer.valueOf(val);
183.9 attributeTypes.put(nm, num);
183.10 attributeTypes.put(num, nm);
183.11 }
183.12 @@ -154,11 +154,11 @@
183.13 defineAttributeType("NUTOKEN", NUTOKEN);
183.14 defineAttributeType("NUTOKENS", NUTOKENS);
183.15
183.16 - attributeTypes.put("fixed", new Integer(FIXED));
183.17 - attributeTypes.put("required", new Integer(REQUIRED));
183.18 - attributeTypes.put("current", new Integer(CURRENT));
183.19 - attributeTypes.put("conref", new Integer(CONREF));
183.20 - attributeTypes.put("implied", new Integer(IMPLIED));
183.21 + attributeTypes.put("fixed", Integer.valueOf(FIXED));
183.22 + attributeTypes.put("required", Integer.valueOf(REQUIRED));
183.23 + attributeTypes.put("current", Integer.valueOf(CURRENT));
183.24 + attributeTypes.put("conref", Integer.valueOf(CONREF));
183.25 + attributeTypes.put("implied", Integer.valueOf(IMPLIED));
183.26 }
183.27
183.28 public static int name2type(String nm) {
183.29 @@ -167,6 +167,6 @@
183.30 }
183.31
183.32 public static String type2name(int tp) {
183.33 - return (String)attributeTypes.get(new Integer(tp));
183.34 + return (String)attributeTypes.get(Integer.valueOf(tp));
183.35 }
183.36 }
184.1 --- a/src/share/classes/javax/swing/text/html/parser/DTD.java Mon May 12 18:06:23 2008 -0700
184.2 +++ b/src/share/classes/javax/swing/text/html/parser/DTD.java Fri May 16 12:25:57 2008 -0700
184.3 @@ -113,7 +113,7 @@
184.4 * <code>ch</code> character
184.5 */
184.6 public Entity getEntity(int ch) {
184.7 - return (Entity)entityHash.get(new Integer(ch));
184.8 + return (Entity)entityHash.get(Integer.valueOf(ch));
184.9 }
184.10
184.11 /**
184.12 @@ -178,7 +178,7 @@
184.13 switch (type & ~GENERAL) {
184.14 case CDATA:
184.15 case SDATA:
184.16 - entityHash.put(new Integer(data[0]), ent);
184.17 + entityHash.put(Integer.valueOf(data[0]), ent);
184.18 break;
184.19 }
184.20 }
185.1 --- a/src/share/classes/javax/swing/text/html/parser/Element.java Mon May 12 18:06:23 2008 -0700
185.2 +++ b/src/share/classes/javax/swing/text/html/parser/Element.java Fri May 16 12:25:57 2008 -0700
185.3 @@ -162,10 +162,10 @@
185.4 static Hashtable contentTypes = new Hashtable();
185.5
185.6 static {
185.7 - contentTypes.put("CDATA", new Integer(CDATA));
185.8 - contentTypes.put("RCDATA", new Integer(RCDATA));
185.9 - contentTypes.put("EMPTY", new Integer(EMPTY));
185.10 - contentTypes.put("ANY", new Integer(ANY));
185.11 + contentTypes.put("CDATA", Integer.valueOf(CDATA));
185.12 + contentTypes.put("RCDATA", Integer.valueOf(RCDATA));
185.13 + contentTypes.put("EMPTY", Integer.valueOf(EMPTY));
185.14 + contentTypes.put("ANY", Integer.valueOf(ANY));
185.15 }
185.16
185.17 public static int name2type(String nm) {
186.1 --- a/src/share/classes/javax/swing/text/html/parser/Entity.java Mon May 12 18:06:23 2008 -0700
186.2 +++ b/src/share/classes/javax/swing/text/html/parser/Entity.java Fri May 16 12:25:57 2008 -0700
186.3 @@ -110,15 +110,15 @@
186.4 static Hashtable entityTypes = new Hashtable();
186.5
186.6 static {
186.7 - entityTypes.put("PUBLIC", new Integer(PUBLIC));
186.8 - entityTypes.put("CDATA", new Integer(CDATA));
186.9 - entityTypes.put("SDATA", new Integer(SDATA));
186.10 - entityTypes.put("PI", new Integer(PI));
186.11 - entityTypes.put("STARTTAG", new Integer(STARTTAG));
186.12 - entityTypes.put("ENDTAG", new Integer(ENDTAG));
186.13 - entityTypes.put("MS", new Integer(MS));
186.14 - entityTypes.put("MD", new Integer(MD));
186.15 - entityTypes.put("SYSTEM", new Integer(SYSTEM));
186.16 + entityTypes.put("PUBLIC", Integer.valueOf(PUBLIC));
186.17 + entityTypes.put("CDATA", Integer.valueOf(CDATA));
186.18 + entityTypes.put("SDATA", Integer.valueOf(SDATA));
186.19 + entityTypes.put("PI", Integer.valueOf(PI));
186.20 + entityTypes.put("STARTTAG", Integer.valueOf(STARTTAG));
186.21 + entityTypes.put("ENDTAG", Integer.valueOf(ENDTAG));
186.22 + entityTypes.put("MS", Integer.valueOf(MS));
186.23 + entityTypes.put("MD", Integer.valueOf(MD));
186.24 + entityTypes.put("SYSTEM", Integer.valueOf(SYSTEM));
186.25 }
186.26
186.27 /**
187.1 --- a/src/share/classes/javax/swing/text/html/parser/Parser.java Mon May 12 18:06:23 2008 -0700
187.2 +++ b/src/share/classes/javax/swing/text/html/parser/Parser.java Fri May 16 12:25:57 2008 -0700
187.3 @@ -1842,7 +1842,7 @@
187.4 String elemStr = getString(0);
187.5
187.6 if (elemStr.equals("image")) {
187.7 - elemStr = new String("img");
187.8 + elemStr = "img";
187.9 }
187.10
187.11 /* determine if this element is part of the dtd. */
188.1 --- a/src/share/classes/javax/swing/text/rtf/RTFAttributes.java Mon May 12 18:06:23 2008 -0700
188.2 +++ b/src/share/classes/javax/swing/text/rtf/RTFAttributes.java Fri May 16 12:25:57 2008 -0700
188.3 @@ -281,7 +281,7 @@
188.4 public AssertiveAttribute(int d, Object s, String r, int v)
188.5 {
188.6 super(d, s, r);
188.7 - swingValue = new Integer(v);
188.8 + swingValue = Integer.valueOf(v);
188.9 }
188.10
188.11 public boolean set(MutableAttributeSet target)
188.12 @@ -343,7 +343,7 @@
188.13 public NumericAttribute(int d, Object s,
188.14 String r, int ds, int dr)
188.15 {
188.16 - this(d, s, r, new Integer(ds), dr, 1f);
188.17 + this(d, s, r, Integer.valueOf(ds), dr, 1f);
188.18 }
188.19
188.20 public NumericAttribute(int d, Object s,
188.21 @@ -377,7 +377,7 @@
188.22 Number swingValue;
188.23
188.24 if (scale == 1f)
188.25 - swingValue = new Integer(parameter);
188.26 + swingValue = Integer.valueOf(parameter);
188.27 else
188.28 swingValue = new Float(parameter / scale);
188.29 target.addAttribute(swingName, swingValue);
189.1 --- a/src/share/classes/javax/swing/text/rtf/RTFGenerator.java Mon May 12 18:06:23 2008 -0700
189.2 +++ b/src/share/classes/javax/swing/text/rtf/RTFGenerator.java Fri May 16 12:25:57 2008 -0700
189.3 @@ -83,11 +83,7 @@
189.4 static public final String defaultFontFamily = "Helvetica";
189.5
189.6 /* constants so we can avoid allocating objects in inner loops */
189.7 - /* these should all be final, but javac seems to be a bit buggy */
189.8 - static protected Integer One, Zero;
189.9 - static protected Boolean False;
189.10 - static protected Float ZeroPointZero;
189.11 - static private Object MagicToken;
189.12 + final static private Object MagicToken;
189.13
189.14 /* An array of character-keyword pairs. This could be done
189.15 as a dictionary (and lookup would be quicker), but that
189.16 @@ -98,11 +94,7 @@
189.17 static protected CharacterKeywordPair[] textKeywords;
189.18
189.19 static {
189.20 - One = new Integer(1);
189.21 - Zero = new Integer(0);
189.22 - False = Boolean.valueOf(false);
189.23 MagicToken = new Object();
189.24 - ZeroPointZero = new Float(0);
189.25
189.26 Dictionary textKeywordDictionary = RTFReader.textKeywords;
189.27 Enumeration keys = textKeywordDictionary.keys();
189.28 @@ -142,7 +134,7 @@
189.29 public RTFGenerator(OutputStream to)
189.30 {
189.31 colorTable = new Hashtable();
189.32 - colorTable.put(defaultRTFColor, new Integer(0));
189.33 + colorTable.put(defaultRTFColor, Integer.valueOf(0));
189.34 colorCount = 1;
189.35
189.36 fontTable = new Hashtable();
189.37 @@ -693,7 +685,7 @@
189.38 {
189.39 writeControlWord("pard");
189.40
189.41 - currentAttributes.addAttribute(StyleConstants.Alignment, Zero);
189.42 + currentAttributes.addAttribute(StyleConstants.Alignment, Integer.valueOf(0));
189.43
189.44 int wordIndex;
189.45 int wordCount = RTFAttributes.attributes.length;
190.1 --- a/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Mon May 12 18:06:23 2008 -0700
190.2 +++ b/src/share/classes/javax/swing/tree/DefaultTreeSelectionModel.java Fri May 16 12:25:57 2008 -0700
190.3 @@ -157,8 +157,8 @@
190.4 selectionMode = TreeSelectionModel.DISCONTIGUOUS_TREE_SELECTION;
190.5 if(oldMode != selectionMode && changeSupport != null)
190.6 changeSupport.firePropertyChange(SELECTION_MODE_PROPERTY,
190.7 - new Integer(oldMode),
190.8 - new Integer(selectionMode));
190.9 + Integer.valueOf(oldMode),
190.10 + Integer.valueOf(selectionMode));
190.11 }
190.12
190.13 /**
191.1 --- a/src/share/classes/sun/applet/AppletPanel.java Mon May 12 18:06:23 2008 -0700
191.2 +++ b/src/share/classes/sun/applet/AppletPanel.java Fri May 16 12:25:57 2008 -0700
191.3 @@ -285,7 +285,7 @@
191.4 //System.out.println("SEND0= " + id);
191.5 queue = new Queue();
191.6 }
191.7 - Integer eventId = new Integer(id);
191.8 + Integer eventId = Integer.valueOf(id);
191.9 queue.enqueue(eventId);
191.10 notifyAll();
191.11 }
192.1 --- a/src/share/classes/sun/applet/AppletViewer.java Mon May 12 18:06:23 2008 -0700
192.2 +++ b/src/share/classes/sun/applet/AppletViewer.java Fri May 16 12:25:57 2008 -0700
192.3 @@ -587,9 +587,9 @@
192.4 Dimension d = panel.size();
192.5 Insets in = panel.insets();
192.6 panel.atts.put("width",
192.7 - new Integer(d.width - (in.left + in.right)).toString());
192.8 + Integer.toString(d.width - (in.left + in.right)));
192.9 panel.atts.put("height",
192.10 - new Integer(d.height - (in.top + in.bottom)).toString());
192.11 + Integer.toString(d.height - (in.top + in.bottom)));
192.12 }
192.13
192.14 /**
193.1 --- a/src/share/classes/sun/awt/FontConfiguration.java Mon May 12 18:06:23 2008 -0700
193.2 +++ b/src/share/classes/sun/awt/FontConfiguration.java Fri May 16 12:25:57 2008 -0700
193.3 @@ -1956,7 +1956,7 @@
193.4 /*Init these tables to allow componentFontNameID, fontfileNameIDs
193.5 to start from "1".
193.6 */
193.7 - componentFontNameIDs.put("", new Short((short)0));
193.8 + componentFontNameIDs.put("", Short.valueOf((short)0));
193.9
193.10 fontfileNameIDs = new HashMap<String, Short>();
193.11 filenames = new HashMap<Short, Short>();
194.1 --- a/src/share/classes/sun/awt/im/InputContext.java Mon May 12 18:06:23 2008 -0700
194.2 +++ b/src/share/classes/sun/awt/im/InputContext.java Fri May 16 12:25:57 2008 -0700
194.3 @@ -556,7 +556,7 @@
194.4 }
194.5 usedInputMethods.put(inputMethodLocator.deriveLocator(null), inputMethod);
194.6 perInputMethodState.put(inputMethod,
194.7 - new Boolean(clientWindowNotificationEnabled));
194.8 + Boolean.valueOf(clientWindowNotificationEnabled));
194.9 enableClientWindowNotification(inputMethod, false);
194.10 if (this == inputMethodWindowContext) {
194.11 inputMethod.hideWindows();
194.12 @@ -921,7 +921,7 @@
194.13 if (perInputMethodState == null) {
194.14 perInputMethodState = new HashMap(5);
194.15 }
194.16 - perInputMethodState.put(requester, new Boolean(enable));
194.17 + perInputMethodState.put(requester, Boolean.valueOf(enable));
194.18 return;
194.19 }
194.20
195.1 --- a/src/share/classes/sun/font/FileFontStrike.java Mon May 12 18:06:23 2008 -0700
195.2 +++ b/src/share/classes/sun/font/FileFontStrike.java Fri May 16 12:25:57 2008 -0700
195.3 @@ -657,7 +657,7 @@
195.4 * we first obtain this information, then the image, and never
195.5 * will access this value again.
195.6 */
195.7 - Integer key = new Integer(glyphCode);
195.8 + Integer key = Integer.valueOf(glyphCode);
195.9 Point2D.Float value = null;
195.10 ConcurrentHashMap<Integer, Point2D.Float> glyphMetricsMap = null;
195.11 if (glyphMetricsMapRef != null) {
195.12 @@ -724,7 +724,7 @@
195.13 boundsMap = new ConcurrentHashMap<Integer, Rectangle2D.Float>();
195.14 }
195.15
195.16 - Integer key = new Integer(glyphCode);
195.17 + Integer key = Integer.valueOf(glyphCode);
195.18 Rectangle2D.Float bounds = boundsMap.get(key);
195.19
195.20 if (bounds == null) {
196.1 --- a/src/share/classes/sun/font/FontManager.java Mon May 12 18:06:23 2008 -0700
196.2 +++ b/src/share/classes/sun/font/FontManager.java Fri May 16 12:25:57 2008 -0700
196.3 @@ -2124,7 +2124,7 @@
196.4
196.5 private static void addLCIDMapEntry(Map<String, Short> map,
196.6 String key, short value) {
196.7 - map.put(key, new Short(value));
196.8 + map.put(key, Short.valueOf(value));
196.9 }
196.10
196.11 private static synchronized void createLCIDMap() {
197.1 --- a/src/share/classes/sun/font/FontResolver.java Mon May 12 18:06:23 2008 -0700
197.2 +++ b/src/share/classes/sun/font/FontResolver.java Fri May 16 12:25:57 2008 -0700
197.3 @@ -117,7 +117,7 @@
197.4 Font2D font2D = FontManager.getFont2D(font);
197.5 if (font2D.hasSupplementaryChars()) {
197.6 fonts.add(font);
197.7 - indices.add(new Integer(i));
197.8 + indices.add(Integer.valueOf(i));
197.9 }
197.10 }
197.11
198.1 --- a/src/share/classes/sun/font/PhysicalStrike.java Mon May 12 18:06:23 2008 -0700
198.2 +++ b/src/share/classes/sun/font/PhysicalStrike.java Fri May 16 12:25:57 2008 -0700
198.3 @@ -114,7 +114,7 @@
198.4 */
198.5 Point2D.Float getGlyphPoint(int glyphCode, int ptNumber) {
198.6 Point2D.Float gp = null;
198.7 - Integer ptKey = new Integer(glyphCode<<16|ptNumber);
198.8 + Integer ptKey = Integer.valueOf(glyphCode<<16|ptNumber);
198.9 if (glyphPointMapCache == null) {
198.10 synchronized (this) {
198.11 if (glyphPointMapCache == null) {
199.1 --- a/src/share/classes/sun/java2d/SunGraphics2D.java Mon May 12 18:06:23 2008 -0700
199.2 +++ b/src/share/classes/sun/java2d/SunGraphics2D.java Fri May 16 12:25:57 2008 -0700
199.3 @@ -1374,7 +1374,7 @@
199.4 SunHints.Value.get(SunHints.INTKEY_FRACTIONALMETRICS,
199.5 fractionalMetricsHint));
199.6 model.put(SunHints.KEY_TEXT_ANTIALIAS_LCD_CONTRAST,
199.7 - new Integer(lcdTextContrast));
199.8 + Integer.valueOf(lcdTextContrast));
199.9 Object value;
199.10 switch (interpolationHint) {
199.11 case SunHints.INTVAL_INTERPOLATION_NEAREST_NEIGHBOR:
200.1 --- a/src/share/classes/sun/java2d/loops/SurfaceType.java Mon May 12 18:06:23 2008 -0700
200.2 +++ b/src/share/classes/sun/java2d/loops/SurfaceType.java Fri May 16 12:25:57 2008 -0700
200.3 @@ -408,7 +408,7 @@
200.4 if (unusedUID > 255) {
200.5 throw new InternalError("surface type id overflow");
200.6 }
200.7 - i = new Integer(unusedUID++);
200.8 + i = Integer.valueOf(unusedUID++);
200.9 surfaceUIDMap.put(desc, i);
200.10 }
200.11 return i.intValue();
201.1 --- a/src/share/classes/sun/print/PSPrinterJob.java Mon May 12 18:06:23 2008 -0700
201.2 +++ b/src/share/classes/sun/print/PSPrinterJob.java Fri May 16 12:25:57 2008 -0700
201.3 @@ -1536,16 +1536,16 @@
201.4 execCmd = new String[ncomps];
201.5 execCmd[n++] = "/usr/bin/lpr";
201.6 if ((pFlags & PRINTER) != 0) {
201.7 - execCmd[n++] = new String("-P" + printer);
201.8 + execCmd[n++] = "-P" + printer;
201.9 }
201.10 if ((pFlags & BANNER) != 0) {
201.11 - execCmd[n++] = new String("-J" + banner);
201.12 + execCmd[n++] = "-J" + banner;
201.13 }
201.14 if ((pFlags & COPIES) != 0) {
201.15 - execCmd[n++] = new String("-#" + new Integer(copies).toString());
201.16 + execCmd[n++] = "-#" + copies;
201.17 }
201.18 if ((pFlags & NOSHEET) != 0) {
201.19 - execCmd[n++] = new String("-h");
201.20 + execCmd[n++] = "-h";
201.21 }
201.22 if ((pFlags & OPTIONS) != 0) {
201.23 execCmd[n++] = new String(options);
201.24 @@ -1556,19 +1556,19 @@
201.25 execCmd[n++] = "/usr/bin/lp";
201.26 execCmd[n++] = "-c"; // make a copy of the spool file
201.27 if ((pFlags & PRINTER) != 0) {
201.28 - execCmd[n++] = new String("-d" + printer);
201.29 + execCmd[n++] = "-d" + printer;
201.30 }
201.31 if ((pFlags & BANNER) != 0) {
201.32 - execCmd[n++] = new String("-t" + banner);
201.33 + execCmd[n++] = "-t" + banner;
201.34 }
201.35 if ((pFlags & COPIES) != 0) {
201.36 - execCmd[n++] = new String("-n" + new Integer(copies).toString());
201.37 + execCmd[n++] = "-n" + copies;
201.38 }
201.39 if ((pFlags & NOSHEET) != 0) {
201.40 - execCmd[n++] = new String("-o nobanner");
201.41 + execCmd[n++] = "-o nobanner";
201.42 }
201.43 if ((pFlags & OPTIONS) != 0) {
201.44 - execCmd[n++] = new String("-o" + options);
201.45 + execCmd[n++] = "-o" + options;
201.46 }
201.47 }
201.48 execCmd[n++] = spoolFile;
202.1 --- a/src/share/classes/sun/print/RasterPrinterJob.java Mon May 12 18:06:23 2008 -0700
202.2 +++ b/src/share/classes/sun/print/RasterPrinterJob.java Fri May 16 12:25:57 2008 -0700
202.3 @@ -245,7 +245,7 @@
202.4 /**
202.5 * The name of the job being printed.
202.6 */
202.7 - private String mDocName = new String("Java Printing");
202.8 + private String mDocName = "Java Printing";
202.9
202.10
202.11 /**
203.1 --- a/src/share/classes/sun/swing/FilePane.java Mon May 12 18:06:23 2008 -0700
203.2 +++ b/src/share/classes/sun/swing/FilePane.java Fri May 16 12:25:57 2008 -0700
203.3 @@ -1285,7 +1285,6 @@
203.4
203.5 int lastIndex = -1;
203.6 File editFile = null;
203.7 - int editX = 20;
203.8
203.9 private int getEditIndex() {
203.10 return lastIndex;
203.11 @@ -1315,7 +1314,9 @@
203.12 * @param index visual index of the file to be edited
203.13 */
203.14 private void editFileName(int index) {
203.15 - File currentDirectory = getFileChooser().getCurrentDirectory();
203.16 + JFileChooser chooser = getFileChooser();
203.17 + File currentDirectory = chooser.getCurrentDirectory();
203.18 +
203.19 if (readOnly || !canWrite(currentDirectory)) {
203.20 return;
203.21 }
203.22 @@ -1332,9 +1333,15 @@
203.23 editCell.setNextFocusableComponent(list);
203.24 }
203.25 list.add(editCell);
203.26 - editCell.setText(getFileChooser().getName(editFile));
203.27 + editCell.setText(chooser.getName(editFile));
203.28 ComponentOrientation orientation = list.getComponentOrientation();
203.29 editCell.setComponentOrientation(orientation);
203.30 +
203.31 + Icon icon = chooser.getIcon(editFile);
203.32 +
203.33 + // PENDING - grab padding (4) below from defaults table.
203.34 + int editX = icon == null ? 20 : icon.getIconWidth() + 4;
203.35 +
203.36 if (orientation.isLeftToRight()) {
203.37 editCell.setBounds(editX + r.x, r.y, r.width - editX, r.height);
203.38 } else {
203.39 @@ -1458,11 +1465,6 @@
203.40 Icon icon = getFileChooser().getIcon(file);
203.41 if (icon != null) {
203.42 setIcon(icon);
203.43 -
203.44 - if (isSelected) {
203.45 - // PENDING - grab padding (4) below from defaults table.
203.46 - editX = icon.getIconWidth() + 4;
203.47 - }
203.48 } else {
203.49 if (getFileChooser().getFileSystemView().isTraversable(file)) {
203.50 setText(fileName+File.separator);
204.1 --- a/src/share/classes/sun/swing/WindowsPlacesBar.java Mon May 12 18:06:23 2008 -0700
204.2 +++ b/src/share/classes/sun/swing/WindowsPlacesBar.java Fri May 16 12:25:57 2008 -0700
204.3 @@ -93,11 +93,18 @@
204.4 if (index >= 0 && index < folderName.length() - 1) {
204.5 folderName = folderName.substring(index + 1);
204.6 }
204.7 - Icon icon = null;
204.8 + Icon icon;
204.9 if (files[i] instanceof ShellFolder) {
204.10 // We want a large icon, fsv only gives us a small.
204.11 ShellFolder sf = (ShellFolder)files[i];
204.12 - icon = new ImageIcon(sf.getIcon(true), sf.getFolderType());
204.13 + Image image = sf.getIcon(true);
204.14 +
204.15 + if (image == null) {
204.16 + // Get default image
204.17 + image = (Image) ShellFolder.get("shell32LargeIcon 1");
204.18 + }
204.19 +
204.20 + icon = image == null ? null : new ImageIcon(image, sf.getFolderType());
204.21 } else {
204.22 icon = fsv.getSystemIcon(files[i]);
204.23 }
205.1 --- a/src/share/classes/sun/text/normalizer/VersionInfo.java Mon May 12 18:06:23 2008 -0700
205.2 +++ b/src/share/classes/sun/text/normalizer/VersionInfo.java Fri May 16 12:25:57 2008 -0700
205.3 @@ -116,7 +116,7 @@
205.4 throw new IllegalArgumentException(INVALID_VERSION_NUMBER_);
205.5 }
205.6 int version = getInt(major, minor, milli, micro);
205.7 - Integer key = new Integer(version);
205.8 + Integer key = Integer.valueOf(version);
205.9 Object result = MAP_.get(key);
205.10 if (result == null) {
205.11 result = new VersionInfo(version);
206.1 --- a/src/solaris/classes/sun/awt/X11/MWMConstants.java Mon May 12 18:06:23 2008 -0700
206.2 +++ b/src/solaris/classes/sun/awt/X11/MWMConstants.java Fri May 16 12:25:57 2008 -0700
206.3 @@ -1,5 +1,5 @@
206.4 /*
206.5 - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
206.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
206.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
206.8 *
206.9 * This code is free software; you can redistribute it and/or modify it
206.10 @@ -26,7 +26,9 @@
206.11
206.12 package sun.awt.X11;
206.13
206.14 -public interface MWMConstants {
206.15 +final public class MWMConstants {
206.16 +
206.17 + private MWMConstants(){}
206.18
206.19 /* bit definitions for MwmHints.flags */
206.20 static final int MWM_HINTS_FUNCTIONS= (1 << 0);
207.1 --- a/src/solaris/classes/sun/awt/X11/MotifDnDConstants.java Mon May 12 18:06:23 2008 -0700
207.2 +++ b/src/solaris/classes/sun/awt/X11/MotifDnDConstants.java Fri May 16 12:25:57 2008 -0700
207.3 @@ -118,11 +118,11 @@
207.4 XA_MOTIF_DRAG_WINDOW,
207.5 0, 1,
207.6 false,
207.7 - XlibWrapper.AnyPropertyType);
207.8 + XConstants.AnyPropertyType);
207.9 try {
207.10 int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
207.11
207.12 - if (status == XlibWrapper.Success &&
207.13 + if (status == XConstants.Success &&
207.14 wpg.getData() != 0 &&
207.15 wpg.getActualType() == XAtom.XA_WINDOW &&
207.16 wpg.getActualFormat() == 32 &&
207.17 @@ -163,20 +163,20 @@
207.18 XlibWrapper.XGrabServer(newDisplay);
207.19
207.20 try {
207.21 - XlibWrapper.XSetCloseDownMode(newDisplay, (int)XlibWrapper.RetainPermanent);
207.22 + XlibWrapper.XSetCloseDownMode(newDisplay, (int)XConstants.RetainPermanent);
207.23
207.24 XSetWindowAttributes xwa = new XSetWindowAttributes();
207.25
207.26 try {
207.27 xwa.set_override_redirect(true);
207.28 - xwa.set_event_mask(XlibWrapper.PropertyChangeMask);
207.29 + xwa.set_event_mask(XConstants.PropertyChangeMask);
207.30
207.31 motifWindow = XlibWrapper.XCreateWindow(newDisplay, defaultRootWindow,
207.32 -10, -10, 1, 1, 0, 0,
207.33 - XlibWrapper.InputOnly,
207.34 - XlibWrapper.CopyFromParent,
207.35 - (XlibWrapper.CWOverrideRedirect |
207.36 - XlibWrapper.CWEventMask),
207.37 + XConstants.InputOnly,
207.38 + XConstants.CopyFromParent,
207.39 + (XConstants.CWOverrideRedirect |
207.40 + XConstants.CWEventMask),
207.41 xwa.pData);
207.42
207.43 if (motifWindow == 0) {
207.44 @@ -195,13 +195,13 @@
207.45 defaultRootWindow,
207.46 XA_MOTIF_DRAG_WINDOW.getAtom(),
207.47 XAtom.XA_WINDOW, 32,
207.48 - XlibWrapper.PropModeReplace,
207.49 + XConstants.PropModeReplace,
207.50 data, 1);
207.51
207.52 XToolkit.RESTORE_XERROR_HANDLER();
207.53
207.54 if (XToolkit.saved_error != null &&
207.55 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
207.56 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
207.57 throw new XException("Cannot write motif drag window handle.");
207.58 }
207.59
207.60 @@ -282,7 +282,7 @@
207.61 try {
207.62 int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
207.63
207.64 - if (status != XlibWrapper.Success
207.65 + if (status != XConstants.Success
207.66 || wpg.getActualType() != XA_MOTIF_DRAG_TARGETS.getAtom()
207.67 || wpg.getData() == 0) {
207.68
207.69 @@ -399,13 +399,13 @@
207.70 motifWindow,
207.71 XA_MOTIF_DRAG_TARGETS.getAtom(),
207.72 XA_MOTIF_DRAG_TARGETS.getAtom(), 8,
207.73 - XlibWrapper.PropModeReplace,
207.74 + XConstants.PropModeReplace,
207.75 data, tableSize);
207.76
207.77 XToolkit.RESTORE_XERROR_HANDLER();
207.78
207.79 if (XToolkit.saved_error != null &&
207.80 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
207.81 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
207.82
207.83 // Create a new motif window and retry.
207.84 motifWindow = createMotifWindow();
207.85 @@ -415,13 +415,13 @@
207.86 motifWindow,
207.87 XA_MOTIF_DRAG_TARGETS.getAtom(),
207.88 XA_MOTIF_DRAG_TARGETS.getAtom(), 8,
207.89 - XlibWrapper.PropModeReplace,
207.90 + XConstants.PropModeReplace,
207.91 data, tableSize);
207.92
207.93 XToolkit.RESTORE_XERROR_HANDLER();
207.94
207.95 if (XToolkit.saved_error != null &&
207.96 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
207.97 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
207.98 throw new XException("Cannot write motif drag targets property.");
207.99 }
207.100 }
207.101 @@ -538,12 +538,12 @@
207.102 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
207.103 XA_MOTIF_ATOM_0.getAtom(),
207.104 XA_MOTIF_DRAG_INITIATOR_INFO.getAtom(),
207.105 - 8, XlibWrapper.PropModeReplace,
207.106 + 8, XConstants.PropModeReplace,
207.107 structData, MOTIF_INITIATOR_INFO_SIZE);
207.108 XToolkit.RESTORE_XERROR_HANDLER();
207.109
207.110 if (XToolkit.saved_error != null &&
207.111 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
207.112 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
207.113 throw new XException("Cannot write drag initiator info");
207.114 }
207.115 } finally {
207.116 @@ -571,12 +571,12 @@
207.117 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
207.118 XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
207.119 XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
207.120 - 8, XlibWrapper.PropModeReplace,
207.121 + 8, XConstants.PropModeReplace,
207.122 data, dataSize);
207.123 XToolkit.RESTORE_XERROR_HANDLER();
207.124
207.125 if (XToolkit.saved_error != null &&
207.126 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
207.127 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
207.128 throw new XException("Cannot write Motif receiver info property");
207.129 }
207.130 } finally {
208.1 --- a/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java Mon May 12 18:06:23 2008 -0700
208.2 +++ b/src/solaris/classes/sun/awt/X11/MotifDnDDragSourceProtocol.java Fri May 16 12:25:57 2008 -0700
208.3 @@ -1,5 +1,5 @@
208.4 /*
208.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
208.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
208.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
208.8 *
208.9 * This code is free software; you can redistribute it and/or modify it
208.10 @@ -44,7 +44,7 @@
208.11
208.12 private static final Unsafe unsafe = XlibWrapper.unsafe;
208.13
208.14 - private long targetEnterServerTime = XlibWrapper.CurrentTime;
208.15 + private long targetEnterServerTime = XConstants.CurrentTime;
208.16
208.17 protected MotifDnDDragSourceProtocol(XDragSourceProtocolListener listener) {
208.18 super(listener);
208.19 @@ -86,7 +86,7 @@
208.20
208.21 if (!MotifDnDConstants.MotifDnDSelection.setOwner(contents, formatMap,
208.22 formats,
208.23 - XlibWrapper.CurrentTime)) {
208.24 + XConstants.CurrentTime)) {
208.25 cleanup();
208.26 throw new InvalidDnDOperationException("Cannot acquire selection ownership");
208.27 }
208.28 @@ -137,7 +137,7 @@
208.29 long time = t;
208.30
208.31 /* Discard events from the previous receiver. */
208.32 - if (targetEnterServerTime == XlibWrapper.CurrentTime ||
208.33 + if (targetEnterServerTime == XConstants.CurrentTime ||
208.34 time < targetEnterServerTime) {
208.35 return true;
208.36 }
208.37 @@ -181,7 +181,7 @@
208.38 new WindowPropertyGetter(window,
208.39 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
208.40 0, 0xFFFF, false,
208.41 - XlibWrapper.AnyPropertyType);
208.42 + XConstants.AnyPropertyType);
208.43
208.44 try {
208.45 int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
208.46 @@ -200,7 +200,7 @@
208.47 * CARD32 heap_offset B32;
208.48 * } xmDragReceiverInfoStruct;
208.49 */
208.50 - if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
208.51 + if (status == (int)XConstants.Success && wpg.getData() != 0 &&
208.52 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
208.53 wpg.getNumberOfItems() >=
208.54 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
208.55 @@ -243,7 +243,7 @@
208.56
208.57 XClientMessageEvent msg = new XClientMessageEvent();
208.58 try {
208.59 - msg.set_type(XlibWrapper.ClientMessage);
208.60 + msg.set_type(XConstants.ClientMessage);
208.61 msg.set_window(getTargetWindow());
208.62 msg.set_format(8);
208.63 msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
208.64 @@ -267,7 +267,7 @@
208.65
208.66 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
208.67 getTargetProxyWindow(),
208.68 - false, XlibWrapper.NoEventMask,
208.69 + false, XConstants.NoEventMask,
208.70 msg.pData);
208.71 } finally {
208.72 msg.dispose();
208.73 @@ -281,7 +281,7 @@
208.74
208.75 XClientMessageEvent msg = new XClientMessageEvent();
208.76 try {
208.77 - msg.set_type(XlibWrapper.ClientMessage);
208.78 + msg.set_type(XConstants.ClientMessage);
208.79 msg.set_window(getTargetWindow());
208.80 msg.set_format(8);
208.81 msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
208.82 @@ -305,7 +305,7 @@
208.83
208.84 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
208.85 getTargetProxyWindow(),
208.86 - false, XlibWrapper.NoEventMask,
208.87 + false, XConstants.NoEventMask,
208.88 msg.pData);
208.89 } finally {
208.90 msg.dispose();
208.91 @@ -318,7 +318,7 @@
208.92
208.93 XClientMessageEvent msg = new XClientMessageEvent();
208.94 try {
208.95 - msg.set_type(XlibWrapper.ClientMessage);
208.96 + msg.set_type(XConstants.ClientMessage);
208.97 msg.set_window(getTargetWindow());
208.98 msg.set_format(8);
208.99 msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
208.100 @@ -336,7 +336,7 @@
208.101
208.102 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
208.103 getTargetProxyWindow(),
208.104 - false, XlibWrapper.NoEventMask,
208.105 + false, XConstants.NoEventMask,
208.106 msg.pData);
208.107 } finally {
208.108 msg.dispose();
208.109 @@ -356,7 +356,7 @@
208.110
208.111 XClientMessageEvent msg = new XClientMessageEvent();
208.112 try {
208.113 - msg.set_type(XlibWrapper.ClientMessage);
208.114 + msg.set_type(XConstants.ClientMessage);
208.115 msg.set_window(getTargetWindow());
208.116 msg.set_format(8);
208.117 msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
208.118 @@ -382,7 +382,7 @@
208.119
208.120 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
208.121 getTargetProxyWindow(),
208.122 - false, XlibWrapper.NoEventMask,
208.123 + false, XConstants.NoEventMask,
208.124 msg.pData);
208.125 } finally {
208.126 msg.dispose();
208.127 @@ -397,12 +397,12 @@
208.128
208.129 public void cleanupTargetInfo() {
208.130 super.cleanupTargetInfo();
208.131 - targetEnterServerTime = XlibWrapper.CurrentTime;
208.132 + targetEnterServerTime = XConstants.CurrentTime;
208.133 }
208.134
208.135 public void dispatchEvent(XEvent ev) {
208.136 switch (ev.get_type()) {
208.137 - case XlibWrapper.SelectionRequest:
208.138 + case XConstants.SelectionRequest:
208.139 XSelectionRequestEvent xsre = ev.get_xselectionrequest();
208.140 long atom = xsre.get_selection();
208.141
209.1 --- a/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java Mon May 12 18:06:23 2008 -0700
209.2 +++ b/src/solaris/classes/sun/awt/X11/MotifDnDDropTargetProtocol.java Fri May 16 12:25:57 2008 -0700
209.3 @@ -99,7 +99,7 @@
209.4 new WindowPropertyGetter(embedder,
209.5 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
209.6 0, 0xFFFF, false,
209.7 - XlibWrapper.AnyPropertyType);
209.8 + XConstants.AnyPropertyType);
209.9
209.10 try {
209.11 status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
209.12 @@ -118,7 +118,7 @@
209.13 * CARD32 heap_offset B32;
209.14 * } xmDragReceiverInfoStruct;
209.15 */
209.16 - if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
209.17 + if (status == (int)XConstants.Success && wpg.getData() != 0 &&
209.18 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
209.19 wpg.getNumberOfItems() >=
209.20 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
209.21 @@ -166,12 +166,12 @@
209.22 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), embedder,
209.23 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
209.24 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
209.25 - 8, XlibWrapper.PropModeReplace,
209.26 + 8, XConstants.PropModeReplace,
209.27 data, dataSize);
209.28 XToolkit.RESTORE_XERROR_HANDLER();
209.29
209.30 if (XToolkit.saved_error != null &&
209.31 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
209.32 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
209.33 throw new XException("Cannot write Motif receiver info property");
209.34 }
209.35 } finally {
209.36 @@ -201,7 +201,7 @@
209.37 new WindowPropertyGetter(embedder,
209.38 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
209.39 0, 0xFFFF, false,
209.40 - XlibWrapper.AnyPropertyType);
209.41 + XConstants.AnyPropertyType);
209.42
209.43 try {
209.44 status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
209.45 @@ -220,7 +220,7 @@
209.46 * CARD32 heap_offset B32;
209.47 * } xmDragReceiverInfoStruct;
209.48 */
209.49 - if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
209.50 + if (status == (int)XConstants.Success && wpg.getData() != 0 &&
209.51 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
209.52 wpg.getNumberOfItems() >=
209.53 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
209.54 @@ -240,12 +240,12 @@
209.55 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), embedder,
209.56 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
209.57 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom(),
209.58 - 8, XlibWrapper.PropModeReplace,
209.59 + 8, XConstants.PropModeReplace,
209.60 data, dataSize);
209.61 XToolkit.RESTORE_XERROR_HANDLER();
209.62
209.63 if (XToolkit.saved_error != null &&
209.64 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
209.65 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
209.66 throw new XException("Cannot write Motif receiver info property");
209.67 }
209.68 }
209.69 @@ -273,7 +273,7 @@
209.70 new WindowPropertyGetter(embedded,
209.71 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
209.72 0, 0xFFFF, false,
209.73 - XlibWrapper.AnyPropertyType);
209.74 + XConstants.AnyPropertyType);
209.75
209.76 try {
209.77 status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
209.78 @@ -292,7 +292,7 @@
209.79 * CARD32 heap_offset B32;
209.80 * } xmDragReceiverInfoStruct;
209.81 */
209.82 - if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
209.83 + if (status == (int)XConstants.Success && wpg.getData() != 0 &&
209.84 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
209.85 wpg.getNumberOfItems() >=
209.86 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
209.87 @@ -322,12 +322,12 @@
209.88 new WindowPropertyGetter(window,
209.89 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO,
209.90 0, 0xFFFF, false,
209.91 - XlibWrapper.AnyPropertyType);
209.92 + XConstants.AnyPropertyType);
209.93
209.94 try {
209.95 int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
209.96
209.97 - if (status == (int)XlibWrapper.Success && wpg.getData() != 0 &&
209.98 + if (status == (int)XConstants.Success && wpg.getData() != 0 &&
209.99 wpg.getActualType() != 0 && wpg.getActualFormat() == 8 &&
209.100 wpg.getNumberOfItems() >=
209.101 MotifDnDConstants.MOTIF_RECEIVER_INFO_SIZE) {
209.102 @@ -377,7 +377,7 @@
209.103 try {
209.104 int status = wpg.execute(XToolkit.IgnoreBadWindowHandler);
209.105
209.106 - if (status == XlibWrapper.Success && wpg.getData() != 0 &&
209.107 + if (status == XConstants.Success && wpg.getData() != 0 &&
209.108 wpg.getActualType() ==
209.109 MotifDnDConstants.XA_MOTIF_DRAG_INITIATOR_INFO.getAtom() &&
209.110 wpg.getActualFormat() == 8 &&
209.111 @@ -420,7 +420,7 @@
209.112
209.113 if (status == 0 ||
209.114 (XToolkit.saved_error != null &&
209.115 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
209.116 + XToolkit.saved_error.get_error_code() != XConstants.Success)) {
209.117 throw new XException("XGetWindowAttributes failed");
209.118 }
209.119
209.120 @@ -432,12 +432,12 @@
209.121 XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
209.122 XlibWrapper.XSelectInput(XToolkit.getDisplay(), source_win,
209.123 source_win_mask |
209.124 - XlibWrapper.StructureNotifyMask);
209.125 + XConstants.StructureNotifyMask);
209.126
209.127 XToolkit.RESTORE_XERROR_HANDLER();
209.128
209.129 if (XToolkit.saved_error != null &&
209.130 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
209.131 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
209.132 throw new XException("XSelectInput failed");
209.133 }
209.134
209.135 @@ -590,7 +590,7 @@
209.136 XClientMessageEvent dummy = new XClientMessageEvent();
209.137
209.138 try {
209.139 - dummy.set_type(XlibWrapper.ClientMessage);
209.140 + dummy.set_type(XConstants.ClientMessage);
209.141 dummy.set_window(xclient.get_window());
209.142 dummy.set_format(32);
209.143 dummy.set_message_type(0);
209.144 @@ -600,7 +600,7 @@
209.145 dummy.set_data(3, 0);
209.146 dummy.set_data(4, 0);
209.147 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
209.148 - proxy, false, XlibWrapper.NoEventMask,
209.149 + proxy, false, XConstants.NoEventMask,
209.150 dummy.pData);
209.151 } finally {
209.152 dummy.dispose();
209.153 @@ -821,7 +821,7 @@
209.154 XClientMessageEvent msg = new XClientMessageEvent();
209.155
209.156 try {
209.157 - msg.set_type(XlibWrapper.ClientMessage);
209.158 + msg.set_type(XConstants.ClientMessage);
209.159 msg.set_window(MotifDnDConstants.Swapper.getInt(data + 12, eventByteOrder));
209.160 msg.set_format(8);
209.161 msg.set_message_type(MotifDnDConstants.XA_MOTIF_DRAG_AND_DROP_MESSAGE.getAtom());
209.162 @@ -878,7 +878,7 @@
209.163 try {
209.164 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
209.165 msg.get_window(),
209.166 - false, XlibWrapper.NoEventMask,
209.167 + false, XConstants.NoEventMask,
209.168 msg.pData);
209.169 } finally {
209.170 XToolkit.awtUnlock();
210.1 --- a/src/solaris/classes/sun/awt/X11/WindowPropertyGetter.java Mon May 12 18:06:23 2008 -0700
210.2 +++ b/src/solaris/classes/sun/awt/X11/WindowPropertyGetter.java Fri May 16 12:25:57 2008 -0700
210.3 @@ -1,5 +1,5 @@
210.4 /*
210.5 - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
210.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
210.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
210.8 *
210.9 * This code is free software; you can redistribute it and/or modify it
210.10 @@ -89,7 +89,7 @@
210.11
210.12 if (isCachingSupported() && isCached()) {
210.13 readFromCache();
210.14 - return XlibWrapper.Success;
210.15 + return XConstants.Success;
210.16 }
210.17
210.18 // Fix for performance problem - IgnodeBadWindowHandler is
210.19 @@ -106,7 +106,7 @@
210.20 offset, length, (auto_delete?1:0), type,
210.21 actual_type, actual_format, nitems_ptr,
210.22 bytes_after, data);
210.23 - if (isCachingSupported() && status == XlibWrapper.Success && getData() != 0 && isCacheableProperty(property)) {
210.24 + if (isCachingSupported() && status == XConstants.Success && getData() != 0 && isCacheableProperty(property)) {
210.25 // Property has some data, we cache them
210.26 cacheProperty();
210.27 }
211.1 --- a/src/solaris/classes/sun/awt/X11/XAWTXSettings.java Mon May 12 18:06:23 2008 -0700
211.2 +++ b/src/solaris/classes/sun/awt/X11/XAWTXSettings.java Fri May 16 12:25:57 2008 -0700
211.3 @@ -1,5 +1,5 @@
211.4 /*
211.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
211.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
211.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
211.8 *
211.9 * This code is free software; you can redistribute it and/or modify it
211.10 @@ -128,7 +128,7 @@
211.11 try {
211.12 int status = getter.execute(XToolkit.IgnoreBadWindowHandler);
211.13
211.14 - if (status != XlibWrapper.Success || getter.getData() == 0) {
211.15 + if (status != XConstants.Success || getter.getData() == 0) {
211.16 if (log.isLoggable(Level.FINE)) log.fine("OH OH : getter failed status = " + status );
211.17 settings = null;
211.18 }
212.1 --- a/src/solaris/classes/sun/awt/X11/XAtom.java Mon May 12 18:06:23 2008 -0700
212.2 +++ b/src/solaris/classes/sun/awt/X11/XAtom.java Fri May 16 12:25:57 2008 -0700
212.3 @@ -370,7 +370,7 @@
212.4 false, property_type);
212.5 try {
212.6 int status = getter.execute();
212.7 - if (status != XlibWrapper.Success || getter.getData() == 0) {
212.8 + if (status != XConstants.Success || getter.getData() == 0) {
212.9 return 0;
212.10 }
212.11 if (getter.getActualType() != property_type || getter.getActualFormat() != 32) {
212.12 @@ -401,7 +401,7 @@
212.13 try {
212.14 Native.putCard32(XlibWrapper.larg1, value);
212.15 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
212.16 - atom, XA_CARDINAL, 32, XlibWrapper.PropModeReplace,
212.17 + atom, XA_CARDINAL, 32, XConstants.PropModeReplace,
212.18 XlibWrapper.larg1, 1);
212.19 } finally {
212.20 XToolkit.awtUnlock();
212.21 @@ -432,7 +432,7 @@
212.22 false, this);
212.23 try {
212.24 int status = getter.execute();
212.25 - if (status != XlibWrapper.Success || getter.getData() == 0) {
212.26 + if (status != XConstants.Success || getter.getData() == 0) {
212.27 return false;
212.28 }
212.29 if (getter.getActualType() != atom
212.30 @@ -466,7 +466,7 @@
212.31 false, type);
212.32 try {
212.33 int status = getter.execute();
212.34 - if (status != XlibWrapper.Success || getter.getData() == 0) {
212.35 + if (status != XConstants.Success || getter.getData() == 0) {
212.36 return false;
212.37 }
212.38 if (getter.getActualType() != type
212.39 @@ -497,7 +497,7 @@
212.40 XToolkit.awtLock();
212.41 try {
212.42 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
212.43 - atom, atom, 32, XlibWrapper.PropModeReplace,
212.44 + atom, atom, 32, XConstants.PropModeReplace,
212.45 data_ptr, length);
212.46 } finally {
212.47 XToolkit.awtUnlock();
212.48 @@ -518,7 +518,7 @@
212.49 XToolkit.awtLock();
212.50 try {
212.51 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
212.52 - atom, type, 32, XlibWrapper.PropModeReplace,
212.53 + atom, type, 32, XConstants.PropModeReplace,
212.54 data_ptr, length);
212.55 } finally {
212.56 XToolkit.awtUnlock();
212.57 @@ -539,7 +539,7 @@
212.58 XToolkit.awtLock();
212.59 try {
212.60 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
212.61 - atom, type, 8, XlibWrapper.PropModeReplace,
212.62 + atom, type, 8, XConstants.PropModeReplace,
212.63 data_ptr, length);
212.64 } finally {
212.65 XToolkit.awtUnlock();
212.66 @@ -602,7 +602,7 @@
212.67 false, property_type);
212.68 try {
212.69 int status = getter.execute();
212.70 - if (status != XlibWrapper.Success || getter.getData() == 0) {
212.71 + if (status != XConstants.Success || getter.getData() == 0) {
212.72 return null;
212.73 }
212.74 if (getter.getActualType() != property_type || getter.getActualFormat() != 8) {
212.75 @@ -674,7 +674,7 @@
212.76 false, XA_ATOM);
212.77 try {
212.78 int status = getter.execute();
212.79 - if (status != XlibWrapper.Success || getter.getData() == 0) {
212.80 + if (status != XConstants.Success || getter.getData() == 0) {
212.81 return emptyList;
212.82 }
212.83 if (getter.getActualType() != XA_ATOM || getter.getActualFormat() != 32) {
212.84 @@ -797,7 +797,7 @@
212.85 try {
212.86 Native.putWindow(XlibWrapper.larg1, window_value);
212.87 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), window,
212.88 - atom, XA_WINDOW, 32, XlibWrapper.PropModeReplace,
212.89 + atom, XA_WINDOW, 32, XConstants.PropModeReplace,
212.90 XlibWrapper.larg1, 1);
212.91 } finally {
212.92 XToolkit.awtUnlock();
212.93 @@ -821,7 +821,7 @@
212.94 false, XA_WINDOW);
212.95 try {
212.96 int status = getter.execute();
212.97 - if (status != XlibWrapper.Success || getter.getData() == 0) {
212.98 + if (status != XConstants.Success || getter.getData() == 0) {
212.99 return 0;
212.100 }
212.101 if (getter.getActualType() != XA_WINDOW || getter.getActualFormat() != 32) {
213.1 --- a/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java Mon May 12 18:06:23 2008 -0700
213.2 +++ b/src/solaris/classes/sun/awt/X11/XBaseMenuWindow.java Fri May 16 12:25:57 2008 -0700
213.3 @@ -1,5 +1,5 @@
213.4 /*
213.5 - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
213.6 + * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
213.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
213.8 *
213.9 * This code is free software; you can redistribute it and/or modify it
213.10 @@ -885,14 +885,14 @@
213.11 */
213.12 protected boolean isEventDisabled(XEvent e) {
213.13 switch (e.get_type()) {
213.14 - case XlibWrapper.Expose :
213.15 - case XlibWrapper.GraphicsExpose :
213.16 - case XlibWrapper.ButtonPress:
213.17 - case XlibWrapper.ButtonRelease:
213.18 - case XlibWrapper.MotionNotify:
213.19 - case XlibWrapper.KeyPress:
213.20 - case XlibWrapper.KeyRelease:
213.21 - case XlibWrapper.DestroyNotify:
213.22 + case XConstants.Expose :
213.23 + case XConstants.GraphicsExpose :
213.24 + case XConstants.ButtonPress:
213.25 + case XConstants.ButtonRelease:
213.26 + case XConstants.MotionNotify:
213.27 + case XConstants.KeyPress:
213.28 + case XConstants.KeyRelease:
213.29 + case XConstants.DestroyNotify:
213.30 return super.isEventDisabled(e);
213.31 default:
213.32 return true;
214.1 --- a/src/solaris/classes/sun/awt/X11/XBaseWindow.java Mon May 12 18:06:23 2008 -0700
214.2 +++ b/src/solaris/classes/sun/awt/X11/XBaseWindow.java Fri May 16 12:25:57 2008 -0700
214.3 @@ -1,5 +1,5 @@
214.4 /*
214.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
214.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
214.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
214.8 *
214.9 * This code is free software; you can redistribute it and/or modify it
214.10 @@ -30,7 +30,7 @@
214.11 import java.util.logging.*;
214.12 import java.util.*;
214.13
214.14 -public class XBaseWindow implements XConstants, XUtilConstants {
214.15 +public class XBaseWindow {
214.16 private static final Logger log = Logger.getLogger("sun.awt.X11.XBaseWindow");
214.17 private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XBaseWindow");
214.18 private static final Logger eventLog = Logger.getLogger("sun.awt.X11.event.XBaseWindow");
214.19 @@ -148,7 +148,7 @@
214.20 Long eventMask = (Long)params.get(EVENT_MASK);
214.21 if (eventMask != null) {
214.22 long mask = eventMask.longValue();
214.23 - mask |= SubstructureNotifyMask;
214.24 + mask |= XConstants.SubstructureNotifyMask;
214.25 params.put(EVENT_MASK, mask);
214.26 }
214.27
214.28 @@ -281,10 +281,10 @@
214.29 }
214.30 params.putIfNull(PARENT_WINDOW, Long.valueOf(XToolkit.getDefaultRootWindow()));
214.31 params.putIfNull(BOUNDS, new Rectangle(DEF_LOCATION, DEF_LOCATION, MIN_SIZE, MIN_SIZE));
214.32 - params.putIfNull(DEPTH, Integer.valueOf((int)XlibWrapper.CopyFromParent));
214.33 - params.putIfNull(VISUAL, Long.valueOf(XlibWrapper.CopyFromParent));
214.34 - params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XlibWrapper.InputOnly));
214.35 - params.putIfNull(VALUE_MASK, Long.valueOf(XlibWrapper.CWEventMask));
214.36 + params.putIfNull(DEPTH, Integer.valueOf((int)XConstants.CopyFromParent));
214.37 + params.putIfNull(VISUAL, Long.valueOf(XConstants.CopyFromParent));
214.38 + params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XConstants.InputOnly));
214.39 + params.putIfNull(VALUE_MASK, Long.valueOf(XConstants.CWEventMask));
214.40 Rectangle bounds = (Rectangle)params.get(BOUNDS);
214.41 bounds.width = Math.max(MIN_SIZE, bounds.width);
214.42 bounds.height = Math.max(MIN_SIZE, bounds.height);
214.43 @@ -293,7 +293,7 @@
214.44 long eventMask = eventMaskObj != null ? eventMaskObj.longValue() : 0;
214.45 // We use our own synthetic grab see XAwtState.getGrabWindow()
214.46 // (see X vol. 1, 8.3.3.2)
214.47 - eventMask |= PropertyChangeMask | OwnerGrabButtonMask;
214.48 + eventMask |= XConstants.PropertyChangeMask | XConstants.OwnerGrabButtonMask;
214.49 params.put(EVENT_MASK, Long.valueOf(eventMask));
214.50 }
214.51
214.52 @@ -312,23 +312,23 @@
214.53
214.54 Long eventMask = (Long)params.get(EVENT_MASK);
214.55 xattr.set_event_mask(eventMask.longValue());
214.56 - value_mask |= XlibWrapper.CWEventMask;
214.57 + value_mask |= XConstants.CWEventMask;
214.58
214.59 Long border_pixel = (Long)params.get(BORDER_PIXEL);
214.60 if (border_pixel != null) {
214.61 xattr.set_border_pixel(border_pixel.longValue());
214.62 - value_mask |= XlibWrapper.CWBorderPixel;
214.63 + value_mask |= XConstants.CWBorderPixel;
214.64 }
214.65
214.66 Long colormap = (Long)params.get(COLORMAP);
214.67 if (colormap != null) {
214.68 xattr.set_colormap(colormap.longValue());
214.69 - value_mask |= XlibWrapper.CWColormap;
214.70 + value_mask |= XConstants.CWColormap;
214.71 }
214.72 Long background_pixmap = (Long)params.get(BACKGROUND_PIXMAP);
214.73 if (background_pixmap != null) {
214.74 xattr.set_background_pixmap(background_pixmap.longValue());
214.75 - value_mask |= XlibWrapper.CWBackPixmap;
214.76 + value_mask |= XConstants.CWBackPixmap;
214.77 }
214.78
214.79 Long parentWindow = (Long)params.get(PARENT_WINDOW);
214.80 @@ -339,25 +339,25 @@
214.81 Boolean overrideRedirect = (Boolean)params.get(OVERRIDE_REDIRECT);
214.82 if (overrideRedirect != null) {
214.83 xattr.set_override_redirect(overrideRedirect.booleanValue());
214.84 - value_mask |= XlibWrapper.CWOverrideRedirect;
214.85 + value_mask |= XConstants.CWOverrideRedirect;
214.86 }
214.87
214.88 Boolean saveUnder = (Boolean)params.get(SAVE_UNDER);
214.89 if (saveUnder != null) {
214.90 xattr.set_save_under(saveUnder.booleanValue());
214.91 - value_mask |= XlibWrapper.CWSaveUnder;
214.92 + value_mask |= XConstants.CWSaveUnder;
214.93 }
214.94
214.95 Integer backingStore = (Integer)params.get(BACKING_STORE);
214.96 if (backingStore != null) {
214.97 xattr.set_backing_store(backingStore.intValue());
214.98 - value_mask |= XlibWrapper.CWBackingStore;
214.99 + value_mask |= XConstants.CWBackingStore;
214.100 }
214.101
214.102 Integer bitGravity = (Integer)params.get(BIT_GRAVITY);
214.103 if (bitGravity != null) {
214.104 xattr.set_bit_gravity(bitGravity.intValue());
214.105 - value_mask |= XlibWrapper.CWBitGravity;
214.106 + value_mask |= XConstants.CWBitGravity;
214.107 }
214.108
214.109 if (log.isLoggable(Level.FINE)) {
214.110 @@ -487,25 +487,25 @@
214.111 // Note: if PPosition is not set in flags this means that
214.112 // we want to reset PPosition in hints. This is necessary
214.113 // for locationByPlatform functionality
214.114 - if ((flags & XlibWrapper.PPosition) != 0) {
214.115 + if ((flags & XUtilConstants.PPosition) != 0) {
214.116 hints.set_x(x);
214.117 hints.set_y(y);
214.118 }
214.119 - if ((flags & XlibWrapper.PSize) != 0) {
214.120 + if ((flags & XUtilConstants.PSize) != 0) {
214.121 hints.set_width(width);
214.122 hints.set_height(height);
214.123 - } else if ((hints.get_flags() & XlibWrapper.PSize) != 0) {
214.124 - flags |= XlibWrapper.PSize;
214.125 + } else if ((hints.get_flags() & XUtilConstants.PSize) != 0) {
214.126 + flags |= XUtilConstants.PSize;
214.127 }
214.128 - if ((flags & XlibWrapper.PMinSize) != 0) {
214.129 + if ((flags & XUtilConstants.PMinSize) != 0) {
214.130 hints.set_min_width(width);
214.131 hints.set_min_height(height);
214.132 - } else if ((hints.get_flags() & XlibWrapper.PMinSize) != 0) {
214.133 - flags |= XlibWrapper.PMinSize;
214.134 + } else if ((hints.get_flags() & XUtilConstants.PMinSize) != 0) {
214.135 + flags |= XUtilConstants.PMinSize;
214.136 //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
214.137 //We don't need to reset minimum size if it's already set
214.138 }
214.139 - if ((flags & XlibWrapper.PMaxSize) != 0) {
214.140 + if ((flags & XUtilConstants.PMaxSize) != 0) {
214.141 if (maxBounds != null) {
214.142 if (maxBounds.width != Integer.MAX_VALUE) {
214.143 hints.set_max_width(maxBounds.width);
214.144 @@ -521,8 +521,8 @@
214.145 hints.set_max_width(width);
214.146 hints.set_max_height(height);
214.147 }
214.148 - } else if ((hints.get_flags() & XlibWrapper.PMaxSize) != 0) {
214.149 - flags |= XlibWrapper.PMaxSize;
214.150 + } else if ((hints.get_flags() & XUtilConstants.PMaxSize) != 0) {
214.151 + flags |= XUtilConstants.PMaxSize;
214.152 if (maxBounds != null) {
214.153 if (maxBounds.width != Integer.MAX_VALUE) {
214.154 hints.set_max_width(maxBounds.width);
214.155 @@ -538,9 +538,9 @@
214.156 // Leave intact
214.157 }
214.158 }
214.159 - flags |= XlibWrapper.PWinGravity;
214.160 + flags |= XUtilConstants.PWinGravity;
214.161 hints.set_flags(flags);
214.162 - hints.set_win_gravity((int)XlibWrapper.NorthWestGravity);
214.163 + hints.set_win_gravity((int)XConstants.NorthWestGravity);
214.164 if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting hints, resulted flags " + XlibWrapper.hintsToString(flags) +
214.165 ", values " + hints);
214.166 XlibWrapper.XSetWMNormalHints(XToolkit.getDisplay(), getWindow(), hints.pData);
214.167 @@ -552,7 +552,7 @@
214.168 public boolean isMinSizeSet() {
214.169 XSizeHints hints = getHints();
214.170 long flags = hints.get_flags();
214.171 - return ((flags & XlibWrapper.PMinSize) == XlibWrapper.PMinSize);
214.172 + return ((flags & XUtilConstants.PMinSize) == XUtilConstants.PMinSize);
214.173 }
214.174
214.175 /**
214.176 @@ -837,29 +837,29 @@
214.177 //6273031: PIT. Choice drop down does not close once it is right clicked to show a popup menu
214.178 //remember previous window having grab and if it's not null ungrab it.
214.179 XBaseWindow prevGrabWindow = XAwtState.getGrabWindow();
214.180 - final int eventMask = (int) (ButtonPressMask | ButtonReleaseMask
214.181 - | EnterWindowMask | LeaveWindowMask | PointerMotionMask
214.182 - | ButtonMotionMask);
214.183 + final int eventMask = (int) (XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
214.184 + | XConstants.EnterWindowMask | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
214.185 + | XConstants.ButtonMotionMask);
214.186 final int ownerEvents = 1;
214.187
214.188 int ptrGrab = XlibWrapper.XGrabPointer(XToolkit.getDisplay(),
214.189 - getContentWindow(), ownerEvents, eventMask, GrabModeAsync,
214.190 - GrabModeAsync, None, (XWM.isMotif() ? XToolkit.arrowCursor : None),
214.191 - CurrentTime);
214.192 + getContentWindow(), ownerEvents, eventMask, XConstants.GrabModeAsync,
214.193 + XConstants.GrabModeAsync, XConstants.None, (XWM.isMotif() ? XToolkit.arrowCursor : XConstants.None),
214.194 + XConstants.CurrentTime);
214.195 // Check grab results to be consistent with X server grab
214.196 - if (ptrGrab != GrabSuccess) {
214.197 - XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
214.198 + if (ptrGrab != XConstants.GrabSuccess) {
214.199 + XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
214.200 XAwtState.setGrabWindow(null);
214.201 grabLog.fine(" Grab Failure - mouse");
214.202 return false;
214.203 }
214.204
214.205 int keyGrab = XlibWrapper.XGrabKeyboard(XToolkit.getDisplay(),
214.206 - getContentWindow(), ownerEvents, GrabModeAsync, GrabModeAsync,
214.207 - CurrentTime);
214.208 - if (keyGrab != GrabSuccess) {
214.209 - XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
214.210 - XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), CurrentTime);
214.211 + getContentWindow(), ownerEvents, XConstants.GrabModeAsync, XConstants.GrabModeAsync,
214.212 + XConstants.CurrentTime);
214.213 + if (keyGrab != XConstants.GrabSuccess) {
214.214 + XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
214.215 + XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), XConstants.CurrentTime);
214.216 XAwtState.setGrabWindow(null);
214.217 grabLog.fine(" Grab Failure - keyboard");
214.218 return false;
214.219 @@ -882,8 +882,8 @@
214.220 grabLog.log(Level.FINE, "UnGrab input on {0}", new Object[] {grabWindow});
214.221 if (grabWindow != null) {
214.222 grabWindow.ungrabInputImpl();
214.223 - XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), CurrentTime);
214.224 - XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), CurrentTime);
214.225 + XlibWrapper.XUngrabPointer(XToolkit.getDisplay(), XConstants.CurrentTime);
214.226 + XlibWrapper.XUngrabKeyboard(XToolkit.getDisplay(), XConstants.CurrentTime);
214.227 XAwtState.setGrabWindow(null);
214.228 // we need to call XFlush() here to force ungrab
214.229 // see 6384219 for details
214.230 @@ -979,15 +979,15 @@
214.231 */
214.232 public void handleButtonPressRelease(XEvent xev) {
214.233 XButtonEvent xbe = xev.get_xbutton();
214.234 - final int buttonState = xbe.get_state() & (Button1Mask | Button2Mask
214.235 - | Button3Mask | Button4Mask | Button5Mask);
214.236 + final int buttonState = xbe.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask
214.237 + | XConstants.Button3Mask | XConstants.Button4Mask | XConstants.Button5Mask);
214.238 switch (xev.get_type()) {
214.239 - case ButtonPress:
214.240 + case XConstants.ButtonPress:
214.241 if (buttonState == 0) {
214.242 XAwtState.setAutoGrabWindow(this);
214.243 }
214.244 break;
214.245 - case ButtonRelease:
214.246 + case XConstants.ButtonRelease:
214.247 if (isFullRelease(buttonState, xbe.get_button())) {
214.248 XAwtState.setAutoGrabWindow(null);
214.249 }
214.250 @@ -1012,30 +1012,30 @@
214.251 */
214.252 static boolean isFullRelease(int buttonState, int button) {
214.253 switch (button) {
214.254 - case Button1:
214.255 - return buttonState == Button1Mask;
214.256 - case Button2:
214.257 - return buttonState == Button2Mask;
214.258 - case Button3:
214.259 - return buttonState == Button3Mask;
214.260 - case Button4:
214.261 - return buttonState == Button4Mask;
214.262 - case Button5:
214.263 - return buttonState == Button5Mask;
214.264 + case XConstants.Button1:
214.265 + return buttonState == XConstants.Button1Mask;
214.266 + case XConstants.Button2:
214.267 + return buttonState == XConstants.Button2Mask;
214.268 + case XConstants.Button3:
214.269 + return buttonState == XConstants.Button3Mask;
214.270 + case XConstants.Button4:
214.271 + return buttonState == XConstants.Button4Mask;
214.272 + case XConstants.Button5:
214.273 + return buttonState == XConstants.Button5Mask;
214.274 }
214.275 return buttonState == 0;
214.276 }
214.277
214.278 static boolean isGrabbedEvent(XEvent ev, XBaseWindow target) {
214.279 switch (ev.get_type()) {
214.280 - case ButtonPress:
214.281 - case ButtonRelease:
214.282 - case MotionNotify:
214.283 - case KeyPress:
214.284 - case KeyRelease:
214.285 + case XConstants.ButtonPress:
214.286 + case XConstants.ButtonRelease:
214.287 + case XConstants.MotionNotify:
214.288 + case XConstants.KeyPress:
214.289 + case XConstants.KeyRelease:
214.290 return true;
214.291 - case LeaveNotify:
214.292 - case EnterNotify:
214.293 + case XConstants.LeaveNotify:
214.294 + case XConstants.EnterNotify:
214.295 // We shouldn't dispatch this events to the grabbed components (see 6317481)
214.296 // But this logic is important if the grabbed component is top-level (see realSync)
214.297 return (target instanceof XWindowPeer);
214.298 @@ -1067,53 +1067,53 @@
214.299
214.300 switch (type)
214.301 {
214.302 - case VisibilityNotify:
214.303 + case XConstants.VisibilityNotify:
214.304 handleVisibilityEvent(xev);
214.305 break;
214.306 - case ClientMessage:
214.307 + case XConstants.ClientMessage:
214.308 handleClientMessage(xev);
214.309 break;
214.310 - case Expose :
214.311 - case GraphicsExpose :
214.312 + case XConstants.Expose :
214.313 + case XConstants.GraphicsExpose :
214.314 handleExposeEvent(xev);
214.315 break;
214.316 - case ButtonPress:
214.317 - case ButtonRelease:
214.318 + case XConstants.ButtonPress:
214.319 + case XConstants.ButtonRelease:
214.320 handleButtonPressRelease(xev);
214.321 break;
214.322
214.323 - case MotionNotify:
214.324 + case XConstants.MotionNotify:
214.325 handleMotionNotify(xev);
214.326 break;
214.327 - case KeyPress:
214.328 + case XConstants.KeyPress:
214.329 handleKeyPress(xev);
214.330 break;
214.331 - case KeyRelease:
214.332 + case XConstants.KeyRelease:
214.333 handleKeyRelease(xev);
214.334 break;
214.335 - case EnterNotify:
214.336 - case LeaveNotify:
214.337 + case XConstants.EnterNotify:
214.338 + case XConstants.LeaveNotify:
214.339 handleXCrossingEvent(xev);
214.340 break;
214.341 - case ConfigureNotify:
214.342 + case XConstants.ConfigureNotify:
214.343 handleConfigureNotifyEvent(xev);
214.344 break;
214.345 - case MapNotify:
214.346 + case XConstants.MapNotify:
214.347 handleMapNotifyEvent(xev);
214.348 break;
214.349 - case UnmapNotify:
214.350 + case XConstants.UnmapNotify:
214.351 handleUnmapNotifyEvent(xev);
214.352 break;
214.353 - case ReparentNotify:
214.354 + case XConstants.ReparentNotify:
214.355 handleReparentNotifyEvent(xev);
214.356 break;
214.357 - case PropertyNotify:
214.358 + case XConstants.PropertyNotify:
214.359 handlePropertyNotify(xev);
214.360 break;
214.361 - case DestroyNotify:
214.362 + case XConstants.DestroyNotify:
214.363 handleDestroyNotify(xev);
214.364 break;
214.365 - case CreateNotify:
214.366 + case XConstants.CreateNotify:
214.367 handleCreateNotify(xev);
214.368 break;
214.369 }
215.1 --- a/src/solaris/classes/sun/awt/X11/XClipboard.java Mon May 12 18:06:23 2008 -0700
215.2 +++ b/src/solaris/classes/sun/awt/X11/XClipboard.java Fri May 16 12:25:57 2008 -0700
215.3 @@ -185,7 +185,7 @@
215.4
215.5 private static class SelectionNotifyHandler implements XEventDispatcher {
215.6 public void dispatchEvent(XEvent ev) {
215.7 - if (ev.get_type() == XlibWrapper.SelectionNotify) {
215.8 + if (ev.get_type() == XConstants.SelectionNotify) {
215.9 final XSelectionEvent xse = ev.get_xselection();
215.10 XClipboard clipboard = null;
215.11 synchronized (XClipboard.classLock) {
215.12 @@ -223,7 +223,7 @@
215.13 XDataTransferer.TARGETS_ATOM.getAtom(),
215.14 getTargetsPropertyAtom().getAtom(),
215.15 XWindow.getXAWTRootWindow().getWindow(),
215.16 - XlibWrapper.CurrentTime);
215.17 + XConstants.CurrentTime);
215.18 isSelectionNotifyProcessed = false;
215.19 }
215.20 } finally {
215.21 @@ -260,7 +260,7 @@
215.22
215.23 long[] formats = null;
215.24
215.25 - if (propertyAtom == XlibWrapper.None) {
215.26 + if (propertyAtom == XConstants.None) {
215.27 // We treat None property atom as "empty selection".
215.28 formats = new long[0];
215.29 } else {
215.30 @@ -268,7 +268,7 @@
215.31 new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
215.32 XAtom.get(propertyAtom), 0,
215.33 XSelection.MAX_LENGTH, true,
215.34 - XlibWrapper.AnyPropertyType);
215.35 + XConstants.AnyPropertyType);
215.36 try {
215.37 targetsGetter.execute();
215.38 formats = XSelection.getFormats(targetsGetter);
216.1 --- a/src/solaris/classes/sun/awt/X11/XComponentPeer.java Mon May 12 18:06:23 2008 -0700
216.2 +++ b/src/solaris/classes/sun/awt/X11/XComponentPeer.java Fri May 16 12:25:57 2008 -0700
216.3 @@ -72,7 +72,7 @@
216.4 import sun.awt.image.ToolkitImage;
216.5 import sun.java2d.pipe.Region;
216.6
216.7 -public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer, XConstants {
216.8 +public class XComponentPeer extends XWindow implements ComponentPeer, DropTargetPeer {
216.9 /* FIX ME: these constants copied from java.awt.KeyboardFocusManager */
216.10 static final int SNFH_FAILURE = 0;
216.11 static final int SNFH_SUCCESS_HANDLED = 1;
216.12 @@ -420,40 +420,36 @@
216.13 case SNFH_SUCCESS_PROCEED:
216.14 // Currently we just generate focus events like we deal with lightweight instead of calling
216.15 // XSetInputFocus on native window
216.16 - if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Proceeding with request to " + lightweightChild + " in " + target);
216.17 + if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Proceeding with request to " +
216.18 + lightweightChild + " in " + target);
216.19 /**
216.20 * The problems with requests in non-focused window arise because shouldNativelyFocusHeavyweight
216.21 * checks that native window is focused while appropriate WINDOW_GAINED_FOCUS has not yet
216.22 * been processed - it is in EventQueue. Thus, SNFH allows native request and stores request record
216.23 - * in requests list - and it breaks our requests sequence as first record on WGF should be the last focus
216.24 - * owner which had focus before WLF. So, we should not add request record for such requests
216.25 + * in requests list - and it breaks our requests sequence as first record on WGF should be the last
216.26 + * focus owner which had focus before WLF. So, we should not add request record for such requests
216.27 * but store this component in mostRecent - and return true as before for compatibility.
216.28 */
216.29 Window parentWindow = getContainingWindow(target);
216.30 - if (parentWindow != null) {
216.31 - // and check that it is focused
216.32 - if (!parentWindow.isFocused()) {
216.33 - XWindowPeer wpeer = (XWindowPeer)parentWindow.getPeer();
216.34 - /*
216.35 - * Fix for 6314575.
216.36 - * Shouldn't restore focus on 'actualFocusedWindow'
216.37 - * when a component inside a Frame is requesting it.
216.38 - */
216.39 - wpeer.setActualFocusedWindow(null);
216.40 + if (parentWindow == null) {
216.41 + return rejectFocusRequestHelper("WARNING: Parent window is null");
216.42 + }
216.43 + XWindowPeer wpeer = (XWindowPeer)parentWindow.getPeer();
216.44 + if (wpeer == null) {
216.45 + return rejectFocusRequestHelper("WARNING: Parent window's peer is null");
216.46 + }
216.47 + /*
216.48 + * Passing null 'actualFocusedWindow' as we don't want to restore focus on it
216.49 + * when a component inside a Frame is requesting focus.
216.50 + * See 6314575 for details.
216.51 + */
216.52 + boolean res = wpeer.requestWindowFocus(null);
216.53
216.54 - boolean res = wpeer.requestWindowFocus();
216.55 - if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Requested window focus: " + res);
216.56 - // If parent window can be made focused and has been made focused(synchronously)
216.57 - // then we can proceed with children, otherwise we retreat.
216.58 - if (!(res && parentWindow.isFocused())) {
216.59 - focusLog.finer("Waiting for asynchronous processing of window focus request");
216.60 - KeyboardFocusManagerPeerImpl.removeLastFocusRequest(target);
216.61 - return false;
216.62 - }
216.63 - }
216.64 - } else {
216.65 - if (focusLog.isLoggable(Level.FINER)) focusLog.finer("WARNING: Parent window is null");
216.66 - return false;
216.67 + if (focusLog.isLoggable(Level.FINER)) focusLog.finer("Requested window focus: " + res);
216.68 + // If parent window can be made focused and has been made focused(synchronously)
216.69 + // then we can proceed with children, otherwise we retreat.
216.70 + if (!(res && parentWindow.isFocused())) {
216.71 + return rejectFocusRequestHelper("Waiting for asynchronous processing of the request");
216.72 }
216.73
216.74 // NOTE: We simulate heavyweight behavior of Motif - component receives focus right
216.75 @@ -469,6 +465,12 @@
216.76 return false;
216.77 }
216.78
216.79 + private boolean rejectFocusRequestHelper(String logMsg) {
216.80 + if (focusLog.isLoggable(Level.FINER)) focusLog.finer(logMsg);
216.81 + KeyboardFocusManagerPeerImpl.removeLastFocusRequest(target);
216.82 + return false;
216.83 + }
216.84 +
216.85 void handleJavaFocusEvent(AWTEvent e) {
216.86 if (focusLog.isLoggable(Level.FINER)) focusLog.finer(e.toString());
216.87 if (e.getID() == FocusEvent.FOCUS_GAINED) {
216.88 @@ -718,7 +720,7 @@
216.89 * handleJavaMouseEvent() would be more suitable place to do this
216.90 * but we want Swing to have this functionality also.
216.91 */
216.92 - if (xev.get_type() == ButtonPress) {
216.93 + if (xev.get_type() == XConstants.ButtonPress) {
216.94 final XWindowPeer parentXWindow = getParentTopLevel();
216.95 Window parentWindow = (Window)parentXWindow.getTarget();
216.96 if (parentXWindow.isFocusableWindow() && parentXWindow.isSimpleWindow() &&
216.97 @@ -841,7 +843,7 @@
216.98 XSetWindowAttributes xwa = new XSetWindowAttributes();
216.99 xwa.set_cursor(xcursor);
216.100
216.101 - long valuemask = XlibWrapper.CWCursor;
216.102 + long valuemask = XConstants.CWCursor;
216.103
216.104 XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),getWindow(),valuemask,xwa.pData);
216.105 XlibWrapper.XFlush(XToolkit.getDisplay());
216.106 @@ -1342,20 +1344,20 @@
216.107 enableLog.log(Level.FINEST, "Component is {1}, checking for disabled event {0}", new Object[] {e, (isEnabled()?"enabled":"disable")});
216.108 if (!isEnabled()) {
216.109 switch (e.get_type()) {
216.110 - case ButtonPress:
216.111 - case ButtonRelease:
216.112 - case KeyPress:
216.113 - case KeyRelease:
216.114 - case EnterNotify:
216.115 - case LeaveNotify:
216.116 - case MotionNotify:
216.117 + case XConstants.ButtonPress:
216.118 + case XConstants.ButtonRelease:
216.119 + case XConstants.KeyPress:
216.120 + case XConstants.KeyRelease:
216.121 + case XConstants.EnterNotify:
216.122 + case XConstants.LeaveNotify:
216.123 + case XConstants.MotionNotify:
216.124 enableLog.log(Level.FINER, "Event {0} is disable", new Object[] {e});
216.125 return true;
216.126 }
216.127 }
216.128 switch(e.get_type()) {
216.129 - case MapNotify:
216.130 - case UnmapNotify:
216.131 + case XConstants.MapNotify:
216.132 + case XConstants.UnmapNotify:
216.133 return true;
216.134 }
216.135 return super.isEventDisabled(e);
217.1 --- a/src/solaris/classes/sun/awt/X11/XConstants.java Mon May 12 18:06:23 2008 -0700
217.2 +++ b/src/solaris/classes/sun/awt/X11/XConstants.java Fri May 16 12:25:57 2008 -0700
217.3 @@ -1,5 +1,5 @@
217.4 /*
217.5 - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
217.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
217.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
217.8 *
217.9 * This code is free software; you can redistribute it and/or modify it
217.10 @@ -25,7 +25,10 @@
217.11
217.12 package sun.awt.X11;
217.13
217.14 -public interface XConstants {
217.15 +final public class XConstants {
217.16 +
217.17 + private XConstants(){}
217.18 +
217.19 public static final int X_PROTOCOL = 11 ; /* current protocol version */
217.20 public static final int X_PROTOCOL_REVISION = 0 ; /* current minor version */
217.21
217.22 @@ -292,9 +295,9 @@
217.23 public static final int RevertToParent = 2 ;
217.24
217.25 /* Used in XEventsQueued */
217.26 - int QueuedAlready = 0;
217.27 - int QueuedAfterReading = 1;
217.28 - int QueuedAfterFlush = 2;
217.29 + public static final int QueuedAlready = 0;
217.30 + public static final int QueuedAfterReading = 1;
217.31 + public static final int QueuedAfterFlush = 2;
217.32
217.33
217.34 /*****************************************************************
218.1 --- a/src/solaris/classes/sun/awt/X11/XContentWindow.java Mon May 12 18:06:23 2008 -0700
218.2 +++ b/src/solaris/classes/sun/awt/X11/XContentWindow.java Fri May 16 12:25:57 2008 -0700
218.3 @@ -43,7 +43,7 @@
218.4 * It should always be located at (- left inset, - top inset) in the associated
218.5 * decorated window. So coordinates in it would be the same as java coordinates.
218.6 */
218.7 -public final class XContentWindow extends XWindow implements XConstants {
218.8 +public final class XContentWindow extends XWindow {
218.9 private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XContentWindow");
218.10
218.11 static XContentWindow createContent(XDecoratedPeer parentFrame) {
218.12 @@ -76,10 +76,10 @@
218.13
218.14 void preInit(XCreateWindowParams params) {
218.15 super.preInit(params);
218.16 - params.putIfNull(BIT_GRAVITY, Integer.valueOf(NorthWestGravity));
218.17 + params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));
218.18 Long eventMask = (Long)params.get(EVENT_MASK);
218.19 if (eventMask != null) {
218.20 - eventMask = eventMask & ~(StructureNotifyMask);
218.21 + eventMask = eventMask & ~(XConstants.StructureNotifyMask);
218.22 params.put(EVENT_MASK, eventMask);
218.23 }
218.24 }
218.25 @@ -90,15 +90,15 @@
218.26 protected boolean isEventDisabled(XEvent e) {
218.27 switch (e.get_type()) {
218.28 // Override parentFrame to receive MouseEnter/Exit
218.29 - case EnterNotify:
218.30 - case LeaveNotify:
218.31 + case XConstants.EnterNotify:
218.32 + case XConstants.LeaveNotify:
218.33 return false;
218.34 // We handle ConfigureNotify specifically in XDecoratedPeer
218.35 - case ConfigureNotify:
218.36 + case XConstants.ConfigureNotify:
218.37 return true;
218.38 // We don't want SHOWN/HIDDEN on content window since it will duplicate XDecoratedPeer
218.39 - case MapNotify:
218.40 - case UnmapNotify:
218.41 + case XConstants.MapNotify:
218.42 + case XConstants.UnmapNotify:
218.43 return true;
218.44 default:
218.45 return super.isEventDisabled(e) || parentFrame.isEventDisabled(e);
219.1 --- a/src/solaris/classes/sun/awt/X11/XCursorFontConstants.java Mon May 12 18:06:23 2008 -0700
219.2 +++ b/src/solaris/classes/sun/awt/X11/XCursorFontConstants.java Fri May 16 12:25:57 2008 -0700
219.3 @@ -1,5 +1,5 @@
219.4 /*
219.5 - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
219.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
219.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
219.8 *
219.9 * This code is free software; you can redistribute it and/or modify it
219.10 @@ -25,7 +25,10 @@
219.11
219.12 package sun.awt.X11;
219.13
219.14 -public interface XCursorFontConstants {
219.15 +final public class XCursorFontConstants {
219.16 +
219.17 + private XCursorFontConstants(){}
219.18 +
219.19 /* cursorfont defines */
219.20 static final int XC_num_glyphs=154;
219.21 static final int XC_X_cursor=0;
220.1 --- a/src/solaris/classes/sun/awt/X11/XCustomCursor.java Mon May 12 18:06:23 2008 -0700
220.2 +++ b/src/solaris/classes/sun/awt/X11/XCustomCursor.java Fri May 16 12:25:57 2008 -0700
220.3 @@ -1,5 +1,5 @@
220.4 /*
220.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
220.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
220.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
220.8 *
220.9 * This code is free software; you can redistribute it and/or modify it
220.10 @@ -83,7 +83,7 @@
220.11 long colormap = XToolkit.getDefaultXColormap();
220.12 XColor fore_color = new XColor();
220.13
220.14 - fore_color.set_flags((byte) (XlibWrapper.DoRed | XlibWrapper.DoGreen | XlibWrapper.DoBlue));
220.15 + fore_color.set_flags((byte) (XConstants.DoRed | XConstants.DoGreen | XConstants.DoBlue));
220.16 fore_color.set_red((short)(((fcolor >> 16) & 0x000000ff) << 8));
220.17 fore_color.set_green((short) (((fcolor >> 8) & 0x000000ff) << 8));
220.18 fore_color.set_blue((short)(((fcolor >> 0) & 0x000000ff) << 8));
220.19 @@ -92,7 +92,7 @@
220.20
220.21
220.22 XColor back_color = new XColor();
220.23 - back_color.set_flags((byte) (XlibWrapper.DoRed | XlibWrapper.DoGreen | XlibWrapper.DoBlue));
220.24 + back_color.set_flags((byte) (XConstants.DoRed | XConstants.DoGreen | XConstants.DoBlue));
220.25
220.26 back_color.set_red((short) (((bcolor >> 16) & 0x000000ff) << 8));
220.27 back_color.set_green((short) (((bcolor >> 8) & 0x000000ff) << 8));
221.1 --- a/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java Mon May 12 18:06:23 2008 -0700
221.2 +++ b/src/solaris/classes/sun/awt/X11/XDecoratedPeer.java Fri May 16 12:25:57 2008 -0700
221.3 @@ -1,5 +1,5 @@
221.4 /*
221.5 - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
221.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
221.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
221.8 *
221.9 * This code is free software; you can redistribute it and/or modify it
221.10 @@ -40,9 +40,7 @@
221.11 private static final Logger log = Logger.getLogger("sun.awt.X11.XDecoratedPeer");
221.12 private static final Logger insLog = Logger.getLogger("sun.awt.X11.insets.XDecoratedPeer");
221.13 private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XDecoratedPeer");
221.14 - private final static Logger iconLog = Logger.getLogger("sun.awt.X11.icon.XDecoratedPeer");
221.15 -
221.16 - private static XAtom resize_request = new XAtom("_SUN_AWT_RESIZE_REQUEST", false);
221.17 + private static final Logger iconLog = Logger.getLogger("sun.awt.X11.icon.XDecoratedPeer");
221.18
221.19 // Set to true when we get the first ConfigureNotify after being
221.20 // reparented - indicates that WM has adopted the top-level.
221.21 @@ -73,14 +71,11 @@
221.22
221.23 void preInit(XCreateWindowParams params) {
221.24 super.preInit(params);
221.25 - if (!resize_request.isInterned()) {
221.26 - resize_request.intern(false);
221.27 - }
221.28 winAttr.initialFocus = true;
221.29
221.30 - currentInsets = new Insets(0,0,0,0); // replacemenet for wdata->top, left, bottom, right
221.31 + currentInsets = new Insets(0,0,0,0);
221.32 + applyGuessedInsets();
221.33
221.34 - applyGuessedInsets();
221.35 Rectangle bounds = (Rectangle)params.get(BOUNDS);
221.36 dimensions = new WindowDimensions(bounds, getRealInsets(), false);
221.37 params.put(BOUNDS, dimensions.getClientRect());
221.38 @@ -89,7 +84,7 @@
221.39 // Deny default processing of these events on the shell - proxy will take care of
221.40 // them instead
221.41 Long eventMask = (Long)params.get(EVENT_MASK);
221.42 - params.add(EVENT_MASK, Long.valueOf(eventMask.longValue() & ~(FocusChangeMask | KeyPressMask | KeyReleaseMask)));
221.43 + params.add(EVENT_MASK, Long.valueOf(eventMask.longValue() & ~(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)));
221.44 }
221.45
221.46 void postInit(XCreateWindowParams params) {
221.47 @@ -98,7 +93,10 @@
221.48 // happen after the X window is created.
221.49 initResizability();
221.50 updateSizeHints(dimensions);
221.51 + XWM.requestWMExtents(getWindow());
221.52 +
221.53 content = XContentWindow.createContent(this);
221.54 +
221.55 if (warningWindow != null) {
221.56 warningWindow.toFront();
221.57 }
221.58 @@ -121,7 +119,6 @@
221.59 updateMinSizeHints();
221.60 }
221.61
221.62 -
221.63 private void updateMinSizeHints() {
221.64 if (isResizable()) {
221.65 Dimension minimumSize = getTargetMinimumSize();
221.66 @@ -131,7 +128,7 @@
221.67 int minHeight = minimumSize.height - insets.top - insets.bottom;
221.68 if (minWidth < 0) minWidth = 0;
221.69 if (minHeight < 0) minHeight = 0;
221.70 - setSizeHints(XlibWrapper.PMinSize | (isLocationByPlatform()?0:(XlibWrapper.PPosition | XlibWrapper.USPosition)),
221.71 + setSizeHints(XUtilConstants.PMinSize | (isLocationByPlatform()?0:(XUtilConstants.PPosition | XUtilConstants.USPosition)),
221.72 getX(), getY(), minWidth, minHeight);
221.73 if (isVisible()) {
221.74 Rectangle bounds = getShellBounds();
221.75 @@ -143,7 +140,7 @@
221.76 }
221.77 } else {
221.78 boolean isMinSizeSet = isMinSizeSet();
221.79 - XWM.removeSizeHints(this, XlibWrapper.PMinSize);
221.80 + XWM.removeSizeHints(this, XUtilConstants.PMinSize);
221.81 /* Some WMs need remap to redecorate the window */
221.82 if (isMinSizeSet && isShowing() && XWM.needRemap(this)) {
221.83 /*
221.84 @@ -238,23 +235,59 @@
221.85 return false;
221.86 }
221.87
221.88 - Insets difference(Insets i1, Insets i2) {
221.89 + private static Insets difference(Insets i1, Insets i2) {
221.90 return new Insets(i1.top-i2.top, i1.left - i2.left, i1.bottom-i2.bottom, i1.right-i2.right);
221.91 }
221.92
221.93 - void add(Insets i1, Insets i2) {
221.94 - i1.left += i2.left;
221.95 - i1.top += i2.top;
221.96 - i1.right += i2.right;
221.97 - i1.bottom += i2.bottom;
221.98 - }
221.99 - boolean isNull(Insets i) {
221.100 + private static boolean isNull(Insets i) {
221.101 return (i == null) || ((i.left | i.top | i.right | i.bottom) == 0);
221.102 }
221.103 - Insets copy(Insets i) {
221.104 +
221.105 + private static Insets copy(Insets i) {
221.106 return new Insets(i.top, i.left, i.bottom, i.right);
221.107 }
221.108
221.109 + // insets which we get from WM (e.g from _NET_FRAME_EXTENTS)
221.110 + private Insets wm_set_insets;
221.111 +
221.112 + private Insets getWMSetInsets(XAtom changedAtom) {
221.113 + if (isEmbedded()) {
221.114 + return null;
221.115 + }
221.116 +
221.117 + if (wm_set_insets != null) {
221.118 + return wm_set_insets;
221.119 + }
221.120 +
221.121 + if (changedAtom == null) {
221.122 + wm_set_insets = XWM.getInsetsFromExtents(getWindow());
221.123 + } else {
221.124 + wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
221.125 + }
221.126 +
221.127 + insLog.log(Level.FINER, "FRAME_EXTENTS: {0}", new Object[]{wm_set_insets});
221.128 +
221.129 + if (wm_set_insets != null) {
221.130 + wm_set_insets = copy(wm_set_insets);
221.131 + }
221.132 + return wm_set_insets;
221.133 + }
221.134 +
221.135 + private void resetWMSetInsets() {
221.136 + wm_set_insets = null;
221.137 + }
221.138 +
221.139 + public void handlePropertyNotify(XEvent xev) {
221.140 + super.handlePropertyNotify(xev);
221.141 +
221.142 + XPropertyEvent ev = xev.get_xproperty();
221.143 + if (ev.get_atom() == XWM.XA_KDE_NET_WM_FRAME_STRUT.getAtom()
221.144 + || ev.get_atom() == XWM.XA_NET_FRAME_EXTENTS.getAtom())
221.145 + {
221.146 + getWMSetInsets(XAtom.get(ev.get_atom()));
221.147 + }
221.148 + }
221.149 +
221.150 long reparent_serial = 0;
221.151
221.152 public void handleReparentNotifyEvent(XEvent xev) {
221.153 @@ -337,35 +370,30 @@
221.154 Insets correction = difference(correctWM, currentInsets);
221.155 insLog.log(Level.FINEST, "Corrention {0}", new Object[] {correction});
221.156 if (!isNull(correction)) {
221.157 - /*
221.158 - * Actual insets account for menubar/warning label,
221.159 - * so we can't assign directly but must adjust them.
221.160 - */
221.161 - add(currentInsets, correction);
221.162 + currentInsets = copy(correctWM);
221.163 applyGuessedInsets();
221.164
221.165 //Fix for 6318109: PIT: Min Size is not honored properly when a
221.166 //smaller size is specified in setSize(), XToolkit
221.167 //update minimum size hints
221.168 updateMinSizeHints();
221.169 -
221.170 - /*
221.171 - * If this window has been sized by a pack() we need
221.172 - * to keep the interior geometry intact. Since pack()
221.173 - * computed width and height with wrong insets, we
221.174 - * must adjust the target dimensions appropriately.
221.175 - */
221.176 }
221.177 if (insLog.isLoggable(Level.FINER)) insLog.finer("Dimensions before reparent: " + dimensions);
221.178
221.179 dimensions.setInsets(getRealInsets());
221.180 insets_corrected = true;
221.181
221.182 - if (isMaximized()) {
221.183 + if (isMaximized() || isNull(correction)) {
221.184 return;
221.185 }
221.186
221.187 - if ((getHints().get_flags() & (USPosition | PPosition)) != 0) {
221.188 + /*
221.189 + * If this window has been sized by a pack() we need
221.190 + * to keep the interior geometry intact. Since pack()
221.191 + * computed width and height with wrong insets, we
221.192 + * must adjust the target dimensions appropriately.
221.193 + */
221.194 + if ((getHints().get_flags() & (XUtilConstants.USPosition | XUtilConstants.PPosition)) != 0) {
221.195 reshape(dimensions, SET_BOUNDS, false);
221.196 } else {
221.197 reshape(dimensions, SET_SIZE, false);
221.198 @@ -384,10 +412,10 @@
221.199
221.200
221.201 protected Insets guessInsets() {
221.202 - if (isEmbedded()) {
221.203 + if (isEmbedded() || isTargetUndecorated()) {
221.204 return new Insets(0, 0, 0, 0);
221.205 } else {
221.206 - if (currentInsets.top > 0) {
221.207 + if (!isNull(currentInsets)) {
221.208 /* insets were set on wdata by System Properties */
221.209 return copy(currentInsets);
221.210 } else {
221.211 @@ -403,7 +431,6 @@
221.212 private void applyGuessedInsets() {
221.213 Insets guessed = guessInsets();
221.214 currentInsets = copy(guessed);
221.215 - insets = copy(currentInsets);
221.216 }
221.217
221.218 public void revalidate() {
221.219 @@ -416,16 +443,18 @@
221.220 }
221.221
221.222 Insets getRealInsets() {
221.223 - if (isNull(insets)) {
221.224 + if (isNull(currentInsets)) {
221.225 applyGuessedInsets();
221.226 }
221.227 - return insets;
221.228 + return currentInsets;
221.229 }
221.230
221.231 public Insets getInsets() {
221.232 Insets in = copy(getRealInsets());
221.233 in.top += getMenuBarHeight() + getWarningWindowHeight();
221.234 - if (insLog.isLoggable(Level.FINEST)) insLog.log(Level.FINEST, "Get insets returns {0}", new Object[] {in});
221.235 + if (insLog.isLoggable(Level.FINEST)) {
221.236 + insLog.log(Level.FINEST, "Get insets returns {0}", new Object[] {in});
221.237 + }
221.238 return in;
221.239 }
221.240
221.241 @@ -835,30 +864,30 @@
221.242 public void setResizable(boolean resizable) {
221.243 int fs = winAttr.functions;
221.244 if (!isResizable() && resizable) {
221.245 - insets = currentInsets = new Insets(0, 0, 0, 0);
221.246 + currentInsets = new Insets(0, 0, 0, 0);
221.247 resetWMSetInsets();
221.248 if (!isEmbedded()) {
221.249 setReparented(false);
221.250 }
221.251 winAttr.isResizable = resizable;
221.252 - if ((fs & MWM_FUNC_ALL) != 0) {
221.253 - fs &= ~(MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
221.254 + if ((fs & MWMConstants.MWM_FUNC_ALL) != 0) {
221.255 + fs &= ~(MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
221.256 } else {
221.257 - fs |= (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
221.258 + fs |= (MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
221.259 }
221.260 winAttr.functions = fs;
221.261 XWM.setShellResizable(this);
221.262 } else if (isResizable() && !resizable) {
221.263 - insets = currentInsets = new Insets(0, 0, 0, 0);
221.264 + currentInsets = new Insets(0, 0, 0, 0);
221.265 resetWMSetInsets();
221.266 if (!isEmbedded()) {
221.267 setReparented(false);
221.268 }
221.269 winAttr.isResizable = resizable;
221.270 - if ((fs & MWM_FUNC_ALL) != 0) {
221.271 - fs |= (MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
221.272 + if ((fs & MWMConstants.MWM_FUNC_ALL) != 0) {
221.273 + fs |= (MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
221.274 } else {
221.275 - fs &= ~(MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE);
221.276 + fs &= ~(MWMConstants.MWM_FUNC_RESIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
221.277 }
221.278 winAttr.functions = fs;
221.279 XWM.setShellNotResizable(this, dimensions, dimensions.getBounds(), false);
221.280 @@ -936,10 +965,10 @@
221.281 protected boolean isEventDisabled(XEvent e) {
221.282 switch (e.get_type()) {
221.283 // Do not generate MOVED/RESIZED events since we generate them by ourselves
221.284 - case ConfigureNotify:
221.285 + case XConstants.ConfigureNotify:
221.286 return true;
221.287 - case EnterNotify:
221.288 - case LeaveNotify:
221.289 + case XConstants.EnterNotify:
221.290 + case XConstants.LeaveNotify:
221.291 // Disable crossing event on outer borders of Frame so
221.292 // we receive only one set of cross notifications(first set is from content window)
221.293 return true;
221.294 @@ -964,7 +993,7 @@
221.295 if (winAttr.isResizable) {
221.296 //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
221.297 //We need to update frame's minimum size, not to reset it
221.298 - XWM.removeSizeHints(this, XlibWrapper.PMaxSize);
221.299 + XWM.removeSizeHints(this, XUtilConstants.PMaxSize);
221.300 updateMinimumSize();
221.301 }
221.302 } else {
221.303 @@ -1004,10 +1033,6 @@
221.304 } else if (cl.get_data(0) == wm_take_focus.getAtom()) {
221.305 handleWmTakeFocus(cl);
221.306 }
221.307 - } else if (cl.get_message_type() == resize_request.getAtom()) {
221.308 - reshape((int)cl.get_data(0), (int)cl.get_data(1),
221.309 - (int)cl.get_data(2), (int)cl.get_data(3),
221.310 - (int)cl.get_data(4), true);
221.311 }
221.312 }
221.313
221.314 @@ -1114,53 +1139,51 @@
221.315 focusLog.fine("Request for decorated window focus");
221.316 // If this is Frame or Dialog we can't assure focus request success - but we still can try
221.317 // If this is Window and its owner Frame is active we can be sure request succedded.
221.318 - Window win = (Window)target;
221.319 Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
221.320 Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
221.321
221.322 focusLog.log(Level.FINER, "Current window is: active={0}, focused={1}",
221.323 - new Object[]{ Boolean.valueOf(win == activeWindow),
221.324 - Boolean.valueOf(win == focusedWindow)});
221.325 + new Object[]{ Boolean.valueOf(target == activeWindow),
221.326 + Boolean.valueOf(target == focusedWindow)});
221.327
221.328 XWindowPeer toFocus = this;
221.329 while (toFocus.nextTransientFor != null) {
221.330 toFocus = toFocus.nextTransientFor;
221.331 }
221.332 -
221.333 - if (this == toFocus) {
221.334 - if (focusAllowedFor()) {
221.335 - if (win == activeWindow && win != focusedWindow) {
221.336 - // Happens when focus is on window child
221.337 - focusLog.fine("Focus is on child window - transfering it back");
221.338 - handleWindowFocusInSync(-1);
221.339 - } else {
221.340 - focusLog.fine("Requesting focus to this window");
221.341 - if (timeProvided) {
221.342 - requestXFocus(time);
221.343 - } else {
221.344 - requestXFocus();
221.345 - }
221.346 - }
221.347 - return true;
221.348 - } else {
221.349 - return false;
221.350 - }
221.351 - }
221.352 - else if (toFocus.focusAllowedFor()) {
221.353 - focusLog.fine("Requesting focus to " + toFocus);
221.354 - if (timeProvided) {
221.355 - toFocus.requestXFocus(time);
221.356 - } else {
221.357 - toFocus.requestXFocus();
221.358 - }
221.359 - return false;
221.360 - }
221.361 - else
221.362 - {
221.363 + if (toFocus == null || !toFocus.focusAllowedFor()) {
221.364 // This might change when WM will have property to determine focus policy.
221.365 // Right now, because policy is unknown we can't be sure we succedded
221.366 return false;
221.367 }
221.368 + if (this == toFocus) {
221.369 + if (isWMStateNetHidden()) {
221.370 + focusLog.fine("The window is unmapped, so rejecting the request");
221.371 + return false;
221.372 + }
221.373 + if (target == activeWindow && target != focusedWindow) {
221.374 + // Happens when an owned window is currently focused
221.375 + focusLog.fine("Focus is on child window - transfering it back to the owner");
221.376 + handleWindowFocusInSync(-1);
221.377 + return true;
221.378 + }
221.379 + Window realNativeFocusedWindow = XWindowPeer.getNativeFocusedWindow();
221.380 + focusLog.finest("Real native focused window: " + realNativeFocusedWindow +
221.381 + "\nKFM's focused window: " + focusedWindow);
221.382 +
221.383 + // See 6522725, 6613426.
221.384 + if (target == realNativeFocusedWindow) {
221.385 + focusLog.fine("The window is already natively focused.");
221.386 + return true;
221.387 + }
221.388 + }
221.389 + focusLog.fine("Requesting focus to " + (this == toFocus ? "this window" : toFocus));
221.390 +
221.391 + if (timeProvided) {
221.392 + toFocus.requestXFocus(time);
221.393 + } else {
221.394 + toFocus.requestXFocus();
221.395 + }
221.396 + return (this == toFocus);
221.397 }
221.398
221.399 XWindowPeer actualFocusedWindow = null;
222.1 --- a/src/solaris/classes/sun/awt/X11/XDialogPeer.java Mon May 12 18:06:23 2008 -0700
222.2 +++ b/src/solaris/classes/sun/awt/X11/XDialogPeer.java Fri May 16 12:25:57 2008 -0700
222.3 @@ -1,5 +1,5 @@
222.4 /*
222.5 - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
222.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
222.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
222.8 *
222.9 * This code is free software; you can redistribute it and/or modify it
222.10 @@ -51,7 +51,7 @@
222.11 } else {
222.12 winAttr.decorations = winAttr.AWT_DECOR_NONE;
222.13 }
222.14 - winAttr.functions = MWM_FUNC_ALL;
222.15 + winAttr.functions = MWMConstants.MWM_FUNC_ALL;
222.16 winAttr.isResizable = true; //target.isResizable();
222.17 winAttr.initialResizability = target.isResizable();
222.18 winAttr.title = target.getTitle();
222.19 @@ -80,14 +80,6 @@
222.20 super.setVisible(vis);
222.21 }
222.22
222.23 - protected Insets guessInsets() {
222.24 - if (isTargetUndecorated()) {
222.25 - return new Insets(0, 0, 0, 0);
222.26 - } else {
222.27 - return super.guessInsets();
222.28 - }
222.29 - }
222.30 -
222.31 @Override
222.32 boolean isTargetUndecorated() {
222.33 if (undecorated != null) {
222.34 @@ -100,10 +92,10 @@
222.35 int getDecorations() {
222.36 int d = super.getDecorations();
222.37 // remove minimize and maximize buttons for dialogs
222.38 - if ((d & MWM_DECOR_ALL) != 0) {
222.39 - d |= (MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE);
222.40 + if ((d & MWMConstants.MWM_DECOR_ALL) != 0) {
222.41 + d |= (MWMConstants.MWM_DECOR_MINIMIZE | MWMConstants.MWM_DECOR_MAXIMIZE);
222.42 } else {
222.43 - d &= ~(MWM_DECOR_MINIMIZE | MWM_DECOR_MAXIMIZE);
222.44 + d &= ~(MWMConstants.MWM_DECOR_MINIMIZE | MWMConstants.MWM_DECOR_MAXIMIZE);
222.45 }
222.46 return d;
222.47 }
222.48 @@ -111,10 +103,10 @@
222.49 int getFunctions() {
222.50 int f = super.getFunctions();
222.51 // remove minimize and maximize functions for dialogs
222.52 - if ((f & MWM_FUNC_ALL) != 0) {
222.53 - f |= (MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE);
222.54 + if ((f & MWMConstants.MWM_FUNC_ALL) != 0) {
222.55 + f |= (MWMConstants.MWM_FUNC_MINIMIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
222.56 } else {
222.57 - f &= ~(MWM_FUNC_MINIMIZE | MWM_FUNC_MAXIMIZE);
222.58 + f &= ~(MWMConstants.MWM_FUNC_MINIMIZE | MWMConstants.MWM_FUNC_MAXIMIZE);
222.59 }
222.60 return f;
222.61 }
223.1 --- a/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java Mon May 12 18:06:23 2008 -0700
223.2 +++ b/src/solaris/classes/sun/awt/X11/XDnDDragSourceProtocol.java Fri May 16 12:25:57 2008 -0700
223.3 @@ -1,5 +1,5 @@
223.4 /*
223.5 - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
223.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
223.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
223.8 *
223.9 * This code is free software; you can redistribute it and/or modify it
223.10 @@ -103,7 +103,7 @@
223.11 XToolkit.RESTORE_XERROR_HANDLER();
223.12
223.13 if (XToolkit.saved_error != null &&
223.14 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
223.15 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
223.16 cleanup();
223.17 throw new XException("Cannot write XdndActionList property");
223.18 }
223.19 @@ -124,7 +124,7 @@
223.20 XToolkit.RESTORE_XERROR_HANDLER();
223.21
223.22 if (XToolkit.saved_error != null &&
223.23 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
223.24 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
223.25 cleanup();
223.26 throw new XException("Cannot write XdndActionList property");
223.27 }
223.28 @@ -134,7 +134,7 @@
223.29 }
223.30
223.31 if (!XDnDConstants.XDnDSelection.setOwner(contents, formatMap, formats,
223.32 - XlibWrapper.CurrentTime)) {
223.33 + XConstants.CurrentTime)) {
223.34 cleanup();
223.35 throw new InvalidDnDOperationException("Cannot acquire selection ownership");
223.36 }
223.37 @@ -193,11 +193,11 @@
223.38
223.39 WindowPropertyGetter wpg1 =
223.40 new WindowPropertyGetter(window, XDnDConstants.XA_XdndAware, 0, 1,
223.41 - false, XlibWrapper.AnyPropertyType);
223.42 + false, XConstants.AnyPropertyType);
223.43
223.44 int status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
223.45
223.46 - if (status == XlibWrapper.Success &&
223.47 + if (status == XConstants.Success &&
223.48 wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
223.49
223.50 int targetVersion = (int)Native.getLong(wpg1.getData());
223.51 @@ -217,7 +217,7 @@
223.52 try {
223.53 status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
223.54
223.55 - if (status == XlibWrapper.Success &&
223.56 + if (status == XConstants.Success &&
223.57 wpg2.getData() != 0 &&
223.58 wpg2.getActualType() == XAtom.XA_WINDOW) {
223.59
223.60 @@ -235,7 +235,7 @@
223.61 try {
223.62 status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
223.63
223.64 - if (status != XlibWrapper.Success ||
223.65 + if (status != XConstants.Success ||
223.66 wpg3.getData() == 0 ||
223.67 wpg3.getActualType() != XAtom.XA_WINDOW ||
223.68 Native.getLong(wpg3.getData()) != proxy) {
223.69 @@ -246,12 +246,12 @@
223.70 new WindowPropertyGetter(proxy,
223.71 XDnDConstants.XA_XdndAware,
223.72 0, 1, false,
223.73 - XlibWrapper.AnyPropertyType);
223.74 + XConstants.AnyPropertyType);
223.75
223.76 try {
223.77 status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
223.78
223.79 - if (status != XlibWrapper.Success ||
223.80 + if (status != XConstants.Success ||
223.81 wpg4.getData() == 0 ||
223.82 wpg4.getActualType() != XAtom.XA_ATOM) {
223.83
223.84 @@ -283,7 +283,7 @@
223.85
223.86 XClientMessageEvent msg = new XClientMessageEvent();
223.87 try {
223.88 - msg.set_type((int)XlibWrapper.ClientMessage);
223.89 + msg.set_type((int)XConstants.ClientMessage);
223.90 msg.set_window(getTargetWindow());
223.91 msg.set_format(32);
223.92 msg.set_message_type(XDnDConstants.XA_XdndEnter.getAtom());
223.93 @@ -297,7 +297,7 @@
223.94 msg.set_data(4, formats.length > 2 ? formats[2] : 0);
223.95 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
223.96 getTargetProxyWindow(),
223.97 - false, XlibWrapper.NoEventMask,
223.98 + false, XConstants.NoEventMask,
223.99 msg.pData);
223.100 } finally {
223.101 msg.dispose();
223.102 @@ -311,7 +311,7 @@
223.103
223.104 XClientMessageEvent msg = new XClientMessageEvent();
223.105 try {
223.106 - msg.set_type((int)XlibWrapper.ClientMessage);
223.107 + msg.set_type((int)XConstants.ClientMessage);
223.108 msg.set_window(getTargetWindow());
223.109 msg.set_format(32);
223.110 msg.set_message_type(XDnDConstants.XA_XdndPosition.getAtom());
223.111 @@ -322,7 +322,7 @@
223.112 msg.set_data(4, XDnDConstants.getXDnDActionForJavaAction(sourceAction));
223.113 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
223.114 getTargetProxyWindow(),
223.115 - false, XlibWrapper.NoEventMask,
223.116 + false, XConstants.NoEventMask,
223.117 msg.pData);
223.118 } finally {
223.119 msg.dispose();
223.120 @@ -335,7 +335,7 @@
223.121
223.122 XClientMessageEvent msg = new XClientMessageEvent();
223.123 try {
223.124 - msg.set_type((int)XlibWrapper.ClientMessage);
223.125 + msg.set_type((int)XConstants.ClientMessage);
223.126 msg.set_window(getTargetWindow());
223.127 msg.set_format(32);
223.128 msg.set_message_type(XDnDConstants.XA_XdndLeave.getAtom());
223.129 @@ -346,7 +346,7 @@
223.130 msg.set_data(4, 0);
223.131 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
223.132 getTargetProxyWindow(),
223.133 - false, XlibWrapper.NoEventMask,
223.134 + false, XConstants.NoEventMask,
223.135 msg.pData);
223.136 } finally {
223.137 msg.dispose();
223.138 @@ -361,7 +361,7 @@
223.139
223.140 XClientMessageEvent msg = new XClientMessageEvent();
223.141 try {
223.142 - msg.set_type((int)XlibWrapper.ClientMessage);
223.143 + msg.set_type((int)XConstants.ClientMessage);
223.144 msg.set_window(getTargetWindow());
223.145 msg.set_format(32);
223.146 msg.set_message_type(XDnDConstants.XA_XdndDrop.getAtom());
223.147 @@ -372,7 +372,7 @@
223.148 msg.set_data(4, 0);
223.149 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
223.150 getTargetProxyWindow(),
223.151 - false, XlibWrapper.NoEventMask,
223.152 + false, XConstants.NoEventMask,
223.153 msg.pData);
223.154 } finally {
223.155 msg.dispose();
223.156 @@ -406,7 +406,7 @@
223.157 assert XToolkit.isAWTLockHeldByCurrentThread();
223.158
223.159 XlibWrapper.XSendEvent(XToolkit.getDisplay(), sourceWindow,
223.160 - false, XlibWrapper.NoEventMask,
223.161 + false, XConstants.NoEventMask,
223.162 xclient.pData);
223.163
223.164 return true;
224.1 --- a/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java Mon May 12 18:06:23 2008 -0700
224.2 +++ b/src/solaris/classes/sun/awt/X11/XDnDDropTargetProtocol.java Fri May 16 12:25:57 2008 -0700
224.3 @@ -1,5 +1,5 @@
224.4 /*
224.5 - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
224.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
224.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
224.8 *
224.9 * This code is free software; you can redistribute it and/or modify it
224.10 @@ -93,7 +93,7 @@
224.11 XToolkit.RESTORE_XERROR_HANDLER();
224.12
224.13 if (XToolkit.saved_error != null &&
224.14 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
224.15 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
224.16 throw new XException("Cannot write XdndAware property");
224.17 }
224.18 } finally {
224.19 @@ -119,12 +119,12 @@
224.20
224.21 WindowPropertyGetter wpg1 =
224.22 new WindowPropertyGetter(embedder, XDnDConstants.XA_XdndAware, 0, 1,
224.23 - false, XlibWrapper.AnyPropertyType);
224.24 + false, XConstants.AnyPropertyType);
224.25
224.26 try {
224.27 status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
224.28
224.29 - if (status == XlibWrapper.Success &&
224.30 + if (status == XConstants.Success &&
224.31 wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
224.32
224.33 overriden = true;
224.34 @@ -143,7 +143,7 @@
224.35 try {
224.36 status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
224.37
224.38 - if (status == XlibWrapper.Success &&
224.39 + if (status == XConstants.Success &&
224.40 wpg2.getData() != 0 &&
224.41 wpg2.getActualType() == XAtom.XA_WINDOW) {
224.42
224.43 @@ -161,7 +161,7 @@
224.44 try {
224.45 status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
224.46
224.47 - if (status != XlibWrapper.Success ||
224.48 + if (status != XConstants.Success ||
224.49 wpg3.getData() == 0 ||
224.50 wpg3.getActualType() != XAtom.XA_WINDOW ||
224.51 Native.getLong(wpg3.getData()) != proxy) {
224.52 @@ -172,12 +172,12 @@
224.53 new WindowPropertyGetter(proxy,
224.54 XDnDConstants.XA_XdndAware,
224.55 0, 1, false,
224.56 - XlibWrapper.AnyPropertyType);
224.57 + XConstants.AnyPropertyType);
224.58
224.59 try {
224.60 status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
224.61
224.62 - if (status != XlibWrapper.Success ||
224.63 + if (status != XConstants.Success ||
224.64 wpg4.getData() == 0 ||
224.65 wpg4.getActualType() != XAtom.XA_ATOM) {
224.66
224.67 @@ -212,7 +212,7 @@
224.68
224.69 if (XToolkit.saved_error != null &&
224.70 XToolkit.saved_error.get_error_code() !=
224.71 - XlibWrapper.Success) {
224.72 + XConstants.Success) {
224.73 throw new XException("Cannot write XdndAware property");
224.74 }
224.75
224.76 @@ -226,7 +226,7 @@
224.77
224.78 if (XToolkit.saved_error != null &&
224.79 XToolkit.saved_error.get_error_code() !=
224.80 - XlibWrapper.Success) {
224.81 + XConstants.Success) {
224.82 throw new XException("Cannot write XdndProxy property");
224.83 }
224.84
224.85 @@ -239,7 +239,7 @@
224.86
224.87 if (XToolkit.saved_error != null &&
224.88 XToolkit.saved_error.get_error_code() !=
224.89 - XlibWrapper.Success) {
224.90 + XConstants.Success) {
224.91 throw new XException("Cannot write XdndAware property");
224.92 }
224.93
224.94 @@ -252,7 +252,7 @@
224.95
224.96 if (XToolkit.saved_error != null &&
224.97 XToolkit.saved_error.get_error_code() !=
224.98 - XlibWrapper.Success) {
224.99 + XConstants.Success) {
224.100 throw new XException("Cannot write XdndProxy property");
224.101 }
224.102 } finally {
224.103 @@ -285,7 +285,7 @@
224.104
224.105 if (XToolkit.saved_error != null &&
224.106 XToolkit.saved_error.get_error_code() !=
224.107 - XlibWrapper.Success) {
224.108 + XConstants.Success) {
224.109 throw new XException("Cannot write XdndAware property");
224.110 }
224.111
224.112 @@ -298,7 +298,7 @@
224.113
224.114 if (XToolkit.saved_error != null &&
224.115 XToolkit.saved_error.get_error_code() !=
224.116 - XlibWrapper.Success) {
224.117 + XConstants.Success) {
224.118 throw new XException("Cannot write XdndProxy property");
224.119 }
224.120 } finally {
224.121 @@ -326,12 +326,12 @@
224.122
224.123 WindowPropertyGetter wpg1 =
224.124 new WindowPropertyGetter(embedded, XDnDConstants.XA_XdndAware, 0, 1,
224.125 - false, XlibWrapper.AnyPropertyType);
224.126 + false, XConstants.AnyPropertyType);
224.127
224.128 try {
224.129 status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
224.130
224.131 - if (status == XlibWrapper.Success &&
224.132 + if (status == XConstants.Success &&
224.133 wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
224.134
224.135 overriden = true;
224.136 @@ -350,7 +350,7 @@
224.137 try {
224.138 status = wpg2.execute(XToolkit.IgnoreBadWindowHandler);
224.139
224.140 - if (status == XlibWrapper.Success &&
224.141 + if (status == XConstants.Success &&
224.142 wpg2.getData() != 0 &&
224.143 wpg2.getActualType() == XAtom.XA_WINDOW) {
224.144
224.145 @@ -368,7 +368,7 @@
224.146 try {
224.147 status = wpg3.execute(XToolkit.IgnoreBadWindowHandler);
224.148
224.149 - if (status != XlibWrapper.Success ||
224.150 + if (status != XConstants.Success ||
224.151 wpg3.getData() == 0 ||
224.152 wpg3.getActualType() != XAtom.XA_WINDOW ||
224.153 Native.getLong(wpg3.getData()) != proxy) {
224.154 @@ -379,12 +379,12 @@
224.155 new WindowPropertyGetter(proxy,
224.156 XDnDConstants.XA_XdndAware,
224.157 0, 1, false,
224.158 - XlibWrapper.AnyPropertyType);
224.159 + XConstants.AnyPropertyType);
224.160
224.161 try {
224.162 status = wpg4.execute(XToolkit.IgnoreBadWindowHandler);
224.163
224.164 - if (status != XlibWrapper.Success ||
224.165 + if (status != XConstants.Success ||
224.166 wpg4.getData() == 0 ||
224.167 wpg4.getActualType() != XAtom.XA_ATOM) {
224.168
224.169 @@ -408,12 +408,12 @@
224.170
224.171 WindowPropertyGetter wpg1 =
224.172 new WindowPropertyGetter(window, XDnDConstants.XA_XdndAware, 0, 1,
224.173 - false, XlibWrapper.AnyPropertyType);
224.174 + false, XConstants.AnyPropertyType);
224.175
224.176 try {
224.177 int status = wpg1.execute(XToolkit.IgnoreBadWindowHandler);
224.178
224.179 - if (status == XlibWrapper.Success &&
224.180 + if (status == XConstants.Success &&
224.181 wpg1.getData() != 0 && wpg1.getActualType() == XAtom.XA_ATOM) {
224.182
224.183 return true;
224.184 @@ -523,7 +523,7 @@
224.185
224.186 for (int i = 0; i < 3; i++) {
224.187 long j;
224.188 - if ((j = xclient.get_data(2 + i)) != XlibWrapper.None) {
224.189 + if ((j = xclient.get_data(2 + i)) != XConstants.None) {
224.190 formats3[countFormats++] = j;
224.191 }
224.192 }
224.193 @@ -549,7 +549,7 @@
224.194
224.195 if (status == 0 ||
224.196 (XToolkit.saved_error != null &&
224.197 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
224.198 + XToolkit.saved_error.get_error_code() != XConstants.Success)) {
224.199 throw new XException("XGetWindowAttributes failed");
224.200 }
224.201
224.202 @@ -561,12 +561,12 @@
224.203 XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
224.204 XlibWrapper.XSelectInput(XToolkit.getDisplay(), source_win,
224.205 source_win_mask |
224.206 - XlibWrapper.StructureNotifyMask);
224.207 + XConstants.StructureNotifyMask);
224.208
224.209 XToolkit.RESTORE_XERROR_HANDLER();
224.210
224.211 if (XToolkit.saved_error != null &&
224.212 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
224.213 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
224.214 throw new XException("XSelectInput failed");
224.215 }
224.216
224.217 @@ -581,7 +581,7 @@
224.218 }
224.219
224.220 private boolean processXdndPosition(XClientMessageEvent xclient) {
224.221 - long time_stamp = (int)XlibWrapper.CurrentTime;
224.222 + long time_stamp = (int)XConstants.CurrentTime;
224.223 long xdnd_action = 0;
224.224 int java_action = DnDConstants.ACTION_NONE;
224.225 int x = 0;
224.226 @@ -748,7 +748,7 @@
224.227 long data3, long data4) {
224.228 XClientMessageEvent enter = new XClientMessageEvent();
224.229 try {
224.230 - enter.set_type((int)XlibWrapper.ClientMessage);
224.231 + enter.set_type((int)XConstants.ClientMessage);
224.232 enter.set_window(toplevel);
224.233 enter.set_format(32);
224.234 enter.set_message_type(XDnDConstants.XA_XdndEnter.getAtom());
224.235 @@ -774,7 +774,7 @@
224.236 long sourceWindow) {
224.237 XClientMessageEvent leave = new XClientMessageEvent();
224.238 try {
224.239 - leave.set_type((int)XlibWrapper.ClientMessage);
224.240 + leave.set_type((int)XConstants.ClientMessage);
224.241 leave.set_window(toplevel);
224.242 leave.set_format(32);
224.243 leave.set_message_type(XDnDConstants.XA_XdndLeave.getAtom());
224.244 @@ -804,7 +804,7 @@
224.245
224.246 XClientMessageEvent msg = new XClientMessageEvent();
224.247 try {
224.248 - msg.set_type((int)XlibWrapper.ClientMessage);
224.249 + msg.set_type((int)XConstants.ClientMessage);
224.250 msg.set_window(xclient.get_data(0));
224.251 msg.set_format(32);
224.252 msg.set_message_type(XDnDConstants.XA_XdndStatus.getAtom());
224.253 @@ -826,7 +826,7 @@
224.254 try {
224.255 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
224.256 xclient.get_data(0),
224.257 - false, XlibWrapper.NoEventMask,
224.258 + false, XConstants.NoEventMask,
224.259 msg.pData);
224.260 } finally {
224.261 XToolkit.awtUnlock();
224.262 @@ -842,7 +842,7 @@
224.263 throws IllegalArgumentException, IOException {
224.264 XClientMessageEvent xclient = new XClientMessageEvent(ctxt);
224.265 long message_type = xclient.get_message_type();
224.266 - long time_stamp = XlibWrapper.CurrentTime;
224.267 + long time_stamp = XConstants.CurrentTime;
224.268
224.269 // NOTE: we assume that the source supports at least version 1, so we
224.270 // can use the time stamp
224.271 @@ -892,7 +892,7 @@
224.272
224.273 XClientMessageEvent msg = new XClientMessageEvent();
224.274 try {
224.275 - msg.set_type((int)XlibWrapper.ClientMessage);
224.276 + msg.set_type((int)XConstants.ClientMessage);
224.277 msg.set_window(xclient.get_data(0));
224.278 msg.set_format(32);
224.279 msg.set_message_type(XDnDConstants.XA_XdndFinished.getAtom());
224.280 @@ -914,7 +914,7 @@
224.281 try {
224.282 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
224.283 xclient.get_data(0),
224.284 - false, XlibWrapper.NoEventMask,
224.285 + false, XConstants.NoEventMask,
224.286 msg.pData);
224.287 } finally {
224.288 XToolkit.awtUnlock();
224.289 @@ -1119,7 +1119,7 @@
224.290 XToolkit.RESTORE_XERROR_HANDLER();
224.291
224.292 if (XToolkit.saved_error != null &&
224.293 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
224.294 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
224.295 if (logger.isLoggable(Level.WARNING)) {
224.296 logger.warning("Cannot set XdndTypeList on the proxy window");
224.297 }
225.1 --- a/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java Mon May 12 18:06:23 2008 -0700
225.2 +++ b/src/solaris/classes/sun/awt/X11/XDragSourceContextPeer.java Fri May 16 12:25:57 2008 -0700
225.3 @@ -1,5 +1,5 @@
225.4 /*
225.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
225.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
225.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
225.8 *
225.9 * This code is free software; you can redistribute it and/or modify it
225.10 @@ -55,11 +55,11 @@
225.11 Logger.getLogger("sun.awt.X11.xembed.xdnd.XDragSourceContextPeer");
225.12
225.13 /* The events selected on the root window when the drag begins. */
225.14 - private static final int ROOT_EVENT_MASK = (int)XlibWrapper.ButtonMotionMask |
225.15 - (int)XlibWrapper.KeyPressMask | (int)XlibWrapper.KeyReleaseMask;
225.16 + private static final int ROOT_EVENT_MASK = (int)XConstants.ButtonMotionMask |
225.17 + (int)XConstants.KeyPressMask | (int)XConstants.KeyReleaseMask;
225.18 /* The events to be delivered during grab. */
225.19 - private static final int GRAB_EVENT_MASK = (int)XlibWrapper.ButtonPressMask |
225.20 - (int)XlibWrapper.ButtonMotionMask | (int)XlibWrapper.ButtonReleaseMask;
225.21 + private static final int GRAB_EVENT_MASK = (int)XConstants.ButtonPressMask |
225.22 + (int)XConstants.ButtonMotionMask | (int)XConstants.ButtonReleaseMask;
225.23
225.24 /* The event mask of the root window before the drag operation starts. */
225.25 private long rootEventMask = 0;
225.26 @@ -196,11 +196,11 @@
225.27
225.28 status = XlibWrapper.XGrabPointer(XToolkit.getDisplay(), rootWindow,
225.29 0, GRAB_EVENT_MASK,
225.30 - XlibWrapper.GrabModeAsync,
225.31 - XlibWrapper.GrabModeAsync,
225.32 - XlibWrapper.None, xcursor, timeStamp);
225.33 + XConstants.GrabModeAsync,
225.34 + XConstants.GrabModeAsync,
225.35 + XConstants.None, xcursor, timeStamp);
225.36
225.37 - if (status != XlibWrapper.GrabSuccess) {
225.38 + if (status != XConstants.GrabSuccess) {
225.39 cleanup(timeStamp);
225.40 throwGrabFailureException("Cannot grab pointer", status);
225.41 return;
225.42 @@ -208,11 +208,11 @@
225.43
225.44 status = XlibWrapper.XGrabKeyboard(XToolkit.getDisplay(), rootWindow,
225.45 0,
225.46 - XlibWrapper.GrabModeAsync,
225.47 - XlibWrapper.GrabModeAsync,
225.48 + XConstants.GrabModeAsync,
225.49 + XConstants.GrabModeAsync,
225.50 timeStamp);
225.51
225.52 - if (status != XlibWrapper.GrabSuccess) {
225.53 + if (status != XConstants.GrabSuccess) {
225.54 cleanup(timeStamp);
225.55 throwGrabFailureException("Cannot grab keyboard", status);
225.56 return;
225.57 @@ -276,7 +276,7 @@
225.58 XlibWrapper.XChangeActivePointerGrab(XToolkit.getDisplay(),
225.59 GRAB_EVENT_MASK,
225.60 xcursor,
225.61 - XlibWrapper.CurrentTime);
225.62 + XConstants.CurrentTime);
225.63 }
225.64
225.65 protected boolean needsBogusExitBeforeDrop() {
225.66 @@ -287,10 +287,10 @@
225.67 throws InvalidDnDOperationException {
225.68 String msgCause = "";
225.69 switch (grabStatus) {
225.70 - case XlibWrapper.GrabNotViewable: msgCause = "not viewable"; break;
225.71 - case XlibWrapper.AlreadyGrabbed: msgCause = "already grabbed"; break;
225.72 - case XlibWrapper.GrabInvalidTime: msgCause = "invalid time"; break;
225.73 - case XlibWrapper.GrabFrozen: msgCause = "grab frozen"; break;
225.74 + case XConstants.GrabNotViewable: msgCause = "not viewable"; break;
225.75 + case XConstants.AlreadyGrabbed: msgCause = "already grabbed"; break;
225.76 + case XConstants.GrabInvalidTime: msgCause = "invalid time"; break;
225.77 + case XConstants.GrabFrozen: msgCause = "grab frozen"; break;
225.78 default: msgCause = "unknown failure"; break;
225.79 }
225.80 throw new InvalidDnDOperationException(msg + ": " + msgCause);
225.81 @@ -537,7 +537,7 @@
225.82 return false;
225.83 }
225.84
225.85 - if (ev.get_type() != (int)XlibWrapper.ClientMessage) {
225.86 + if (ev.get_type() != (int)XConstants.ClientMessage) {
225.87 return false;
225.88 }
225.89
225.90 @@ -579,18 +579,18 @@
225.91 }
225.92
225.93 switch (ev.get_type()) {
225.94 - case XlibWrapper.ClientMessage: {
225.95 + case XConstants.ClientMessage: {
225.96 XClientMessageEvent xclient = ev.get_xclient();
225.97 return processClientMessage(xclient);
225.98 }
225.99 - case XlibWrapper.DestroyNotify: {
225.100 + case XConstants.DestroyNotify: {
225.101 XDestroyWindowEvent xde = ev.get_xdestroywindow();
225.102
225.103 /* Target crashed during drop processing - cleanup. */
225.104 if (!dragInProgress &&
225.105 dragProtocol != null &&
225.106 xde.get_window() == dragProtocol.getTargetWindow()) {
225.107 - cleanup(XlibWrapper.CurrentTime);
225.108 + cleanup(XConstants.CurrentTime);
225.109 return true;
225.110 }
225.111 /* Pass along */
225.112 @@ -604,14 +604,14 @@
225.113
225.114 /* Process drag-only messages. */
225.115 switch (ev.get_type()) {
225.116 - case XlibWrapper.KeyRelease:
225.117 - case XlibWrapper.KeyPress: {
225.118 + case XConstants.KeyRelease:
225.119 + case XConstants.KeyPress: {
225.120 XKeyEvent xkey = ev.get_xkey();
225.121 long keysym = XlibWrapper.XKeycodeToKeysym(XToolkit.getDisplay(),
225.122 xkey.get_keycode(), 0);
225.123 switch ((int)keysym) {
225.124 case (int)XKeySymConstants.XK_Escape: {
225.125 - if (ev.get_type() == (int)XlibWrapper.KeyRelease) {
225.126 + if (ev.get_type() == (int)XConstants.KeyRelease) {
225.127 cleanup(xkey.get_time());
225.128 }
225.129 break;
225.130 @@ -631,7 +631,7 @@
225.131 XlibWrapper.larg7); // modifiers
225.132 XMotionEvent xmotion = new XMotionEvent();
225.133 try {
225.134 - xmotion.set_type(XlibWrapper.MotionNotify);
225.135 + xmotion.set_type(XConstants.MotionNotify);
225.136 xmotion.set_serial(xkey.get_serial());
225.137 xmotion.set_send_event(xkey.get_send_event());
225.138 xmotion.set_display(xkey.get_display());
225.139 @@ -658,12 +658,12 @@
225.140 }
225.141 return true;
225.142 }
225.143 - case XlibWrapper.ButtonPress:
225.144 + case XConstants.ButtonPress:
225.145 return true;
225.146 - case XlibWrapper.MotionNotify:
225.147 + case XConstants.MotionNotify:
225.148 processMouseMove(ev.get_xmotion());
225.149 return true;
225.150 - case XlibWrapper.ButtonRelease: {
225.151 + case XConstants.ButtonRelease: {
225.152 XButtonEvent xbutton = ev.get_xbutton();
225.153 /*
225.154 * On some X servers it could happen that ButtonRelease coordinates
225.155 @@ -672,7 +672,7 @@
225.156 */
225.157 XMotionEvent xmotion = new XMotionEvent();
225.158 try {
225.159 - xmotion.set_type(XlibWrapper.MotionNotify);
225.160 + xmotion.set_type(XConstants.MotionNotify);
225.161 xmotion.set_serial(xbutton.get_serial());
225.162 xmotion.set_send_event(xbutton.get_send_event());
225.163 xmotion.set_display(xbutton.get_display());
225.164 @@ -694,8 +694,8 @@
225.165 } finally {
225.166 xmotion.dispose();
225.167 }
225.168 - if (xbutton.get_button() == XlibWrapper.Button1
225.169 - || xbutton.get_button() == XlibWrapper.Button2) {
225.170 + if (xbutton.get_button() == XConstants.Button1
225.171 + || xbutton.get_button() == XConstants.Button2) {
225.172 // drag is initiated with Button1 or Button2 pressed and
225.173 // ended on release of either of these buttons (as the same
225.174 // behavior was with our old Motif DnD-based implementation)
225.175 @@ -789,6 +789,6 @@
225.176 dragDropFinished(success, action, x, y);
225.177
225.178 dndInProgress = false;
225.179 - cleanup(XlibWrapper.CurrentTime);
225.180 + cleanup(XConstants.CurrentTime);
225.181 }
225.182 }
226.1 --- a/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java Mon May 12 18:06:23 2008 -0700
226.2 +++ b/src/solaris/classes/sun/awt/X11/XDragSourceProtocol.java Fri May 16 12:25:57 2008 -0700
226.3 @@ -1,5 +1,5 @@
226.4 /*
226.5 - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
226.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
226.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
226.8 *
226.9 * This code is free software; you can redistribute it and/or modify it
226.10 @@ -189,7 +189,7 @@
226.11
226.12 if (status == 0 ||
226.13 (XToolkit.saved_error != null &&
226.14 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
226.15 + XToolkit.saved_error.get_error_code() != XConstants.Success)) {
226.16 throw new XException("XGetWindowAttributes failed");
226.17 }
226.18
226.19 @@ -201,12 +201,12 @@
226.20 XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
226.21 XlibWrapper.XSelectInput(XToolkit.getDisplay(), targetWindow,
226.22 targetWindowMask |
226.23 - XlibWrapper.StructureNotifyMask);
226.24 + XConstants.StructureNotifyMask);
226.25
226.26 XToolkit.RESTORE_XERROR_HANDLER();
226.27
226.28 if (XToolkit.saved_error != null &&
226.29 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
226.30 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
226.31 throw new XException("XSelectInput failed");
226.32 }
226.33
227.1 --- a/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java Mon May 12 18:06:23 2008 -0700
227.2 +++ b/src/solaris/classes/sun/awt/X11/XDropTargetEventProcessor.java Fri May 16 12:25:57 2008 -0700
227.3 @@ -1,5 +1,5 @@
227.4 /*
227.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
227.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
227.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
227.8 *
227.9 * This code is free software; you can redistribute it and/or modify it
227.10 @@ -43,7 +43,7 @@
227.11 private XDropTargetEventProcessor() {}
227.12
227.13 private boolean doProcessEvent(XEvent ev) {
227.14 - if (ev.get_type() == (int)XlibWrapper.DestroyNotify &&
227.15 + if (ev.get_type() == (int)XConstants.DestroyNotify &&
227.16 protocol != null &&
227.17 ev.get_xany().get_window() == protocol.getSourceWindow()) {
227.18 protocol.cleanup();
227.19 @@ -51,7 +51,7 @@
227.20 return false;
227.21 }
227.22
227.23 - if (ev.get_type() == (int)XlibWrapper.PropertyNotify) {
227.24 + if (ev.get_type() == (int)XConstants.PropertyNotify) {
227.25 XPropertyEvent xproperty = ev.get_xproperty();
227.26 if (xproperty.get_atom() ==
227.27 MotifDnDConstants.XA_MOTIF_DRAG_RECEIVER_INFO.getAtom()) {
227.28 @@ -60,7 +60,7 @@
227.29 }
227.30 }
227.31
227.32 - if (ev.get_type() != (int)XlibWrapper.ClientMessage) {
227.33 + if (ev.get_type() != (int)XConstants.ClientMessage) {
227.34 return false;
227.35 }
227.36
228.1 --- a/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java Mon May 12 18:06:23 2008 -0700
228.2 +++ b/src/solaris/classes/sun/awt/X11/XDropTargetProtocol.java Fri May 16 12:25:57 2008 -0700
228.3 @@ -1,5 +1,5 @@
228.4 /*
228.5 - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
228.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
228.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
228.8 *
228.9 * This code is free software; you can redistribute it and/or modify it
228.10 @@ -149,7 +149,7 @@
228.11 XToolkit.awtLock();
228.12 try {
228.13 XlibWrapper.XSendEvent(XToolkit.getDisplay(), proxy, false,
228.14 - XlibWrapper.NoEventMask, xclient.pData);
228.15 + XConstants.NoEventMask, xclient.pData);
228.16 } finally {
228.17 XToolkit.awtUnlock();
228.18 }
228.19 @@ -317,7 +317,7 @@
228.20
228.21 protected final void removeEmbedderRegistryEntry(long embedder) {
228.22 synchronized (this) {
228.23 - embedderRegistry.remove(new Long(embedder));
228.24 + embedderRegistry.remove(Long.valueOf(embedder));
228.25 }
228.26 }
228.27 }
229.1 --- a/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java Mon May 12 18:06:23 2008 -0700
229.2 +++ b/src/solaris/classes/sun/awt/X11/XDropTargetRegistry.java Fri May 16 12:25:57 2008 -0700
229.3 @@ -1,5 +1,5 @@
229.4 /*
229.5 - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
229.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
229.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
229.8 *
229.9 * This code is free software; you can redistribute it and/or modify it
229.10 @@ -27,18 +27,14 @@
229.11
229.12 import java.util.ArrayList;
229.13 import java.util.Collections;
229.14 -import java.util.Enumeration;
229.15 import java.util.HashMap;
229.16 import java.util.HashSet;
229.17 -import java.util.Hashtable;
229.18 import java.util.Iterator;
229.19 import java.util.List;
229.20 import java.util.logging.*;
229.21
229.22 import java.awt.Point;
229.23
229.24 -import sun.awt.dnd.SunDropTargetContextPeer;
229.25 -import sun.awt.dnd.SunDropTargetEvent;
229.26
229.27 /**
229.28 * The class responsible for registration/deregistration of drop sites.
229.29 @@ -179,11 +175,11 @@
229.30
229.31 if (status == 0 ||
229.32 (XToolkit.saved_error != null &&
229.33 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
229.34 + XToolkit.saved_error.get_error_code() != XConstants.Success)) {
229.35 continue;
229.36 }
229.37
229.38 - if (wattr.get_map_state() != XlibWrapper.IsUnmapped
229.39 + if (wattr.get_map_state() != XConstants.IsUnmapped
229.40 && dest_x < wattr.get_width()
229.41 && dest_y < wattr.get_height()) {
229.42 return window;
229.43 @@ -233,7 +229,7 @@
229.44
229.45 if (status == 0 ||
229.46 (XToolkit.saved_error != null &&
229.47 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
229.48 + XToolkit.saved_error.get_error_code() != XConstants.Success)) {
229.49 throw new XException("XGetWindowAttributes failed");
229.50 }
229.51
229.52 @@ -243,14 +239,14 @@
229.53 wattr.dispose();
229.54 }
229.55
229.56 - if ((event_mask & XlibWrapper.PropertyChangeMask) == 0) {
229.57 + if ((event_mask & XConstants.PropertyChangeMask) == 0) {
229.58 XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
229.59 XlibWrapper.XSelectInput(XToolkit.getDisplay(), embedder,
229.60 - event_mask | XlibWrapper.PropertyChangeMask);
229.61 + event_mask | XConstants.PropertyChangeMask);
229.62 XToolkit.RESTORE_XERROR_HANDLER();
229.63
229.64 if (XToolkit.saved_error != null &&
229.65 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
229.66 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
229.67 throw new XException("XSelectInput failed");
229.68 }
229.69 }
229.70 @@ -329,7 +325,7 @@
229.71
229.72 embedderProtocols = Collections.unmodifiableList(embedderProtocols);
229.73
229.74 - Long lToplevel = new Long(embedder);
229.75 + Long lToplevel = Long.valueOf(embedder);
229.76 boolean isXEmbedServer = false;
229.77 synchronized (this) {
229.78 EmbeddedDropSiteEntry entry =
229.79 @@ -397,14 +393,14 @@
229.80 long event_mask = entry.getEventMask();
229.81
229.82 /* Restore the original event mask for the embedder. */
229.83 - if ((event_mask & XlibWrapper.PropertyChangeMask) == 0) {
229.84 + if ((event_mask & XConstants.PropertyChangeMask) == 0) {
229.85 XToolkit.WITH_XERROR_HANDLER(XToolkit.IgnoreBadWindowHandler);
229.86 XlibWrapper.XSelectInput(XToolkit.getDisplay(), embedder,
229.87 event_mask);
229.88 XToolkit.RESTORE_XERROR_HANDLER();
229.89
229.90 if (XToolkit.saved_error != null &&
229.91 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
229.92 + XToolkit.saved_error.get_error_code() != XConstants.Success) {
229.93 throw new XException("XSelectInput failed");
229.94 }
229.95 }
230.1 --- a/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java Mon May 12 18:06:23 2008 -0700
230.2 +++ b/src/solaris/classes/sun/awt/X11/XEmbedCanvasPeer.java Fri May 16 12:25:57 2008 -0700
230.3 @@ -1,5 +1,5 @@
230.4 /*
230.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
230.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
230.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
230.8 *
230.9 * This code is free software; you can redistribute it and/or modify it
230.10 @@ -81,10 +81,10 @@
230.11 super.preInit(params);
230.12
230.13 params.put(EVENT_MASK,
230.14 - KeyPressMask | KeyReleaseMask
230.15 - | FocusChangeMask | ButtonPressMask | ButtonReleaseMask
230.16 - | EnterWindowMask | LeaveWindowMask | PointerMotionMask
230.17 - | ButtonMotionMask | ExposureMask | StructureNotifyMask | SubstructureNotifyMask);
230.18 + XConstants.KeyPressMask | XConstants.KeyReleaseMask
230.19 + | XConstants.FocusChangeMask | XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
230.20 + | XConstants.EnterWindowMask | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
230.21 + | XConstants.ButtonMotionMask | XConstants.ExposureMask | XConstants.StructureNotifyMask | XConstants.SubstructureNotifyMask);
230.22
230.23 }
230.24
230.25 @@ -134,7 +134,7 @@
230.26 try {
230.27 XToolkit.addEventDispatcher(xembed.handle, xembed);
230.28 XlibWrapper.XSelectInput(XToolkit.getDisplay(), xembed.handle,
230.29 - XlibWrapper.StructureNotifyMask | XlibWrapper.PropertyChangeMask);
230.30 + XConstants.StructureNotifyMask | XConstants.PropertyChangeMask);
230.31
230.32 XDropTargetRegistry.getRegistry().registerXEmbedClient(getWindow(), xembed.handle);
230.33 } finally {
230.34 @@ -194,7 +194,7 @@
230.35 public void dispatchEvent(XEvent ev) {
230.36 super.dispatchEvent(ev);
230.37 switch (ev.get_type()) {
230.38 - case CreateNotify:
230.39 + case XConstants.CreateNotify:
230.40 XCreateWindowEvent cr = ev.get_xcreatewindow();
230.41 if (xembedLog.isLoggable(Level.FINEST)) {
230.42 xembedLog.finest("Message on embedder: " + cr);
230.43 @@ -205,7 +205,7 @@
230.44 }
230.45 embedChild(cr.get_window());
230.46 break;
230.47 - case DestroyNotify:
230.48 + case XConstants.DestroyNotify:
230.49 XDestroyWindowEvent dn = ev.get_xdestroywindow();
230.50 if (xembedLog.isLoggable(Level.FINEST)) {
230.51 xembedLog.finest("Message on embedder: " + dn);
230.52 @@ -215,7 +215,7 @@
230.53 }
230.54 childDestroyed();
230.55 break;
230.56 - case ReparentNotify:
230.57 + case XConstants.ReparentNotify:
230.58 XReparentEvent rep = ev.get_xreparent();
230.59 if (xembedLog.isLoggable(Level.FINEST)) {
230.60 xembedLog.finest("Message on embedder: " + rep);
230.61 @@ -309,7 +309,7 @@
230.62
230.63 if (status == 0 ||
230.64 (XToolkit.saved_error != null &&
230.65 - XToolkit.saved_error.get_error_code() != XlibWrapper.Success)) {
230.66 + XToolkit.saved_error.get_error_code() != XConstants.Success)) {
230.67 return null;
230.68 }
230.69
230.70 @@ -480,7 +480,7 @@
230.71 if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Forwarding native key event: " + ke);
230.72 XToolkit.awtLock();
230.73 try {
230.74 - XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XlibWrapper.NoEventMask, data);
230.75 + XlibWrapper.XSendEvent(XToolkit.getDisplay(), xembed.handle, false, XConstants.NoEventMask, data);
230.76 } finally {
230.77 XToolkit.awtUnlock();
230.78 }
230.79 @@ -742,7 +742,7 @@
230.80 version = Native.getCard32(xembed_info_data, 0);
230.81 flags = Native.getCard32(xembed_info_data, 1);
230.82 boolean new_mapped = (flags & XEMBED_MAPPED) != 0;
230.83 - boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XlibWrapper.IsUnmapped;
230.84 + boolean currently_mapped = XlibUtil.getWindowMapState(handle) != XConstants.IsUnmapped;
230.85 if (new_mapped != currently_mapped) {
230.86 if (xembedLog.isLoggable(Level.FINER))
230.87 xembedLog.fine("Mapping state of the client has changed, old state: " + currently_mapped + ", new state: " + new_mapped);
230.88 @@ -803,13 +803,13 @@
230.89 public void dispatchEvent(XEvent xev) {
230.90 int type = xev.get_type();
230.91 switch (type) {
230.92 - case PropertyNotify:
230.93 + case XConstants.PropertyNotify:
230.94 handlePropertyNotify(xev);
230.95 break;
230.96 - case ConfigureNotify:
230.97 + case XConstants.ConfigureNotify:
230.98 handleConfigureNotify(xev);
230.99 break;
230.100 - case ClientMessage:
230.101 + case XConstants.ClientMessage:
230.102 handleClientMessage(xev);
230.103 break;
230.104 }
230.105 @@ -844,7 +844,7 @@
230.106 XKeyEvent ke = new XKeyEvent(data);
230.107
230.108 // We recognize only these masks
230.109 - modifiers = ke.get_state() & (ShiftMask | ControlMask | LockMask);
230.110 + modifiers = ke.get_state() & (XConstants.ShiftMask | XConstants.ControlMask | XConstants.LockMask);
230.111 if (xembedLog.isLoggable(Level.FINEST)) xembedLog.finest("Mapped " + e + " to " + this);
230.112 } finally {
230.113 XlibWrapper.unsafe.freeMemory(data);
231.1 --- a/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java Mon May 12 18:06:23 2008 -0700
231.2 +++ b/src/solaris/classes/sun/awt/X11/XEmbedChildProxyPeer.java Fri May 16 12:25:57 2008 -0700
231.3 @@ -1,5 +1,5 @@
231.4 /*
231.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
231.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
231.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
231.8 *
231.9 * This code is free software; you can redistribute it and/or modify it
231.10 @@ -53,7 +53,7 @@
231.11 try {
231.12 XToolkit.addEventDispatcher(handle, this);
231.13 XlibWrapper.XSelectInput(XToolkit.getDisplay(), handle,
231.14 - XlibWrapper.StructureNotifyMask | XlibWrapper.PropertyChangeMask);
231.15 + XConstants.StructureNotifyMask | XConstants.PropertyChangeMask);
231.16 }
231.17 finally {
231.18 XToolkit.awtUnlock();
231.19 @@ -341,10 +341,10 @@
231.20 public void dispatchEvent(XEvent xev) {
231.21 int type = xev.get_type();
231.22 switch (type) {
231.23 - case XlibWrapper.PropertyNotify:
231.24 + case XConstants.PropertyNotify:
231.25 handlePropertyNotify(xev);
231.26 break;
231.27 - case XlibWrapper.ConfigureNotify:
231.28 + case XConstants.ConfigureNotify:
231.29 handleConfigureNotify(xev);
231.30 break;
231.31 }
232.1 --- a/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java Mon May 12 18:06:23 2008 -0700
232.2 +++ b/src/solaris/classes/sun/awt/X11/XEmbedClientHelper.java Fri May 16 12:25:57 2008 -0700
232.3 @@ -1,5 +1,5 @@
232.4 /*
232.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
232.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
232.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
232.8 *
232.9 * This code is free software; you can redistribute it and/or modify it
232.10 @@ -145,10 +145,10 @@
232.11
232.12 public void dispatchEvent(XEvent xev) {
232.13 switch(xev.get_type()) {
232.14 - case XlibWrapper.ClientMessage:
232.15 + case XConstants.ClientMessage:
232.16 handleClientMessage(xev);
232.17 break;
232.18 - case XlibWrapper.ReparentNotify:
232.19 + case XConstants.ReparentNotify:
232.20 handleReparentNotify(xev);
232.21 break;
232.22 }
233.1 --- a/src/solaris/classes/sun/awt/X11/XEmbedHelper.java Mon May 12 18:06:23 2008 -0700
233.2 +++ b/src/solaris/classes/sun/awt/X11/XEmbedHelper.java Fri May 16 12:25:57 2008 -0700
233.3 @@ -1,5 +1,5 @@
233.4 /*
233.5 - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
233.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
233.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
233.8 *
233.9 * This code is free software; you can redistribute it and/or modify it
233.10 @@ -94,7 +94,7 @@
233.11 }
233.12 void sendMessage(long window, int message, long detail, long data1, long data2) {
233.13 XClientMessageEvent msg = new XClientMessageEvent();
233.14 - msg.set_type((int)XlibWrapper.ClientMessage);
233.15 + msg.set_type((int)XConstants.ClientMessage);
233.16 msg.set_window(window);
233.17 msg.set_message_type(XEmbed.getAtom());
233.18 msg.set_format(32);
233.19 @@ -106,7 +106,7 @@
233.20 XToolkit.awtLock();
233.21 try {
233.22 if (xembedLog.isLoggable(Level.FINE)) xembedLog.fine("Sending " + XEmbedMessageToString(msg));
233.23 - XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XlibWrapper.NoEventMask, msg.pData);
233.24 + XlibWrapper.XSendEvent(XToolkit.getDisplay(), window, false, XConstants.NoEventMask, msg.pData);
233.25 }
233.26 finally {
233.27 XToolkit.awtUnlock();
234.1 --- a/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java Mon May 12 18:06:23 2008 -0700
234.2 +++ b/src/solaris/classes/sun/awt/X11/XEmbedServerTester.java Fri May 16 12:25:57 2008 -0700
234.3 @@ -1,5 +1,5 @@
234.4 /*
234.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
234.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
234.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
234.8 *
234.9 * This code is free software; you can redistribute it and/or modify it
234.10 @@ -260,7 +260,7 @@
234.11 mapped = 0;
234.12 embedCompletely();
234.13 sleep(1000);
234.14 - if (XlibUtil.getWindowMapState(window.getWindow()) != XlibWrapper.IsUnmapped) {
234.15 + if (XlibUtil.getWindowMapState(window.getWindow()) != IsUnmapped) {
234.16 throw new RuntimeException("Client has been mapped");
234.17 }
234.18 }
234.19 @@ -383,11 +383,11 @@
234.20 try {
234.21 XCreateWindowParams params =
234.22 new XCreateWindowParams(new Object[] {
234.23 - XBaseWindow.PARENT_WINDOW, new Long(reparent?XToolkit.getDefaultRootWindow():parent),
234.24 + XBaseWindow.PARENT_WINDOW, Long.valueOf(reparent?XToolkit.getDefaultRootWindow():parent),
234.25 XBaseWindow.BOUNDS, initialBounds,
234.26 XBaseWindow.EMBEDDED, Boolean.TRUE,
234.27 XBaseWindow.VISIBLE, Boolean.valueOf(mapped == XEmbedHelper.XEMBED_MAPPED),
234.28 - XBaseWindow.EVENT_MASK, new Long(VisibilityChangeMask | StructureNotifyMask |
234.29 + XBaseWindow.EVENT_MASK, Long.valueOf(VisibilityChangeMask | StructureNotifyMask |
234.30 SubstructureNotifyMask | KeyPressMask)});
234.31 window = new XBaseWindow(params);
234.32
234.33 @@ -613,12 +613,12 @@
234.34 }
234.35 }
234.36 private void checkMapped() {
234.37 - if (XlibUtil.getWindowMapState(window.getWindow()) == XlibWrapper.IsUnmapped) {
234.38 + if (XlibUtil.getWindowMapState(window.getWindow()) == IsUnmapped) {
234.39 throw new RuntimeException("Client is not mapped");
234.40 }
234.41 }
234.42 private void checkNotMapped() {
234.43 - if (XlibUtil.getWindowMapState(window.getWindow()) != XlibWrapper.IsUnmapped) {
234.44 + if (XlibUtil.getWindowMapState(window.getWindow()) != IsUnmapped) {
234.45 throw new RuntimeException("Client is mapped");
234.46 }
234.47 }
235.1 --- a/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java Mon May 12 18:06:23 2008 -0700
235.2 +++ b/src/solaris/classes/sun/awt/X11/XEmbeddedFramePeer.java Fri May 16 12:25:57 2008 -0700
235.3 @@ -1,5 +1,5 @@
235.4 /*
235.5 - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
235.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
235.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
235.8 *
235.9 * This code is free software; you can redistribute it and/or modify it
235.10 @@ -114,8 +114,8 @@
235.11 protected boolean isEventDisabled(XEvent e) {
235.12 if (embedder != null && embedder.isActive()) {
235.13 switch (e.get_type()) {
235.14 - case FocusIn:
235.15 - case FocusOut:
235.16 + case XConstants.FocusIn:
235.17 + case XConstants.FocusOut:
235.18 return true;
235.19 }
235.20 }
236.1 --- a/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java Mon May 12 18:06:23 2008 -0700
236.2 +++ b/src/solaris/classes/sun/awt/X11/XEmbeddingContainer.java Fri May 16 12:25:57 2008 -0700
236.3 @@ -1,5 +1,5 @@
236.4 /*
236.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
236.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
236.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
236.8 *
236.9 * This code is free software; you can redistribute it and/or modify it
236.10 @@ -121,7 +121,7 @@
236.11 }
236.12 public void dispatchEvent(XEvent xev) {
236.13 switch(xev.get_type()) {
236.14 - case XlibWrapper.ClientMessage:
236.15 + case XConstants.ClientMessage:
236.16 handleClientMessage(xev);
236.17 break;
236.18 }
236.19 @@ -149,7 +149,7 @@
236.20 ke.set_window(child);
236.21 XToolkit.awtLock();
236.22 try {
236.23 - XlibWrapper.XSendEvent(XToolkit.getDisplay(), child, false, XlibWrapper.NoEventMask, data);
236.24 + XlibWrapper.XSendEvent(XToolkit.getDisplay(), child, false, XConstants.NoEventMask, data);
236.25 }
236.26 finally {
236.27 XToolkit.awtUnlock();
237.1 --- a/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java Mon May 12 18:06:23 2008 -0700
237.2 +++ b/src/solaris/classes/sun/awt/X11/XFileDialogPeer.java Fri May 16 12:25:57 2008 -0700
237.3 @@ -908,7 +908,7 @@
237.4 * Converts the filter into the form which is acceptable by Java's regexps
237.5 */
237.6 private String convert(String filter) {
237.7 - String regex = new String("^" + filter + "$");
237.8 + String regex = "^" + filter + "$";
237.9 regex = regex.replaceAll("\\.", "\\\\.");
237.10 regex = regex.replaceAll("\\?", ".");
237.11 regex = regex.replaceAll("\\*", ".*");
238.1 --- a/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java Mon May 12 18:06:23 2008 -0700
238.2 +++ b/src/solaris/classes/sun/awt/X11/XFocusProxyWindow.java Fri May 16 12:25:57 2008 -0700
238.3 @@ -1,5 +1,5 @@
238.4 /*
238.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
238.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
238.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
238.8 *
238.9 * This code is free software; you can redistribute it and/or modify it
238.10 @@ -41,7 +41,7 @@
238.11 super(new XCreateWindowParams(new Object[] {
238.12 BOUNDS, new Rectangle(-1, -1, 1, 1),
238.13 PARENT_WINDOW, new Long(owner.getWindow()),
238.14 - EVENT_MASK, new Long(FocusChangeMask | KeyPressMask | KeyReleaseMask)
238.15 + EVENT_MASK, new Long(XConstants.FocusChangeMask | XConstants.KeyPressMask | XConstants.KeyReleaseMask)
238.16 }));
238.17 this.owner = owner;
238.18 }
238.19 @@ -67,8 +67,8 @@
238.20 int type = ev.get_type();
238.21 switch (type)
238.22 {
238.23 - case XlibWrapper.FocusIn:
238.24 - case XlibWrapper.FocusOut:
238.25 + case XConstants.FocusIn:
238.26 + case XConstants.FocusOut:
238.27 handleFocusEvent(ev);
238.28 break;
238.29 }
239.1 --- a/src/solaris/classes/sun/awt/X11/XFramePeer.java Mon May 12 18:06:23 2008 -0700
239.2 +++ b/src/solaris/classes/sun/awt/X11/XFramePeer.java Fri May 16 12:25:57 2008 -0700
239.3 @@ -37,7 +37,7 @@
239.4 import java.util.logging.Level;
239.5 import java.util.logging.Logger;
239.6
239.7 -class XFramePeer extends XDecoratedPeer implements FramePeer, XConstants {
239.8 +class XFramePeer extends XDecoratedPeer implements FramePeer {
239.9 private static Logger log = Logger.getLogger("sun.awt.X11.XFramePeer");
239.10 private static Logger stateLog = Logger.getLogger("sun.awt.X11.states");
239.11 private static Logger insLog = Logger.getLogger("sun.awt.X11.insets.XFramePeer");
239.12 @@ -71,7 +71,7 @@
239.13 } else {
239.14 winAttr.decorations = winAttr.AWT_DECOR_NONE;
239.15 }
239.16 - winAttr.functions = MWM_FUNC_ALL;
239.17 + winAttr.functions = MWMConstants.MWM_FUNC_ALL;
239.18 winAttr.isResizable = true; // target.isResizable();
239.19 winAttr.title = target.getTitle();
239.20 winAttr.initialResizability = target.isResizable();
239.21 @@ -87,14 +87,6 @@
239.22 setupState(true);
239.23 }
239.24
239.25 - protected Insets guessInsets() {
239.26 - if (isTargetUndecorated()) {
239.27 - return new Insets(0, 0, 0, 0);
239.28 - } else {
239.29 - return super.guessInsets();
239.30 - }
239.31 - }
239.32 -
239.33 @Override
239.34 boolean isTargetUndecorated() {
239.35 if (undecorated != null) {
239.36 @@ -109,9 +101,9 @@
239.37 state = winAttr.initialState;
239.38 }
239.39 if ((state & Frame.ICONIFIED) != 0) {
239.40 - setInitialState(IconicState);
239.41 + setInitialState(XUtilConstants.IconicState);
239.42 } else {
239.43 - setInitialState(NormalState);
239.44 + setInitialState(XUtilConstants.NormalState);
239.45 }
239.46 setExtendedState(state);
239.47 }
239.48 @@ -221,7 +213,7 @@
239.49 XToolkit.awtLock();
239.50 try {
239.51 XSizeHints hints = getHints();
239.52 - hints.set_flags(hints.get_flags() | (int)XlibWrapper.PMaxSize);
239.53 + hints.set_flags(hints.get_flags() | (int)XUtilConstants.PMaxSize);
239.54 if (b.width != Integer.MAX_VALUE) {
239.55 hints.set_max_width(b.width);
239.56 } else {
239.57 @@ -344,7 +336,7 @@
239.58 XToolkit.awtLock();
239.59 try {
239.60 XWMHints hints = getWMHints();
239.61 - hints.set_flags((int)XlibWrapper.StateHint | hints.get_flags());
239.62 + hints.set_flags((int)XUtilConstants.StateHint | hints.get_flags());
239.63 hints.set_initial_state(wm_state);
239.64 if (stateLog.isLoggable(Level.FINE)) stateLog.fine("Setting initial WM state on " + this + " to " + wm_state);
239.65 XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
240.1 --- a/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java Mon May 12 18:06:23 2008 -0700
240.2 +++ b/src/solaris/classes/sun/awt/X11/XGlobalCursorManager.java Fri May 16 12:25:57 2008 -0700
240.3 @@ -1,5 +1,5 @@
240.4 /*
240.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
240.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
240.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
240.8 *
240.9 * This code is free software; you can redistribute it and/or modify it
240.10 @@ -229,46 +229,46 @@
240.11 int cursorType = 0;
240.12 switch (type) {
240.13 case Cursor.DEFAULT_CURSOR:
240.14 - cursorType = XlibWrapper.XC_left_ptr;
240.15 + cursorType = XCursorFontConstants.XC_left_ptr;
240.16 break;
240.17 case Cursor.CROSSHAIR_CURSOR:
240.18 - cursorType = XlibWrapper.XC_crosshair;
240.19 + cursorType = XCursorFontConstants.XC_crosshair;
240.20 break;
240.21 case Cursor.TEXT_CURSOR:
240.22 - cursorType = XlibWrapper.XC_xterm;
240.23 + cursorType = XCursorFontConstants.XC_xterm;
240.24 break;
240.25 case Cursor.WAIT_CURSOR:
240.26 - cursorType = XlibWrapper.XC_watch;
240.27 + cursorType = XCursorFontConstants.XC_watch;
240.28 break;
240.29 case Cursor.SW_RESIZE_CURSOR:
240.30 - cursorType = XlibWrapper.XC_bottom_left_corner;
240.31 + cursorType = XCursorFontConstants.XC_bottom_left_corner;
240.32 break;
240.33 case Cursor.NW_RESIZE_CURSOR:
240.34 - cursorType = XlibWrapper.XC_top_left_corner;
240.35 + cursorType = XCursorFontConstants.XC_top_left_corner;
240.36 break;
240.37 case Cursor.SE_RESIZE_CURSOR:
240.38 - cursorType = XlibWrapper.XC_bottom_right_corner;
240.39 + cursorType = XCursorFontConstants.XC_bottom_right_corner;
240.40 break;
240.41 case Cursor.NE_RESIZE_CURSOR:
240.42 - cursorType = XlibWrapper.XC_top_right_corner;
240.43 + cursorType = XCursorFontConstants.XC_top_right_corner;
240.44 break;
240.45 case Cursor.S_RESIZE_CURSOR:
240.46 - cursorType = XlibWrapper.XC_bottom_side;
240.47 + cursorType = XCursorFontConstants.XC_bottom_side;
240.48 break;
240.49 case Cursor.N_RESIZE_CURSOR:
240.50 - cursorType = XlibWrapper.XC_top_side;
240.51 + cursorType = XCursorFontConstants.XC_top_side;
240.52 break;
240.53 case Cursor.W_RESIZE_CURSOR:
240.54 - cursorType = XlibWrapper.XC_left_side;
240.55 + cursorType = XCursorFontConstants.XC_left_side;
240.56 break;
240.57 case Cursor.E_RESIZE_CURSOR:
240.58 - cursorType = XlibWrapper.XC_right_side;
240.59 + cursorType = XCursorFontConstants.XC_right_side;
240.60 break;
240.61 case Cursor.HAND_CURSOR:
240.62 - cursorType = XlibWrapper.XC_hand2;
240.63 + cursorType = XCursorFontConstants.XC_hand2;
240.64 break;
240.65 case Cursor.MOVE_CURSOR:
240.66 - cursorType = XlibWrapper.XC_fleur;
240.67 + cursorType = XCursorFontConstants.XC_fleur;
240.68 break;
240.69 }
240.70
241.1 --- a/src/solaris/classes/sun/awt/X11/XIconWindow.java Mon May 12 18:06:23 2008 -0700
241.2 +++ b/src/solaris/classes/sun/awt/X11/XIconWindow.java Fri May 16 12:25:57 2008 -0700
241.3 @@ -1,5 +1,5 @@
241.4 /*
241.5 - * Copyright 2003-2006 Sun Microsystems, Inc. All Rights Reserved.
241.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
241.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
241.8 *
241.9 * This code is free software; you can redistribute it and/or modify it
241.10 @@ -293,7 +293,7 @@
241.11 long dst = XlibWrapper.XCreateImage(XToolkit.getDisplay(),
241.12 visInfo.get_visual(),
241.13 (int)awtImage.get_Depth(),
241.14 - (int)XlibWrapper.ZPixmap,
241.15 + (int)XConstants.ZPixmap,
241.16 0,
241.17 bytes,
241.18 iconWidth,
241.19 @@ -470,9 +470,9 @@
241.20 params.add(BACKGROUND_PIXMAP, iconPixmap);
241.21 params.add(COLORMAP, adata.get_awt_cmap());
241.22 params.add(DEPTH, awtImage.get_Depth());
241.23 - params.add(VISUAL_CLASS, (int)XlibWrapper.InputOutput);
241.24 + params.add(VISUAL_CLASS, (int)XConstants.InputOutput);
241.25 params.add(VISUAL, visInfo.get_visual());
241.26 - params.add(VALUE_MASK, XlibWrapper.CWBorderPixel | XlibWrapper.CWColormap | XlibWrapper.CWBackPixmap);
241.27 + params.add(VALUE_MASK, XConstants.CWBorderPixel | XConstants.CWColormap | XConstants.CWBackPixmap);
241.28 params.add(PARENT_WINDOW, XlibWrapper.RootWindow(XToolkit.getDisplay(), visInfo.get_screen()));
241.29 params.add(BOUNDS, new Rectangle(0, 0, iconWidth, iconHeight));
241.30 params.remove(DELAYED);
241.31 @@ -488,9 +488,9 @@
241.32 XlibWrapper.XClearWindow(XToolkit.getDisplay(), getWindow());
241.33 }
241.34 // Provide both pixmap and window, WM or Taskbar will use the one they find more appropriate
241.35 - long newFlags = hints.get_flags() | XlibWrapper.IconPixmapHint | XlibWrapper.IconMaskHint;
241.36 + long newFlags = hints.get_flags() | XUtilConstants.IconPixmapHint | XUtilConstants.IconMaskHint;
241.37 if (getWindow() != 0) {
241.38 - newFlags |= XlibWrapper.IconWindowHint;
241.39 + newFlags |= XUtilConstants.IconWindowHint;
241.40 }
241.41 hints.set_flags(newFlags);
241.42 hints.set_icon_pixmap(iconPixmap);
242.1 --- a/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java Mon May 12 18:06:23 2008 -0700
242.2 +++ b/src/solaris/classes/sun/awt/X11/XKeyboardFocusManagerPeer.java Fri May 16 12:25:57 2008 -0700
242.3 @@ -96,12 +96,12 @@
242.4 Component focusOwner = activeWindow.getFocusOwner();
242.5 if (focusLog.isLoggable(Level.FINE)) focusLog.fine("Clearing global focus owner " + focusOwner);
242.6 if (focusOwner != null) {
242.7 - XComponentPeer nativePeer = XComponentPeer.getNativeContainer(focusOwner);
242.8 - if (nativePeer != null) {
242.9 +// XComponentPeer nativePeer = XComponentPeer.getNativeContainer(focusOwner);
242.10 +// if (nativePeer != null) {
242.11 FocusEvent fl = new CausedFocusEvent(focusOwner, FocusEvent.FOCUS_LOST, false, null,
242.12 CausedFocusEvent.Cause.CLEAR_GLOBAL_FOCUS_OWNER);
242.13 XWindow.sendEvent(fl);
242.14 - }
242.15 +// }
242.16 }
242.17 }
242.18 }
243.1 --- a/src/solaris/classes/sun/awt/X11/XKeysym.java Mon May 12 18:06:23 2008 -0700
243.2 +++ b/src/solaris/classes/sun/awt/X11/XKeysym.java Fri May 16 12:25:57 2008 -0700
243.3 @@ -1,7 +1,7 @@
243.4 // This is a generated file: do not edit! Edit keysym2ucs.h if necessary.
243.5
243.6 /*
243.7 - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
243.8 + * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
243.9 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
243.10 *
243.11 * This code is free software; you can redistribute it and/or modify it
243.12 @@ -1495,6 +1495,7 @@
243.13
243.14 keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Multi_key), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COMPOSE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
243.15 keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Mode_switch), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
243.16 + keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_ISO_Level3_Shift), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
243.17
243.18 /* Editing block */
243.19 keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Redo), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AGAIN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
244.1 --- a/src/solaris/classes/sun/awt/X11/XListPeer.java Mon May 12 18:06:23 2008 -0700
244.2 +++ b/src/solaris/classes/sun/awt/X11/XListPeer.java Fri May 16 12:25:57 2008 -0700
244.3 @@ -1,5 +1,5 @@
244.4 /*
244.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
244.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
244.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
244.8 *
244.9 * This code is free software; you can redistribute it and/or modify it
244.10 @@ -55,14 +55,15 @@
244.11 public final static int DEFAULT_VISIBLE_ROWS = 4; // From java.awt.List,
244.12 public final static int HORIZ_SCROLL_AMT = 10;
244.13
244.14 - final static int
244.15 - PAINT_VSCROLL = 2,
244.16 - PAINT_HSCROLL = 4,
244.17 - PAINT_ITEMS = 8,
244.18 - PAINT_FOCUS = 16,
244.19 - PAINT_BACKGROUND = 32,
244.20 - PAINT_HIDEFOCUS = 64,
244.21 - PAINT_ALL = PAINT_VSCROLL | PAINT_HSCROLL | PAINT_ITEMS | PAINT_FOCUS | PAINT_BACKGROUND;
244.22 + private final static int PAINT_VSCROLL = 2;
244.23 + private final static int PAINT_HSCROLL = 4;
244.24 + private final static int PAINT_ITEMS = 8;
244.25 + private final static int PAINT_FOCUS = 16;
244.26 + private final static int PAINT_BACKGROUND = 32;
244.27 + private final static int PAINT_HIDEFOCUS = 64;
244.28 + private final static int PAINT_ALL =
244.29 + PAINT_VSCROLL | PAINT_HSCROLL | PAINT_ITEMS | PAINT_FOCUS | PAINT_BACKGROUND;
244.30 + private final static int COPY_AREA = 128;
244.31
244.32 XVerticalScrollbar vsb;
244.33 XHorizontalScrollbar hsb;
244.34 @@ -363,35 +364,6 @@
244.35 }
244.36 }
244.37
244.38 - Area getItemsArea(int firstItem, int lastItem) {
244.39 - firstItem = Math.max(getFirstVisibleItem(), firstItem);
244.40 - lastItem = Math.min(lastItem, getLastVisibleItem());
244.41 - if (lastItem < getFirstVisibleItem()) {
244.42 - return new Area();
244.43 - }
244.44 - if (firstItem <= lastItem) {
244.45 - int startY = getItemY(firstItem);
244.46 - int endY = getItemY(lastItem) + getItemHeight();
244.47 - // Account for focus rectangle, instead should be called twice - before change
244.48 - // of focusIndex and after
244.49 - startY -= 2;
244.50 - endY += 2;
244.51 - // x is 0 since we need to account for focus rectangle,
244.52 - // the same with width
244.53 - return new Area(new Rectangle(0, startY, getItemWidth() + 3, endY-startY+1));
244.54 - } else {
244.55 - return new Area();
244.56 - }
244.57 - }
244.58 -
244.59 - Rectangle getItemRect(int item) {
244.60 - return new Rectangle(MARGIN, getItemY(item), getItemWidth(), getItemHeight());
244.61 - }
244.62 -
244.63 - Area getItemArea(int item) {
244.64 - return new Area(getItemRect(item));
244.65 - }
244.66 -
244.67 public void repaintScrollbarRequest(XScrollbar scrollbar) {
244.68 Graphics g = getGraphics();
244.69 if (scrollbar == hsb) {
244.70 @@ -411,14 +383,36 @@
244.71 repaint(getFirstVisibleItem(), getLastVisibleItem(), PAINT_ALL);
244.72 }
244.73
244.74 - public void repaint(int options) {
244.75 + private void repaint(int options) {
244.76 repaint(getFirstVisibleItem(), getLastVisibleItem(), options);
244.77 }
244.78
244.79 - public void repaint(int firstItem, int lastItem, int options) {
244.80 + private void repaint(int firstItem, int lastItem, int options) {
244.81 + repaint(firstItem, lastItem, options, null, null);
244.82 + }
244.83 +
244.84 + /**
244.85 + * In most cases the entire area of the component doesn't have
244.86 + * to be repainted. The method repaints the particular areas of
244.87 + * the component. The areas to repaint is specified by the option
244.88 + * parameter. The possible values of the option parameter are:
244.89 + * PAINT_VSCROLL, PAINT_HSCROLL, PAINT_ITEMS, PAINT_FOCUS,
244.90 + * PAINT_HIDEFOCUS, PAINT_BACKGROUND, PAINT_ALL, COPY_AREA.
244.91 + *
244.92 + * Note that the COPY_AREA value initiates copy of a source area
244.93 + * of the component by a distance by means of the copyArea method
244.94 + * of the Graphics class.
244.95 + *
244.96 + * @param firstItem the position of the first item of the range to repaint
244.97 + * @param lastItem the position of the last item of the range to repaint
244.98 + * @param options specifies the particular area of the component to repaint
244.99 + * @param source the area of the component to copy
244.100 + * @param distance the distance to copy the source area
244.101 + */
244.102 + private void repaint(int firstItem, int lastItem, int options, Rectangle source, Point distance) {
244.103 Graphics g = getGraphics();
244.104 try {
244.105 - painter.paint(g, firstItem, lastItem, options);
244.106 + painter.paint(g, firstItem, lastItem, options, source, distance);
244.107 } finally {
244.108 g.dispose();
244.109 }
244.110 @@ -1449,35 +1443,29 @@
244.111 }
244.112 vsb.setValue(vsb.getValue() + y);
244.113
244.114 + Rectangle source = null;
244.115 + Point distance = null;
244.116 + int firstItem = 0, lastItem = 0;
244.117 + int options = PAINT_HIDEFOCUS | PAINT_ITEMS | PAINT_VSCROLL | PAINT_FOCUS;
244.118 if (y > 0) {
244.119 - // Fixed 6308295: XAWTduplicate list item is displayed
244.120 - // Window resizing leads to the buffer flushing
244.121 - // That's why the repainting with the PAINT_HIDEFOCUS option is the repainting with PAINT_ALL option
244.122 - // So we should do only the repainting instead of the copy area
244.123 - if (y < itemsInWin && painter.isBuffer()) {
244.124 - if (log.isLoggable(Level.FINEST)) {
244.125 - log.finest("Copying " + "" + MARGIN + "," + ( MARGIN + pixelsToScroll)
244.126 - + "," + (width - SCROLLBAR_AREA) + "," + (h * (itemsInWin - y)-1) +
244.127 - "," + 0 + "," + (-pixelsToScroll));
244.128 - }
244.129 - // Unpaint focus before copying
244.130 - repaint(PAINT_HIDEFOCUS);
244.131 - painter.copyArea(MARGIN, MARGIN + pixelsToScroll, width - SCROLLBAR_AREA, h * (itemsInWin - y - 1)-1, 0, -pixelsToScroll);
244.132 + if (y < itemsInWin) {
244.133 + source = new Rectangle(MARGIN, MARGIN + pixelsToScroll, width - SCROLLBAR_AREA, h * (itemsInWin - y - 1)-1);
244.134 + distance = new Point(0, -pixelsToScroll);
244.135 + options |= COPY_AREA;
244.136 }
244.137 - repaint(vsb.getValue() + (itemsInWin - y)-1, (vsb.getValue() + itemsInWin) - 1, PAINT_ITEMS | PAINT_VSCROLL | PAINT_FOCUS);
244.138 - } else if (y < 0 && painter.isBuffer()) {
244.139 + firstItem = vsb.getValue() + itemsInWin - y - 1;
244.140 + lastItem = vsb.getValue() + itemsInWin - 1;
244.141 +
244.142 + } else if (y < 0) {
244.143 if (y + itemsInWindow() > 0) {
244.144 - if (log.isLoggable(Level.FINEST)) {
244.145 - log.finest("Copying " + MARGIN + "," + MARGIN +"," +
244.146 - (width - SCROLLBAR_AREA) + "," +
244.147 - (h * (itemsInWin + y)) + "," + "0" +"," +(-pixelsToScroll));
244.148 - }
244.149 - repaint(PAINT_HIDEFOCUS);
244.150 - painter.copyArea(MARGIN, MARGIN, width - SCROLLBAR_AREA, h * (itemsInWin + y), 0, -pixelsToScroll);
244.151 + source = new Rectangle(MARGIN, MARGIN, width - SCROLLBAR_AREA, h * (itemsInWin + y));
244.152 + distance = new Point(0, -pixelsToScroll);
244.153 + options |= COPY_AREA;
244.154 }
244.155 - int e = Math.min(getLastVisibleItem(), vsb.getValue() + -y);
244.156 - repaint(vsb.getValue(), e, PAINT_ITEMS | PAINT_VSCROLL | PAINT_FOCUS);
244.157 + firstItem = vsb.getValue();
244.158 + lastItem = Math.min(getLastVisibleItem(), vsb.getValue() + -y);
244.159 }
244.160 + repaint(firstItem, lastItem, options, source, distance);
244.161 }
244.162
244.163 /**
244.164 @@ -1491,12 +1479,17 @@
244.165 int h = height - (SCROLLBAR_AREA + (2 * MARGIN));
244.166 hsb.setValue(hsb.getValue() + x);
244.167
244.168 - if (x < 0 && painter.isBuffer()) {
244.169 - painter.copyArea(MARGIN + SPACE, MARGIN, w + x, h, -x, 0);
244.170 - } else if (x > 0 && painter.isBuffer()) {
244.171 - painter.copyArea(MARGIN + SPACE + x, MARGIN, w - x, h, -x, 0);
244.172 + Rectangle source = null;
244.173 + Point distance = null;
244.174 + if (x < 0) {
244.175 + source = new Rectangle(MARGIN + SPACE, MARGIN, w + x, h);
244.176 + distance = new Point(-x, 0);
244.177 + } else if (x > 0) {
244.178 + source = new Rectangle(MARGIN + SPACE + x, MARGIN, w - x, h);
244.179 + distance = new Point(-x, 0);
244.180 }
244.181 - repaint(vsb.getValue(), lastItemDisplayed(), PAINT_ITEMS | PAINT_HSCROLL);
244.182 + int options = COPY_AREA | PAINT_ITEMS | PAINT_HSCROLL;
244.183 + repaint(vsb.getValue(), lastItemDisplayed(), options, source, distance);
244.184 }
244.185
244.186 /**
244.187 @@ -1677,7 +1670,6 @@
244.188 * Since we can't guarantee the sequence, use awtLock.
244.189 */
244.190 class ListPainter {
244.191 - // TODO: use VolatileImage
244.192 VolatileImage buffer;
244.193 Color[] colors;
244.194
244.195 @@ -1746,6 +1738,11 @@
244.196 }
244.197
244.198 private void paint(Graphics listG, int firstItem, int lastItem, int options) {
244.199 + paint(listG, firstItem, lastItem, options, null, null);
244.200 + }
244.201 +
244.202 + private void paint(Graphics listG, int firstItem, int lastItem, int options,
244.203 + Rectangle source, Point distance) {
244.204 if (log.isLoggable(Level.FINER)) log.finer("Repaint from " + firstItem + " to " + lastItem + " options " + options);
244.205 if (firstItem > lastItem) {
244.206 int t = lastItem;
244.207 @@ -1773,17 +1770,34 @@
244.208 invalidate();
244.209 options = PAINT_ALL;
244.210 continue;
244.211 + case VolatileImage.IMAGE_RESTORED:
244.212 + options = PAINT_ALL;
244.213 }
244.214 Graphics g = localBuffer.createGraphics();
244.215
244.216 + // Note that the order of the following painting operations
244.217 + // should not be modified
244.218 try {
244.219 g.setFont(getFont());
244.220 +
244.221 + // hiding the focus rectangle must be done prior to copying
244.222 + // area and so this is the first action to be performed
244.223 + if ((options & (PAINT_HIDEFOCUS)) != 0) {
244.224 + paintFocus(g, PAINT_HIDEFOCUS);
244.225 + }
244.226 + /*
244.227 + * The shift of the component contents occurs while someone
244.228 + * scrolls the component, the only purpose of the shift is to
244.229 + * increase the painting performance. The shift should be done
244.230 + * prior to painting any area (except hiding focus) and actually
244.231 + * it should never be done jointly with erase background.
244.232 + */
244.233 + if ((options & COPY_AREA) != 0) {
244.234 + g.copyArea(source.x, source.y, source.width, source.height,
244.235 + distance.x, distance.y);
244.236 + }
244.237 if ((options & PAINT_BACKGROUND) != 0) {
244.238 - g.setColor(SystemColor.window);
244.239 - g.fillRect(0, 0, width, height);
244.240 - g.setColor(getListBackground());
244.241 - g.fillRect(0, 0, listWidth, listHeight);
244.242 - draw3DRect(g, getSystemColors(), 0, 0, listWidth - 1, listHeight - 1, false);
244.243 + paintBackground(g);
244.244 // Since we made full erase update items
244.245 firstItem = getFirstVisibleItem();
244.246 lastItem = getLastVisibleItem();
244.247 @@ -1799,8 +1813,8 @@
244.248 g.setClip(getHScrollBarRec());
244.249 paintHorScrollbar(g, true);
244.250 }
244.251 - if ((options & (PAINT_FOCUS|PAINT_HIDEFOCUS)) != 0) {
244.252 - paintFocus(g, options);
244.253 + if ((options & (PAINT_FOCUS)) != 0) {
244.254 + paintFocus(g, PAINT_FOCUS);
244.255 }
244.256 } finally {
244.257 g.dispose();
244.258 @@ -1809,6 +1823,14 @@
244.259 listG.drawImage(localBuffer, 0, 0, null);
244.260 }
244.261
244.262 + private void paintBackground(Graphics g) {
244.263 + g.setColor(SystemColor.window);
244.264 + g.fillRect(0, 0, width, height);
244.265 + g.setColor(getListBackground());
244.266 + g.fillRect(0, 0, listWidth, listHeight);
244.267 + draw3DRect(g, getSystemColors(), 0, 0, listWidth - 1, listHeight - 1, false);
244.268 + }
244.269 +
244.270 private void paintItems(Graphics g, int firstItem, int lastItem, int options) {
244.271 if (log.isLoggable(Level.FINER)) log.finer("Painting items from " + firstItem + " to " + lastItem + ", focused " + focusIndex + ", first " + getFirstVisibleItem() + ", last " + getLastVisibleItem());
244.272
244.273 @@ -1932,53 +1954,5 @@
244.274 }
244.275 g.setClip(clip);
244.276 }
244.277 -
244.278 - public void copyArea(int x, int y, int width, int height, int dx, int dy) {
244.279 - if (log.isLoggable(Level.FINER)) log.finer("Copying area " + x + ", " + y + " " + width +
244.280 - "x" + height + ", (" + dx + "," + dy + ")");
244.281 - VolatileImage localBuffer = null;
244.282 - do {
244.283 - XToolkit.awtLock();
244.284 - try {
244.285 - if (createBuffer()) {
244.286 - // Newly created buffer should be painted over at full
244.287 - repaint(PAINT_ALL);
244.288 - return;
244.289 - }
244.290 - localBuffer = buffer;
244.291 - } finally {
244.292 - XToolkit.awtUnlock();
244.293 - }
244.294 - switch (localBuffer.validate(getGraphicsConfiguration())) {
244.295 - case VolatileImage.IMAGE_INCOMPATIBLE:
244.296 - invalidate();
244.297 - case VolatileImage.IMAGE_RESTORED:
244.298 - // Since we've lost the content we can't just scroll - we should paint again
244.299 - repaint(PAINT_ALL);
244.300 - return;
244.301 - }
244.302 - Graphics g = localBuffer.createGraphics();
244.303 - try {
244.304 - g.copyArea(x, y, width, height, dx, dy);
244.305 - } finally {
244.306 - g.dispose();
244.307 - }
244.308 - } while (localBuffer.contentsLost());
244.309 - Graphics listG = getGraphics();
244.310 - listG.setClip(x, y, width, height);
244.311 - listG.drawImage(localBuffer, 0, 0, null);
244.312 - listG.dispose();
244.313 - }
244.314 -
244.315 - public boolean isBuffer() {
244.316 - boolean isBuffer;
244.317 - XToolkit.awtLock();
244.318 - try {
244.319 - isBuffer = (buffer != null);
244.320 - } finally {
244.321 - XToolkit.awtUnlock();
244.322 - }
244.323 - return isBuffer;
244.324 - }
244.325 }
244.326 }
245.1 --- a/src/solaris/classes/sun/awt/X11/XMSelection.java Mon May 12 18:06:23 2008 -0700
245.2 +++ b/src/solaris/classes/sun/awt/X11/XMSelection.java Fri May 16 12:25:57 2008 -0700
245.3 @@ -1,5 +1,5 @@
245.4 /*
245.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
245.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
245.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
245.8 *
245.9 * This code is free software; you can redistribute it and/or modify it
245.10 @@ -98,7 +98,7 @@
245.11 XToolkit.awtLock();
245.12 try {
245.13 long root = XlibWrapper.RootWindow(display,screen);
245.14 - XlibWrapper.XSelectInput(display, root, XlibWrapper.StructureNotifyMask);
245.15 + XlibWrapper.XSelectInput(display, root, XConstants.StructureNotifyMask);
245.16 XToolkit.addEventDispatcher(root,
245.17 new XEventDispatcher() {
245.18 public void dispatchEvent(XEvent ev) {
245.19 @@ -130,7 +130,7 @@
245.20 synchronized(this) {
245.21 setOwner(owner, screen);
245.22 if (log.isLoggable(Level.FINE)) log.fine("New Selection Owner for screen " + screen + " = " + owner );
245.23 - XlibWrapper.XSelectInput(display, owner, XlibWrapper.StructureNotifyMask | eventMask);
245.24 + XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | eventMask);
245.25 XToolkit.addEventDispatcher(owner,
245.26 new XEventDispatcher() {
245.27 public void dispatchEvent(XEvent ev) {
245.28 @@ -162,7 +162,7 @@
245.29 if (owner != 0) {
245.30 setOwner(owner, screen);
245.31 if (log.isLoggable(Level.FINE)) log.fine("Selection Owner for screen " + screen + " = " + owner );
245.32 - XlibWrapper.XSelectInput(display, owner, XlibWrapper.StructureNotifyMask | extra_mask);
245.33 + XlibWrapper.XSelectInput(display, owner, XConstants.StructureNotifyMask | extra_mask);
245.34 XToolkit.addEventDispatcher(owner,
245.35 new XEventDispatcher() {
245.36 public void dispatchEvent(XEvent ev) {
245.37 @@ -205,7 +205,7 @@
245.38
245.39 static boolean processRootEvent(XEvent xev, int screen) {
245.40 switch (xev.get_type()) {
245.41 - case XlibWrapper.ClientMessage: {
245.42 + case XConstants.ClientMessage: {
245.43 return processClientMessage(xev, screen);
245.44 }
245.45 }
245.46 @@ -225,7 +225,7 @@
245.47 */
245.48
245.49 public XMSelection (String selname) {
245.50 - this(selname, XlibWrapper.PropertyChangeMask);
245.51 + this(selname, XConstants.PropertyChangeMask);
245.52 }
245.53
245.54
245.55 @@ -319,11 +319,11 @@
245.56
245.57 void dispatchSelectionEvent(XEvent xev, int screen) {
245.58 if (log.isLoggable(Level.FINE)) log.fine("Event =" + xev);
245.59 - if (xev.get_type() == XlibWrapper.DestroyNotify) {
245.60 + if (xev.get_type() == XConstants.DestroyNotify) {
245.61 XDestroyWindowEvent de = xev.get_xdestroywindow();
245.62 dispatchOwnerDeath( de, screen);
245.63 }
245.64 - else if (xev.get_type() == XlibWrapper.PropertyNotify) {
245.65 + else if (xev.get_type() == XConstants.PropertyNotify) {
245.66 XPropertyEvent xpe = xev.get_xproperty();
245.67 dispatchSelectionChanged( xpe, screen);
245.68 }
246.1 --- a/src/solaris/classes/sun/awt/X11/XNETProtocol.java Mon May 12 18:06:23 2008 -0700
246.2 +++ b/src/solaris/classes/sun/awt/X11/XNETProtocol.java Fri May 16 12:25:57 2008 -0700
246.3 @@ -99,7 +99,7 @@
246.4 return;
246.5 }
246.6 if (log.isLoggable(Level.FINE)) log.fine("Requesting state on " + window + " for " + state);
246.7 - req.set_type((int)XlibWrapper.ClientMessage);
246.8 + req.set_type((int)XConstants.ClientMessage);
246.9 req.set_window(window.getWindow());
246.10 req.set_message_type(XA_NET_WM_STATE.getAtom());
246.11 req.set_format(32);
246.12 @@ -109,7 +109,7 @@
246.13 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
246.14 XlibWrapper.RootWindow(XToolkit.getDisplay(), window.getScreenNumber()),
246.15 false,
246.16 - XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
246.17 + XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
246.18 req.pData);
246.19 }
246.20 finally {
246.21 @@ -183,7 +183,7 @@
246.22 if (window.isShowing()) {
246.23 XClientMessageEvent req = new XClientMessageEvent();
246.24 try {
246.25 - req.set_type((int)XlibWrapper.ClientMessage);
246.26 + req.set_type((int)XConstants.ClientMessage);
246.27 req.set_window(window.getWindow());
246.28 req.set_message_type(XA_NET_WM_STATE.getAtom());
246.29 req.set_format(32);
246.30 @@ -195,7 +195,7 @@
246.31 XlibWrapper.XSendEvent(XToolkit.getDisplay(),
246.32 XlibWrapper.RootWindow(XToolkit.getDisplay(), window.getScreenNumber()),
246.33 false,
246.34 - XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
246.35 + XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
246.36 req.pData);
246.37 }
246.38 finally {
247.1 --- a/src/solaris/classes/sun/awt/X11/XProtocol.java Mon May 12 18:06:23 2008 -0700
247.2 +++ b/src/solaris/classes/sun/awt/X11/XProtocol.java Fri May 16 12:25:57 2008 -0700
247.3 @@ -1,5 +1,5 @@
247.4 /*
247.5 - * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved.
247.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
247.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
247.8 *
247.9 * This code is free software; you can redistribute it and/or modify it
247.10 @@ -42,7 +42,7 @@
247.11 static XToolkit.XErrorHandler VerifyChangePropertyHandler = new XToolkit.XErrorHandler() {
247.12 public int handleError(long display, XErrorEvent err) {
247.13 XToolkit.XERROR_SAVE(err);
247.14 - if (err.get_request_code() == XlibWrapper.X_ChangeProperty) {
247.15 + if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
247.16 return 0;
247.17 } else {
247.18 return XToolkit.SAVED_ERROR_HANDLER(display, err);
248.1 --- a/src/solaris/classes/sun/awt/X11/XProtocolConstants.java Mon May 12 18:06:23 2008 -0700
248.2 +++ b/src/solaris/classes/sun/awt/X11/XProtocolConstants.java Fri May 16 12:25:57 2008 -0700
248.3 @@ -1,5 +1,5 @@
248.4 /*
248.5 - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
248.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
248.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
248.8 *
248.9 * This code is free software; you can redistribute it and/or modify it
248.10 @@ -25,7 +25,10 @@
248.11
248.12 package sun.awt.X11;
248.13
248.14 -public interface XProtocolConstants {
248.15 +final public class XProtocolConstants {
248.16 +
248.17 + private XProtocolConstants(){}
248.18 +
248.19 /* Reply codes */
248.20 public static final int X_Reply = 1 ; /* Normal reply */
248.21 public static final int X_Error = 0 ; /* Error */
249.1 --- a/src/solaris/classes/sun/awt/X11/XScrollbar.java Mon May 12 18:06:23 2008 -0700
249.2 +++ b/src/solaris/classes/sun/awt/X11/XScrollbar.java Fri May 16 12:25:57 2008 -0700
249.3 @@ -458,16 +458,16 @@
249.4 String type;
249.5 switch (id) {
249.6 case MouseEvent.MOUSE_PRESSED:
249.7 - type = new String("press");
249.8 + type = "press";
249.9 break;
249.10 case MouseEvent.MOUSE_RELEASED:
249.11 - type = new String("release");
249.12 + type = "release";
249.13 break;
249.14 case MouseEvent.MOUSE_DRAGGED:
249.15 - type = new String("drag");
249.16 + type = "drag";
249.17 break;
249.18 default:
249.19 - type = new String("other");
249.20 + type = "other";
249.21 }
249.22 log.finer("Mouse " + type + " event in scroll bar " + this +
249.23 "x = " + x + ", y = " + y +
250.1 --- a/src/solaris/classes/sun/awt/X11/XSelection.java Mon May 12 18:06:23 2008 -0700
250.2 +++ b/src/solaris/classes/sun/awt/X11/XSelection.java Fri May 16 12:25:57 2008 -0700
250.3 @@ -141,7 +141,7 @@
250.4 long selection = selectionAtom.getAtom();
250.5
250.6 // ICCCM prescribes that CurrentTime should not be used for SetSelectionOwner.
250.7 - if (time == XlibWrapper.CurrentTime) {
250.8 + if (time == XConstants.CurrentTime) {
250.9 time = XToolkit.getCurrentServerTime();
250.10 }
250.11
250.12 @@ -199,7 +199,7 @@
250.13 WindowPropertyGetter targetsGetter =
250.14 new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
250.15 selectionPropertyAtom, 0, MAX_LENGTH,
250.16 - true, XlibWrapper.AnyPropertyType);
250.17 + true, XConstants.AnyPropertyType);
250.18
250.19 try {
250.20 XToolkit.awtLock();
250.21 @@ -274,7 +274,7 @@
250.22 new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
250.23 selectionPropertyAtom, 0, MAX_LENGTH,
250.24 false, // don't delete to handle INCR properly.
250.25 - XlibWrapper.AnyPropertyType);
250.26 + XConstants.AnyPropertyType);
250.27
250.28 try {
250.29 XToolkit.awtLock();
250.30 @@ -353,7 +353,7 @@
250.31 new WindowPropertyGetter(XWindow.getXAWTRootWindow().getWindow(),
250.32 selectionPropertyAtom,
250.33 0, MAX_LENGTH, false,
250.34 - XlibWrapper.AnyPropertyType);
250.35 + XConstants.AnyPropertyType);
250.36
250.37 try {
250.38 XToolkit.awtLock();
250.39 @@ -520,7 +520,7 @@
250.40 try {
250.41 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor, property,
250.42 format, dataFormat,
250.43 - XlibWrapper.PropModeReplace,
250.44 + XConstants.PropModeReplace,
250.45 nativeDataPtr, count);
250.46 } finally {
250.47 XToolkit.awtUnlock();
250.48 @@ -543,14 +543,14 @@
250.49 boolean conversionSucceeded = false;
250.50
250.51 if (ownershipTime != 0 &&
250.52 - (requestTime == XlibWrapper.CurrentTime || requestTime >= ownershipTime))
250.53 + (requestTime == XConstants.CurrentTime || requestTime >= ownershipTime))
250.54 {
250.55 // Handle MULTIPLE requests as per ICCCM.
250.56 if (format == XDataTransferer.MULTIPLE_ATOM.getAtom()) {
250.57 conversionSucceeded = handleMultipleRequest(requestor, property);
250.58 } else {
250.59 // Support for obsolete clients as per ICCCM.
250.60 - if (property == XlibWrapper.None) {
250.61 + if (property == XConstants.None) {
250.62 property = format;
250.63 }
250.64
250.65 @@ -564,12 +564,12 @@
250.66
250.67 if (!conversionSucceeded) {
250.68 // None property indicates conversion failure.
250.69 - property = XlibWrapper.None;
250.70 + property = XConstants.None;
250.71 }
250.72
250.73 XSelectionEvent xse = new XSelectionEvent();
250.74 try {
250.75 - xse.set_type(XlibWrapper.SelectionNotify);
250.76 + xse.set_type(XConstants.SelectionNotify);
250.77 xse.set_send_event(true);
250.78 xse.set_requestor(requestor);
250.79 xse.set_selection(selectionAtom.getAtom());
250.80 @@ -580,7 +580,7 @@
250.81 XToolkit.awtLock();
250.82 try {
250.83 XlibWrapper.XSendEvent(XToolkit.getDisplay(), requestor, false,
250.84 - XlibWrapper.NoEventMask, xse.pData);
250.85 + XConstants.NoEventMask, xse.pData);
250.86 } finally {
250.87 XToolkit.awtUnlock();
250.88 }
250.89 @@ -590,7 +590,7 @@
250.90 }
250.91
250.92 private boolean handleMultipleRequest(final long requestor, long property) {
250.93 - if (XlibWrapper.None == property) {
250.94 + if (XConstants.None == property) {
250.95 // The property cannot be None for a MULTIPLE request.
250.96 return false;
250.97 }
250.98 @@ -601,7 +601,7 @@
250.99 WindowPropertyGetter wpg =
250.100 new WindowPropertyGetter(requestor, XAtom.get(property),
250.101 0, MAX_LENGTH, false,
250.102 - XlibWrapper.AnyPropertyType);
250.103 + XConstants.AnyPropertyType);
250.104 try {
250.105 wpg.execute();
250.106
250.107 @@ -629,7 +629,7 @@
250.108 property,
250.109 wpg.getActualType(),
250.110 wpg.getActualFormat(),
250.111 - XlibWrapper.PropModeReplace,
250.112 + XConstants.PropModeReplace,
250.113 wpg.getData(),
250.114 wpg.getNumberOfItems());
250.115 } finally {
250.116 @@ -673,7 +673,7 @@
250.117 try {
250.118 XlibWrapper.XChangeProperty(XToolkit.getDisplay(), requestor,
250.119 property, XAtom.XA_ATOM, dataFormat,
250.120 - XlibWrapper.PropModeReplace,
250.121 + XConstants.PropModeReplace,
250.122 nativeDataPtr, count);
250.123 } finally {
250.124 XToolkit.awtUnlock();
250.125 @@ -712,7 +712,7 @@
250.126 private static class SelectionEventHandler implements XEventDispatcher {
250.127 public void dispatchEvent(XEvent ev) {
250.128 switch (ev.get_type()) {
250.129 - case XlibWrapper.SelectionNotify: {
250.130 + case XConstants.SelectionNotify: {
250.131 XToolkit.awtLock();
250.132 try {
250.133 XSelectionEvent xse = ev.get_xselection();
250.134 @@ -733,7 +733,7 @@
250.135 }
250.136 break;
250.137 }
250.138 - case XlibWrapper.SelectionRequest: {
250.139 + case XConstants.SelectionRequest: {
250.140 XSelectionRequestEvent xsre = ev.get_xselectionrequest();
250.141 long atom = xsre.get_selection();
250.142 XSelection selection = XSelection.getSelection(XAtom.get(atom));
250.143 @@ -743,7 +743,7 @@
250.144 }
250.145 break;
250.146 }
250.147 - case XlibWrapper.SelectionClear: {
250.148 + case XConstants.SelectionClear: {
250.149 XSelectionClearEvent xsce = ev.get_xselectionclear();
250.150 long atom = xsce.get_selection();
250.151 XSelection selection = XSelection.getSelection(XAtom.get(atom));
250.152 @@ -793,7 +793,7 @@
250.153 wattr.pData);
250.154 XlibWrapper.XSelectInput(XToolkit.getDisplay(), requestor,
250.155 wattr.get_your_event_mask() |
250.156 - XlibWrapper.PropertyChangeMask);
250.157 + XConstants.PropertyChangeMask);
250.158 } finally {
250.159 XToolkit.awtUnlock();
250.160 }
250.161 @@ -805,10 +805,10 @@
250.162
250.163 public void dispatchEvent(XEvent ev) {
250.164 switch (ev.get_type()) {
250.165 - case XlibWrapper.PropertyNotify:
250.166 + case XConstants.PropertyNotify:
250.167 XPropertyEvent xpe = ev.get_xproperty();
250.168 if (xpe.get_window() == requestor &&
250.169 - xpe.get_state() == XlibWrapper.PropertyDelete &&
250.170 + xpe.get_state() == XConstants.PropertyDelete &&
250.171 xpe.get_atom() == property) {
250.172
250.173 int count = data.length - offset;
250.174 @@ -834,7 +834,7 @@
250.175 XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
250.176 requestor, property,
250.177 target, format,
250.178 - XlibWrapper.PropModeReplace,
250.179 + XConstants.PropModeReplace,
250.180 nativeDataPtr, count);
250.181 } finally {
250.182 XToolkit.awtUnlock();
250.183 @@ -853,9 +853,9 @@
250.184 private static class IncrementalTransferHandler implements XEventDispatcher {
250.185 public void dispatchEvent(XEvent ev) {
250.186 switch (ev.get_type()) {
250.187 - case XlibWrapper.PropertyNotify:
250.188 + case XConstants.PropertyNotify:
250.189 XPropertyEvent xpe = ev.get_xproperty();
250.190 - if (xpe.get_state() == XlibWrapper.PropertyNewValue &&
250.191 + if (xpe.get_state() == XConstants.PropertyNewValue &&
250.192 xpe.get_atom() == selectionPropertyAtom.getAtom()) {
250.193 XToolkit.awtLock();
250.194 try {
251.1 --- a/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java Mon May 12 18:06:23 2008 -0700
251.2 +++ b/src/solaris/classes/sun/awt/X11/XSystemTrayPeer.java Fri May 16 12:25:57 2008 -0700
251.3 @@ -1,5 +1,5 @@
251.4 /*
251.5 - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
251.6 + * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
251.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
251.8 *
251.9 * This code is free software; you can redistribute it and/or modify it
251.10 @@ -131,7 +131,7 @@
251.11 XClientMessageEvent xev = new XClientMessageEvent();
251.12
251.13 try {
251.14 - xev.set_type(XlibWrapper.ClientMessage);
251.15 + xev.set_type(XConstants.ClientMessage);
251.16 xev.set_window(win);
251.17 xev.set_format(32);
251.18 xev.set_message_type(_NET_SYSTEM_TRAY_OPCODE.getAtom());
251.19 @@ -144,7 +144,7 @@
251.20 XToolkit.awtLock();
251.21 try {
251.22 XlibWrapper.XSendEvent(XToolkit.getDisplay(), win, false,
251.23 - XlibWrapper.NoEventMask, xev.pData);
251.24 + XConstants.NoEventMask, xev.pData);
251.25 } finally {
251.26 XToolkit.awtUnlock();
251.27 }
252.1 --- a/src/solaris/classes/sun/awt/X11/XToolkit.java Mon May 12 18:06:23 2008 -0700
252.2 +++ b/src/solaris/classes/sun/awt/X11/XToolkit.java Fri May 16 12:25:57 2008 -0700
252.3 @@ -54,8 +54,7 @@
252.4 import sun.misc.PerformanceLogger;
252.5 import sun.print.PrintJob2D;
252.6
252.7 -public final class XToolkit extends UNIXToolkit implements Runnable, XConstants
252.8 -{
252.9 +public final class XToolkit extends UNIXToolkit implements Runnable {
252.10 private static Logger log = Logger.getLogger("sun.awt.X11.XToolkit");
252.11 private static Logger eventLog = Logger.getLogger("sun.awt.X11.event.XToolkit");
252.12 private static final Logger timeoutTaskLog = Logger.getLogger("sun.awt.X11.timeoutTask.XToolkit");
252.13 @@ -169,7 +168,7 @@
252.14 static XErrorHandler IgnoreBadWindowHandler = new XErrorHandler() {
252.15 public int handleError(long display, XErrorEvent err) {
252.16 XERROR_SAVE(err);
252.17 - if (err.get_error_code() == BadWindow) {
252.18 + if (err.get_error_code() == XConstants.BadWindow) {
252.19 return 0;
252.20 } else {
252.21 return SAVED_ERROR_HANDLER(display, err);
252.22 @@ -425,7 +424,7 @@
252.23 // Only our windows guaranteely generate MotionNotify, so we
252.24 // should track enter/leave, to catch the moment when to
252.25 // switch to XQueryPointer
252.26 - if (e.get_type() == MotionNotify) {
252.27 + if (e.get_type() == XConstants.MotionNotify) {
252.28 XMotionEvent ev = e.get_xmotion();
252.29 awtLock();
252.30 try {
252.31 @@ -437,7 +436,7 @@
252.32 } finally {
252.33 awtUnlock();
252.34 }
252.35 - } else if (e.get_type() == LeaveNotify) {
252.36 + } else if (e.get_type() == XConstants.LeaveNotify) {
252.37 // Leave from our window
252.38 awtLock();
252.39 try {
252.40 @@ -445,7 +444,7 @@
252.41 } finally {
252.42 awtUnlock();
252.43 }
252.44 - } else if (e.get_type() == EnterNotify) {
252.45 + } else if (e.get_type() == XConstants.EnterNotify) {
252.46 // Entrance into our window
252.47 XCrossingEvent ev = e.get_xcrossing();
252.48 awtLock();
252.49 @@ -492,7 +491,7 @@
252.50 final XAnyEvent xany = ev.get_xany();
252.51
252.52 if (windowToXWindow(xany.get_window()) != null &&
252.53 - (ev.get_type() == MotionNotify || ev.get_type() == EnterNotify || ev.get_type() == LeaveNotify))
252.54 + (ev.get_type() == XConstants.MotionNotify || ev.get_type() == XConstants.EnterNotify || ev.get_type() == XConstants.LeaveNotify))
252.55 {
252.56 processGlobalMotionEvent(ev);
252.57 }
252.58 @@ -549,15 +548,15 @@
252.59 // If no events are queued, waitForEvents() causes calls to
252.60 // awtUnlock(), awtJNI_ThreadYield, poll, awtLock(),
252.61 // so it spends most of its time in poll, without holding the lock.
252.62 - while ((XlibWrapper.XEventsQueued(getDisplay(), XlibWrapper.QueuedAfterReading) == 0) &&
252.63 - (XlibWrapper.XEventsQueued(getDisplay(), XlibWrapper.QueuedAfterFlush) == 0)) {
252.64 + while ((XlibWrapper.XEventsQueued(getDisplay(), XConstants.QueuedAfterReading) == 0) &&
252.65 + (XlibWrapper.XEventsQueued(getDisplay(), XConstants.QueuedAfterFlush) == 0)) {
252.66 callTimeoutTasks();
252.67 waitForEvents(getNextTaskTime());
252.68 }
252.69 XlibWrapper.XNextEvent(getDisplay(),ev.pData);
252.70 }
252.71
252.72 - if (ev.get_type() != NoExpose) {
252.73 + if (ev.get_type() != XConstants.NoExpose) {
252.74 eventNumber++;
252.75 }
252.76
252.77 @@ -582,13 +581,13 @@
252.78 }
252.79 }
252.80 }
252.81 - if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == KeyPress || ev.get_type() == KeyRelease) ) {
252.82 + if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
252.83 keyEventLog.fine("before XFilterEvent:"+ev);
252.84 }
252.85 if (XlibWrapper.XFilterEvent(ev.getPData(), w)) {
252.86 continue;
252.87 }
252.88 - if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == KeyPress || ev.get_type() == KeyRelease) ) {
252.89 + if( keyEventLog.isLoggable(Level.FINE) && (ev.get_type() == XConstants.KeyPress || ev.get_type() == XConstants.KeyRelease) ) {
252.90 keyEventLog.fine("after XFilterEvent:"+ev); // IS THIS CORRECT?
252.91 }
252.92
252.93 @@ -750,7 +749,7 @@
252.94 * _NET_WM_STRUT[_PARTIAL] hints for iconified windows
252.95 * are not included to the screen insets.
252.96 */
252.97 - if (XlibUtil.getWindowMapState(window) == XlibWrapper.IsUnmapped)
252.98 + if (XlibUtil.getWindowMapState(window) == XConstants.IsUnmapped)
252.99 {
252.100 continue;
252.101 }
252.102 @@ -1289,7 +1288,7 @@
252.103 new XEventDispatcher() {
252.104 public void dispatchEvent(XEvent ev) {
252.105 switch (ev.get_type()) {
252.106 - case PropertyNotify:
252.107 + case XConstants.PropertyNotify:
252.108 XPropertyEvent xpe = ev.get_xproperty();
252.109
252.110 awtLock();
252.111 @@ -1322,7 +1321,7 @@
252.112 XlibWrapper.XChangeProperty(XToolkit.getDisplay(),
252.113 XBaseWindow.getXAWTRootWindow().getWindow(),
252.114 _XA_JAVA_TIME_PROPERTY_ATOM.getAtom(), XAtom.XA_ATOM, 32,
252.115 - PropModeAppend,
252.116 + XConstants.PropModeAppend,
252.117 0, 0);
252.118 XlibWrapper.XFlush(XToolkit.getDisplay());
252.119
252.120 @@ -1539,8 +1538,8 @@
252.121 final int shiftLock = keysymToPrimaryKeycode(XKeySymConstants.XK_Shift_Lock);
252.122 final int capsLock = keysymToPrimaryKeycode(XKeySymConstants.XK_Caps_Lock);
252.123
252.124 - final int modmask[] = { ShiftMask, LockMask, ControlMask, Mod1Mask,
252.125 - Mod2Mask, Mod3Mask, Mod4Mask, Mod5Mask };
252.126 + final int modmask[] = { XConstants.ShiftMask, XConstants.LockMask, XConstants.ControlMask, XConstants.Mod1Mask,
252.127 + XConstants.Mod2Mask, XConstants.Mod3Mask, XConstants.Mod4Mask, XConstants.Mod5Mask };
252.128
252.129 log.fine("In setupModifierMap");
252.130 awtLock();
252.131 @@ -2047,7 +2046,7 @@
252.132 if (oops_waiter == null) {
252.133 oops_waiter = new XEventDispatcher() {
252.134 public void dispatchEvent(XEvent e) {
252.135 - if (e.get_type() == SelectionNotify) {
252.136 + if (e.get_type() == XConstants.SelectionNotify) {
252.137 XSelectionEvent pe = e.get_xselection();
252.138 if (pe.get_property() == oops.getAtom()) {
252.139 oops_updated = true;
252.140 @@ -2083,7 +2082,7 @@
252.141 eventLog.log(Level.FINER, "WM_S0 selection owner {0}", new Object[] {XlibWrapper.XGetSelectionOwner(getDisplay(), atom.getAtom())});
252.142 XlibWrapper.XConvertSelection(getDisplay(), atom.getAtom(),
252.143 XAtom.get("VERSION").getAtom(), oops.getAtom(),
252.144 - win.getWindow(), XlibWrapper.CurrentTime);
252.145 + win.getWindow(), XConstants.CurrentTime);
252.146 XSync();
252.147
252.148
253.1 --- a/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java Mon May 12 18:06:23 2008 -0700
253.2 +++ b/src/solaris/classes/sun/awt/X11/XTrayIconPeer.java Fri May 16 12:25:57 2008 -0700
253.3 @@ -98,7 +98,7 @@
253.4 parentXED = new XEventDispatcher() {
253.5 // It's executed under AWTLock.
253.6 public void dispatchEvent(XEvent ev) {
253.7 - if (isDisposed() || ev.get_type() != XlibWrapper.ConfigureNotify) {
253.8 + if (isDisposed() || ev.get_type() != XConstants.ConfigureNotify) {
253.9 return;
253.10 }
253.11
253.12 @@ -194,7 +194,7 @@
253.13 XTrayIconPeer xtiPeer = XTrayIconPeer.this;
253.14
253.15 public void dispatchEvent(XEvent ev) {
253.16 - if (isDisposed() || ev.get_type() != XlibWrapper.ReparentNotify) {
253.17 + if (isDisposed() || ev.get_type() != XConstants.ReparentNotify) {
253.18 return;
253.19 }
253.20
253.21 @@ -214,7 +214,7 @@
253.22 }
253.23
253.24 if (!isTrayIconDisplayed) {
253.25 - addXED(eframeParentID, parentXED, XlibWrapper.StructureNotifyMask);
253.26 + addXED(eframeParentID, parentXED, XConstants.StructureNotifyMask);
253.27
253.28 isTrayIconDisplayed = true;
253.29 XToolkit.awtLockNotifyAll();
253.30 @@ -222,7 +222,7 @@
253.31 }
253.32 };
253.33
253.34 - addXED(getWindow(), eframeXED, XlibWrapper.StructureNotifyMask);
253.35 + addXED(getWindow(), eframeXED, XConstants.StructureNotifyMask);
253.36
253.37 XSystemTrayPeer.getPeerInstance().addTrayIcon(this); // throws AWTException
253.38
253.39 @@ -833,6 +833,7 @@
253.40 Dimension tpSize = textPanel.getSize();
253.41 iconCanvas.setSize(BALLOON_ICON_WIDTH, (BALLOON_ICON_HEIGHT > tpSize.height ?
253.42 BALLOON_ICON_HEIGHT : tpSize.height));
253.43 + iconCanvas.validate();
253.44 }
253.45
253.46 SunToolkit.executeOnEventHandlerThread(xtiPeer.target, new Runnable() {
254.1 --- a/src/solaris/classes/sun/awt/X11/XUtilConstants.java Mon May 12 18:06:23 2008 -0700
254.2 +++ b/src/solaris/classes/sun/awt/X11/XUtilConstants.java Fri May 16 12:25:57 2008 -0700
254.3 @@ -1,5 +1,5 @@
254.4 /*
254.5 - * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.
254.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
254.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
254.8 *
254.9 * This code is free software; you can redistribute it and/or modify it
254.10 @@ -25,7 +25,10 @@
254.11
254.12 package sun.awt.X11;
254.13
254.14 -public interface XUtilConstants {
254.15 +final public class XUtilConstants {
254.16 +
254.17 + private XUtilConstants(){}
254.18 +
254.19 /*
254.20 * Bitmask returned by XParseGeometry(). Each bit tells if the corresponding
254.21 * value (x, y, width, height) was found in the parsed string.
255.1 --- a/src/solaris/classes/sun/awt/X11/XWINProtocol.java Mon May 12 18:06:23 2008 -0700
255.2 +++ b/src/solaris/classes/sun/awt/X11/XWINProtocol.java Fri May 16 12:25:57 2008 -0700
255.3 @@ -1,5 +1,5 @@
255.4 /*
255.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
255.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
255.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
255.8 *
255.9 * This code is free software; you can redistribute it and/or modify it
255.10 @@ -58,7 +58,7 @@
255.11 }
255.12
255.13 XClientMessageEvent req = new XClientMessageEvent();
255.14 - req.set_type(XlibWrapper.ClientMessage);
255.15 + req.set_type(XConstants.ClientMessage);
255.16 req.set_window(window.getWindow());
255.17 req.set_message_type(XA_WIN_STATE.getAtom());
255.18 req.set_format(32);
255.19 @@ -71,7 +71,7 @@
255.20 XlibWrapper.RootWindow(XToolkit.getDisplay(),
255.21 window.getScreenNumber()),
255.22 false,
255.23 - XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
255.24 + XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
255.25 req.pData);
255.26 }
255.27 finally {
255.28 @@ -150,7 +150,7 @@
255.29 public void setLayer(XWindowPeer window, int layer) {
255.30 if (window.isShowing()) {
255.31 XClientMessageEvent req = new XClientMessageEvent();
255.32 - req.set_type(XlibWrapper.ClientMessage);
255.33 + req.set_type(XConstants.ClientMessage);
255.34 req.set_window(window.getWindow());
255.35 req.set_message_type(XA_WIN_LAYER.getAtom());
255.36 req.set_format(32);
255.37 @@ -164,7 +164,7 @@
255.38 XlibWrapper.RootWindow(XToolkit.getDisplay(),
255.39 window.getScreenNumber()),
255.40 false,
255.41 - /*XlibWrapper.SubstructureRedirectMask | */XlibWrapper.SubstructureNotifyMask,
255.42 + /*XConstants.SubstructureRedirectMask | */XConstants.SubstructureNotifyMask,
255.43 req.pData);
255.44 }
255.45 finally {
256.1 --- a/src/solaris/classes/sun/awt/X11/XWM.java Mon May 12 18:06:23 2008 -0700
256.2 +++ b/src/solaris/classes/sun/awt/X11/XWM.java Fri May 16 12:25:57 2008 -0700
256.3 @@ -46,7 +46,7 @@
256.4 * Class incapsulating knowledge about window managers in general
256.5 * Descendants should provide some information about specific window manager.
256.6 */
256.7 -final class XWM implements MWMConstants, XUtilConstants
256.8 +final class XWM
256.9 {
256.10
256.11 private final static Logger log = Logger.getLogger("sun.awt.X11.XWM");
256.12 @@ -274,12 +274,12 @@
256.13 }
256.14
256.15 winmgr_running = false;
256.16 - substruct.set_event_mask(XlibWrapper.SubstructureRedirectMask);
256.17 + substruct.set_event_mask(XConstants.SubstructureRedirectMask);
256.18
256.19 XToolkit.WITH_XERROR_HANDLER(DetectWMHandler);
256.20 XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
256.21 XToolkit.getDefaultRootWindow(),
256.22 - XlibWrapper.CWEventMask,
256.23 + XConstants.CWEventMask,
256.24 substruct.pData);
256.25 XToolkit.RESTORE_XERROR_HANDLER();
256.26
256.27 @@ -291,7 +291,7 @@
256.28 substruct.set_event_mask(0);
256.29 XlibWrapper.XChangeWindowAttributes(XToolkit.getDisplay(),
256.30 XToolkit.getDefaultRootWindow(),
256.31 - XlibWrapper.CWEventMask,
256.32 + XConstants.CWEventMask,
256.33 substruct.pData);
256.34 if (insLog.isLoggable(Level.FINE)) {
256.35 insLog.finer("It looks like there is no WM thus NO_WM");
256.36 @@ -322,7 +322,7 @@
256.37 XAtom.XA_STRING);
256.38 try {
256.39 int status = getter.execute(XToolkit.IgnoreBadWindowHandler);
256.40 - if (status != XlibWrapper.Success || getter.getData() == 0) {
256.41 + if (status != XConstants.Success || getter.getData() == 0) {
256.42 return 0;
256.43 }
256.44
256.45 @@ -411,7 +411,7 @@
256.46 false, XA_DT_SM_WINDOW_INFO);
256.47 try {
256.48 int status = getter.execute();
256.49 - if (status != XlibWrapper.Success || getter.getData() == 0) {
256.50 + if (status != XConstants.Success || getter.getData() == 0) {
256.51 log.finer("Getting of _DT_SM_WINDOW_INFO is not successfull");
256.52 return false;
256.53 }
256.54 @@ -442,7 +442,7 @@
256.55 status = getter2.execute(XToolkit.IgnoreBadWindowHandler);
256.56
256.57
256.58 - if (status != XlibWrapper.Success || getter2.getData() == 0) {
256.59 + if (status != XConstants.Success || getter2.getData() == 0) {
256.60 log.finer("Getting of _DT_SM_STATE_INFO is not successfull");
256.61 return false;
256.62 }
256.63 @@ -480,18 +480,18 @@
256.64 WindowPropertyGetter getter =
256.65 new WindowPropertyGetter(XToolkit.getDefaultRootWindow(),
256.66 XA_MOTIF_WM_INFO, 0,
256.67 - PROP_MOTIF_WM_INFO_ELEMENTS,
256.68 + MWMConstants.PROP_MOTIF_WM_INFO_ELEMENTS,
256.69 false, XA_MOTIF_WM_INFO);
256.70 try {
256.71 int status = getter.execute();
256.72
256.73 - if (status != XlibWrapper.Success || getter.getData() == 0) {
256.74 + if (status != XConstants.Success || getter.getData() == 0) {
256.75 return false;
256.76 }
256.77
256.78 if (getter.getActualType() != XA_MOTIF_WM_INFO.getAtom()
256.79 || getter.getActualFormat() != 32
256.80 - || getter.getNumberOfItems() != PROP_MOTIF_WM_INFO_ELEMENTS
256.81 + || getter.getNumberOfItems() != MWMConstants.PROP_MOTIF_WM_INFO_ELEMENTS
256.82 || getter.getBytesAfter() != 0)
256.83 {
256.84 return false;
256.85 @@ -516,7 +516,7 @@
256.86 0, 1, false,
256.87 XA_WM_STATE);
256.88 try {
256.89 - if (state_getter.execute() == XlibWrapper.Success &&
256.90 + if (state_getter.execute() == XConstants.Success &&
256.91 state_getter.getData() != 0 &&
256.92 state_getter.getActualType() == XA_WM_STATE.getAtom())
256.93 {
256.94 @@ -577,7 +577,7 @@
256.95 static XToolkit.XErrorHandler VerifyChangePropertyHandler = new XToolkit.XErrorHandler() {
256.96 public int handleError(long display, XErrorEvent err) {
256.97 XToolkit.XERROR_SAVE(err);
256.98 - if (err.get_request_code() == XlibWrapper.X_ChangeProperty) {
256.99 + if (err.get_request_code() == XProtocolConstants.X_ChangeProperty) {
256.100 return 0;
256.101 } else {
256.102 return XToolkit.SAVED_ERROR_HANDLER(display, err);
256.103 @@ -621,11 +621,11 @@
256.104 XlibWrapper.XChangePropertyS(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
256.105 XA_ICEWM_WINOPTHINT.getAtom(),
256.106 XA_ICEWM_WINOPTHINT.getAtom(),
256.107 - 8, XlibWrapper.PropModeReplace,
256.108 + 8, XConstants.PropModeReplace,
256.109 new String(opt));
256.110 XToolkit.RESTORE_XERROR_HANDLER();
256.111
256.112 - if (XToolkit.saved_error != null && XToolkit.saved_error.get_error_code() != XlibWrapper.Success) {
256.113 + if (XToolkit.saved_error != null && XToolkit.saved_error.get_error_code() != XConstants.Success) {
256.114 log.finer("Erorr getting XA_ICEWM_WINOPTHINT property");
256.115 return false;
256.116 }
256.117 @@ -654,7 +654,7 @@
256.118 true, XA_ICEWM_WINOPTHINT);
256.119 try {
256.120 int status = getter.execute();
256.121 - boolean res = (status == XlibWrapper.Success && getter.getActualType() != 0);
256.122 + boolean res = (status == XConstants.Success && getter.getActualType() != 0);
256.123 log.finer("Status getting XA_ICEWM_WINOPTHINT: " + !res);
256.124 return !res || isNetWMName("IceWM");
256.125 } finally {
256.126 @@ -686,8 +686,8 @@
256.127 static XToolkit.XErrorHandler DetectWMHandler = new XToolkit.XErrorHandler() {
256.128 public int handleError(long display, XErrorEvent err) {
256.129 XToolkit.XERROR_SAVE(err);
256.130 - if (err.get_request_code() == XlibWrapper.X_ChangeWindowAttributes
256.131 - && err.get_error_code() == XlibWrapper.BadAccess)
256.132 + if (err.get_request_code() == XProtocolConstants.X_ChangeWindowAttributes
256.133 + && err.get_error_code() == XConstants.BadAccess)
256.134 {
256.135 winmgr_running = true;
256.136 return 0;
256.137 @@ -804,7 +804,7 @@
256.138 * XXX: Why do we need this in the first place???
256.139 */
256.140 static void removeSizeHints(XDecoratedPeer window, long mask) {
256.141 - mask &= PMaxSize | PMinSize;
256.142 + mask &= XUtilConstants.PMaxSize | XUtilConstants.PMinSize;
256.143
256.144 XToolkit.awtLock();
256.145 try {
256.146 @@ -830,13 +830,13 @@
256.147 * rest of the code.
256.148 */
256.149 static int normalizeMotifDecor(int decorations) {
256.150 - if ((decorations & MWM_DECOR_ALL) == 0) {
256.151 + if ((decorations & MWMConstants.MWM_DECOR_ALL) == 0) {
256.152 return decorations;
256.153 }
256.154 - int d = MWM_DECOR_BORDER | MWM_DECOR_RESIZEH
256.155 - | MWM_DECOR_TITLE
256.156 - | MWM_DECOR_MENU | MWM_DECOR_MINIMIZE
256.157 - | MWM_DECOR_MAXIMIZE;
256.158 + int d = MWMConstants.MWM_DECOR_BORDER | MWMConstants.MWM_DECOR_RESIZEH
256.159 + | MWMConstants.MWM_DECOR_TITLE
256.160 + | MWMConstants.MWM_DECOR_MENU | MWMConstants.MWM_DECOR_MINIMIZE
256.161 + | MWMConstants.MWM_DECOR_MAXIMIZE;
256.162 d &= ~decorations;
256.163 return d;
256.164 }
256.165 @@ -848,14 +848,14 @@
256.166 * rest of the code.
256.167 */
256.168 static int normalizeMotifFunc(int functions) {
256.169 - if ((functions & MWM_FUNC_ALL) == 0) {
256.170 + if ((functions & MWMConstants.MWM_FUNC_ALL) == 0) {
256.171 return functions;
256.172 }
256.173 - int f = MWM_FUNC_RESIZE |
256.174 - MWM_FUNC_MOVE |
256.175 - MWM_FUNC_MAXIMIZE |
256.176 - MWM_FUNC_MINIMIZE |
256.177 - MWM_FUNC_CLOSE;
256.178 + int f = MWMConstants.MWM_FUNC_RESIZE |
256.179 + MWMConstants.MWM_FUNC_MOVE |
256.180 + MWMConstants.MWM_FUNC_MAXIMIZE |
256.181 + MWMConstants.MWM_FUNC_MINIMIZE |
256.182 + MWMConstants.MWM_FUNC_CLOSE;
256.183 f &= ~functions;
256.184 return f;
256.185 }
256.186 @@ -872,15 +872,15 @@
256.187 XAtomList decorDel = new XAtomList();
256.188 decorations = normalizeMotifDecor(decorations);
256.189 if (insLog.isLoggable(Level.FINER)) insLog.finer("Setting OL_DECOR to " + Integer.toBinaryString(decorations));
256.190 - if ((decorations & MWM_DECOR_TITLE) == 0) {
256.191 + if ((decorations & MWMConstants.MWM_DECOR_TITLE) == 0) {
256.192 decorDel.add(XA_OL_DECOR_HEADER);
256.193 }
256.194 - if ((decorations & (MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE)) == 0) {
256.195 + if ((decorations & (MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE)) == 0) {
256.196 decorDel.add(XA_OL_DECOR_RESIZE);
256.197 }
256.198 - if ((decorations & (MWM_DECOR_MENU |
256.199 - MWM_DECOR_MAXIMIZE |
256.200 - MWM_DECOR_MINIMIZE)) == 0)
256.201 + if ((decorations & (MWMConstants.MWM_DECOR_MENU |
256.202 + MWMConstants.MWM_DECOR_MAXIMIZE |
256.203 + MWMConstants.MWM_DECOR_MINIMIZE)) == 0)
256.204 {
256.205 decorDel.add(XA_OL_DECOR_CLOSE);
256.206 }
256.207 @@ -898,19 +898,21 @@
256.208 */
256.209 static void setMotifDecor(XWindowPeer window, boolean resizable, int decorations, int functions) {
256.210 /* Apparently some WMs don't implement MWM_*_ALL semantic correctly */
256.211 - if ((decorations & MWM_DECOR_ALL) != 0
256.212 - && (decorations != MWM_DECOR_ALL))
256.213 + if ((decorations & MWMConstants.MWM_DECOR_ALL) != 0
256.214 + && (decorations != MWMConstants.MWM_DECOR_ALL))
256.215 {
256.216 decorations = normalizeMotifDecor(decorations);
256.217 }
256.218 - if ((functions & MWM_FUNC_ALL) != 0
256.219 - && (functions != MWM_FUNC_ALL))
256.220 + if ((functions & MWMConstants.MWM_FUNC_ALL) != 0
256.221 + && (functions != MWMConstants.MWM_FUNC_ALL))
256.222 {
256.223 functions = normalizeMotifFunc(functions);
256.224 }
256.225
256.226 PropMwmHints hints = window.getMWMHints();
256.227 - hints.set_flags(hints.get_flags() | MWM_HINTS_FUNCTIONS | MWM_HINTS_DECORATIONS);
256.228 + hints.set_flags(hints.get_flags() |
256.229 + MWMConstants.MWM_HINTS_FUNCTIONS |
256.230 + MWMConstants.MWM_HINTS_DECORATIONS);
256.231 hints.set_functions(functions);
256.232 hints.set_decorations(decorations);
256.233
256.234 @@ -950,10 +952,10 @@
256.235 boolean resizable = window.isResizable();
256.236
256.237 if (!resizable) {
256.238 - if ((decorations & MWM_DECOR_ALL) != 0) {
256.239 - decorations |= MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE;
256.240 + if ((decorations & MWMConstants.MWM_DECOR_ALL) != 0) {
256.241 + decorations |= MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE;
256.242 } else {
256.243 - decorations &= ~(MWM_DECOR_RESIZEH | MWM_DECOR_MAXIMIZE);
256.244 + decorations &= ~(MWMConstants.MWM_DECOR_RESIZEH | MWMConstants.MWM_DECOR_MAXIMIZE);
256.245 }
256.246 }
256.247 setMotifDecor(window, resizable, decorations, functions);
256.248 @@ -988,7 +990,7 @@
256.249 /* REMINDER: will need to revisit when setExtendedStateBounds is added */
256.250 //Fix for 4320050: Minimum size for java.awt.Frame is not being enforced.
256.251 //We need to update frame's minimum size, not to reset it
256.252 - removeSizeHints(window, PMaxSize);
256.253 + removeSizeHints(window, XUtilConstants.PMaxSize);
256.254 window.updateMinimumSize();
256.255
256.256 /* Restore decorations */
256.257 @@ -1134,7 +1136,7 @@
256.258 }
256.259
256.260 int wm_state = window.getWMState();
256.261 - if (wm_state == XlibWrapper.WithdrawnState) {
256.262 + if (wm_state == XUtilConstants.WithdrawnState) {
256.263 stateLog.finer("WithdrawnState");
256.264 return false;
256.265 } else {
256.266 @@ -1158,7 +1160,7 @@
256.267 int getState(XDecoratedPeer window) {
256.268 int res = 0;
256.269 final int wm_state = window.getWMState();
256.270 - if (wm_state == XlibWrapper.IconicState) {
256.271 + if (wm_state == XUtilConstants.IconicState) {
256.272 res = Frame.ICONIFIED;
256.273 } else {
256.274 res = Frame.NORMAL;
256.275 @@ -1397,7 +1399,7 @@
256.276 new WindowPropertyGetter(window, atom,
256.277 0, 4, false, XAtom.XA_CARDINAL);
256.278 try {
256.279 - if (getter.execute() != XlibWrapper.Success
256.280 + if (getter.execute() != XConstants.Success
256.281 || getter.getData() == 0
256.282 || getter.getActualType() != XAtom.XA_CARDINAL
256.283 || getter.getActualFormat() != 32)
256.284 @@ -1426,7 +1428,7 @@
256.285
256.286 XClientMessageEvent msg = new XClientMessageEvent();
256.287 msg.zero();
256.288 - msg.set_type(XlibWrapper.ClientMessage);
256.289 + msg.set_type(XConstants.ClientMessage);
256.290 msg.set_display(XToolkit.getDisplay());
256.291 msg.set_window(window);
256.292 msg.set_format(32);
256.293 @@ -1436,13 +1438,15 @@
256.294 if (net_protocol != null && net_protocol.active()) {
256.295 msg.set_message_type(XA_NET_REQUEST_FRAME_EXTENTS.getAtom());
256.296 XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
256.297 - false, XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
256.298 + false,
256.299 + XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
256.300 msg.getPData());
256.301 }
256.302 if (getWMID() == XWM.KDE2_WM) {
256.303 msg.set_message_type(XA_KDE_NET_WM_FRAME_STRUT.getAtom());
256.304 XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
256.305 - false, XlibWrapper.SubstructureRedirectMask | XlibWrapper.SubstructureNotifyMask,
256.306 + false,
256.307 + XConstants.SubstructureRedirectMask | XConstants.SubstructureNotifyMask,
256.308 msg.getPData());
256.309 }
256.310 // XXX: should we wait for response? XIfEvent() would be useful here :)
257.1 --- a/src/solaris/classes/sun/awt/X11/XWindow.java Mon May 12 18:06:23 2008 -0700
257.2 +++ b/src/solaris/classes/sun/awt/X11/XWindow.java Fri May 16 12:25:57 2008 -0700
257.3 @@ -103,12 +103,14 @@
257.4 return defaultFont;
257.5 }
257.6
257.7 - /*
257.8 - * Keeps all buttons which were pressed at the time of the last mouse
257.9 - * drag until all buttons will be released, contains state as bit masks
257.10 - * Button1Mask, Button2Mask, Button3Mask
257.11 - */
257.12 - private int mouseDragState = 0;
257.13 + /* A bitmask keeps the button's numbers as Button1Mask, Button2Mask, Button3Mask
257.14 + * which are allowed to
257.15 + * generate the CLICK event after the RELEASE has happened.
257.16 + * There are conditions that must be true for that sending CLICK event:
257.17 + * 1) button was initially PRESSED
257.18 + * 2) no movement or drag has happened until RELEASE
257.19 + */
257.20 + private int mouseButtonClickAllowed = 0;
257.21
257.22 native int getNativeColor(Color clr, GraphicsConfiguration gc);
257.23 native void getWMInsets(long window, long left, long top, long right, long bottom, long border);
257.24 @@ -178,10 +180,10 @@
257.25 AwtGraphicsConfigData gData = getGraphicsConfigurationData();
257.26 X11GraphicsConfig config = (X11GraphicsConfig) getGraphicsConfiguration();
257.27 XVisualInfo visInfo = gData.get_awt_visInfo();
257.28 - params.putIfNull(EVENT_MASK, KeyPressMask | KeyReleaseMask
257.29 - | FocusChangeMask | ButtonPressMask | ButtonReleaseMask
257.30 - | EnterWindowMask | LeaveWindowMask | PointerMotionMask
257.31 - | ButtonMotionMask | ExposureMask | StructureNotifyMask);
257.32 + params.putIfNull(EVENT_MASK, XConstants.KeyPressMask | XConstants.KeyReleaseMask
257.33 + | XConstants.FocusChangeMask | XConstants.ButtonPressMask | XConstants.ButtonReleaseMask
257.34 + | XConstants.EnterWindowMask | XConstants.LeaveWindowMask | XConstants.PointerMotionMask
257.35 + | XConstants.ButtonMotionMask | XConstants.ExposureMask | XConstants.StructureNotifyMask);
257.36
257.37 if (target != null) {
257.38 params.putIfNull(BOUNDS, target.getBounds());
257.39 @@ -192,9 +194,9 @@
257.40 getColorModel(); // fix 4948833: this call forces the color map to be initialized
257.41 params.putIfNull(COLORMAP, gData.get_awt_cmap());
257.42 params.putIfNull(DEPTH, gData.get_awt_depth());
257.43 - params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XlibWrapper.InputOutput));
257.44 + params.putIfNull(VISUAL_CLASS, Integer.valueOf((int)XConstants.InputOutput));
257.45 params.putIfNull(VISUAL, visInfo.get_visual());
257.46 - params.putIfNull(VALUE_MASK, XlibWrapper.CWBorderPixel | XlibWrapper.CWEventMask | XlibWrapper.CWColormap);
257.47 + params.putIfNull(VALUE_MASK, XConstants.CWBorderPixel | XConstants.CWEventMask | XConstants.CWColormap);
257.48 Long parentWindow = (Long)params.get(PARENT_WINDOW);
257.49 if (parentWindow == null || parentWindow.longValue() == 0) {
257.50 XToolkit.awtLock();
257.51 @@ -553,10 +555,10 @@
257.52 static int getModifiers(int state, int button, int keyCode) {
257.53 int modifiers = 0;
257.54
257.55 - if (((state & XlibWrapper.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) {
257.56 + if (((state & XConstants.ShiftMask) != 0) ^ (keyCode == KeyEvent.VK_SHIFT)) {
257.57 modifiers |= InputEvent.SHIFT_DOWN_MASK;
257.58 }
257.59 - if (((state & XlibWrapper.ControlMask) != 0) ^ (keyCode == KeyEvent.VK_CONTROL)) {
257.60 + if (((state & XConstants.ControlMask) != 0) ^ (keyCode == KeyEvent.VK_CONTROL)) {
257.61 modifiers |= InputEvent.CTRL_DOWN_MASK;
257.62 }
257.63 if (((state & XToolkit.metaMask) != 0) ^ (keyCode == KeyEvent.VK_META)) {
257.64 @@ -568,13 +570,13 @@
257.65 if (((state & XToolkit.modeSwitchMask) != 0) ^ (keyCode == KeyEvent.VK_ALT_GRAPH)) {
257.66 modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK;
257.67 }
257.68 - if (((state & XlibWrapper.Button1Mask) != 0) ^ (button == MouseEvent.BUTTON1)) {
257.69 + if (((state & XConstants.Button1Mask) != 0) ^ (button == MouseEvent.BUTTON1)) {
257.70 modifiers |= InputEvent.BUTTON1_DOWN_MASK;
257.71 }
257.72 - if (((state & XlibWrapper.Button2Mask) != 0) ^ (button == MouseEvent.BUTTON2)) {
257.73 + if (((state & XConstants.Button2Mask) != 0) ^ (button == MouseEvent.BUTTON2)) {
257.74 modifiers |= InputEvent.BUTTON2_DOWN_MASK;
257.75 }
257.76 - if (((state & XlibWrapper.Button3Mask) != 0) ^ (button == MouseEvent.BUTTON3)) {
257.77 + if (((state & XConstants.Button3Mask) != 0) ^ (button == MouseEvent.BUTTON3)) {
257.78 modifiers |= InputEvent.BUTTON3_DOWN_MASK;
257.79 }
257.80 return modifiers;
257.81 @@ -584,10 +586,10 @@
257.82 int mods = stroke.getModifiers();
257.83 int res = 0;
257.84 if ((mods & (InputEvent.SHIFT_DOWN_MASK | InputEvent.SHIFT_MASK)) != 0) {
257.85 - res |= XToolkit.ShiftMask;
257.86 + res |= XConstants.ShiftMask;
257.87 }
257.88 if ((mods & (InputEvent.CTRL_DOWN_MASK | InputEvent.CTRL_MASK)) != 0) {
257.89 - res |= XToolkit.ControlMask;
257.90 + res |= XConstants.ControlMask;
257.91 }
257.92 if ((mods & (InputEvent.ALT_DOWN_MASK | InputEvent.ALT_MASK)) != 0) {
257.93 res |= XToolkit.altMask;
257.94 @@ -602,12 +604,12 @@
257.95 }
257.96
257.97 private static int getButtonMask(long mouseButton) {
257.98 - if (mouseButton == XlibWrapper.Button1) {
257.99 - return XlibWrapper.Button1Mask;
257.100 - } else if (mouseButton == XlibWrapper.Button2) {
257.101 - return XlibWrapper.Button2Mask;
257.102 - } else if (mouseButton == XlibWrapper.Button3) {
257.103 - return XlibWrapper.Button3Mask;
257.104 + if (mouseButton == XConstants.Button1) {
257.105 + return XConstants.Button1Mask;
257.106 + } else if (mouseButton == XConstants.Button2) {
257.107 + return XConstants.Button2Mask;
257.108 + } else if (mouseButton == XConstants.Button3) {
257.109 + return XConstants.Button3Mask;
257.110 }
257.111 return 0;
257.112 }
257.113 @@ -659,7 +661,9 @@
257.114 y = localXY.y;
257.115 }
257.116
257.117 - if (type == XlibWrapper.ButtonPress) {
257.118 + if (type == XConstants.ButtonPress) {
257.119 + //Allow this mouse button to generate CLICK event on next ButtonRelease
257.120 + mouseButtonClickAllowed |= getButtonMask(lbutton);
257.121 XWindow lastWindow = (lastWindowRef != null) ? ((XWindow)lastWindowRef.get()):(null);
257.122 /*
257.123 multiclick checking
257.124 @@ -689,16 +693,16 @@
257.125 }
257.126 }
257.127
257.128 - if (lbutton == XlibWrapper.Button1)
257.129 + if (lbutton == XConstants.Button1)
257.130 button = MouseEvent.BUTTON1;
257.131 - else if (lbutton == XlibWrapper.Button2 )
257.132 + else if (lbutton == XConstants.Button2 )
257.133 button = MouseEvent.BUTTON2;
257.134 - else if (lbutton == XlibWrapper.Button3)
257.135 + else if (lbutton == XConstants.Button3)
257.136 button = MouseEvent.BUTTON3;
257.137 - else if (lbutton == XlibWrapper.Button4) {
257.138 + else if (lbutton == XConstants.Button4) {
257.139 button = 4;
257.140 wheel_mouse = true;
257.141 - } else if (lbutton == XlibWrapper.Button5) {
257.142 + } else if (lbutton == XConstants.Button5) {
257.143 button = 5;
257.144 wheel_mouse = true;
257.145 }
257.146 @@ -707,7 +711,7 @@
257.147
257.148 if (!wheel_mouse) {
257.149 MouseEvent me = new MouseEvent((Component)getEventSource(),
257.150 - type == XlibWrapper.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED,
257.151 + type == XConstants.ButtonPress ? MouseEvent.MOUSE_PRESSED : MouseEvent.MOUSE_RELEASED,
257.152 jWhen,modifiers, x, y,
257.153 xbe.get_x_root(),
257.154 xbe.get_y_root(),
257.155 @@ -715,8 +719,8 @@
257.156
257.157 postEventToEventQueue(me);
257.158
257.159 - if (((mouseDragState & getButtonMask(lbutton)) == 0) && // No up-button in the drag-state
257.160 - (type == XlibWrapper.ButtonRelease))
257.161 + if ((type == XConstants.ButtonRelease) &&
257.162 + ((mouseButtonClickAllowed & getButtonMask(lbutton)) != 0) ) // No up-button in the drag-state
257.163 {
257.164 postEventToEventQueue(me = new MouseEvent((Component)getEventSource(),
257.165 MouseEvent.MOUSE_CLICKED,
257.166 @@ -731,7 +735,7 @@
257.167
257.168 }
257.169 else {
257.170 - if (xev.get_type() == XlibWrapper.ButtonPress) {
257.171 + if (xev.get_type() == XConstants.ButtonPress) {
257.172 MouseWheelEvent mwe = new MouseWheelEvent((Component)getEventSource(),MouseEvent.MOUSE_WHEEL, jWhen,
257.173 modifiers,
257.174 x, y,
257.175 @@ -743,7 +747,11 @@
257.176 }
257.177 }
257.178
257.179 - mouseDragState &= ~getButtonMask(lbutton); // Exclude the up-button from the drag-state
257.180 + /* Update the state variable AFTER the CLICKED event post. */
257.181 + if (type == XConstants.ButtonRelease) {
257.182 + /* Exclude this mouse button from allowed list.*/
257.183 + mouseButtonClickAllowed &= ~getButtonMask(lbutton);
257.184 + }
257.185 }
257.186
257.187 public void handleMotionNotify(XEvent xev) {
257.188 @@ -753,7 +761,7 @@
257.189 return;
257.190 }
257.191
257.192 - int mouseKeyState = (xme.get_state() & (Button1Mask | Button2Mask | Button3Mask));
257.193 + int mouseKeyState = (xme.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask | XConstants.Button3Mask));
257.194 boolean isDragging = (mouseKeyState != 0);
257.195 int mouseEventType = 0;
257.196
257.197 @@ -776,7 +784,7 @@
257.198 Math.abs(lastY - y) < AWT_MULTICLICK_SMUDGE))) {
257.199 clickCount = 0;
257.200 lastWindowRef = null;
257.201 - mouseDragState = mouseKeyState;
257.202 + mouseButtonClickAllowed = 0;
257.203 lastTime = 0;
257.204 lastX = 0;
257.205 lastY = 0;
257.206 @@ -823,10 +831,10 @@
257.207 // accordingly. This leads to impossibility to make a double click on Component (6404708)
257.208 XWindowPeer toplevel = getToplevelXWindow();
257.209 if (toplevel != null && !toplevel.isModalBlocked()){
257.210 - if (xce.get_mode() != NotifyNormal) {
257.211 + if (xce.get_mode() != XConstants.NotifyNormal) {
257.212 // 6404708 : need update cursor in accordance with skipping Leave/EnterNotify event
257.213 // whereas it doesn't need to handled further.
257.214 - if (xce.get_type() == EnterNotify) {
257.215 + if (xce.get_type() == XConstants.EnterNotify) {
257.216 XAwtState.setComponentMouseEntered(getEventSource());
257.217 XGlobalCursorManager.nativeUpdateCursor(getEventSource());
257.218 } else { // LeaveNotify:
257.219 @@ -840,7 +848,7 @@
257.220 // From java point the event is bogus as ancestor is obscured, so if
257.221 // the child can get java event itself, we skip it on ancestor.
257.222 long childWnd = xce.get_subwindow();
257.223 - if (childWnd != None) {
257.224 + if (childWnd != XConstants.None) {
257.225 XBaseWindow child = XToolkit.windowToXWindow(childWnd);
257.226 if (child != null && child instanceof XWindow &&
257.227 !child.isEventDisabled(xev))
257.228 @@ -853,7 +861,7 @@
257.229 final Component compWithMouse = XAwtState.getComponentMouseEntered();
257.230 if (toplevel != null) {
257.231 if(!toplevel.isModalBlocked()){
257.232 - if (xce.get_type() == EnterNotify) {
257.233 + if (xce.get_type() == XConstants.EnterNotify) {
257.234 // Change XAwtState's component mouse entered to the up-to-date one before requesting
257.235 // to update the cursor since XAwtState.getComponentMouseEntered() is used when the
257.236 // cursor is updated (in XGlobalCursorManager.findHeavyweightUnderCursor()).
257.237 @@ -895,7 +903,7 @@
257.238 eventLog.finest("Clearing last window ref");
257.239 lastWindowRef = null;
257.240 }
257.241 - if (xce.get_type() == EnterNotify) {
257.242 + if (xce.get_type() == XConstants.EnterNotify) {
257.243 MouseEvent me = new MouseEvent(getEventSource(), MouseEvent.MOUSE_ENTERED,
257.244 jWhen, modifiers, xce.get_x(), xce.get_y(), xce.get_x_root(), xce.get_y_root(), clickCount,
257.245 popupTrigger, MouseEvent.NOBUTTON);
257.246 @@ -990,7 +998,7 @@
257.247 final void handleKeyPress(XKeyEvent ev) {
257.248 long keysym[] = new long[2];
257.249 char unicodeKey = 0;
257.250 - keysym[0] = NoSymbol;
257.251 + keysym[0] = XConstants.NoSymbol;
257.252
257.253 if (keyEventLog.isLoggable(Level.FINE)) {
257.254 logIncomingKeyEvent( ev );
257.255 @@ -1073,7 +1081,7 @@
257.256 private void handleKeyRelease(XKeyEvent ev) {
257.257 long keysym[] = new long[2];
257.258 char unicodeKey = 0;
257.259 - keysym[0] = NoSymbol;
257.260 + keysym[0] = XConstants.NoSymbol;
257.261
257.262 if (keyEventLog.isLoggable(Level.FINE)) {
257.263 logIncomingKeyEvent( ev );
257.264 @@ -1153,10 +1161,10 @@
257.265 }
257.266
257.267 void updateSizeHints(int x, int y, int width, int height) {
257.268 - long flags = XlibWrapper.PSize | (isLocationByPlatform() ? 0 : (XlibWrapper.PPosition | XlibWrapper.USPosition));
257.269 + long flags = XUtilConstants.PSize | (isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition));
257.270 if (!isResizable()) {
257.271 log.log(Level.FINER, "Window {0} is not resizable", new Object[] {this});
257.272 - flags |= XlibWrapper.PMinSize | XlibWrapper.PMaxSize;
257.273 + flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize;
257.274 } else {
257.275 log.log(Level.FINER, "Window {0} is resizable", new Object[] {this});
257.276 }
257.277 @@ -1164,10 +1172,10 @@
257.278 }
257.279
257.280 void updateSizeHints(int x, int y) {
257.281 - long flags = isLocationByPlatform() ? 0 : (XlibWrapper.PPosition | XlibWrapper.USPosition);
257.282 + long flags = isLocationByPlatform() ? 0 : (XUtilConstants.PPosition | XUtilConstants.USPosition);
257.283 if (!isResizable()) {
257.284 log.log(Level.FINER, "Window {0} is not resizable", new Object[] {this});
257.285 - flags |= XlibWrapper.PMinSize | XlibWrapper.PMaxSize | XlibWrapper.PSize;
257.286 + flags |= XUtilConstants.PMinSize | XUtilConstants.PMaxSize | XUtilConstants.PSize;
257.287 } else {
257.288 log.log(Level.FINER, "Window {0} is resizable", new Object[] {this});
257.289 }
258.1 --- a/src/solaris/classes/sun/awt/X11/XWindowPeer.java Mon May 12 18:06:23 2008 -0700
258.2 +++ b/src/solaris/classes/sun/awt/X11/XWindowPeer.java Fri May 16 12:25:57 2008 -0700
258.3 @@ -50,7 +50,7 @@
258.4 import sun.awt.X11GraphicsEnvironment;
258.5
258.6 class XWindowPeer extends XPanelPeer implements WindowPeer,
258.7 - DisplayChangedListener, MWMConstants {
258.8 + DisplayChangedListener {
258.9
258.10 private static final Logger log = Logger.getLogger("sun.awt.X11.XWindowPeer");
258.11 private static final Logger focusLog = Logger.getLogger("sun.awt.X11.focus.XWindowPeer");
258.12 @@ -65,7 +65,6 @@
258.13 static XAtom wm_delete_window;
258.14 static XAtom wm_take_focus;
258.15
258.16 - Insets insets = new Insets( 0, 0, 0, 0 );
258.17 XWindowAttributesData winAttr;
258.18 private boolean cachedFocusableWindow;
258.19 XWarningWindow warningWindow;
258.20 @@ -133,13 +132,12 @@
258.21 params.put(REPARENTED,
258.22 Boolean.valueOf(isOverrideRedirect() || isSimpleWindow()));
258.23 super.preInit(params);
258.24 - params.putIfNull(BIT_GRAVITY, Integer.valueOf(NorthWestGravity));
258.25 + params.putIfNull(BIT_GRAVITY, Integer.valueOf(XConstants.NorthWestGravity));
258.26
258.27 - savedState = WithdrawnState;
258.28 + savedState = XUtilConstants.WithdrawnState;
258.29 XA_NET_WM_STATE = XAtom.get("_NET_WM_STATE");
258.30
258.31 winAttr = new XWindowAttributesData();
258.32 - insets = new Insets(0,0,0,0);
258.33
258.34 params.put(OVERRIDE_REDIRECT, Boolean.valueOf(isOverrideRedirect()));
258.35
258.36 @@ -239,7 +237,7 @@
258.37
258.38 // Set group leader
258.39 XWMHints hints = getWMHints();
258.40 - hints.set_flags(hints.get_flags() | (int)XlibWrapper.WindowGroupHint);
258.41 + hints.set_flags(hints.get_flags() | (int)XUtilConstants.WindowGroupHint);
258.42 hints.set_window_group(ownerWindow);
258.43 XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
258.44 }
258.45 @@ -260,7 +258,6 @@
258.46
258.47 setSaveUnder(true);
258.48
258.49 - XWM.requestWMExtents(getWindow());
258.50 updateIconImages();
258.51 }
258.52
258.53 @@ -503,7 +500,7 @@
258.54 Rectangle bounds = getBounds();
258.55
258.56 XSizeHints hints = getHints();
258.57 - setSizeHints(hints.get_flags() | XlibWrapper.PPosition | XlibWrapper.PSize,
258.58 + setSizeHints(hints.get_flags() | XUtilConstants.PPosition | XUtilConstants.PSize,
258.59 bounds.x, bounds.y, bounds.width, bounds.height);
258.60 XWM.setMotifDecor(this, false, 0, 0);
258.61
258.62 @@ -531,7 +528,7 @@
258.63 XToolkit.awtLock();
258.64 try {
258.65 XWMHints hints = getWMHints();
258.66 - hints.set_flags(hints.get_flags() | (int)XlibWrapper.InputHint);
258.67 + hints.set_flags(hints.get_flags() | (int)XUtilConstants.InputHint);
258.68 hints.set_input(false/*isNativelyNonFocusableWindow() ? (0):(1)*/);
258.69 XlibWrapper.XSetWMHints(XToolkit.getDisplay(), getWindow(), hints.pData);
258.70 }
258.71 @@ -541,9 +538,7 @@
258.72 }
258.73
258.74 public Insets getInsets() {
258.75 - Insets in = (Insets)(insets.clone());
258.76 - in.top += getWarningWindowHeight();
258.77 - return in;
258.78 + return new Insets(getWarningWindowHeight(), 0, 0, 0);
258.79 }
258.80
258.81 // NOTE: This method may be called by privileged threads.
258.82 @@ -582,7 +577,7 @@
258.83 }
258.84
258.85 /*
258.86 - * Converts native focused X window id into Java peer.
258.87 + * Retrives real native focused window and converts it into Java peer.
258.88 */
258.89 static XWindowPeer getNativeFocusedWindowPeer() {
258.90 XBaseWindow baseWindow = XToolkit.windowToXWindow(xGetInputFocus());
258.91 @@ -591,6 +586,14 @@
258.92 ((XFocusProxyWindow)baseWindow).getOwner() : null;
258.93 }
258.94
258.95 + /*
258.96 + * Retrives real native focused window and converts it into Java window.
258.97 + */
258.98 + static Window getNativeFocusedWindow() {
258.99 + XWindowPeer peer = getNativeFocusedWindowPeer();
258.100 + return peer != null ? (Window)peer.target : null;
258.101 + }
258.102 +
258.103 boolean isFocusableWindow() {
258.104 if (XToolkit.isToolkitThread() || SunToolkit.isAWTLockHeldByCurrentThread())
258.105 {
258.106 @@ -821,12 +824,12 @@
258.107 if (isEventDisabled(xev)) {
258.108 return;
258.109 }
258.110 - if (xev.get_type() == XlibWrapper.FocusIn)
258.111 + if (xev.get_type() == XConstants.FocusIn)
258.112 {
258.113 // If this window is non-focusable don't post any java focus event
258.114 if (focusAllowedFor()) {
258.115 - if (xfe.get_mode() == XlibWrapper.NotifyNormal // Normal notify
258.116 - || xfe.get_mode() == XlibWrapper.NotifyWhileGrabbed) // Alt-Tab notify
258.117 + if (xfe.get_mode() == XConstants.NotifyNormal // Normal notify
258.118 + || xfe.get_mode() == XConstants.NotifyWhileGrabbed) // Alt-Tab notify
258.119 {
258.120 handleWindowFocusIn(xfe.get_serial());
258.121 }
258.122 @@ -834,8 +837,8 @@
258.123 }
258.124 else
258.125 {
258.126 - if (xfe.get_mode() == XlibWrapper.NotifyNormal // Normal notify
258.127 - || xfe.get_mode() == XlibWrapper.NotifyWhileGrabbed) // Alt-Tab notify
258.128 + if (xfe.get_mode() == XConstants.NotifyNormal // Normal notify
258.129 + || xfe.get_mode() == XConstants.NotifyWhileGrabbed) // Alt-Tab notify
258.130 {
258.131 // If this window is non-focusable don't post any java focus event
258.132 if (!isNativelyNonFocusableWindow()) {
258.133 @@ -994,7 +997,8 @@
258.134
258.135 return ret;
258.136 }
258.137 - private boolean isDesktopWindow( long wi ) {
258.138 +
258.139 + private static boolean isDesktopWindow( long wi ) {
258.140 return XWM.getWM().isDesktopWindow( wi );
258.141 }
258.142
258.143 @@ -1022,7 +1026,7 @@
258.144 try {
258.145 Rectangle bounds = getBounds();
258.146 XSizeHints hints = getHints();
258.147 - setSizeHints(hints.get_flags() & ~(USPosition | PPosition),
258.148 + setSizeHints(hints.get_flags() & ~(XUtilConstants.USPosition | XUtilConstants.PPosition),
258.149 bounds.x, bounds.y, bounds.width, bounds.height);
258.150 } finally {
258.151 XToolkit.awtUnlock();
258.152 @@ -1059,10 +1063,10 @@
258.153 XUnmapEvent unmap = new XUnmapEvent();
258.154 unmap.set_window(window);
258.155 unmap.set_event(XToolkit.getDefaultRootWindow());
258.156 - unmap.set_type((int)XlibWrapper.UnmapNotify);
258.157 + unmap.set_type((int)XConstants.UnmapNotify);
258.158 unmap.set_from_configure(false);
258.159 XlibWrapper.XSendEvent(XToolkit.getDisplay(), XToolkit.getDefaultRootWindow(),
258.160 - false, XlibWrapper.SubstructureNotifyMask | XlibWrapper.SubstructureRedirectMask,
258.161 + false, XConstants.SubstructureNotifyMask | XConstants.SubstructureRedirectMask,
258.162 unmap.pData);
258.163 unmap.dispose();
258.164 }
258.165 @@ -1168,10 +1172,6 @@
258.166 // State has changed, invalidate saved value
258.167 stateChanged = true;
258.168 stateChanged(ev.get_time(), savedState, getWMState());
258.169 - } else if (ev.get_atom() == XWM.XA_KDE_NET_WM_FRAME_STRUT.getAtom()
258.170 - || ev.get_atom() == XWM.XA_NET_FRAME_EXTENTS.getAtom())
258.171 - {
258.172 - getWMSetInsets(XAtom.get(ev.get_atom()));
258.173 }
258.174 }
258.175
258.176 @@ -1252,7 +1252,7 @@
258.177 return res;
258.178 }
258.179
258.180 - private boolean isWMStateNetHidden() {
258.181 + protected boolean isWMStateNetHidden() {
258.182 XNETProtocol protocol = XWM.getWM().getNETProtocol();
258.183 return (protocol != null && protocol.isWMStateNetHidden(this));
258.184 }
258.185 @@ -1305,12 +1305,12 @@
258.186 XWM.XA_WM_STATE);
258.187 try {
258.188 int status = getter.execute();
258.189 - if (status != XlibWrapper.Success || getter.getData() == 0) {
258.190 - return savedState = XlibWrapper.WithdrawnState;
258.191 + if (status != XConstants.Success || getter.getData() == 0) {
258.192 + return savedState = XUtilConstants.WithdrawnState;
258.193 }
258.194
258.195 if (getter.getActualType() != XWM.XA_WM_STATE.getAtom() && getter.getActualFormat() != 32) {
258.196 - return savedState = XlibWrapper.WithdrawnState;
258.197 + return savedState = XUtilConstants.WithdrawnState;
258.198 }
258.199 savedState = (int)Native.getCard32(getter.getData());
258.200 } finally {
258.201 @@ -1321,7 +1321,7 @@
258.202 }
258.203
258.204 boolean isWithdrawn() {
258.205 - return getWMState() == XlibWrapper.WithdrawnState;
258.206 + return getWMState() == XUtilConstants.WithdrawnState;
258.207 }
258.208
258.209 boolean hasDecorations(int decor) {
258.210 @@ -1740,6 +1740,11 @@
258.211 return window;
258.212 }
258.213
258.214 + public boolean requestWindowFocus(XWindowPeer actualFocusedWindow) {
258.215 + setActualFocusedWindow(actualFocusedWindow);
258.216 + return requestWindowFocus();
258.217 + }
258.218 +
258.219 public boolean requestWindowFocus() {
258.220 return requestWindowFocus(0, false);
258.221 }
258.222 @@ -1748,25 +1753,25 @@
258.223 focusLog.fine("Request for window focus");
258.224 // If this is Frame or Dialog we can't assure focus request success - but we still can try
258.225 // If this is Window and its owner Frame is active we can be sure request succedded.
258.226 - Window win = (Window) target;
258.227 - Window owner = XWindowPeer.getDecoratedOwner(win);
258.228 + Window ownerWindow = XWindowPeer.getDecoratedOwner((Window)target);
258.229 + Window focusedWindow = XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow();
258.230 + Window activeWindow = XWindowPeer.getDecoratedOwner(focusedWindow);
258.231
258.232 - final Window activeWindow =
258.233 - XWindowPeer.getDecoratedOwner(XKeyboardFocusManagerPeer.getCurrentNativeFocusedWindow());
258.234 - if (activeWindow == owner) {
258.235 + if (isWMStateNetHidden()) {
258.236 + focusLog.fine("The window is unmapped, so rejecting the request");
258.237 + return false;
258.238 + }
258.239 + if (activeWindow == ownerWindow) {
258.240 focusLog.fine("Parent window is active - generating focus for this window");
258.241 handleWindowFocusInSync(-1);
258.242 return true;
258.243 - } else {
258.244 - focusLog.fine("Parent window is not active");
258.245 }
258.246 - ComponentPeer peer = ComponentAccessor.getPeer(owner);
258.247 - if (peer instanceof XDecoratedPeer) {
258.248 - XDecoratedPeer wpeer = (XDecoratedPeer) peer;
258.249 - if (wpeer.requestWindowFocus(this, time, timeProvided)) {
258.250 - focusLog.fine("Parent window accepted focus request - generating focus for this window");
258.251 - return true;
258.252 - }
258.253 + focusLog.fine("Parent window is not active");
258.254 +
258.255 + XDecoratedPeer wpeer = (XDecoratedPeer)ComponentAccessor.getPeer(ownerWindow);
258.256 + if (wpeer != null && wpeer.requestWindowFocus(this, time, timeProvided)) {
258.257 + focusLog.fine("Parent window accepted focus request - generating focus for this window");
258.258 + return true;
258.259 }
258.260 focusLog.fine("Denied - parent window is not active and didn't accept focus request");
258.261 return false;
258.262 @@ -1818,14 +1823,14 @@
258.263 if( rootPropertyEventDispatcher == null ) {
258.264 rootPropertyEventDispatcher = new XEventDispatcher() {
258.265 public void dispatchEvent(XEvent ev) {
258.266 - if( ev.get_type() == PropertyNotify ) {
258.267 + if( ev.get_type() == XConstants.PropertyNotify ) {
258.268 handleRootPropertyNotify( ev );
258.269 }
258.270 }
258.271 };
258.272 XlibWrapper.XSelectInput( XToolkit.getDisplay(),
258.273 XToolkit.getDefaultRootWindow(),
258.274 - XlibWrapper.PropertyChangeMask);
258.275 + XConstants.PropertyChangeMask);
258.276 XToolkit.addEventDispatcher(XToolkit.getDefaultRootWindow(),
258.277 rootPropertyEventDispatcher);
258.278 }
258.279 @@ -1860,7 +1865,7 @@
258.280 public PropMwmHints getMWMHints() {
258.281 if (mwm_hints == null) {
258.282 mwm_hints = new PropMwmHints();
258.283 - if (!XWM.XA_MWM_HINTS.getAtomData(getWindow(), mwm_hints.pData, PROP_MWM_HINTS_ELEMENTS)) {
258.284 + if (!XWM.XA_MWM_HINTS.getAtomData(getWindow(), mwm_hints.pData, MWMConstants.PROP_MWM_HINTS_ELEMENTS)) {
258.285 mwm_hints.zero();
258.286 }
258.287 }
258.288 @@ -1870,41 +1875,10 @@
258.289 public void setMWMHints(PropMwmHints hints) {
258.290 mwm_hints = hints;
258.291 if (hints != null) {
258.292 - XWM.XA_MWM_HINTS.setAtomData(getWindow(), mwm_hints.pData, PROP_MWM_HINTS_ELEMENTS);
258.293 + XWM.XA_MWM_HINTS.setAtomData(getWindow(), mwm_hints.pData, MWMConstants.PROP_MWM_HINTS_ELEMENTS);
258.294 }
258.295 }
258.296
258.297 - private Insets wm_set_insets;
258.298 - public Insets getWMSetInsets(XAtom changedAtom) {
258.299 - if (isEmbedded()) {
258.300 - return null;
258.301 - }
258.302 -
258.303 - if (wm_set_insets != null) {
258.304 - return wm_set_insets;
258.305 - }
258.306 -
258.307 - if (changedAtom == null) {
258.308 - wm_set_insets = XWM.getInsetsFromExtents(getWindow());
258.309 - } else {
258.310 - wm_set_insets = XWM.getInsetsFromProp(getWindow(), changedAtom);
258.311 - }
258.312 -
258.313 - insLog.log(Level.FINER, "FRAME_EXTENTS: {0}", new Object[]{wm_set_insets});
258.314 -
258.315 - if (wm_set_insets != null) {
258.316 - handleWMSetInsets(wm_set_insets);
258.317 - }
258.318 - return wm_set_insets;
258.319 - }
258.320 -
258.321 - protected void handleWMSetInsets(Insets newInsets) {
258.322 - wm_set_insets = (Insets)newInsets.clone();
258.323 - }
258.324 -
258.325 - public void resetWMSetInsets() {
258.326 - wm_set_insets = null;
258.327 - }
258.328 protected synchronized void updateDropTarget() {
258.329 if (dropTargetCount > 0) {
258.330 long window = getWindow();
258.331 @@ -1960,7 +1934,7 @@
258.332 new Object[] {xme, isGrabbed(), containsGlobal(xme.get_x_root(), xme.get_y_root())});
258.333 }
258.334 if (isGrabbed()) {
258.335 - boolean dragging = (xme.get_state() & (Button1Mask | Button2Mask | Button3Mask)) != 0;
258.336 + boolean dragging = (xme.get_state() & (XConstants.Button1Mask | XConstants.Button2Mask | XConstants.Button3Mask)) != 0;
258.337 // When window is grabbed, all events are dispatched to
258.338 // it. Retarget them to the corresponding windows (notice
258.339 // that XBaseWindow.dispatchEvent does the opposite
258.340 @@ -1974,8 +1948,9 @@
258.341 // So, I do not want to implement complicated logic for better retargeting.
258.342 target = pressTarget.isVisible() ? pressTarget : this;
258.343 xme.set_window(target.getWindow());
258.344 - xme.set_x(xme.get_x_root() - target.getX());
258.345 - xme.set_y(xme.get_y_root() - target.getY());
258.346 + Point localCoord = target.toLocal(xme.get_x_root(), xme.get_y_root());
258.347 + xme.set_x(localCoord.x);
258.348 + xme.set_y(localCoord.y);
258.349 }
258.350 grabLog.log(Level.FINER, " - Grab event target {0}", new Object[] {target});
258.351 if (target != null) {
258.352 @@ -2013,12 +1988,12 @@
258.353 try {
258.354 grabLog.log(Level.FINER, " - Grab event target {0} (press target {1})", new Object[] {target, pressTarget});
258.355 if (xbe.get_type() == XConstants.ButtonPress
258.356 - && xbe.get_button() == XlibWrapper.Button1)
258.357 + && xbe.get_button() == XConstants.Button1)
258.358 {
258.359 // need to keep it to retarget mouse release
258.360 pressTarget = target;
258.361 } else if (xbe.get_type() == XConstants.ButtonRelease
258.362 - && xbe.get_button() == XlibWrapper.Button1
258.363 + && xbe.get_button() == XConstants.Button1
258.364 && pressTarget != target)
258.365 {
258.366 // during grab we do receive mouse release on different component (not on the source
258.367 @@ -2026,8 +2001,9 @@
258.368 // see 6390326 for more information.
258.369 target = pressTarget.isVisible() ? pressTarget : this;
258.370 xbe.set_window(target.getWindow());
258.371 - xbe.set_x(xbe.get_x_root() - target.getX());
258.372 - xbe.set_y(xbe.get_y_root() - target.getY());
258.373 + Point localCoord = target.toLocal(xbe.get_x_root(), xbe.get_y_root());
258.374 + xbe.set_x(localCoord.x);
258.375 + xbe.set_y(localCoord.y);
258.376 pressTarget = this;
258.377 }
258.378 if (target != null && target != getContentXWindow() && target != this) {
259.1 --- a/src/solaris/classes/sun/awt/X11/XlibUtil.java Mon May 12 18:06:23 2008 -0700
259.2 +++ b/src/solaris/classes/sun/awt/X11/XlibUtil.java Fri May 16 12:25:57 2008 -0700
259.3 @@ -1,5 +1,5 @@
259.4 /*
259.5 - * Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved.
259.6 + * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
259.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
259.8 *
259.9 * This code is free software; you can redistribute it and/or modify it
259.10 @@ -152,7 +152,7 @@
259.11 int status = xtc.execute(XToolkit.IgnoreBadWindowHandler);
259.12 if ((status != 0) &&
259.13 ((XToolkit.saved_error == null) ||
259.14 - (XToolkit.saved_error.get_error_code() == XlibWrapper.Success)))
259.15 + (XToolkit.saved_error.get_error_code() == XConstants.Success)))
259.16 {
259.17 translated = new Point(xtc.get_dest_x(), xtc.get_dest_y());
259.18 }
259.19 @@ -351,7 +351,7 @@
259.20 XToolkit.RESTORE_XERROR_HANDLER();
259.21 if ((status != 0) &&
259.22 ((XToolkit.saved_error == null) ||
259.23 - (XToolkit.saved_error.get_error_code() == XlibWrapper.Success)))
259.24 + (XToolkit.saved_error.get_error_code() == XConstants.Success)))
259.25 {
259.26 return wattr.get_map_state();
259.27 }
259.28 @@ -362,7 +362,7 @@
259.29 XToolkit.awtUnlock();
259.30 }
259.31
259.32 - return XlibWrapper.IsUnmapped;
259.33 + return XConstants.IsUnmapped;
259.34 }
259.35
259.36 /**
260.1 --- a/src/solaris/classes/sun/awt/X11/XlibWrapper.java Mon May 12 18:06:23 2008 -0700
260.2 +++ b/src/solaris/classes/sun/awt/X11/XlibWrapper.java Fri May 16 12:25:57 2008 -0700
260.3 @@ -1,5 +1,5 @@
260.4 /*
260.5 - * Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved.
260.6 + * Copyright 2002-2008 Sun Microsystems, Inc. All Rights Reserved.
260.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
260.8 *
260.9 * This code is free software; you can redistribute it and/or modify it
260.10 @@ -29,8 +29,7 @@
260.11 import java.security.PrivilegedAction;
260.12 import sun.misc.*;
260.13
260.14 -public class XlibWrapper implements XConstants, XUtilConstants, XProtocolConstants,
260.15 - XCursorFontConstants
260.16 +final public class XlibWrapper
260.17 {
260.18 static Unsafe unsafe = Unsafe.getUnsafe();
260.19 // strange constants
260.20 @@ -321,7 +320,7 @@
260.21 if (XPropertyCache.isCachingSupported() &&
260.22 XToolkit.windowToXWindow(window) != null &&
260.23 WindowPropertyGetter.isCacheableProperty(XAtom.get(atom)) &&
260.24 - mode == PropModeReplace)
260.25 + mode == XConstants.PropModeReplace)
260.26 {
260.27 int length = (format / 8) * nelements;
260.28 XPropertyCache.storeCache(
260.29 @@ -585,25 +584,25 @@
260.30
260.31 static String hintsToString(long flags) {
260.32 StringBuffer buf = new StringBuffer();
260.33 - if ((flags & PMaxSize) != 0) {
260.34 + if ((flags & XUtilConstants.PMaxSize) != 0) {
260.35 buf.append("PMaxSize ");
260.36 }
260.37 - if ((flags & PMinSize) != 0) {
260.38 + if ((flags & XUtilConstants.PMinSize) != 0) {
260.39 buf.append("PMinSize ");
260.40 }
260.41 - if ((flags & USSize) != 0) {
260.42 + if ((flags & XUtilConstants.USSize) != 0) {
260.43 buf.append("USSize ");
260.44 }
260.45 - if ((flags & USPosition) != 0) {
260.46 + if ((flags & XUtilConstants.USPosition) != 0) {
260.47 buf.append("USPosition ");
260.48 }
260.49 - if ((flags & PPosition) != 0) {
260.50 + if ((flags & XUtilConstants.PPosition) != 0) {
260.51 buf.append("PPosition ");
260.52 }
260.53 - if ((flags & PSize) != 0) {
260.54 + if ((flags & XUtilConstants.PSize) != 0) {
260.55 buf.append("PSize ");
260.56 }
260.57 - if ((flags & PWinGravity) != 0) {
260.58 + if ((flags & XUtilConstants.PWinGravity) != 0) {
260.59 buf.append("PWinGravity ");
260.60 }
260.61 return buf.toString();
261.1 --- a/src/solaris/classes/sun/awt/X11/genhash.awk Mon May 12 18:06:23 2008 -0700
261.2 +++ b/src/solaris/classes/sun/awt/X11/genhash.awk Fri May 16 12:25:57 2008 -0700
261.3 @@ -1,4 +1,4 @@
261.4 -# Copyright 2005 Sun Microsystems, Inc. All Rights Reserved.
261.5 +# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
261.6 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
261.7 #
261.8 # This code is free software; you can redistribute it and/or modify it
261.9 @@ -38,8 +38,8 @@
261.10 if( $1 != "0x0000" ) {
261.11 ndx = toupper($1);
261.12 sub(/0X/, "", ndx);
261.13 - printf(" keysym2UCSHash.put( (long)%s, (char)%s); // %s --> %s \n",
261.14 - $4, $1, $3, unic[ndx]);
261.15 + printf(" keysym2UCSHash.put( (long)%s, (char)%s); // %s -->%s\n",
261.16 + $4, $1, $3, (unic[ndx]=="" ? "" : " " unic[ndx]));
261.17 }
261.18 }
261.19 /tojava/ { sub(/tojava /, ""); sub(/tojava$/, ""); print}
262.1 --- a/src/solaris/classes/sun/awt/X11/keysym2ucs.h Mon May 12 18:06:23 2008 -0700
262.2 +++ b/src/solaris/classes/sun/awt/X11/keysym2ucs.h Fri May 16 12:25:57 2008 -0700
262.3 @@ -1,5 +1,5 @@
262.4 /*
262.5 - * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
262.6 + * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
262.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
262.8 *
262.9 * This code is free software; you can redistribute it and/or modify it
262.10 @@ -39,7 +39,7 @@
262.11 */
262.12
262.13 tojava /*
262.14 -tojava * Copyright 2005-2007 Sun Microsystems, Inc. All Rights Reserved.
262.15 +tojava * Copyright 2005-2008 Sun Microsystems, Inc. All Rights Reserved.
262.16 tojava * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
262.17 tojava *
262.18 tojava * This code is free software; you can redistribute it and/or modify it
262.19 @@ -2546,6 +2546,7 @@
262.20 tojava
262.21 tojava keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Multi_key), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_COMPOSE, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
262.22 tojava keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Mode_switch), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
262.23 +tojava keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_ISO_Level3_Shift), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_ALT_GRAPH, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
262.24 tojava
262.25 tojava /* Editing block */
262.26 tojava keysym2JavaKeycodeHash.put( Long.valueOf(XKeySymConstants.XK_Redo), new Keysym2JavaKeycode(java.awt.event.KeyEvent.VK_AGAIN, java.awt.event.KeyEvent.KEY_LOCATION_STANDARD));
263.1 --- a/src/solaris/classes/sun/awt/X11GraphicsConfig.java Mon May 12 18:06:23 2008 -0700
263.2 +++ b/src/solaris/classes/sun/awt/X11GraphicsConfig.java Fri May 16 12:25:57 2008 -0700
263.3 @@ -421,7 +421,7 @@
263.4 {
263.5 return new SunVolatileImage(target,
263.6 target.getWidth(), target.getHeight(),
263.7 - new Long(backBuffer));
263.8 + Long.valueOf(backBuffer));
263.9 }
263.10
263.11 /**
264.1 --- a/src/solaris/classes/sun/awt/X11GraphicsDevice.java Mon May 12 18:06:23 2008 -0700
264.2 +++ b/src/solaris/classes/sun/awt/X11GraphicsDevice.java Fri May 16 12:25:57 2008 -0700
264.3 @@ -164,7 +164,7 @@
264.4 if (ret[i] == null) {
264.5 boolean doubleBuffer =
264.6 (dbeSupported &&
264.7 - doubleBufferVisuals.contains(new Integer(visNum)));
264.8 + doubleBufferVisuals.contains(Integer.valueOf(visNum)));
264.9 ret[i] = X11GraphicsConfig.getConfig(this, visNum, depth,
264.10 getConfigColormap(i, screen),
264.11 doubleBuffer);
264.12 @@ -199,7 +199,7 @@
264.13 public static native boolean isDBESupported();
264.14 // Callback for adding a new double buffer visual into our set
264.15 private void addDoubleBufferVisual(int visNum) {
264.16 - doubleBufferVisuals.add(new Integer(visNum));
264.17 + doubleBufferVisuals.add(Integer.valueOf(visNum));
264.18 }
264.19 // Enumerates all visuals that support double buffering
264.20 private native void getDoubleBufferVisuals(int screen);
264.21 @@ -239,7 +239,7 @@
264.22 doubleBufferVisuals = new HashSet();
264.23 getDoubleBufferVisuals(screen);
264.24 doubleBuffer =
264.25 - doubleBufferVisuals.contains(new Integer(visNum));
264.26 + doubleBufferVisuals.contains(Integer.valueOf(visNum));
264.27 }
264.28 defaultConfig = X11GraphicsConfig.getConfig(this, visNum,
264.29 depth, getConfigColormap(0, screen),
265.1 --- a/src/solaris/classes/sun/print/UnixPrintJob.java Mon May 12 18:06:23 2008 -0700
265.2 +++ b/src/solaris/classes/sun/print/UnixPrintJob.java Fri May 16 12:25:57 2008 -0700
265.3 @@ -867,39 +867,38 @@
265.4 execCmd[n++] = "/usr/bin/lp";
265.5 execCmd[n++] = "-c"; // make a copy of the spool file
265.6 if ((pFlags & PRINTER) != 0) {
265.7 - execCmd[n++] = new String("-d" + printer);
265.8 + execCmd[n++] = "-d" + printer;
265.9 }
265.10 if ((pFlags & BANNER) != 0) {
265.11 String quoteChar = "\"";
265.12 - execCmd[n++] = new String("-t " + quoteChar+banner+quoteChar);
265.13 + execCmd[n++] = "-t " + quoteChar+banner+quoteChar;
265.14 }
265.15 if ((pFlags & COPIES) != 0) {
265.16 - execCmd[n++] = new String("-n " +
265.17 - new Integer(copies).toString());
265.18 + execCmd[n++] = "-n " + copies;
265.19 }
265.20 if ((pFlags & NOSHEET) != 0) {
265.21 - execCmd[n++] = new String("-o nobanner");
265.22 + execCmd[n++] = "-o nobanner";
265.23 }
265.24 if ((pFlags & OPTIONS) != 0) {
265.25 - execCmd[n++] = new String("-o " + options);
265.26 + execCmd[n++] = "-o " + options;
265.27 }
265.28 } else {
265.29 execCmd = new String[ncomps];
265.30 execCmd[n++] = "/usr/bin/lpr";
265.31 if ((pFlags & PRINTER) != 0) {
265.32 - execCmd[n++] = new String("-P" + printer);
265.33 + execCmd[n++] = "-P" + printer;
265.34 }
265.35 if ((pFlags & BANNER) != 0) {
265.36 - execCmd[n++] = new String("-J " + banner);
265.37 + execCmd[n++] = "-J " + banner;
265.38 }
265.39 if ((pFlags & COPIES) != 0) {
265.40 - execCmd[n++] = new String("-#" + new Integer(copies).toString());
265.41 + execCmd[n++] = "-#" + copies;
265.42 }
265.43 if ((pFlags & NOSHEET) != 0) {
265.44 - execCmd[n++] = new String("-h");
265.45 + execCmd[n++] = "-h";
265.46 }
265.47 if ((pFlags & OPTIONS) != 0) {
265.48 - execCmd[n++] = new String("-o" + options);
265.49 + execCmd[n++] = "-o" + options;
265.50 }
265.51 }
265.52 execCmd[n++] = spoolFile;
266.1 --- a/src/solaris/native/sun/awt/MouseInfo.c Mon May 12 18:06:23 2008 -0700
266.2 +++ b/src/solaris/native/sun/awt/MouseInfo.c Fri May 16 12:25:57 2008 -0700
266.3 @@ -54,7 +54,7 @@
266.4 int i;
266.5 int32_t xr, yr, xw, yw;
266.6 uint32_t keys;
266.7 - BOOL pointerFound;
266.8 + Bool pointerFound;
266.9
266.10 AWT_LOCK();
266.11 if (pointClass == NULL) {
266.12 @@ -102,7 +102,7 @@
266.13 int32_t xr = 0, yr = 0, xw = 0, yw = 0;
266.14 uint32_t keys = 0;
266.15 uint32_t nchildren = 0;
266.16 - BOOL pointerFound = 0;
266.17 + Bool pointerFound = 0;
266.18 struct FrameData *wdata = NULL;
266.19 jobject winPeer = NULL;
266.20
267.1 --- a/src/solaris/native/sun/awt/gtk2_interface.c Mon May 12 18:06:23 2008 -0700
267.2 +++ b/src/solaris/native/sun/awt/gtk2_interface.c Fri May 16 12:25:57 2008 -0700
267.3 @@ -333,6 +333,7 @@
267.4 static GdkPixbuf* (*fp_gtk_widget_render_icon)(GtkWidget *widget,
267.5 const gchar *stock_id, GtkIconSize size, const gchar *detail);
267.6 static void (*fp_gtk_widget_set_name)(GtkWidget *widget, const gchar *name);
267.7 +static void (*fp_gtk_widget_set_parent)(GtkWidget *widget, GtkWidget *parent);
267.8 static void (*fp_gtk_widget_set_direction)(GtkWidget *widget,
267.9 GtkTextDirection direction);
267.10 static void (*fp_gtk_widget_style_get)(GtkWidget *widget,
267.11 @@ -570,6 +571,8 @@
267.12 dl_symbol("gtk_widget_render_icon");
267.13 fp_gtk_widget_set_name =
267.14 dl_symbol("gtk_widget_set_name");
267.15 + fp_gtk_widget_set_parent =
267.16 + dl_symbol("gtk_widget_set_parent");
267.17 fp_gtk_widget_set_direction =
267.18 dl_symbol("gtk_widget_set_direction");
267.19 fp_gtk_widget_style_get =
267.20 @@ -1040,7 +1043,7 @@
267.21 (NULL == gtk2_widgets[_GTK_COMBO_BOX_ARROW_BUTTON_TYPE]))
267.22 {
267.23 gtk2_widgets[_GTK_COMBO_BOX_ARROW_BUTTON_TYPE] =
267.24 - (*fp_gtk_button_new)();
267.25 + (*fp_gtk_toggle_button_new)();
267.26 }
267.27 result = gtk2_widgets[_GTK_COMBO_BOX_ARROW_BUTTON_TYPE];
267.28 break;
267.29 @@ -1414,12 +1417,20 @@
267.30 widget_type == COMBO_BOX_TEXT_FIELD)
267.31 {
267.32 /*
267.33 - * We add a regular GtkButton/GtkEntry to a GtkComboBoxEntry
267.34 - * in order to trick engines into thinking it's a real combobox
267.35 - * arrow button/text field.
267.36 - */
267.37 + * We add a regular GtkButton/GtkEntry to a GtkComboBoxEntry
267.38 + * in order to trick engines into thinking it's a real combobox
267.39 + * arrow button/text field.
267.40 + */
267.41 GtkWidget *combo = (*fp_gtk_combo_box_entry_new)();
267.42 - (*fp_gtk_container_add)((GtkContainer *)combo, result);
267.43 +
267.44 + if (widget_type == COMBO_BOX_TEXT_FIELD)
267.45 + (*fp_gtk_container_add)((GtkContainer *)combo, result);
267.46 + else
267.47 + {
267.48 + (*fp_gtk_widget_set_parent)(result, combo);
267.49 + ((GtkBin*)combo)->child = result;
267.50 + }
267.51 +
267.52 (*fp_gtk_container_add)((GtkContainer *)gtk2_fixed, combo);
267.53 (*fp_gtk_widget_realize)(result);
267.54 return result;
268.1 --- a/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c Mon May 12 18:06:23 2008 -0700
268.2 +++ b/src/solaris/native/sun/awt/splashscreen/splashscreen_sys.c Fri May 16 12:25:57 2008 -0700
268.3 @@ -436,6 +436,7 @@
268.4 break;
268.5 }
268.6 case PseudoColor: {
268.7 + int availableColors;
268.8 int numColors;
268.9 int numComponents[3];
268.10 unsigned long colorIndex[SPLASH_COLOR_MAP_SIZE];
268.11 @@ -444,9 +445,20 @@
268.12 int depth = XDefaultDepthOfScreen(splash->screen);
268.13 int scale = 65535 / MAX_COLOR_VALUE;
268.14
268.15 - numColors = GetNumAvailableColors(splash->display, splash->screen,
268.16 + availableColors = GetNumAvailableColors(splash->display, splash->screen,
268.17 splash->visual->map_entries);
268.18 - numColors = quantizeColors(numColors, numComponents);
268.19 + numColors = quantizeColors(availableColors, numComponents);
268.20 + if (numColors > availableColors) {
268.21 + // Could not allocate the color cells. Most probably
268.22 + // the pool got exhausted. Disable the splash screen.
268.23 + XCloseDisplay(splash->display);
268.24 + splash->isVisible = -1;
268.25 + splash->display = NULL;
268.26 + splash->screen = NULL;
268.27 + splash->visual = NULL;
268.28 + fprintf(stderr, "Warning: unable to initialize the splashscreen. Not enough available color cells.\n");
268.29 + return;
268.30 + }
268.31 splash->cmap = AllocColors(splash->display, splash->screen,
268.32 numColors, colorIndex);
268.33 for (i = 0; i < numColors; i++) {
269.1 --- a/src/solaris/native/sun/xawt/XWindow.c Mon May 12 18:06:23 2008 -0700
269.2 +++ b/src/solaris/native/sun/xawt/XWindow.c Fri May 16 12:25:57 2008 -0700
269.3 @@ -1234,7 +1234,7 @@
269.4 }
269.5 }
269.6
269.7 -JNIEXPORT int JNICALL
269.8 +JNIEXPORT jint JNICALL
269.9 Java_sun_awt_X11_XWindow_getKeySymForAWTKeyCode(JNIEnv* env, jclass clazz, jint keycode) {
269.10 return awt_getX11KeySym(keycode);
269.11 }
270.1 --- a/src/solaris/native/sun/xawt/XlibWrapper.c Mon May 12 18:06:23 2008 -0700
270.2 +++ b/src/solaris/native/sun/xawt/XlibWrapper.c Fri May 16 12:25:57 2008 -0700
270.3 @@ -359,7 +359,7 @@
270.4 XDestroyWindow( (Display *)jlong_to_ptr(display),(Window) window);
270.5 }
270.6
270.7 -JNIEXPORT int JNICALL Java_sun_awt_X11_XlibWrapper_XGrabPointer
270.8 +JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XGrabPointer
270.9 (JNIEnv *env, jclass clazz, jlong display, jlong window,
270.10 jint owner_events, jint event_mask, jint pointer_mode,
270.11 jint keyboard_mode, jlong confine_to, jlong cursor, jlong time)
270.12 @@ -377,7 +377,7 @@
270.13 XUngrabPointer( (Display *)jlong_to_ptr(display), (Time) time);
270.14 }
270.15
270.16 -JNIEXPORT int JNICALL Java_sun_awt_X11_XlibWrapper_XGrabKeyboard
270.17 +JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XGrabKeyboard
270.18 (JNIEnv *env, jclass clazz, jlong display, jlong window,
270.19 jint owner_events, jint pointer_mode,
270.20 jint keyboard_mode, jlong time)
270.21 @@ -621,7 +621,7 @@
270.22
270.23 }
270.24
270.25 -JNIEXPORT int JNICALL Java_sun_awt_X11_XlibWrapper_XTranslateCoordinates
270.26 +JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XTranslateCoordinates
270.27 (JNIEnv *env, jclass clazz, jlong display, jlong src_w, jlong dest_w,
270.28 jlong src_x, jlong src_y, jlong dest_x_return, jlong dest_y_return,
270.29 jlong child_return)
270.30 @@ -634,7 +634,7 @@
270.31 (Window *) jlong_to_ptr(child_return));
270.32 }
270.33
270.34 -JNIEXPORT int JNICALL Java_sun_awt_X11_XlibWrapper_XEventsQueued
270.35 +JNIEXPORT jint JNICALL Java_sun_awt_X11_XlibWrapper_XEventsQueued
270.36 (JNIEnv *env, jclass clazz, jlong display, jint mode) {
270.37
270.38 AWT_CHECK_HAVE_LOCK();
271.1 --- a/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java Mon May 12 18:06:23 2008 -0700
271.2 +++ b/src/windows/classes/sun/awt/shell/Win32ShellFolder2.java Fri May 16 12:25:57 2008 -0700
271.3 @@ -910,18 +910,20 @@
271.4 /**
271.5 * Gets an icon from the Windows system icon list as an <code>Image</code>
271.6 */
271.7 - static Image getShell32Icon(int iconID) {
271.8 + static Image getShell32Icon(int iconID, boolean getLargeIcon) {
271.9 boolean useVGAColors = true; // Will be ignored on XP and later
271.10
271.11 + int size = getLargeIcon ? 32 : 16;
271.12 +
271.13 Toolkit toolkit = Toolkit.getDefaultToolkit();
271.14 String shellIconBPP = (String)toolkit.getDesktopProperty("win.icon.shellIconBPP");
271.15 if (shellIconBPP != null) {
271.16 useVGAColors = shellIconBPP.equals("4");
271.17 }
271.18
271.19 - long hIcon = getIconResource("shell32.dll", iconID, 16, 16, useVGAColors);
271.20 + long hIcon = getIconResource("shell32.dll", iconID, size, size, useVGAColors);
271.21 if (hIcon != 0) {
271.22 - Image icon = makeIcon(hIcon, false);
271.23 + Image icon = makeIcon(hIcon, getLargeIcon);
271.24 disposeIcon(hIcon);
271.25 return icon;
271.26 }
272.1 --- a/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java Mon May 12 18:06:23 2008 -0700
272.2 +++ b/src/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java Fri May 16 12:25:57 2008 -0700
272.3 @@ -313,13 +313,12 @@
272.4 return null;
272.5 }
272.6 return Win32ShellFolder2.getSystemIcon(iconType);
272.7 - } else if (key.startsWith("shell32Icon ")) {
272.8 - int i;
272.9 - String name = key.substring(key.indexOf(" ")+1);
272.10 + } else if (key.startsWith("shell32Icon ") || key.startsWith("shell32LargeIcon ")) {
272.11 + String name = key.substring(key.indexOf(" ") + 1);
272.12 try {
272.13 - i = Integer.parseInt(name);
272.14 + int i = Integer.parseInt(name);
272.15 if (i >= 0) {
272.16 - return Win32ShellFolder2.getShell32Icon(i);
272.17 + return Win32ShellFolder2.getShell32Icon(i, key.startsWith("shell32LargeIcon "));
272.18 }
272.19 } catch (NumberFormatException ex) {
272.20 }
273.1 --- a/src/windows/classes/sun/awt/windows/WDataTransferer.java Mon May 12 18:06:23 2008 -0700
273.2 +++ b/src/windows/classes/sun/awt/windows/WDataTransferer.java Fri May 16 12:25:57 2008 -0700
273.3 @@ -568,7 +568,7 @@
273.4 byte[] headerBytes = null, trailerBytes = null;
273.5
273.6 try {
273.7 - headerBytes = new String(header).getBytes(ENCODING);
273.8 + headerBytes = header.toString().getBytes(ENCODING);
273.9 trailerBytes = htmlSuffix.getBytes(ENCODING);
273.10 } catch (UnsupportedEncodingException cannotHappen) {
273.11 }
274.1 --- a/src/windows/classes/sun/awt/windows/WInputMethod.java Mon May 12 18:06:23 2008 -0700
274.2 +++ b/src/windows/classes/sun/awt/windows/WInputMethod.java Fri May 16 12:25:57 2008 -0700
274.3 @@ -488,7 +488,7 @@
274.4 attrStr.addAttribute(Attribute.INPUT_METHOD_SEGMENT,
274.5 new Annotation(null), 0, text.length());
274.6 attrStr.addAttribute(Attribute.READING,
274.7 - new Annotation(new String("")), 0, text.length());
274.8 + new Annotation(""), 0, text.length());
274.9 }
274.10
274.11 // set Hilight Information
275.1 --- a/src/windows/classes/sun/awt/windows/WPanelPeer.java Mon May 12 18:06:23 2008 -0700
275.2 +++ b/src/windows/classes/sun/awt/windows/WPanelPeer.java Fri May 16 12:25:57 2008 -0700
275.3 @@ -30,9 +30,11 @@
275.4 import java.util.Vector;
275.5
275.6 import sun.awt.SunGraphicsCallback;
275.7 +import java.util.logging.*;
275.8
275.9 class WPanelPeer extends WCanvasPeer implements PanelPeer {
275.10
275.11 + private static final Logger log = Logger.getLogger("sun.awt.windows.WPanelPeer");
275.12 // ComponentPeer overrides
275.13
275.14 public void paint(Graphics g) {
275.15 @@ -131,8 +133,16 @@
275.16 for (int i = 0; i < cont.getComponentCount(); i++) {
275.17 Component comp = cont.getComponent(i);
275.18 if (!comp.isLightweight()) {
275.19 - if (comp.getPeer() != null) {
275.20 - peers.add(comp.getPeer());
275.21 + ComponentPeer peer = comp.getPeer();
275.22 + if (peer != null && (peer instanceof WComponentPeer))
275.23 + {
275.24 + peers.add(peer);
275.25 + } else {
275.26 + if (log.isLoggable(Level.FINE)) {
275.27 + log.log(Level.FINE,
275.28 + "peer of a {0} is null or not a WComponentPeer: {1}.",
275.29 + new Object[]{comp, peer});
275.30 + }
275.31 }
275.32 }
275.33 if (comp.isLightweight() && comp instanceof Container) {
276.1 --- a/src/windows/classes/sun/awt/windows/WWindowPeer.java Mon May 12 18:06:23 2008 -0700
276.2 +++ b/src/windows/classes/sun/awt/windows/WWindowPeer.java Fri May 16 12:25:57 2008 -0700
276.3 @@ -123,7 +123,7 @@
276.4 public void setTitle(String title) {
276.5 // allow a null title to pass as an empty string.
276.6 if (title == null) {
276.7 - title = new String("");
276.8 + title = "";
276.9 }
276.10 _setTitle(title);
276.11 }
277.1 --- a/src/windows/classes/sun/print/Win32PrintService.java Mon May 12 18:06:23 2008 -0700
277.2 +++ b/src/windows/classes/sun/print/Win32PrintService.java Fri May 16 12:25:57 2008 -0700
277.3 @@ -348,7 +348,7 @@
277.4
277.5 idList = new ArrayList();
277.6 for (int i=0; i < media.length; i++) {
277.7 - idList.add(new Integer(media[i]));
277.8 + idList.add(Integer.valueOf(media[i]));
277.9 }
277.10
277.11 mediaSizes = getMediaSizes(idList, media);
277.12 @@ -517,7 +517,7 @@
277.13 if ((wid <= 0) || (ht <= 0)) {
277.14 //Remove corresponding ID from list
277.15 if (nMedia == media.length) {
277.16 - Integer remObj = new Integer(media[i]);
277.17 + Integer remObj = Integer.valueOf(media[i]);
277.18 idList.remove(idList.indexOf(remObj));
277.19 }
277.20 continue;
277.21 @@ -539,7 +539,7 @@
277.22 msList.add(ms);
277.23 } catch(IllegalArgumentException e) {
277.24 if (nMedia == media.length) {
277.25 - Integer remObj = new Integer(media[i]);
277.26 + Integer remObj = Integer.valueOf(media[i]);
277.27 idList.remove(idList.indexOf(remObj));
277.28 }
277.29 }
277.30 @@ -984,7 +984,7 @@
277.31 // cannot be null but to be safe, add a check
277.32 if ((idList != null) && (mediaSizes != null) &&
277.33 (idList.size() == mediaSizes.length)) {
277.34 - Integer defIdObj = new Integer(defPaper);
277.35 + Integer defIdObj = Integer.valueOf(defPaper);
277.36 int index = idList.indexOf(defIdObj);
277.37 if (index>=0 && index<mediaSizes.length) {
277.38 return mediaSizes[index].getMediaSizeName();
278.1 --- a/src/windows/native/sun/windows/awt_Component.cpp Mon May 12 18:06:23 2008 -0700
278.2 +++ b/src/windows/native/sun/windows/awt_Component.cpp Fri May 16 12:25:57 2008 -0700
278.3 @@ -234,6 +234,7 @@
278.4
278.5 AwtComponent::AwtComponent()
278.6 {
278.7 + m_mouseButtonClickAllowed = 0;
278.8 m_callbacksEnabled = FALSE;
278.9 m_hwnd = NULL;
278.10
278.11 @@ -246,7 +247,6 @@
278.12 m_nextControlID = 1;
278.13 m_childList = NULL;
278.14 m_myControlID = 0;
278.15 - m_mouseDragState = 0;
278.16 m_hdwp = NULL;
278.17 m_validationNestCount = 0;
278.18
278.19 @@ -903,8 +903,27 @@
278.20
278.21 void AwtComponent::Hide()
278.22 {
278.23 + JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
278.24 + jobject peer = GetPeer(env);
278.25 + BOOL oldValue = sm_suppressFocusAndActivation;
278.26 m_visible = false;
278.27 +
278.28 + // On disposal the focus owner actually loses focus at the moment of hiding.
278.29 + // So, focus change suppression (if requested) should be made here.
278.30 + if (GetHWnd() == sm_focusOwner &&
278.31 + !JNU_CallMethodByName(env, NULL, peer, "isAutoFocusTransferOnDisposal", "()Z").z)
278.32 + {
278.33 + sm_suppressFocusAndActivation = TRUE;
278.34 + // The native system may autotransfer focus on hiding to the parent
278.35 + // of the component. Nevertheless this focus change won't be posted
278.36 + // to the Java level, we're better to avoid this. Anyway, after
278.37 + // the disposal focus should be requested to the right component.
278.38 + ::SetFocus(NULL);
278.39 + sm_focusOwner = NULL;
278.40 + }
278.41 ::ShowWindow(GetHWnd(), SW_HIDE);
278.42 +
278.43 + sm_suppressFocusAndActivation = oldValue;
278.44 }
278.45
278.46 BOOL
278.47 @@ -2495,9 +2514,11 @@
278.48 lastClickX = x;
278.49 lastClickY = y;
278.50 }
278.51 + /*
278.52 + *Set appropriate bit of the mask on WM_MOUSE_DOWN message.
278.53 + */
278.54 + m_mouseButtonClickAllowed |= GetButtonMK(button);
278.55 lastTime = now;
278.56 - // it's needed only if WM_LBUTTONUP doesn't come for some reason
278.57 - m_mouseDragState &= ~GetButtonMK(button);
278.58
278.59 MSG msg;
278.60 InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
278.61 @@ -2535,14 +2556,17 @@
278.62 (GetButton(button) == java_awt_event_MouseEvent_BUTTON3 ?
278.63 TRUE : FALSE), GetButton(button), &msg);
278.64 /*
278.65 - * If no movement, then report a click following the button release
278.66 + * If no movement, then report a click following the button release.
278.67 + * When WM_MOUSEUP comes to a window without previous WM_MOUSEDOWN,
278.68 + * spurous MOUSE_CLICK is about to happen. See 6430553.
278.69 */
278.70 - if (!(m_mouseDragState & GetButtonMK(button))) { // No up-button in the drag-state
278.71 + if ((m_mouseButtonClickAllowed & GetButtonMK(button)) != 0) { //CLICK allowed
278.72 SendMouseEvent(java_awt_event_MouseEvent_MOUSE_CLICKED,
278.73 TimeHelper::getMessageTimeUTC(), x, y, GetJavaModifiers(),
278.74 clickCount, JNI_FALSE, GetButton(button));
278.75 }
278.76 - m_mouseDragState &= ~GetButtonMK(button); // Exclude the up-button from the drag-state
278.77 + // Exclude button from allowed to generate CLICK messages
278.78 + m_mouseButtonClickAllowed &= ~GetButtonMK(button);
278.79
278.80 if ((flags & ALL_MK_BUTTONS) == 0) {
278.81 // only update if all buttons have been released
278.82 @@ -2586,7 +2610,8 @@
278.83 SendMouseEvent(java_awt_event_MouseEvent_MOUSE_DRAGGED, TimeHelper::getMessageTimeUTC(), x, y,
278.84 GetJavaModifiers(), 0, JNI_FALSE,
278.85 java_awt_event_MouseEvent_NOBUTTON, &msg);
278.86 - m_mouseDragState = flags;
278.87 + //dragging means no more CLICKs until next WM_MOUSE_DOWN/WM_MOUSE_UP message sequence
278.88 + m_mouseButtonClickAllowed = 0;
278.89 } else {
278.90 MSG msg;
278.91 InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
278.92 @@ -5740,6 +5765,10 @@
278.93 env->DeleteGlobalRef(event);
278.94 delete nhes;
278.95 return;
278.96 +
278.97 + } else if (id == java_awt_event_KeyEvent_KEY_PRESSED) {
278.98 + // Fix for 6637607: reset consuming
278.99 + keyDownConsumed = FALSE;
278.100 }
278.101
278.102 /* Consume a KEY_TYPED event if a KEY_PRESSED had been, to support
279.1 --- a/src/windows/native/sun/windows/awt_Component.h Mon May 12 18:06:23 2008 -0700
279.2 +++ b/src/windows/native/sun/windows/awt_Component.h Fri May 16 12:25:57 2008 -0700
279.3 @@ -707,13 +707,6 @@
279.4 BOOL m_backgroundColorSet;
279.5 BOOL m_visible; /* copy of Component.visible */
279.6
279.7 - /*
279.8 - * Keeps all buttons which were pressed at the time of the last mouse
279.9 - * drag until all buttons will be released, contains state as bit masks
279.10 - * MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
279.11 - */
279.12 - UINT m_mouseDragState;
279.13 -
279.14 static BOOL sm_suppressFocusAndActivation;
279.15 static HWND sm_realFocusOpposite;
279.16
279.17 @@ -725,6 +718,15 @@
279.18 static UINT sm_95WheelSupport;
279.19
279.20 private:
279.21 + /* A bitmask keeps the button's numbers as MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
279.22 + * which are allowed to
279.23 + * generate the CLICK event after the RELEASE has happened.
279.24 + * There are conditions that must be true for that sending CLICK event:
279.25 + * 1) button was initially PRESSED
279.26 + * 2) no movement or drag has happened until RELEASE
279.27 + */
279.28 + UINT m_mouseButtonClickAllowed;
279.29 +
279.30 BOOL m_bSubclassed;
279.31
279.32 COLORREF m_colorForeground;
280.1 --- a/src/windows/native/sun/windows/awt_Dialog.cpp Mon May 12 18:06:23 2008 -0700
280.2 +++ b/src/windows/native/sun/windows/awt_Dialog.cpp Fri May 16 12:25:57 2008 -0700
280.3 @@ -1,5 +1,5 @@
280.4 /*
280.5 - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved.
280.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
280.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
280.8 *
280.9 * This code is free software; you can redistribute it and/or modify it
280.10 @@ -428,8 +428,12 @@
280.11 {
280.12 JNIEnv *env = (JNIEnv *)JNU_GetEnv(jvm, JNI_VERSION_1_2);
280.13
280.14 - jlongArray windows = (jlongArray)(env->CallStaticObjectMethod(AwtWindow::wwindowPeerCls,
280.15 - AwtWindow::getActiveWindowsMID));
280.16 + jclass wwindowPeerCls = env->FindClass("sun/awt/windows/WWindowPeer");
280.17 + jmethodID getActiveWindowsMID = env->GetStaticMethodID(wwindowPeerCls,
280.18 + "getActiveWindowHandles", "()[J");
280.19 + DASSERT(getActiveWindowsMID != NULL);
280.20 + jlongArray windows = (jlongArray)(env->CallStaticObjectMethod(wwindowPeerCls,
280.21 + getActiveWindowsMID));
280.22 if (windows == NULL) {
280.23 return;
280.24 }
281.1 --- a/src/windows/native/sun/windows/awt_TrayIcon.cpp Mon May 12 18:06:23 2008 -0700
281.2 +++ b/src/windows/native/sun/windows/awt_TrayIcon.cpp Fri May 16 12:25:57 2008 -0700
281.3 @@ -84,7 +84,7 @@
281.4 if (sm_instCount++ == 0 && AwtTrayIcon::sm_msgWindow == NULL) {
281.5 sm_msgWindow = AwtTrayIcon::CreateMessageWindow();
281.6 }
281.7 - m_mouseDragState = 0;
281.8 + m_mouseButtonClickAllowed = 0;
281.9 }
281.10
281.11 AwtTrayIcon::~AwtTrayIcon() {
281.12 @@ -349,7 +349,7 @@
281.13 }
281.14 lastTime = now;
281.15 // it's needed only if WM_LBUTTONUP doesn't come for some reason
281.16 - m_mouseDragState &= ~AwtComponent::GetButtonMK(button);
281.17 + m_mouseButtonClickAllowed |= AwtComponent::GetButtonMK(button);
281.18
281.19 MSG msg;
281.20 AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
281.21 @@ -371,12 +371,12 @@
281.22 (AwtComponent::GetButton(button) == java_awt_event_MouseEvent_BUTTON3 ?
281.23 TRUE : FALSE), AwtComponent::GetButton(button), &msg);
281.24
281.25 - if (!(m_mouseDragState & AwtComponent::GetButtonMK(button))) { // No up-button in the drag-state
281.26 + if ((m_mouseButtonClickAllowed & AwtComponent::GetButtonMK(button)) != 1) { // No up-button in the drag-state
281.27 SendMouseEvent(java_awt_event_MouseEvent_MOUSE_CLICKED,
281.28 TimeHelper::windowsToUTC(::GetTickCount()), x, y, AwtComponent::GetJavaModifiers(),
281.29 clickCount, JNI_FALSE, AwtComponent::GetButton(button));
281.30 }
281.31 - m_mouseDragState &= ~AwtComponent::GetButtonMK(button); // Exclude the up-button from the drag-state
281.32 + m_mouseButtonClickAllowed &= ~AwtComponent::GetButtonMK(button); // Exclude the up-button from the drag-state
281.33
281.34 return mrConsume;
281.35 }
281.36 @@ -398,7 +398,7 @@
281.37 lastY = y;
281.38 AwtComponent::InitMessage(&msg, lastMessage, flags, MAKELPARAM(x, y), x, y);
281.39 if ((flags & AwtComponent::ALL_MK_BUTTONS) != 0) {
281.40 - m_mouseDragState = flags;
281.41 + m_mouseButtonClickAllowed = 0;
281.42 } else {
281.43 SendMouseEvent(java_awt_event_MouseEvent_MOUSE_MOVED, TimeHelper::windowsToUTC(::GetTickCount()), x, y,
281.44 AwtComponent::GetJavaModifiers(), 0, JNI_FALSE,
282.1 --- a/src/windows/native/sun/windows/awt_TrayIcon.h Mon May 12 18:06:23 2008 -0700
282.2 +++ b/src/windows/native/sun/windows/awt_TrayIcon.h Fri May 16 12:25:57 2008 -0700
282.3 @@ -176,12 +176,14 @@
282.4 private:
282.5 AWT_NOTIFYICONDATA m_nid;
282.6
282.7 - /*
282.8 - * Keeps all buttons which were pressed at the time of the last mouse
282.9 - * drag until all buttons will be released, contains state as bit masks
282.10 - * MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
282.11 - */
282.12 - UINT m_mouseDragState;
282.13 + /* A bitmask keeps the button's numbers as MK_LBUTTON, MK_MBUTTON, MK_RBUTTON
282.14 + * which are allowed to
282.15 + * generate the CLICK event after the RELEASE has happened.
282.16 + * There are conditions that must be true for that sending CLICK event:
282.17 + * 1) button was initially PRESSED
282.18 + * 2) no movement or drag has happened until RELEASE
282.19 + */
282.20 + UINT m_mouseButtonClickAllowed;
282.21
282.22 class TrayIconListItem {
282.23 public:
283.1 --- a/src/windows/native/sun/windows/awt_Window.cpp Mon May 12 18:06:23 2008 -0700
283.2 +++ b/src/windows/native/sun/windows/awt_Window.cpp Fri May 16 12:25:57 2008 -0700
283.3 @@ -1,5 +1,5 @@
283.4 /*
283.5 - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved.
283.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
283.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
283.8 *
283.9 * This code is free software; you can redistribute it and/or modify it
283.10 @@ -122,9 +122,6 @@
283.11 jfieldID AwtWindow::locationByPlatformID;
283.12 jfieldID AwtWindow::autoRequestFocusID;
283.13
283.14 -jclass AwtWindow::wwindowPeerCls;
283.15 -jmethodID AwtWindow::getActiveWindowsMID;
283.16 -
283.17 jfieldID AwtWindow::sysXID;
283.18 jfieldID AwtWindow::sysYID;
283.19 jfieldID AwtWindow::sysWID;
283.20 @@ -2159,11 +2156,6 @@
283.21 {
283.22 TRY;
283.23
283.24 - AwtWindow::wwindowPeerCls = cls;
283.25 - AwtWindow::getActiveWindowsMID =
283.26 - env->GetStaticMethodID(cls, "getActiveWindowHandles", "()[J");
283.27 - DASSERT(AwtWindow::getActiveWindowsMID != NULL);
283.28 -
283.29 AwtWindow::sysXID = env->GetFieldID(cls, "sysX", "I");
283.30 AwtWindow::sysYID = env->GetFieldID(cls, "sysY", "I");
283.31 AwtWindow::sysWID = env->GetFieldID(cls, "sysW", "I");
284.1 --- a/src/windows/native/sun/windows/awt_Window.h Mon May 12 18:06:23 2008 -0700
284.2 +++ b/src/windows/native/sun/windows/awt_Window.h Fri May 16 12:25:57 2008 -0700
284.3 @@ -1,5 +1,5 @@
284.4 /*
284.5 - * Copyright 1996-2007 Sun Microsystems, Inc. All Rights Reserved.
284.6 + * Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved.
284.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
284.8 *
284.9 * This code is free software; you can redistribute it and/or modify it
284.10 @@ -57,11 +57,6 @@
284.11 static jfieldID screenID; /* screen number passed over from WindowPeer */
284.12 static jfieldID autoRequestFocusID;
284.13
284.14 - /* WWindowPeer class */
284.15 - static jclass wwindowPeerCls;
284.16 - /* long[] getActiveWindowHandles() method in WWindowPeer */
284.17 - static jmethodID getActiveWindowsMID;
284.18 -
284.19 // The coordinates at the peer.
284.20 static jfieldID sysXID;
284.21 static jfieldID sysYID;
285.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
285.2 +++ b/test/java/awt/Component/isLightweightCrash/IsLightweightCrash.java Fri May 16 12:25:57 2008 -0700
285.3 @@ -0,0 +1,59 @@
285.4 +/*
285.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
285.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
285.7 + *
285.8 + * This code is free software; you can redistribute it and/or modify it
285.9 + * under the terms of the GNU General Public License version 2 only, as
285.10 + * published by the Free Software Foundation.
285.11 + *
285.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
285.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
285.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
285.15 + * version 2 for more details (a copy is included in the LICENSE file that
285.16 + * accompanied this code).
285.17 + *
285.18 + * You should have received a copy of the GNU General Public License version
285.19 + * 2 along with this work; if not, write to the Free Software Foundation,
285.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
285.21 + *
285.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
285.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
285.24 + * have any questions.
285.25 + */
285.26 +
285.27 +/*
285.28 + @test
285.29 + @bug 6255653
285.30 + @summary REGRESSION: Override isLightweight() causes access violation in awt.dll
285.31 + @author Andrei Dmitriev: area=awt-component
285.32 + @run main IsLightweightCrash
285.33 +*/
285.34 +
285.35 +/*
285.36 + * The test may not crash for several times so iteratively continue up to some limit.
285.37 + */
285.38 +
285.39 +import java.awt.*;
285.40 +
285.41 +public class IsLightweightCrash {
285.42 + public static int ITERATIONS = 20;
285.43 +
285.44 + public static void main(String []s)
285.45 + {
285.46 + for (int i = 0; i < ITERATIONS; i++){
285.47 + showFrame(i);
285.48 + }
285.49 + }
285.50 +
285.51 + private static void showFrame(int i){
285.52 + System.out.println("iteration = "+i);
285.53 + Frame f = new Frame();
285.54 + f.add(new AHeavyweightComponent());
285.55 + f.setVisible(true);
285.56 + f.setVisible(false);
285.57 + }
285.58 +}
285.59 +
285.60 +class AHeavyweightComponent extends Component {
285.61 + public boolean isLightweight() { return false; }
285.62 +}
286.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
286.2 +++ b/test/java/awt/Component/isLightweightCrash/StubPeerCrash.java Fri May 16 12:25:57 2008 -0700
286.3 @@ -0,0 +1,188 @@
286.4 +/*
286.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
286.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
286.7 + *
286.8 + * This code is free software; you can redistribute it and/or modify it
286.9 + * under the terms of the GNU General Public License version 2 only, as
286.10 + * published by the Free Software Foundation.
286.11 + *
286.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
286.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
286.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
286.15 + * version 2 for more details (a copy is included in the LICENSE file that
286.16 + * accompanied this code).
286.17 + *
286.18 + * You should have received a copy of the GNU General Public License version
286.19 + * 2 along with this work; if not, write to the Free Software Foundation,
286.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
286.21 + *
286.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
286.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
286.24 + * have any questions.
286.25 + */
286.26 +
286.27 +/*
286.28 + @test
286.29 + @bug 6255653
286.30 + @summary REGRESSION: Override isLightweight() causes access violation in awt.dll
286.31 + @author Andrei Dmitriev: area=awt-component
286.32 + @run main StubPeerCrash
286.33 +*/
286.34 +
286.35 +/*
286.36 + * The test may not crash for several times so iteratively continue up to some limit.
286.37 + */
286.38 +
286.39 +import java.awt.*;
286.40 +import java.awt.peer.*;
286.41 +import java.awt.event.PaintEvent;
286.42 +import java.awt.image.ImageProducer;
286.43 +import java.awt.image.ImageObserver;
286.44 +import java.awt.image.ColorModel;
286.45 +import java.awt.image.VolatileImage;
286.46 +import java.awt.GraphicsConfiguration;
286.47 +import sun.awt.CausedFocusEvent;
286.48 +import sun.java2d.pipe.Region;
286.49 +
286.50 +public class StubPeerCrash {
286.51 + public static int ITERATIONS = 20;
286.52 +
286.53 + public static void main(String []s)
286.54 + {
286.55 + for (int i = 0; i < ITERATIONS; i++){
286.56 + showFrame(i);
286.57 + }
286.58 + }
286.59 +
286.60 + private static void showFrame(int i){
286.61 + System.out.println("iteration = "+i);
286.62 + Frame f = new Frame();
286.63 + f.add(new AHeavyweightComponent());
286.64 + f.setVisible(true);
286.65 + f.setVisible(false);
286.66 + }
286.67 +}
286.68 +
286.69 +class AHeavyweightComponent extends Component {
286.70 + private ComponentPeer peer = new StubComponentPeer();
286.71 +
286.72 + public AHeavyweightComponent(){
286.73 + }
286.74 +
286.75 + public boolean isLightweight() {
286.76 + return false;
286.77 + }
286.78 +
286.79 + public ComponentPeer getPeer(){
286.80 + return peer;
286.81 + }
286.82 +}
286.83 +
286.84 +class StubComponentPeer implements ComponentPeer {
286.85 + public boolean isObscured(){return true;};
286.86 + public boolean canDetermineObscurity(){return true;};
286.87 + public void setVisible(boolean b){};
286.88 + public void setEnabled(boolean b){};
286.89 + public void paint(Graphics g){};
286.90 + public void repaint(long tm, int x, int y, int width, int height){};
286.91 + public void print(Graphics g){};
286.92 + public void setBounds(int x, int y, int width, int height, int op){};
286.93 + public void handleEvent(AWTEvent e){};
286.94 + public void coalescePaintEvent(PaintEvent e){};
286.95 + public Point getLocationOnScreen(){return null;};
286.96 + public Dimension getPreferredSize(){return null;};
286.97 + public Dimension getMinimumSize(){return null;};
286.98 + public ColorModel getColorModel(){return null;};
286.99 + public Toolkit getToolkit(){return null;};
286.100 + public Graphics getGraphics(){return null;};
286.101 + public FontMetrics getFontMetrics(Font font){return null;};
286.102 + public void dispose(){};
286.103 + public void setForeground(Color c){};
286.104 + public void setBackground(Color c){};
286.105 + public void setFont(Font f){};
286.106 + public void updateCursorImmediately(){};
286.107 + public boolean requestFocus(Component lightweightChild,
286.108 + boolean temporary,
286.109 + boolean focusedWindowChangeAllowed,
286.110 + long time, CausedFocusEvent.Cause cause){
286.111 + return true;
286.112 + };
286.113 + public boolean isFocusable(){return true;};
286.114 +
286.115 + public Image createImage(ImageProducer producer){return null;};
286.116 + public Image createImage(int width, int height){return null;};
286.117 + public VolatileImage createVolatileImage(int width, int height){return null;};
286.118 + public boolean prepareImage(Image img, int w, int h, ImageObserver o){return true;};
286.119 + public int checkImage(Image img, int w, int h, ImageObserver o){return 0;};
286.120 + public GraphicsConfiguration getGraphicsConfiguration(){return null;};
286.121 + public boolean handlesWheelScrolling(){return true;};
286.122 + public void createBuffers(int numBuffers, BufferCapabilities caps) throws AWTException{};
286.123 + public Image getBackBuffer(){return null;};
286.124 + public void flip(BufferCapabilities.FlipContents flipAction){};
286.125 + public void destroyBuffers(){};
286.126 +
286.127 + /**
286.128 + * Reparents this peer to the new parent referenced by <code>newContainer</code> peer
286.129 + * Implementation depends on toolkit and container.
286.130 + * @param newContainer peer of the new parent container
286.131 + * @since 1.5
286.132 + */
286.133 + public void reparent(ContainerPeer newContainer){};
286.134 + /**
286.135 + * Returns whether this peer supports reparenting to another parent withour destroying the peer
286.136 + * @return true if appropriate reparent is supported, false otherwise
286.137 + * @since 1.5
286.138 + */
286.139 + public boolean isReparentSupported(){return true;};
286.140 +
286.141 + /**
286.142 + * Used by lightweight implementations to tell a ComponentPeer to layout
286.143 + * its sub-elements. For instance, a lightweight Checkbox needs to layout
286.144 + * the box, as well as the text label.
286.145 + */
286.146 + public void layout(){};
286.147 +
286.148 +
286.149 + public Rectangle getBounds(){return null;};
286.150 +
286.151 + /**
286.152 + * Applies the shape to the native component window.
286.153 + * @since 1.7
286.154 + */
286.155 + public void applyShape(Region shape){};
286.156 +
286.157 + /**
286.158 + * DEPRECATED: Replaced by getPreferredSize().
286.159 + */
286.160 + public Dimension preferredSize(){return null;};
286.161 +
286.162 + /**
286.163 + * DEPRECATED: Replaced by getMinimumSize().
286.164 + */
286.165 + public Dimension minimumSize(){return null;};
286.166 +
286.167 + /**
286.168 + * DEPRECATED: Replaced by setVisible(boolean).
286.169 + */
286.170 + public void show(){};
286.171 +
286.172 + /**
286.173 + * DEPRECATED: Replaced by setVisible(boolean).
286.174 + */
286.175 + public void hide(){};
286.176 +
286.177 + /**
286.178 + * DEPRECATED: Replaced by setEnabled(boolean).
286.179 + */
286.180 + public void enable(){};
286.181 +
286.182 + /**
286.183 + * DEPRECATED: Replaced by setEnabled(boolean).
286.184 + */
286.185 + public void disable(){};
286.186 +
286.187 + /**
286.188 + * DEPRECATED: Replaced by setBounds(int, int, int, int).
286.189 + */
286.190 + public void reshape(int x, int y, int width, int height){};
286.191 +}
287.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
287.2 +++ b/test/java/awt/Dialog/CrashXCheckJni/CrashXCheckJni.java Fri May 16 12:25:57 2008 -0700
287.3 @@ -0,0 +1,64 @@
287.4 +/*
287.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
287.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
287.7 + *
287.8 + * This code is free software; you can redistribute it and/or modify it
287.9 + * under the terms of the GNU General Public License version 2 only, as
287.10 + * published by the Free Software Foundation.
287.11 + *
287.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
287.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
287.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
287.15 + * version 2 for more details (a copy is included in the LICENSE file that
287.16 + * accompanied this code).
287.17 + *
287.18 + * You should have received a copy of the GNU General Public License version
287.19 + * 2 along with this work; if not, write to the Free Software Foundation,
287.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
287.21 + *
287.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
287.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
287.24 + * have any questions.
287.25 + */
287.26 +
287.27 +/*
287.28 + @test
287.29 + @bug 6610244
287.30 + @library ../../regtesthelpers
287.31 + @build Util Sysout AbstractTest
287.32 + @summary modal dialog closes with fatal error if -Xcheck:jni is set
287.33 + @author Andrei Dmitriev : area=awt.dialog
287.34 + @run main/othervm -Xcheck:jni CrashXCheckJni
287.35 +*/
287.36 +
287.37 +import java.awt.*;
287.38 +import java.awt.event.*;
287.39 +import java.util.Timer;
287.40 +import java.util.TimerTask;
287.41 +import test.java.awt.regtesthelpers.Util;
287.42 +import test.java.awt.regtesthelpers.AbstractTest;
287.43 +import test.java.awt.regtesthelpers.Sysout;
287.44 +
287.45 +public class CrashXCheckJni {
287.46 +
287.47 + public static void main(String []s)
287.48 + {
287.49 + final Dialog fd = new Dialog(new Frame(), true);
287.50 + Timer t = new Timer();
287.51 + t.schedule(new TimerTask() {
287.52 +
287.53 + public void run() {
287.54 + System.out.println("RUNNING TASK");
287.55 + fd.setVisible(false);
287.56 + fd.dispose();
287.57 + System.out.println("FINISHING TASK");
287.58 + }
287.59 + }, 3000L);
287.60 +
287.61 + fd.setVisible(true);
287.62 + t.cancel();
287.63 + Util.waitForIdle(null);
287.64 +
287.65 + AbstractTest.pass();
287.66 + }
287.67 +}
288.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
288.2 +++ b/test/java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowBlockingTest.java Fri May 16 12:25:57 2008 -0700
288.3 @@ -0,0 +1,165 @@
288.4 +/*
288.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
288.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
288.7 + *
288.8 + * This code is free software; you can redistribute it and/or modify it
288.9 + * under the terms of the GNU General Public License version 2 only, as
288.10 + * published by the Free Software Foundation.
288.11 + *
288.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
288.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
288.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
288.15 + * version 2 for more details (a copy is included in the LICENSE file that
288.16 + * accompanied this code).
288.17 + *
288.18 + * You should have received a copy of the GNU General Public License version
288.19 + * 2 along with this work; if not, write to the Free Software Foundation,
288.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
288.21 + *
288.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
288.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
288.24 + * have any questions.
288.25 + */
288.26 +
288.27 +/*
288.28 + @test
288.29 + @bug 6314575
288.30 + @summary Tests that previosly focused owned window doesn't steal focus when an owner's component requests focus.
288.31 + @author Anton.Tarasov: area=awt.focus
288.32 + @library ../../regtesthelpers
288.33 + @build Util
288.34 + @run main ActualFocusedWindowBlockingTest
288.35 +*/
288.36 +
288.37 +import java.awt.*;
288.38 +import java.awt.event.*;
288.39 +import java.applet.Applet;
288.40 +import java.util.concurrent.atomic.AtomicBoolean;
288.41 +import java.lang.reflect.InvocationTargetException;
288.42 +import sun.awt.SunToolkit;
288.43 +import test.java.awt.regtesthelpers.Util;
288.44 +
288.45 +public class ActualFocusedWindowBlockingTest extends Applet {
288.46 + Robot robot = Util.createRobot();
288.47 + Frame owner = new Frame("Owner Frame");
288.48 + Window win = new Window(owner);
288.49 + Frame frame = new Frame("Auxiliary Frame");
288.50 + Button fButton = new Button("frame button") {public String toString() {return "Frame_Button";}};
288.51 + Button wButton = new Button("window button") {public String toString() {return "Window_Button";}};
288.52 + Button aButton = new Button("auxiliary button") {public String toString() {return "Auxiliary_Button";}};
288.53 +
288.54 + public static void main(String[] args) {
288.55 + ActualFocusedWindowBlockingTest app = new ActualFocusedWindowBlockingTest();
288.56 + app.init();
288.57 + app.start();
288.58 + }
288.59 +
288.60 + public void init() {
288.61 + Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
288.62 + public void eventDispatched(AWTEvent e) {
288.63 + System.out.println("--> " + e);
288.64 + }
288.65 + }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK);
288.66 +
288.67 + owner.add(fButton);
288.68 + win.add(wButton);
288.69 + frame.add(aButton);
288.70 +
288.71 + owner.setName("OWNER_FRAME");
288.72 + win.setName("OWNED_WINDOW");
288.73 + frame.setName("AUX_FRAME");
288.74 +
288.75 + tuneAndShowWindows(new Window[] {owner, win, frame});
288.76 + }
288.77 +
288.78 + public void start() {
288.79 + if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) {
288.80 + System.out.println("No testing on Motif. Test passed.");
288.81 + return;
288.82 + }
288.83 +
288.84 + System.out.println("\nTest started:\n");
288.85 +
288.86 + // Test 1.
288.87 +
288.88 + clickOnCheckFocus(wButton);
288.89 + clickOnCheckFocus(aButton);
288.90 +
288.91 + Util.clickOnComp(fButton, robot);
288.92 + if (!testFocused(fButton)) {
288.93 + throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused by click");
288.94 + }
288.95 +
288.96 + // Test 2.
288.97 +
288.98 + clickOnCheckFocus(wButton);
288.99 + clickOnCheckFocus(aButton);
288.100 +
288.101 + fButton.requestFocus();
288.102 + Util.waitForIdle(robot);
288.103 + if (!testFocused(fButton)) {
288.104 + throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused by request");
288.105 + }
288.106 +
288.107 + // Test 3.
288.108 +
288.109 + clickOnCheckFocus(wButton);
288.110 + clickOnCheckFocus(aButton);
288.111 + clickOnCheckFocus(fButton);
288.112 + clickOnCheckFocus(aButton);
288.113 +
288.114 + Util.clickOnTitle(owner, robot);
288.115 + if (!testFocused(fButton)) {
288.116 + throw new TestFailedException("The owner's component [" + fButton + "] couldn't be focused as the most recent focus owner");
288.117 + }
288.118 +
288.119 + System.out.println("Test passed.");
288.120 + }
288.121 +
288.122 + void tuneAndShowWindows(Window[] arr) {
288.123 + int y = 0;
288.124 + for (Window w: arr) {
288.125 + w.setLayout(new FlowLayout());
288.126 + w.setBounds(100, y, 400, 150);
288.127 + w.setBackground(Color.blue);
288.128 + w.setVisible(true);
288.129 + y += 200;
288.130 + Util.waitForIdle(robot);
288.131 + }
288.132 + }
288.133 +
288.134 + void clickOnCheckFocus(Component c) {
288.135 + if (c instanceof Frame) {
288.136 + Util.clickOnTitle((Frame)c, robot);
288.137 + } else {
288.138 + Util.clickOnComp(c, robot);
288.139 + }
288.140 + if (!testFocused(c)) {
288.141 + throw new TestErrorException(c + "couldn't get focus by click.");
288.142 + }
288.143 + }
288.144 +
288.145 + boolean testFocused(Component c) {
288.146 + for (int i=0; i<10; i++) {
288.147 + if (KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner() == c) {
288.148 + return true;
288.149 + }
288.150 + Util.waitForIdle(robot);
288.151 + }
288.152 + return false;
288.153 + }
288.154 +
288.155 + // Thrown when the behavior being verified is found wrong.
288.156 + class TestFailedException extends RuntimeException {
288.157 + TestFailedException(String msg) {
288.158 + super("Test failed: " + msg);
288.159 + }
288.160 + }
288.161 +
288.162 + // Thrown when an error not related to the behavior being verified is encountered.
288.163 + class TestErrorException extends RuntimeException {
288.164 + TestErrorException(String msg) {
288.165 + super("Unexpected error: " + msg);
288.166 + }
288.167 + }
288.168 +}
289.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
289.2 +++ b/test/java/awt/Focus/ActualFocusedWindowTest/ActualFocusedWindowRetaining.java Fri May 16 12:25:57 2008 -0700
289.3 @@ -0,0 +1,211 @@
289.4 +/*
289.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
289.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
289.7 + *
289.8 + * This code is free software; you can redistribute it and/or modify it
289.9 + * under the terms of the GNU General Public License version 2 only, as
289.10 + * published by the Free Software Foundation.
289.11 + *
289.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
289.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
289.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
289.15 + * version 2 for more details (a copy is included in the LICENSE file that
289.16 + * accompanied this code).
289.17 + *
289.18 + * You should have received a copy of the GNU General Public License version
289.19 + * 2 along with this work; if not, write to the Free Software Foundation,
289.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
289.21 + *
289.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
289.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
289.24 + * have any questions.
289.25 + */
289.26 +
289.27 +/*
289.28 + @test
289.29 + @bug 4823903
289.30 + @summary Tests actual focused window retaining.
289.31 + @author Anton.Tarasov: area=awt.focus
289.32 + @library ../../regtesthelpers
289.33 + @build Util
289.34 + @run main ActualFocusedWindowRetaining
289.35 +*/
289.36 +
289.37 +import java.awt.*;
289.38 +import java.awt.event.*;
289.39 +import java.lang.reflect.*;
289.40 +import java.applet.*;
289.41 +import test.java.awt.regtesthelpers.Util;
289.42 +
289.43 +public class ActualFocusedWindowRetaining extends Applet {
289.44 + public static Frame frame = new Frame("Other Frame");
289.45 + public static Frame owner = new Frame("Test Frame");
289.46 + public static Button otherButton1 = new Button("Other Button 1");
289.47 + public static Button otherButton2 = new Button("Other Button 2");
289.48 + public static Button otherButton3 = new Button("Other Button 3");
289.49 + public static Button testButton1 = new Button("Test Button 1");
289.50 + public static Button testButton2 = new Button("Test Button 2");
289.51 + public static Button testButton3 = new Button("Test Button 3");
289.52 + public static Window window1 = new TestWindow(owner, otherButton2, testButton2, 800, 200);
289.53 + public static Window window2 = new TestWindow(owner, otherButton3, testButton3, 800, 300);
289.54 + public static int step;
289.55 + public static Robot robot = Util.createRobot();
289.56 +
289.57 + public static void main(String[] args) {
289.58 + ActualFocusedWindowRetaining a = new ActualFocusedWindowRetaining();
289.59 + a.init();
289.60 + a.start();
289.61 + }
289.62 +
289.63 + public void start () {
289.64 + Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
289.65 + public void eventDispatched(AWTEvent e) {
289.66 + Object src = e.getSource();
289.67 + Class cls = src.getClass();
289.68 +
289.69 + if (cls == TestWindow.class) {
289.70 + System.out.println(e.paramString() + " on <" + (src == window1 ? "Window 1" : "Window 2") + ">");
289.71 + } else if (cls == Frame.class) {
289.72 + System.out.println(e.paramString() + " on <" + ((Frame)src).getTitle() + ">");
289.73 + } else if (cls == Button.class) {
289.74 + System.out.println(e.paramString() + " on <" + ((Button)src).getLabel() + ">");
289.75 + } else {
289.76 + System.out.println(e.paramString() + " on <Non-testing component>");
289.77 + }
289.78 + }
289.79 + }, AWTEvent.WINDOW_EVENT_MASK | AWTEvent.WINDOW_FOCUS_EVENT_MASK | AWTEvent.FOCUS_EVENT_MASK);
289.80 +
289.81 + setSize (500, 200);
289.82 + setVisible(true);
289.83 + validate();
289.84 +
289.85 + frame.setSize(new Dimension(400, 100));
289.86 + frame.setLocation(800, 400);
289.87 + frame.setVisible(true);
289.88 + frame.toFront();
289.89 +
289.90 + owner.setLayout(new FlowLayout());
289.91 + owner.add(testButton1);
289.92 + owner.add(otherButton1);
289.93 + owner.pack();
289.94 + owner.setLocation(800, 100);
289.95 + owner.setSize(new Dimension(400, 100));
289.96 + owner.setVisible(true);
289.97 + owner.toFront();
289.98 + Util.waitTillShown(owner);
289.99 +
289.100 + window1.setVisible(true);
289.101 + window2.setVisible(true);
289.102 + window1.toFront();
289.103 + window2.toFront();
289.104 + // Wait longer...
289.105 + Util.waitTillShown(window1);
289.106 + Util.waitTillShown(window2);
289.107 +
289.108 + test();
289.109 +
289.110 + frame.dispose();
289.111 + owner.dispose();
289.112 + }
289.113 +
289.114 + public void test() {
289.115 + Button[] butArr = new Button[] {testButton3, testButton2, testButton1};
289.116 + Window[] winArr = new Window[] {window2, window1, owner};
289.117 +
289.118 + step = 1;
289.119 + for (int i = 0; i < 3; i++) {
289.120 + clickInSeriesCheckFocus(null, butArr[i], frame);
289.121 + clickOwnerCheckFocus(winArr[i], butArr[i]);
289.122 + step++;
289.123 + }
289.124 +
289.125 + step = 4;
289.126 + clickInSeriesCheckFocus(testButton3, testButton1, frame);
289.127 + clickOwnerCheckFocus(owner, testButton1);
289.128 +
289.129 + step = 5;
289.130 + clickInSeriesCheckFocus(testButton3, testButton2, frame);
289.131 + clickOwnerCheckFocus(window1, testButton2);
289.132 +
289.133 + step = 6;
289.134 + clickInSeriesCheckFocus(testButton1, testButton2, frame);
289.135 + clickOwnerCheckFocus(window1, testButton2);
289.136 +
289.137 + step = 7;
289.138 + clickInSeriesCheckFocus(testButton1, testButton2, frame);
289.139 + window1.setVisible(false);
289.140 + Util.waitForIdle(robot);
289.141 + clickOwnerCheckFocus(owner, testButton1);
289.142 +
289.143 + step = 8;
289.144 + window1.setVisible(true);
289.145 + Util.waitTillShown(window1);
289.146 + clickInSeriesCheckFocus(null, testButton2, frame);
289.147 + clickOwnerCheckFocus(window1, testButton2);
289.148 + }
289.149 +
289.150 + boolean checkFocusOwner(Component comp) {
289.151 + return (comp == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
289.152 + }
289.153 +
289.154 + boolean checkFocusedWindow(Window win) {
289.155 + return (win == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusedWindow());
289.156 + }
289.157 +
289.158 + void clickOwnerCheckFocus(Window focusedWindow, Component focusedComp) {
289.159 + Util.clickOnTitle(owner, robot);
289.160 + robot.delay(500);
289.161 +
289.162 + if (!checkFocusedWindow(focusedWindow)) {
289.163 + stopTest("Test failed: actual focused window didn't get a focus");
289.164 + }
289.165 + if (!checkFocusOwner(focusedComp)) {
289.166 + stopTest("Test failed: actual focus owner didn't get a focus");
289.167 + }
289.168 + }
289.169 +
289.170 + void clickInSeriesCheckFocus(Component comp1, Component comp2, Frame frame) {
289.171 + if (comp1 != null) {
289.172 + clickOnCheckFocusOwner(comp1);
289.173 + }
289.174 + if (comp2 != null) {
289.175 + clickOnCheckFocusOwner(comp2);
289.176 + }
289.177 + clickOnCheckFocusedWindow(frame);
289.178 + }
289.179 +
289.180 + void clickOnCheckFocusOwner(Component c) {
289.181 + Util.clickOnComp(c, robot);
289.182 + robot.delay(500);
289.183 +
289.184 + if (!checkFocusOwner(c)) {
289.185 + stopTest("Error: can't bring a focus on Component by clicking on it");
289.186 + }
289.187 + }
289.188 +
289.189 + void clickOnCheckFocusedWindow(Frame f) {
289.190 + Util.clickOnTitle(f, robot);
289.191 + robot.delay(500);
289.192 +
289.193 + if (!checkFocusedWindow(f)) {
289.194 + stopTest("Error: can't bring a focus on Frame by clicking on it");
289.195 + }
289.196 + }
289.197 +
289.198 + void stopTest(String msg) {
289.199 + throw new RuntimeException(new String("Step " + step + ": " + msg));
289.200 + }
289.201 +}
289.202 +
289.203 +class TestWindow extends Window {
289.204 + TestWindow(Frame owner, Button otherButton, Button testButton, int x, int y) {
289.205 + super(owner);
289.206 +
289.207 + setLayout(new FlowLayout());
289.208 + setLocation(x, y);
289.209 + add(testButton);
289.210 + add(otherButton);
289.211 + pack();
289.212 + setBackground(Color.green);
289.213 + }
289.214 +}
290.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
290.2 +++ b/test/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest.html Fri May 16 12:25:57 2008 -0700
290.3 @@ -0,0 +1,23 @@
290.4 +<html>
290.5 +<!--
290.6 + @test
290.7 + @bug 4041703 4096228 4025223 4260929
290.8 + @summary Ensures that appletviewer sets a reasonable default focus for an Applet on start
290.9 + @author das area=appletviewer
290.10 + @library ../../regtesthelpers
290.11 + @build Util
290.12 + @run applet AppletInitialFocusTest.html
290.13 + -->
290.14 +<head>
290.15 +<title> AppletInitialFocusTest </title>
290.16 +</head>
290.17 +<body>
290.18 +
290.19 +<h1>AppletInitialFocusTest<br>Bug ID: 4041703</h1>
290.20 +
290.21 +<p> See the dialog box (usually in upper left corner) for instructions</p>
290.22 +
290.23 +<APPLET CODE="AppletInitialFocusTest.class" WIDTH=200 HEIGHT=200></APPLET>
290.24 +</body>
290.25 +</html>
290.26 +
291.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
291.2 +++ b/test/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest.java Fri May 16 12:25:57 2008 -0700
291.3 @@ -0,0 +1,59 @@
291.4 +/*
291.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
291.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
291.7 + *
291.8 + * This code is free software; you can redistribute it and/or modify it
291.9 + * under the terms of the GNU General Public License version 2 only, as
291.10 + * published by the Free Software Foundation.
291.11 + *
291.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
291.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
291.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
291.15 + * version 2 for more details (a copy is included in the LICENSE file that
291.16 + * accompanied this code).
291.17 + *
291.18 + * You should have received a copy of the GNU General Public License version
291.19 + * 2 along with this work; if not, write to the Free Software Foundation,
291.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
291.21 + *
291.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
291.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
291.24 + * have any questions.
291.25 + */
291.26 +
291.27 +/*
291.28 + test
291.29 + @bug 4041703 4096228 4025223 4260929
291.30 + @summary Ensures that appletviewer sets a reasonable default focus for an Applet on start
291.31 + @author das area=appletviewer
291.32 + @run applet AppletInitialFocusTest.html
291.33 +*/
291.34 +
291.35 +import java.applet.Applet;
291.36 +import java.awt.Button;
291.37 +import java.awt.Component;
291.38 +import java.awt.Robot;
291.39 +import java.awt.Window;
291.40 +import test.java.awt.regtesthelpers.Util;
291.41 +
291.42 +public class AppletInitialFocusTest extends Applet {
291.43 + Robot robot = Util.createRobot();
291.44 + Button button = new Button("Button");
291.45 +
291.46 + public void init() {
291.47 + add(button);
291.48 + }
291.49 +
291.50 + public void start() {
291.51 + new Thread(new Runnable() {
291.52 + public void run() {
291.53 + Util.waitTillShown(button);
291.54 + robot.delay(1000); // delay the thread to let EDT to start dispatching focus events
291.55 + Util.waitForIdle(robot);
291.56 + if (!button.hasFocus()) {
291.57 + throw new RuntimeException("Appletviewer doesn't set default focus correctly.");
291.58 + }
291.59 + }
291.60 + }).start();
291.61 + }
291.62 +}
292.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
292.2 +++ b/test/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.html Fri May 16 12:25:57 2008 -0700
292.3 @@ -0,0 +1,24 @@
292.4 +<html>
292.5 +<!--
292.6 + @test
292.7 + @bug 4411534 4517274
292.8 + @summary ensures that user's requestFocus() during applet initialization
292.9 + is not ignored
292.10 + @author prs area=appletviewer
292.11 + @library ../../regtesthelpers
292.12 + @build Util
292.13 + @run applet AppletInitialFocusTest1.html
292.14 + -->
292.15 +<head>
292.16 +<title> AppletInitialFocusTest1 </title>
292.17 +</head>
292.18 +<body>
292.19 +
292.20 +<h1>AppletInitialFocusTest1<br>Bug ID: 4517274</h1>
292.21 +
292.22 +<p> See the dialog box (usually in upper left corner) for instructions</p>
292.23 +
292.24 +<APPLET CODE="AppletInitialFocusTest1.class" WIDTH=200 HEIGHT=200></APPLET>
292.25 +</body>
292.26 +</html>
292.27 +
293.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
293.2 +++ b/test/java/awt/Focus/AppletInitialFocusTest/AppletInitialFocusTest1.java Fri May 16 12:25:57 2008 -0700
293.3 @@ -0,0 +1,71 @@
293.4 +/*
293.5 + test %W% %E%
293.6 + @bug 4411534 4517274
293.7 + @summary ensures that user's requestFocus() during applet initialization
293.8 + is not ignored.
293.9 + @author prs@sparc.spb.su area=appletviewer
293.10 + @run shell AppletInitialFocusTest1.sh
293.11 +*/
293.12 +
293.13 +import java.applet.Applet;
293.14 +import java.awt.*;
293.15 +import java.awt.event.*;
293.16 +
293.17 +public class AppletInitialFocusTest1 extends Applet implements FocusListener {
293.18 +
293.19 + Button button1 = new Button("Button1");
293.20 + Button button2 = new Button("Button2");
293.21 +
293.22 + Object lock = new Object();
293.23 +
293.24 + public void init() {
293.25 +
293.26 + Component parent = this;
293.27 + while (parent != null && !(parent instanceof Window)) {
293.28 + parent = parent.getParent();
293.29 + }
293.30 + /*
293.31 + * This applet is designed to be run only with appletviewer,
293.32 + * so there always should be a toplevel frame.
293.33 + */
293.34 + if (parent == null) {
293.35 + synchronized (lock) {
293.36 + System.err.println("appletviewer not running");
293.37 + System.exit(3);
293.38 + }
293.39 + }
293.40 + button1.addFocusListener(this);
293.41 + button2.addFocusListener(this);
293.42 + add(button1);
293.43 + add(button2);
293.44 + button2.requestFocus();
293.45 + }
293.46 +
293.47 + public void focusGained(FocusEvent e) {
293.48 + if (e.getSource() == button1) {
293.49 + synchronized (lock) {
293.50 + System.err.println("failed: focus on the wrong button");
293.51 + System.exit(2);
293.52 + }
293.53 + }
293.54 + }
293.55 +
293.56 + public void focusLost(FocusEvent e) {
293.57 + }
293.58 +
293.59 + public void start() {
293.60 + Thread thread = new Thread(new Runnable() {
293.61 + public void run() {
293.62 + try {
293.63 + Thread.sleep(10000);
293.64 + synchronized (lock) {
293.65 + System.err.println("passed");
293.66 + System.exit(0);
293.67 + }
293.68 + } catch(InterruptedException e) {
293.69 + }
293.70 + }
293.71 + });
293.72 + thread.start();
293.73 + }
293.74 +}
294.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
294.2 +++ b/test/java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java Fri May 16 12:25:57 2008 -0700
294.3 @@ -0,0 +1,110 @@
294.4 +/*
294.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
294.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
294.7 + *
294.8 + * This code is free software; you can redistribute it and/or modify it
294.9 + * under the terms of the GNU General Public License version 2 only, as
294.10 + * published by the Free Software Foundation.
294.11 + *
294.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
294.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
294.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
294.15 + * version 2 for more details (a copy is included in the LICENSE file that
294.16 + * accompanied this code).
294.17 + *
294.18 + * You should have received a copy of the GNU General Public License version
294.19 + * 2 along with this work; if not, write to the Free Software Foundation,
294.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
294.21 + *
294.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
294.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
294.24 + * have any questions.
294.25 + */
294.26 +
294.27 +/*
294.28 + @test %W% %E%
294.29 + @bug 6637607
294.30 + @summary Showing a modal dlg on TAB KEY_PRESS shouldn't consume inappropriate KEY_TYPED.
294.31 + @author Anton Tarasov: area=awt-focus
294.32 + @library ../../regtesthelpers
294.33 + @build Util
294.34 + @run main ConsumeNextKeyTypedOnModalShowTest
294.35 +*/
294.36 +
294.37 +import java.awt.*;
294.38 +import java.awt.event.*;
294.39 +import java.applet.Applet;
294.40 +import java.util.concurrent.atomic.AtomicBoolean;
294.41 +import java.lang.reflect.InvocationTargetException;
294.42 +import test.java.awt.regtesthelpers.Util;
294.43 +
294.44 +public class ConsumeNextKeyTypedOnModalShowTest extends Applet {
294.45 + Robot robot;
294.46 + Frame frame = new Frame("Frame");
294.47 + Dialog dialog = new Dialog(frame, "Dialog", true);
294.48 + TextField tf0 = new TextField();
294.49 + TextField tf1 = new TextField();
294.50 + Button button = new Button("Button");
294.51 +
294.52 + public static void main(String[] args) {
294.53 + ConsumeNextKeyTypedOnModalShowTest app = new ConsumeNextKeyTypedOnModalShowTest();
294.54 + app.init();
294.55 + app.start();
294.56 + }
294.57 +
294.58 + public void init() {
294.59 + robot = Util.createRobot();
294.60 +
294.61 + tf0.setPreferredSize(new Dimension(50, 30));
294.62 + tf1.setPreferredSize(new Dimension(50, 30));
294.63 + frame.setLayout(new FlowLayout());
294.64 + frame.add(tf0);
294.65 + frame.add(tf1);
294.66 + frame.pack();
294.67 +
294.68 + dialog.add(button);
294.69 + dialog.pack();
294.70 +
294.71 + Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
294.72 + public void eventDispatched(AWTEvent e) {
294.73 + if (e.getID() == KeyEvent.KEY_PRESSED && e.getSource() == tf0) {
294.74 + dialog.setVisible(true);
294.75 + }
294.76 + }
294.77 + }, KeyEvent.KEY_EVENT_MASK);
294.78 + }
294.79 +
294.80 + public void start() {
294.81 + frame.setVisible(true);
294.82 + Util.waitTillShown(frame);
294.83 +
294.84 + // Show the dialog.
294.85 + robot.keyPress(KeyEvent.VK_TAB);
294.86 + robot.delay(50);
294.87 + robot.keyRelease(KeyEvent.VK_TAB);
294.88 +
294.89 + Util.waitForIdle(robot);
294.90 +
294.91 + // Dispose the dialog.
294.92 + Runnable action = new Runnable() {
294.93 + public void run() {
294.94 + dialog.dispose();
294.95 + }
294.96 + };
294.97 + if (!Util.trackFocusGained(tf1, action, 2000, false)) {
294.98 + throw new RuntimeException("Test failed: TAB was processed incorrectly!");
294.99 + }
294.100 +
294.101 + // Check for type-ability.
294.102 + robot.keyPress(KeyEvent.VK_A);
294.103 + robot.delay(50);
294.104 + robot.keyRelease(KeyEvent.VK_A);
294.105 +
294.106 + Util.waitForIdle(robot);
294.107 +
294.108 + if (tf1.getText().equals("")) {
294.109 + throw new RuntimeException("Test failed: couldn't type a char!");
294.110 + }
294.111 + System.out.println("Test passed.");
294.112 + }
294.113 +}
295.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
295.2 +++ b/test/java/awt/Focus/ContainerFocusAutoTransferTest/ContainerFocusAutoTransferTest.java Fri May 16 12:25:57 2008 -0700
295.3 @@ -0,0 +1,243 @@
295.4 +/*
295.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
295.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
295.7 + *
295.8 + * This code is free software; you can redistribute it and/or modify it
295.9 + * under the terms of the GNU General Public License version 2 only, as
295.10 + * published by the Free Software Foundation.
295.11 + *
295.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
295.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
295.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
295.15 + * version 2 for more details (a copy is included in the LICENSE file that
295.16 + * accompanied this code).
295.17 + *
295.18 + * You should have received a copy of the GNU General Public License version
295.19 + * 2 along with this work; if not, write to the Free Software Foundation,
295.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
295.21 + *
295.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
295.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
295.24 + * have any questions.
295.25 + */
295.26 +
295.27 +/*
295.28 + @test
295.29 + @bug 6607170
295.30 + @summary Tests for focus-auto-transfer.
295.31 + @author Anton Tarasov: area=awt-focus
295.32 + @library ../../regtesthelpers
295.33 + @build Util
295.34 + @run main ContainerFocusAutoTransferTest
295.35 +*/
295.36 +
295.37 +import java.applet.Applet;
295.38 +import java.awt.AWTEvent;
295.39 +import java.awt.Component;
295.40 +import java.awt.ComponentOrientation;
295.41 +import java.awt.DefaultKeyboardFocusManager;
295.42 +import java.awt.KeyboardFocusManager;
295.43 +import java.awt.Robot;
295.44 +import java.awt.Color;
295.45 +import java.awt.FlowLayout;
295.46 +import java.awt.Toolkit;
295.47 +import java.awt.event.AWTEventListener;
295.48 +import java.awt.event.FocusEvent;
295.49 +import java.awt.event.WindowEvent;
295.50 +import javax.swing.JButton;
295.51 +import javax.swing.JFrame;
295.52 +import javax.swing.JPanel;
295.53 +import test.java.awt.regtesthelpers.Util;
295.54 +
295.55 +public class ContainerFocusAutoTransferTest extends Applet {
295.56 + Robot robot;
295.57 + TestFrame frame;
295.58 + KeyboardFocusManager kfm;
295.59 + enum TestCase {
295.60 + REMOVAL { public String toString() { return "removal"; } },
295.61 + HIDING { public String toString() { return "hiding"; } },
295.62 + DISABLING { public String toString() { return "disabling"; } },
295.63 + DEFOCUSING { public String toString() { return "defocusing"; } };
295.64 + public abstract String toString();
295.65 + };
295.66 +
295.67 + public static void main(String[] args) {
295.68 + ContainerFocusAutoTransferTest app = new ContainerFocusAutoTransferTest();
295.69 + app.init();
295.70 + app.start();
295.71 + }
295.72 +
295.73 + public void init() {
295.74 + robot = Util.createRobot();
295.75 + kfm = KeyboardFocusManager.getCurrentKeyboardFocusManager();
295.76 + Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
295.77 + public void eventDispatched(AWTEvent event) {
295.78 + System.out.println("--> " + event);
295.79 + }
295.80 + }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK);
295.81 + }
295.82 +
295.83 + public void start() {
295.84 + System.out.println("*** TEST #1 ***");
295.85 + test(TestCase.HIDING);
295.86 +
295.87 + System.out.println("*** TEST #2 ***");
295.88 + test(TestCase.REMOVAL);
295.89 +
295.90 + System.out.println("*** TEST #3 ***");
295.91 + test3(TestCase.DISABLING);
295.92 +
295.93 + System.out.println("*** TEST #4 ***");
295.94 + test3(TestCase.DEFOCUSING);
295.95 +
295.96 + System.out.println("*** TEST #5 ***");
295.97 + test4();
295.98 +
295.99 + System.out.println("Test passed.");
295.100 + }
295.101 +
295.102 + void test(final TestCase t) {
295.103 + showFrame();
295.104 + test1(t); // Test for correct auto-transfer
295.105 + test2(t); // Test for clearing focus
295.106 + }
295.107 +
295.108 + void test1(final TestCase t) {
295.109 + Runnable action = new Runnable() {
295.110 + public void run() {
295.111 + KeyboardFocusManager.setCurrentKeyboardFocusManager(new TestKFM());
295.112 + if (t == TestCase.REMOVAL) {
295.113 + frame.remove(frame.panel0);
295.114 +
295.115 + } else if (t == TestCase.HIDING) {
295.116 + frame.panel0.setVisible(false);
295.117 + }
295.118 + frame.repaint();
295.119 + }
295.120 + };
295.121 + if (!Util.trackFocusGained(frame.b3, action, 2000, false)) {
295.122 + throw new TestFailedException(t + ": focus wasn't transfered as expected!");
295.123 + }
295.124 + KeyboardFocusManager.setCurrentKeyboardFocusManager(kfm);
295.125 + }
295.126 +
295.127 + void test2(TestCase t) {
295.128 + frame.setFocusable(false); // exclude it from the focus cycle
295.129 + if (t == TestCase.REMOVAL) {
295.130 + frame.remove(frame.panel1);
295.131 +
295.132 + } else if (t == TestCase.HIDING) {
295.133 + frame.panel1.setVisible(false);
295.134 + }
295.135 + frame.repaint();
295.136 + Util.waitForIdle(robot);
295.137 + if (kfm.getFocusOwner() != null) {
295.138 + throw new TestFailedException(t + ": focus wasn't cleared!");
295.139 + }
295.140 + }
295.141 +
295.142 + void test3(final TestCase t) {
295.143 + showFrame();
295.144 + Runnable action = new Runnable() {
295.145 + public void run() {
295.146 + if (t == TestCase.DISABLING) {
295.147 + frame.b0.setEnabled(false);
295.148 +
295.149 + } else if (t == TestCase.DEFOCUSING) {
295.150 + frame.b0.setFocusable(false);
295.151 + }
295.152 + }};
295.153 + if (!Util.trackFocusGained(frame.b1, action, 2000, false)) {
295.154 + throw new TestFailedException(t + ": focus wasn't transfered as expected!");
295.155 + }
295.156 + }
295.157 +
295.158 + void test4() {
295.159 + showFrame();
295.160 + frame.setFocusableWindowState(false);
295.161 + Util.waitForIdle(robot);
295.162 + if (kfm.getFocusOwner() != null) {
295.163 + throw new TestFailedException("defocusing the frame: focus wasn't cleared!");
295.164 + }
295.165 + }
295.166 +
295.167 + void showFrame() {
295.168 + if (frame != null) {
295.169 + frame.dispose();
295.170 + Util.waitForIdle(robot);
295.171 + }
295.172 + frame = new TestFrame();
295.173 + frame.setVisible(true);
295.174 + Util.waitTillShown(frame);
295.175 +
295.176 + if (!frame.b0.hasFocus()) {
295.177 + Util.clickOnComp(frame.b0, robot);
295.178 + Util.waitForIdle(robot);
295.179 + if (!frame.b0.hasFocus()) {
295.180 + throw new TestErrorException("couldn't set focus on " + frame.b2);
295.181 + }
295.182 + }
295.183 + }
295.184 +
295.185 + class TestKFM extends DefaultKeyboardFocusManager {
295.186 + public boolean dispatchEvent(AWTEvent e) {
295.187 + if (e.getID() == FocusEvent.FOCUS_GAINED) {
295.188 + System.out.println(e);
295.189 + Component src = (Component)e.getSource();
295.190 + if (src == frame.b1 || src == frame.b2) {
295.191 + throw new TestFailedException("wrong focus transfer on removal!");
295.192 + }
295.193 + }
295.194 + return super.dispatchEvent(e);
295.195 + }
295.196 + }
295.197 +}
295.198 +
295.199 +class TestFrame extends JFrame {
295.200 + public JPanel panel0 = new JPanel();
295.201 + public JPanel panel1 = new JPanel();
295.202 + public JButton b0 = new JButton("b0");
295.203 + public JButton b1 = new JButton("b1");
295.204 + public JButton b2 = new JButton("b2");
295.205 + public JButton b3 = new JButton("b3");
295.206 + public JButton b4 = new JButton("b4");
295.207 +
295.208 + public TestFrame() {
295.209 + super("TestFrame");
295.210 +
295.211 + // The change of the orientation and the reverse order of
295.212 + // adding the buttons to the panel is because in Container.removeNotify()
295.213 + // the child components are removed in the reverse order.
295.214 + // We want that the focus owner (b0) would be removed first and
295.215 + // that the next traversable component would be b1.
295.216 + panel0.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
295.217 + panel0.add(b2);
295.218 + panel0.add(b1);
295.219 + panel0.add(b0);
295.220 +
295.221 + panel1.add(b3);
295.222 + panel1.add(b4);
295.223 +
295.224 + setLayout(new FlowLayout());
295.225 + add(panel0);
295.226 + add(panel1);
295.227 + pack();
295.228 +
295.229 + panel0.setBackground(Color.red);
295.230 + panel1.setBackground(Color.blue);
295.231 + }
295.232 +}
295.233 +
295.234 +// Thrown when the behavior being verified is found wrong.
295.235 +class TestFailedException extends RuntimeException {
295.236 + TestFailedException(String msg) {
295.237 + super("Test failed: " + msg);
295.238 + }
295.239 +}
295.240 +
295.241 +// Thrown when an error not related to the behavior being verified is encountered.
295.242 +class TestErrorException extends RuntimeException {
295.243 + TestErrorException(String msg) {
295.244 + super("Unexpected error: " + msg);
295.245 + }
295.246 +}
296.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
296.2 +++ b/test/java/awt/Focus/FrameJumpingToMouse/FrameJumpingToMouse.java Fri May 16 12:25:57 2008 -0700
296.3 @@ -0,0 +1,86 @@
296.4 +/*
296.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
296.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
296.7 + *
296.8 + * This code is free software; you can redistribute it and/or modify it
296.9 + * under the terms of the GNU General Public License version 2 only, as
296.10 + * published by the Free Software Foundation.
296.11 + *
296.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
296.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
296.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
296.15 + * version 2 for more details (a copy is included in the LICENSE file that
296.16 + * accompanied this code).
296.17 + *
296.18 + * You should have received a copy of the GNU General Public License version
296.19 + * 2 along with this work; if not, write to the Free Software Foundation,
296.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
296.21 + *
296.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
296.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
296.24 + * have any questions.
296.25 + */
296.26 +
296.27 +/*
296.28 + @test
296.29 + @bug 4752312
296.30 + @summary Tests that after moving non-focusable window it ungrabs mouse pointer
296.31 + @author Denis Mikhalkin: area=awt.focus
296.32 + @library ../../regtesthelpers
296.33 + @build Util
296.34 + @run main FrameJumpingToMouse
296.35 +*/
296.36 +
296.37 +import java.applet.Applet;
296.38 +import java.awt.BorderLayout;
296.39 +import java.awt.Dialog;
296.40 +import java.awt.Frame;
296.41 +import java.awt.Point;
296.42 +import java.awt.Robot;
296.43 +import java.awt.TextArea;
296.44 +import java.awt.Toolkit;
296.45 +import java.awt.event.InputEvent;
296.46 +import javax.swing.JFrame;
296.47 +import test.java.awt.regtesthelpers.Util;
296.48 +
296.49 +public class FrameJumpingToMouse extends Applet
296.50 +{
296.51 + JFrame frame = new JFrame("Test jumping frame");
296.52 + Robot robot = Util.createRobot();
296.53 +
296.54 + public static void main(String[] args) {
296.55 + FrameJumpingToMouse test = new FrameJumpingToMouse();
296.56 + test.init();
296.57 + test.start();
296.58 + }
296.59 +
296.60 + public void init() {
296.61 + frame.setFocusableWindowState(false);
296.62 + frame.setBounds(100, 100, 100, 100);
296.63 + }
296.64 +
296.65 + public void start() {
296.66 + frame.setVisible(true);
296.67 + Util.waitTillShown(frame);
296.68 +
296.69 + Point loc = frame.getLocationOnScreen();
296.70 + robot.mouseMove(loc.x + frame.getWidth() / 4, loc.y + frame.getInsets().top / 2);
296.71 + robot.delay(50);
296.72 + robot.mousePress(InputEvent.BUTTON1_MASK);
296.73 + robot.delay(50);
296.74 + robot.mouseMove(loc.x + 100, loc.y + 50);
296.75 + robot.delay(50);
296.76 + robot.mouseRelease(InputEvent.BUTTON1_MASK);
296.77 +
296.78 + Util.waitForIdle(robot);
296.79 +
296.80 + loc = frame.getLocation();
296.81 + robot.mouseMove(loc.x + frame.getWidth() / 2, loc.y + frame.getHeight() / 2);
296.82 + Util.waitForIdle(robot);
296.83 +
296.84 + if (!(frame.getLocation().equals(loc))) {
296.85 + throw new RuntimeException("Test failed: frame is moving to mouse with grab!");
296.86 + }
296.87 + System.out.println("Test passed.");
296.88 + }
296.89 +}
297.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
297.2 +++ b/test/java/awt/Focus/IconifiedFrameFocusChangeTest/IconifiedFrameFocusChangeTest.java Fri May 16 12:25:57 2008 -0700
297.3 @@ -0,0 +1,124 @@
297.4 +/*
297.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
297.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
297.7 + *
297.8 + * This code is free software; you can redistribute it and/or modify it
297.9 + * under the terms of the GNU General Public License version 2 only, as
297.10 + * published by the Free Software Foundation.
297.11 + *
297.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
297.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
297.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
297.15 + * version 2 for more details (a copy is included in the LICENSE file that
297.16 + * accompanied this code).
297.17 + *
297.18 + * You should have received a copy of the GNU General Public License version
297.19 + * 2 along with this work; if not, write to the Free Software Foundation,
297.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
297.21 + *
297.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
297.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
297.24 + * have any questions.
297.25 + */
297.26 +
297.27 +/*
297.28 + @test
297.29 + @bug 6522725
297.30 + @summary Tests for proper request-focus-back on FOCUS_LOST.
297.31 + @author Anton Tarasov: area=awt-focus
297.32 + @library ../../regtesthelpers
297.33 + @build Util
297.34 + @run main IconifiedFrameFocusChangeTest
297.35 +*/
297.36 +
297.37 +import java.awt.*;
297.38 +import java.applet.Applet;
297.39 +import java.awt.event.*;
297.40 +import test.java.awt.regtesthelpers.Util;
297.41 +
297.42 +public class IconifiedFrameFocusChangeTest extends Applet {
297.43 + Frame testFrame = new Frame("Test Frame");
297.44 + Frame otherFrame = new Frame("Other Frame");
297.45 + Button testButton = new Button("test button");
297.46 + Button otherButton = new Button("other button");
297.47 + Robot robot;
297.48 +
297.49 + public static void main(String[] args) {
297.50 + IconifiedFrameFocusChangeTest app = new IconifiedFrameFocusChangeTest();
297.51 + app.init();
297.52 + app.start();
297.53 + }
297.54 +
297.55 + public void init() {
297.56 + robot = Util.createRobot();
297.57 +
297.58 + testFrame.add(testButton);
297.59 + testFrame.pack();
297.60 + otherFrame.add(otherButton);
297.61 + otherFrame.pack();
297.62 + otherFrame.setLocation(200, 0);
297.63 +
297.64 + testButton.addFocusListener(new FocusAdapter() {
297.65 + public void focusLost(FocusEvent e) {
297.66 + testButton.requestFocus();
297.67 + }
297.68 + });
297.69 + }
297.70 +
297.71 + public void start() {
297.72 + otherFrame.setVisible(true);
297.73 + Util.waitForIdle(robot);
297.74 + testFrame.setVisible(true);
297.75 + Util.waitForIdle(robot);
297.76 +
297.77 + if (!testButton.hasFocus()) {
297.78 + throw new TestErrorException("wrong initial focus");
297.79 + }
297.80 +
297.81 + /*
297.82 + * Iconify the Frame. Test that focus switches properly.
297.83 + */
297.84 + Runnable action = new Runnable() {
297.85 + public void run() {
297.86 + testFrame.setExtendedState(Frame.ICONIFIED);
297.87 + }
297.88 + };
297.89 + if (!Util.trackFocusGained(otherButton, action, 2000, true)) {
297.90 + throw new TestFailedException("iconifying focused window didn't trigger focus change");
297.91 + }
297.92 +
297.93 + /*
297.94 + * Test that key events go into the focus owner.
297.95 + */
297.96 + action = new Runnable() {
297.97 + public void run() {
297.98 + robot.keyPress(KeyEvent.VK_SPACE);
297.99 + robot.delay(50);
297.100 + robot.keyRelease(KeyEvent.VK_SPACE);
297.101 + }
297.102 + };
297.103 + if (!Util.trackActionPerformed(otherButton, action, 2000, true)) {
297.104 + throw new TestFailedException("Java focus owner doesn't match to the native one");
297.105 + }
297.106 +
297.107 + System.out.println("Test passed.");
297.108 + }
297.109 +}
297.110 +
297.111 +/**
297.112 + * Thrown when the behavior being verified is found wrong.
297.113 + */
297.114 +class TestFailedException extends RuntimeException {
297.115 + TestFailedException(String msg) {
297.116 + super("Test failed: " + msg);
297.117 + }
297.118 +}
297.119 +
297.120 +/**
297.121 + * Thrown when an error not related to the behavior being verified is encountered.
297.122 + */
297.123 +class TestErrorException extends RuntimeException {
297.124 + TestErrorException(String msg) {
297.125 + super("Unexpected error: " + msg);
297.126 + }
297.127 +}
298.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
298.2 +++ b/test/java/awt/Focus/NonFocusableWindowTest/NoEventsTest.java Fri May 16 12:25:57 2008 -0700
298.3 @@ -0,0 +1,420 @@
298.4 +/*
298.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
298.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
298.7 + *
298.8 + * This code is free software; you can redistribute it and/or modify it
298.9 + * under the terms of the GNU General Public License version 2 only, as
298.10 + * published by the Free Software Foundation.
298.11 + *
298.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
298.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
298.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
298.15 + * version 2 for more details (a copy is included in the LICENSE file that
298.16 + * accompanied this code).
298.17 + *
298.18 + * You should have received a copy of the GNU General Public License version
298.19 + * 2 along with this work; if not, write to the Free Software Foundation,
298.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
298.21 + *
298.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
298.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
298.24 + * have any questions.
298.25 + */
298.26 +
298.27 +/*
298.28 + @test
298.29 + @bug 4452384
298.30 + @summary Tests that non-focusable windows doesn't generate any focus events when accessed.
298.31 + @author Denis.Mikhalkin: area=awt.focus
298.32 + @run main NoEventsTest
298.33 +*/
298.34 +
298.35 +import java.awt.*;
298.36 +import java.awt.event.*;
298.37 +import java.util.*;
298.38 +
298.39 +public class NoEventsTest extends Frame {
298.40 + public static final int DEF_WIDTH = 400,
298.41 + DEF_HEIGHT = 300,
298.42 + DEF_TOP = 1,
298.43 + DEF_LEFT = 100,
298.44 + DEF_ROW = 0,
298.45 + DEF_COL = 0;
298.46 + static boolean automatic = true;
298.47 + static Window[] windows;
298.48 + static Frame main_frame, jumpingFrame;
298.49 + static Button focus_button;
298.50 + static Robot robot;
298.51 + static void pause(int timeout) {
298.52 + Toolkit.getDefaultToolkit().sync();
298.53 + robot.waitForIdle();
298.54 + robot.delay(100);
298.55 + }
298.56 + static GlobalListener listener;
298.57 + public static void main(String[] args) {
298.58 +
298.59 + listener = new GlobalListener();
298.60 + Toolkit.getDefaultToolkit().addAWTEventListener(listener,
298.61 + AWTEvent.FOCUS_EVENT_MASK |
298.62 + AWTEvent.WINDOW_EVENT_MASK);
298.63 + try{
298.64 + robot = new Robot();
298.65 + } catch(Exception e) {}
298.66 + // Create several pairs - focusable Frame with focusable component(button) and non-focusable:
298.67 + // window, resizable frame, non-resizable frame, dialog, non-resiable dialog
298.68 + main_frame = new Frame("focusable frame");
298.69 + focus_button = new Button("button to focus");
298.70 + main_frame.add(focus_button);
298.71 + main_frame.pack();
298.72 + main_frame.setVisible(true);
298.73 + main_frame.setLocation(10, 600);
298.74 + main_frame.addWindowListener(new WindowAdapter() {
298.75 + public void windowClosing(WindowEvent e) {
298.76 + listener.report();
298.77 + System.exit(0);
298.78 + }
298.79 + });
298.80 +
298.81 + jumpingFrame = new Frame("Jumping frame");
298.82 + jumpingFrame.setBounds(DEF_LEFT, DEF_TOP, DEF_WIDTH, DEF_HEIGHT);
298.83 +
298.84 + windows = new Window[7];
298.85 + windows[0] = new TestWindow(0, 0, false, main_frame);
298.86 + //windows[1] = new TestWindow(2, 1, true, main_frame);
298.87 + windows[2] = new NoEventsTest(1, 0, false, true);
298.88 + windows[3] = new NoEventsTest(2, 0, false, false);
298.89 + //windows[4] = new Test(3, 0, true, true);
298.90 + windows[5] = new TestDialog(0, 1, false, true, main_frame);
298.91 + windows[6] = new TestDialog(1, 1, false, false, main_frame);
298.92 + if (!automatic) {
298.93 + int windowInd;
298.94 + for (windowInd = 0; windowInd < windows.length; windowInd++) {
298.95 + if (windows[windowInd] != null) {
298.96 + windows[windowInd].setVisible(true);
298.97 + }
298.98 + }
298.99 + }
298.100 + // Run the test
298.101 + // 1. Click on all controls, check for no focus events for non-focusable, right focus events for focusable
298.102 + // 2. Perform some action with control, check if it works
298.103 + if (automatic) {
298.104 + int windowInd;
298.105 + for (windowInd = 0; windowInd < windows.length; windowInd++) {
298.106 + if (windows[windowInd] != null) {
298.107 + windows[windowInd].setVisible(true);
298.108 + focus_button.requestFocus();
298.109 + pause(1000);
298.110 +
298.111 + // Verify that click on non-focusable window causes no focus lost on active window
298.112 + performFocusClick(windows[windowInd]);
298.113 + focus_button.requestFocus();
298.114 + pause(500);
298.115 + performActionClick(windows[windowInd]);
298.116 +
298.117 + // Verify that toFront, toBack doesn't cause non-focusable window to become active
298.118 + jumpingFrame.setVisible(true);
298.119 + pause(1000);
298.120 + jumpingFrame.toBack();
298.121 + pause(500);
298.122 + jumpingFrame.toFront();
298.123 + pause(500);
298.124 + windows[windowInd].toBack();
298.125 + pause(500);
298.126 + windows[windowInd].toFront();
298.127 + pause(500);
298.128 +
298.129 + // Verify that iconifiyng/deiconfiying and
298.130 + // zooming/unzooming doesn't cause non-focusable
298.131 + // window to become active
298.132 + if (windows[windowInd] instanceof Frame) {
298.133 + Frame toTest = (Frame)windows[windowInd];
298.134 + // Deiconification currently doesn't work!
298.135 +// toTest.setExtendedState(Frame.ICONIFIED);
298.136 +// pause(500);
298.137 +// toTest.setExtendedState(Frame.NORMAL);
298.138 + pause(500);
298.139 + toTest.setExtendedState(Frame.MAXIMIZED_BOTH);
298.140 + pause(500);
298.141 + toTest.setExtendedState(Frame.NORMAL);
298.142 + }
298.143 +
298.144 + windows[windowInd].dispose();
298.145 + jumpingFrame.dispose();
298.146 + }
298.147 + }
298.148 + pause(1000);
298.149 + System.err.println("Test finished.");
298.150 + if (!listener.report()) {
298.151 + throw new RuntimeException("Test Failed. See error stream output for details");
298.152 + }
298.153 + }
298.154 + }
298.155 + static void performFocusClick(Window parent) {
298.156 + if (parent == null) {
298.157 + return;
298.158 + }
298.159 + for (int compInd = 0; compInd < parent.getComponentCount(); compInd++) {
298.160 + Component child = parent.getComponent(compInd);
298.161 + if (child instanceof TestPanel) {
298.162 + TestPanel pan = (TestPanel)child;
298.163 + pan.performFocusClicks(robot);
298.164 + pause(100);
298.165 + }
298.166 + }
298.167 + }
298.168 + static void performActionClick(Window parent) {
298.169 + if (parent == null) {
298.170 + return;
298.171 + }
298.172 + for (int compInd = 0; compInd < parent.getComponentCount(); compInd++) {
298.173 + Component child = parent.getComponent(compInd);
298.174 + if (child instanceof TestPanel) {
298.175 + TestPanel pan = (TestPanel)child;
298.176 + pan.performActionClicks(robot);
298.177 + pause(100);
298.178 + }
298.179 + }
298.180 + }
298.181 + public NoEventsTest(int row, int col, boolean focusable, boolean resizable) {
298.182 + super("Frame" + row + "" + col);
298.183 + TestPanel panel = new TestPanel(row, col);
298.184 + if (NoEventsTest.automatic) {
298.185 + row = NoEventsTest.DEF_ROW;
298.186 + col = NoEventsTest.DEF_COL;
298.187 + }
298.188 + setName(getTitle());
298.189 + add("Center", panel);
298.190 + Label l = new Label(getClass().getSuperclass().getName() + ", " + (focusable?"focusable":"non-focusable") +
298.191 + ", " + (resizable?"resizable":"non-resizable"));
298.192 + l.setBackground(Color.green);
298.193 + add("North", l);
298.194 + setBounds(NoEventsTest.DEF_LEFT + DEF_WIDTH*col, DEF_TOP + DEF_HEIGHT*row, DEF_WIDTH, DEF_HEIGHT);
298.195 + if (!focusable) {
298.196 + setFocusableWindowState(false);
298.197 + }
298.198 + if (!resizable) {
298.199 + setResizable(false);
298.200 + }
298.201 +// setVisible(true);
298.202 + }
298.203 +}
298.204 +class TestWindow extends Window {
298.205 + public TestWindow(int row, int col, boolean focusable, Frame owner) {
298.206 + super(owner);
298.207 + setName("Window" + row + "" + col);
298.208 + TestPanel panel = new TestPanel(row, col);
298.209 + if (NoEventsTest.automatic) {
298.210 + row = NoEventsTest.DEF_ROW;
298.211 + col = NoEventsTest.DEF_COL;
298.212 + }
298.213 +
298.214 + add("Center", panel);
298.215 + Label l = new Label(getClass().getSuperclass().getName() + ", " + (focusable?"focusable":"non-focusable") +
298.216 + ", " + (false?"resizable":"non-resizable"));
298.217 + l.setBackground(Color.green);
298.218 + add("North", l);
298.219 +
298.220 + setBounds(NoEventsTest.DEF_LEFT + NoEventsTest.DEF_WIDTH*col, NoEventsTest.DEF_TOP + NoEventsTest.DEF_HEIGHT*row, NoEventsTest.DEF_WIDTH, NoEventsTest.DEF_HEIGHT);
298.221 + if (!focusable) {
298.222 + setFocusableWindowState(false);
298.223 + }
298.224 +// setVisible(true);
298.225 + }
298.226 +}
298.227 +class TestDialog extends Dialog {
298.228 + public TestDialog(int row, int col, boolean focusable, boolean resizable, Frame owner) {
298.229 + super(owner);
298.230 + setName("Dialog" + row + "" + col);
298.231 + TestPanel panel = new TestPanel(row, col);
298.232 + if (NoEventsTest.automatic) {
298.233 + row = NoEventsTest.DEF_ROW;
298.234 + col = NoEventsTest.DEF_COL;
298.235 + }
298.236 +
298.237 + add("Center", panel);
298.238 + Label l = new Label(getClass().getSuperclass().getName() + ", " + (focusable?"focusable":"non-focusable") +
298.239 + ", " + (resizable?"resizable":"non-resizable"));
298.240 + l.setBackground(Color.green);
298.241 + add("North", l);
298.242 +
298.243 + setBounds(NoEventsTest.DEF_LEFT + NoEventsTest.DEF_WIDTH*col, NoEventsTest.DEF_TOP + NoEventsTest.DEF_HEIGHT*row, NoEventsTest.DEF_WIDTH, NoEventsTest.DEF_HEIGHT);
298.244 + if (!focusable) {
298.245 + setFocusableWindowState(false);
298.246 + }
298.247 + if (!resizable) {
298.248 + setResizable(false);
298.249 + }
298.250 +// setVisible(true);
298.251 + }
298.252 +}
298.253 +
298.254 +class TestPanel extends Panel {
298.255 +
298.256 + void clickComponent(Component comp, Robot robot) {
298.257 + if (comp instanceof Choice) {
298.258 + return;
298.259 + }
298.260 + Point compLoc = comp.getLocationOnScreen();
298.261 + Dimension size = comp.getSize();
298.262 + robot.mouseMove(compLoc.x + size.width/2, compLoc.y + size.height/2);
298.263 + robot.mousePress(InputEvent.BUTTON1_MASK);
298.264 + robot.mouseRelease(InputEvent.BUTTON1_MASK);
298.265 + }
298.266 + void performFocusClicks(Robot robot) {
298.267 + for (int childInd = 0; childInd < getComponentCount(); childInd++) {
298.268 + performFocusClick(getComponent(childInd), robot);
298.269 + }
298.270 + }
298.271 + void performFocusClick(Component comp, Robot robot) {
298.272 + clickComponent(comp, robot);
298.273 + }
298.274 +
298.275 + void performActionClicks(Robot robot) {
298.276 + for (int childInd = 0; childInd < getComponentCount(); childInd++) {
298.277 + performActionClick(getComponent(childInd), robot);
298.278 + }
298.279 + }
298.280 + void performActionClick(Component comp, Robot robot) {
298.281 + }
298.282 +
298.283 + public TestPanel(int row, int col) {
298.284 + setLayout(new FlowLayout());
298.285 + Button b;
298.286 + add(b = new Button("press"+ row + "" + col));
298.287 + b.setName(b.getLabel());
298.288 +// b.addMouseListener(new MouseAdapter() {
298.289 +// public void mousePressed(MouseEvent e) {
298.290 +// System.err.println(e);
298.291 +// }
298.292 +// });
298.293 + TextField t;
298.294 + add(t = new TextField("text" + row + "" + col));
298.295 + t.setName(t.getText());
298.296 +
298.297 + java.awt.List list = new java.awt.List();
298.298 + add(list);
298.299 + list.setName("list");
298.300 + list.add("one");
298.301 + list.add("two");
298.302 + list.add("three");
298.303 + list.setMultipleMode(true);
298.304 + list.setName("list" + row + "" + col);
298.305 +
298.306 + Checkbox check = new Checkbox("checker");
298.307 + add(check);
298.308 + check.setName("check" + row + "" + col);
298.309 +
298.310 + Choice choice = new Choice();
298.311 + choice.add("one");
298.312 + choice.add("two");
298.313 + choice.add("three");
298.314 + add(choice);
298.315 + choice.setName("choice" + row + "" + col);
298.316 +
298.317 + Canvas can = new Canvas() {
298.318 + public Dimension getPreferredSize() {
298.319 + return new Dimension(10, 10);
298.320 + }
298.321 + };
298.322 + can.setBackground(Color.blue);
298.323 + add(can);
298.324 + can.setName("canvas" + row + "" + col);
298.325 +
298.326 + TextArea ta = new TextArea("text\ntttt\naaaa\nwwwww\nqqqqqq\neeeeee\nrrrrrr\nyyyyyy\nuuuuu", 3, 5);
298.327 + add(ta);
298.328 + ta.setName("textarea" + row + "" + col);
298.329 +
298.330 + Scrollbar bar = new Scrollbar(Scrollbar.HORIZONTAL);
298.331 + add(bar);
298.332 + bar.setName("scrollbar" + row + "" + col);
298.333 +
298.334 + CheckboxGroup group = new CheckboxGroup();
298.335 + Checkbox ch1 = new Checkbox("one", group, true);
298.336 + Checkbox ch2 = new Checkbox("two", group, false);
298.337 + add(ch1);
298.338 + add(ch2);
298.339 + ch1.setName("checkbox1 " + row + "" + col);
298.340 + ch2.setName("checkbox2 " + row + "" + col);
298.341 +
298.342 +
298.343 + ScrollPane pane = new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS);
298.344 + add(pane);
298.345 + Button bigButton = new Button("abc") {
298.346 + public Dimension getPreferredSize() {
298.347 + return new Dimension(100, 100);
298.348 + }
298.349 + };
298.350 + pane.add(bigButton);
298.351 + bigButton.setName("bigbutton" + row + "" + col);
298.352 + }
298.353 +}
298.354 +
298.355 +class GlobalListener implements AWTEventListener {
298.356 + java.util.List errors = new java.util.LinkedList();
298.357 + public boolean report() {
298.358 + if (errors.size() != 0) {
298.359 + System.err.println("Test FAILED");
298.360 + } else {
298.361 + System.err.println("Test PASSED");
298.362 + return true;
298.363 + }
298.364 + ListIterator iter = errors.listIterator();
298.365 + while (iter.hasNext()) {
298.366 + System.err.println(iter.next());
298.367 + }
298.368 + return false;
298.369 + }
298.370 + public GlobalListener() {
298.371 + }
298.372 + Window getWindowParent(Component comp) {
298.373 + while (comp != null && !(comp instanceof Window)) {
298.374 + comp = comp.getParent();
298.375 + }
298.376 + return (Window)comp;
298.377 + }
298.378 + void reportError(AWTEvent e, String message) {
298.379 + String error = "ERROR: " + message + " : " + e;
298.380 + errors.add(error);
298.381 + System.err.println(error);
298.382 + }
298.383 + public void eventDispatched(AWTEvent e) {
298.384 + Component comp = (Component)e.getSource();
298.385 + Window parent = getWindowParent(comp);
298.386 + if (!(e instanceof WindowEvent || e instanceof FocusEvent)) {
298.387 + System.err.println("Strange event " + e);
298.388 + }
298.389 +
298.390 + // Skip WINDOW_OPENED
298.391 + if (e.getID() == WindowEvent.WINDOW_CLOSING) {
298.392 + System.err.println(e);
298.393 + }
298.394 + switch (e.getID()) {
298.395 + case WindowEvent.WINDOW_OPENED:
298.396 + case WindowEvent.WINDOW_CLOSING:
298.397 + case WindowEvent.WINDOW_CLOSED:
298.398 + case WindowEvent.WINDOW_ICONIFIED:
298.399 + case WindowEvent.WINDOW_DEICONIFIED:
298.400 + case WindowEvent.WINDOW_STATE_CHANGED:
298.401 + return;
298.402 + case WindowEvent.WINDOW_LOST_FOCUS: {
298.403 + WindowEvent we = (WindowEvent)e;
298.404 + if (we.getOppositeWindow() != null && !we.getOppositeWindow().getFocusableWindowState()) {
298.405 + reportError(e, "frame lost focus because of non-focusable window");
298.406 + }
298.407 + break;
298.408 + }
298.409 + }
298.410 + // Check that Window owner is focusable
298.411 + if (!parent.getFocusableWindowState()) {
298.412 + reportError(e, "focus event for component in non-focusable window " + parent.getName());
298.413 + }
298.414 + if (!comp.isFocusable()) {
298.415 + reportError(e, "focus event for non-focusable component");
298.416 + }
298.417 +// if (e instanceof WindowEvent || e instanceof FocusEvent) {
298.418 +// // System.err.println(e);
298.419 +// }
298.420 + }
298.421 +}
298.422 +
298.423 +
299.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
299.2 +++ b/test/java/awt/Focus/NonFocusableWindowTest/NonfocusableOwnerTest.java Fri May 16 12:25:57 2008 -0700
299.3 @@ -0,0 +1,159 @@
299.4 +/*
299.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
299.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
299.7 + *
299.8 + * This code is free software; you can redistribute it and/or modify it
299.9 + * under the terms of the GNU General Public License version 2 only, as
299.10 + * published by the Free Software Foundation.
299.11 + *
299.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
299.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
299.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
299.15 + * version 2 for more details (a copy is included in the LICENSE file that
299.16 + * accompanied this code).
299.17 + *
299.18 + * You should have received a copy of the GNU General Public License version
299.19 + * 2 along with this work; if not, write to the Free Software Foundation,
299.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
299.21 + *
299.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
299.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
299.24 + * have any questions.
299.25 + */
299.26 +
299.27 +/*
299.28 + @test
299.29 + @bug 6182359
299.30 + @summary Tests that Window having non-focusable owner can't be a focus owner.
299.31 + @author Anton.Tarasov: area=awt.focus
299.32 + @library ../../regtesthelpers
299.33 + @build Util
299.34 + @run main NonfocusableOwnerTest
299.35 +*/
299.36 +
299.37 +import java.awt.*;
299.38 +import java.awt.event.*;
299.39 +import java.applet.Applet;
299.40 +import java.lang.reflect.*;
299.41 +import java.io.*;
299.42 +import test.java.awt.regtesthelpers.Util;
299.43 +
299.44 +public class NonfocusableOwnerTest extends Applet {
299.45 + Robot robot = Util.createRobot();
299.46 + Frame frame;
299.47 + Dialog dialog;
299.48 + Window window1;
299.49 + Window window2;
299.50 + Button button = new Button("button");
299.51 +
299.52 + public static void main(String[] args) {
299.53 + NonfocusableOwnerTest test = new NonfocusableOwnerTest();
299.54 + test.start();
299.55 + }
299.56 +
299.57 + public void start() {
299.58 + Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() {
299.59 + public void eventDispatched(AWTEvent e) {
299.60 + System.out.println(e.toString());
299.61 + }
299.62 + }, FocusEvent.FOCUS_EVENT_MASK | WindowEvent.WINDOW_FOCUS_EVENT_MASK | WindowEvent.WINDOW_EVENT_MASK);
299.63 +
299.64 + frame = new Frame("Frame");
299.65 + frame.setName("Frame-owner");
299.66 + frame.setBounds(100, 0, 100, 100);
299.67 + dialog = new Dialog(frame, "Dialog");
299.68 + dialog.setName("Dialog-owner");
299.69 + dialog.setBounds(100, 0, 100, 100);
299.70 +
299.71 + window1 = new Window(frame);
299.72 + window1.setName("1st child");
299.73 + window1.setBounds(100, 300, 100, 100);
299.74 + window2 = new Window(window1);
299.75 + window2.setName("2nd child");
299.76 + window2.setBounds(100, 500, 100, 100);
299.77 +
299.78 + test1(frame, window1);
299.79 + test2(frame, window1, window2);
299.80 + test3(frame, window1, window2);
299.81 +
299.82 + window1 = new Window(dialog);
299.83 + window1.setBounds(100, 300, 100, 100);
299.84 + window1.setName("1st child");
299.85 + window2 = new Window(window1);
299.86 + window2.setName("2nd child");
299.87 + window2.setBounds(100, 500, 100, 100);
299.88 +
299.89 + test1(dialog, window1);
299.90 + test2(dialog, window1, window2);
299.91 + test3(dialog, window1, window2);
299.92 +
299.93 + System.out.println("Test passed.");
299.94 + }
299.95 +
299.96 + void test1(Window owner, Window child) {
299.97 + System.out.println("* * * STAGE 1 * * *\nWindow owner: " + owner);
299.98 +
299.99 + owner.setFocusableWindowState(false);
299.100 + owner.setVisible(true);
299.101 +
299.102 + child.add(button);
299.103 + child.setVisible(true);
299.104 +
299.105 + Util.waitTillShown(child);
299.106 +
299.107 + Util.clickOnComp(button, robot);
299.108 + if (button == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
299.109 + throw new RuntimeException("Test Failed.");
299.110 + }
299.111 + child.dispose();
299.112 + owner.dispose();
299.113 + }
299.114 +
299.115 + void test2(Window owner, Window child1, Window child2) {
299.116 + System.out.println("* * * STAGE 2 * * *\nWindow nowner: " + owner);
299.117 +
299.118 + owner.setFocusableWindowState(false);
299.119 + owner.setVisible(true);
299.120 +
299.121 + child1.setFocusableWindowState(true);
299.122 + child1.setVisible(true);
299.123 +
299.124 + child2.add(button);
299.125 + child2.setVisible(true);
299.126 +
299.127 + Util.waitTillShown(child2);
299.128 +
299.129 + Util.clickOnComp(button, robot);
299.130 + if (button == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
299.131 + throw new RuntimeException("Test failed.");
299.132 + }
299.133 + child2.dispose();
299.134 + child1.dispose();
299.135 + owner.dispose();
299.136 + }
299.137 +
299.138 + void test3(Window owner, Window child1, Window child2) {
299.139 + System.out.println("* * * STAGE 3 * * *\nWidow owner: " + owner);
299.140 +
299.141 + owner.setFocusableWindowState(true);
299.142 + owner.setVisible(true);
299.143 +
299.144 + child1.setFocusableWindowState(false);
299.145 + child1.setVisible(true);
299.146 +
299.147 + child2.setFocusableWindowState(true);
299.148 + child2.add(button);
299.149 + child2.setVisible(true);
299.150 +
299.151 + Util.waitTillShown(child2);
299.152 +
299.153 + Util.clickOnComp(button, robot);
299.154 + System.err.println("focus owner: " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
299.155 + if (button != KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) {
299.156 + throw new RuntimeException("Test failed.");
299.157 + }
299.158 + child1.dispose();
299.159 + child2.dispose();
299.160 + owner.dispose();
299.161 + }
299.162 +}
300.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
300.2 +++ b/test/java/awt/Focus/TypeAhead/TestFocusFreeze.java Fri May 16 12:25:57 2008 -0700
300.3 @@ -0,0 +1,139 @@
300.4 +/*
300.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
300.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
300.7 + *
300.8 + * This code is free software; you can redistribute it and/or modify it
300.9 + * under the terms of the GNU General Public License version 2 only, as
300.10 + * published by the Free Software Foundation.
300.11 + *
300.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
300.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
300.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
300.15 + * version 2 for more details (a copy is included in the LICENSE file that
300.16 + * accompanied this code).
300.17 + *
300.18 + * You should have received a copy of the GNU General Public License version
300.19 + * 2 along with this work; if not, write to the Free Software Foundation,
300.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
300.21 + *
300.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
300.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
300.24 + * have any questions.
300.25 + */
300.26 +
300.27 +/*
300.28 + @test
300.29 + @bug 6183877 6216005 6225560
300.30 + @library ../../regtesthelpers
300.31 + @build Util
300.32 + @summary Tests that keyboard input doesn't freeze due to type-ahead problems
300.33 + @author Denis.Mikhalkin, Anton.Tarasov: area=awt.focus
300.34 + @run main TestFocusFreeze
300.35 +*/
300.36 +
300.37 +import java.awt.Component;
300.38 +import java.awt.DefaultKeyboardFocusManager;
300.39 +import java.awt.KeyboardFocusManager;
300.40 +import java.awt.Robot;
300.41 +import java.awt.event.ActionEvent;
300.42 +import java.awt.event.ActionListener;
300.43 +import java.awt.event.KeyEvent;
300.44 +import java.util.concurrent.atomic.AtomicBoolean;
300.45 +import javax.swing.JButton;
300.46 +import javax.swing.JDialog;
300.47 +import javax.swing.JFrame;
300.48 +import test.java.awt.regtesthelpers.Util;
300.49 +
300.50 +public class TestFocusFreeze {
300.51 + private static JFrame frame;
300.52 + private static JDialog dialog;
300.53 + private static JButton dlgButton;
300.54 + private static JButton frameButton;
300.55 + private static AtomicBoolean lock = new AtomicBoolean(false);
300.56 + private static Robot robot = Util.createRobot();
300.57 +
300.58 + public static void main(String[] args) {
300.59 + boolean all_passed = true;
300.60 + KeyboardFocusManager testKFM = new TestKFM(robot);
300.61 + KeyboardFocusManager defKFM = KeyboardFocusManager.getCurrentKeyboardFocusManager();
300.62 +
300.63 + for (int i = 0; i < 10; i++) {
300.64 + test(testKFM, defKFM);
300.65 + Util.waitForIdle(robot);
300.66 + System.out.println("Iter " + i + ": " + (lock.get() ? "passed." : "failed!"));
300.67 + if (!lock.get()) {
300.68 + all_passed = false;
300.69 + }
300.70 + }
300.71 + if (!all_passed) {
300.72 + throw new RuntimeException("Test failed: not all iterations passed!");
300.73 + }
300.74 + System.out.println("Test passed.");
300.75 + }
300.76 +
300.77 + public static void test(final KeyboardFocusManager testKFM, final KeyboardFocusManager defKFM) {
300.78 + frame = new JFrame("Frame");
300.79 + dialog = new JDialog(frame, "Dialog", true);
300.80 + dlgButton = new JButton("Dialog_Button");
300.81 + frameButton = new JButton("Frame_Button");
300.82 +
300.83 + lock.set(false);
300.84 +
300.85 + dialog.add(dlgButton);
300.86 + dialog.setLocation(200, 0);
300.87 + dialog.pack();
300.88 + frame.add(frameButton);
300.89 + frame.pack();
300.90 +
300.91 + dlgButton.addActionListener(new ActionListener() {
300.92 + public void actionPerformed(ActionEvent e) {
300.93 + dialog.dispose();
300.94 + frame.dispose();
300.95 + synchronized (lock) {
300.96 + lock.set(true);
300.97 + lock.notifyAll();
300.98 + }
300.99 + }
300.100 + });
300.101 +
300.102 + frameButton.addActionListener(new ActionListener() {
300.103 + public void actionPerformed(ActionEvent e) {
300.104 + // Right before the dialog will be shown, there will be called
300.105 + // enqueuKeyEvents() method. We are to catch it.
300.106 + KeyboardFocusManager.setCurrentKeyboardFocusManager(testKFM);
300.107 + dialog.setVisible(true);
300.108 + KeyboardFocusManager.setCurrentKeyboardFocusManager(defKFM);
300.109 + }
300.110 + });
300.111 +
300.112 + Runnable showAction = new Runnable() {
300.113 + public void run() {
300.114 + frame.setVisible(true);
300.115 + }
300.116 + };
300.117 + if (!Util.trackFocusGained(frameButton, showAction, 2000, false)) {
300.118 + System.out.println("Test error: wrong initial focus!");
300.119 + return;
300.120 + }
300.121 +
300.122 + robot.keyPress(KeyEvent.VK_SPACE);
300.123 + robot.delay(50);
300.124 + robot.keyRelease(KeyEvent.VK_SPACE);
300.125 +
300.126 + Util.waitForCondition(lock, 2000);
300.127 + Util.waitForIdle(robot);
300.128 + }
300.129 +}
300.130 +
300.131 +class TestKFM extends DefaultKeyboardFocusManager {
300.132 + Robot robot;
300.133 + public TestKFM(Robot robot) {
300.134 + this.robot = robot;
300.135 + }
300.136 + protected synchronized void enqueueKeyEvents(long after, Component untilFocused) {
300.137 + super.enqueueKeyEvents(after, untilFocused);
300.138 + robot.keyPress(KeyEvent.VK_SPACE);
300.139 + robot.delay(50);
300.140 + robot.keyRelease(KeyEvent.VK_SPACE);
300.141 + }
300.142 +}
301.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
301.2 +++ b/test/java/awt/Focus/WrongKeyTypedConsumedTest/WrongKeyTypedConsumedTest.java Fri May 16 12:25:57 2008 -0700
301.3 @@ -0,0 +1,129 @@
301.4 +/*
301.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
301.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
301.7 + *
301.8 + * This code is free software; you can redistribute it and/or modify it
301.9 + * under the terms of the GNU General Public License version 2 only, as
301.10 + * published by the Free Software Foundation.
301.11 + *
301.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
301.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
301.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
301.15 + * version 2 for more details (a copy is included in the LICENSE file that
301.16 + * accompanied this code).
301.17 + *
301.18 + * You should have received a copy of the GNU General Public License version
301.19 + * 2 along with this work; if not, write to the Free Software Foundation,
301.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
301.21 + *
301.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
301.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
301.24 + * have any questions.
301.25 + */
301.26 +
301.27 +/*
301.28 + @test
301.29 + @bug 4782886
301.30 + @summary FocusManager consumes wrong KEY_TYPED events
301.31 + @author Oleg.Sukhodolsky: area=awt.focus
301.32 + @library ../../regtesthelpers
301.33 + @build Util
301.34 + @run main WrongKeyTypedConsumedTest
301.35 +*/
301.36 +
301.37 +import java.applet.Applet;
301.38 +import java.awt.AWTException;
301.39 +import java.awt.AWTKeyStroke;
301.40 +import java.awt.BorderLayout;
301.41 +import java.awt.Dialog;
301.42 +import java.awt.Dimension;
301.43 +import java.awt.FlowLayout;
301.44 +import java.awt.Frame;
301.45 +import java.awt.KeyboardFocusManager;
301.46 +import java.awt.Point;
301.47 +import java.awt.Robot;
301.48 +import java.awt.TextArea;
301.49 +
301.50 +import java.awt.event.KeyEvent;
301.51 +
301.52 +import java.util.HashSet;
301.53 +import java.util.Set;
301.54 +
301.55 +import javax.swing.JCheckBox;
301.56 +import javax.swing.JFrame;
301.57 +import javax.swing.JTextArea;
301.58 +
301.59 +import test.java.awt.regtesthelpers.Util;
301.60 +
301.61 +public class WrongKeyTypedConsumedTest extends Applet
301.62 +{
301.63 + Robot robot = Util.createRobot();
301.64 +
301.65 + public static void main(String[] args) {
301.66 + WrongKeyTypedConsumedTest test = new WrongKeyTypedConsumedTest();
301.67 + test.start();
301.68 + }
301.69 +
301.70 + public void start ()
301.71 + {
301.72 + setSize (200,200);
301.73 + setVisible(true);
301.74 + validate();
301.75 +
301.76 + JFrame frame = new JFrame("The Frame");
301.77 + Set ftk = new HashSet();
301.78 + ftk.add(AWTKeyStroke.getAWTKeyStroke(KeyEvent.VK_DOWN, 0));
301.79 + frame.getContentPane().
301.80 + setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS,
301.81 + ftk);
301.82 +
301.83 + JCheckBox checkbox = new JCheckBox("test");
301.84 + frame.getContentPane().add(checkbox, BorderLayout.NORTH);
301.85 +
301.86 + JTextArea textarea = new JTextArea(40, 10);
301.87 + frame.getContentPane().add(textarea);
301.88 +
301.89 + frame.pack();
301.90 + frame.setVisible(true);
301.91 + Util.waitForIdle(robot);
301.92 +
301.93 + if (!frame.isActive()) {
301.94 + throw new RuntimeException("Test Fialed: frame isn't active");
301.95 + }
301.96 +
301.97 + // verify if checkbox has focus
301.98 + if (!checkbox.isFocusOwner()) {
301.99 + checkbox.requestFocusInWindow();
301.100 + Util.waitForIdle(robot);
301.101 + if (!checkbox.isFocusOwner()) {
301.102 + throw new RuntimeException("Test Failed: checkbox doesn't have focus");
301.103 + }
301.104 + }
301.105 +
301.106 + // press VK_DOWN
301.107 + robot.keyPress(KeyEvent.VK_DOWN);
301.108 + robot.delay(50);
301.109 + robot.keyRelease(KeyEvent.VK_DOWN);
301.110 + robot.delay(50);
301.111 +
301.112 + Util.waitForIdle(robot);
301.113 +
301.114 + // verify if text area has focus
301.115 + if (!textarea.isFocusOwner()) {
301.116 + throw new RuntimeException("Test Failed: focus wasn't transfered to text area");
301.117 + }
301.118 + // press '1'
301.119 + robot.keyPress(KeyEvent.VK_1);
301.120 + robot.delay(50);
301.121 + robot.keyRelease(KeyEvent.VK_1);
301.122 + robot.delay(50);
301.123 +
301.124 + Util.waitForIdle(robot);
301.125 +
301.126 + // verify if KEY_TYPED arrived
301.127 + if (!"1".equals(textarea.getText())) {
301.128 + throw new RuntimeException("Test Failed: text area text is \"" + textarea.getText() + "\", not \"1\"");
301.129 + }
301.130 + System.out.println("Test Passed");
301.131 + }
301.132 +}
302.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
302.2 +++ b/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.html Fri May 16 12:25:57 2008 -0700
302.3 @@ -0,0 +1,20 @@
302.4 +<html>
302.5 +<!--
302.6 + @test
302.7 + @bug 6391770
302.8 + @summary Content of the Window should be laid out in the area left after WarningWindow was added.
302.9 + @author Yuri Nesterenko
302.10 + @run applet WindowWithWarningTest.html
302.11 +-->
302.12 +
302.13 + <head>
302.14 + <title>WindowWithWarningTest</title>
302.15 + </head>
302.16 + <pre>
302.17 + This test will run automatically.
302.18 + </pre>
302.19 + <body>
302.20 + <applet code="WindowWithWarningTest.class" width=350 height=300></applet>
302.21 + </body>
302.22 +</html>
302.23 +
303.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
303.2 +++ b/test/java/awt/Insets/WindowWithWarningTest/WindowWithWarningTest.java Fri May 16 12:25:57 2008 -0700
303.3 @@ -0,0 +1,315 @@
303.4 +/*
303.5 + * Copyright 2006-2008 Sun Microsystems, Inc. All Rights Reserved.
303.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
303.7 + *
303.8 + * This code is free software; you can redistribute it and/or modify it
303.9 + * under the terms of the GNU General Public License version 2 only, as
303.10 + * published by the Free Software Foundation.
303.11 + *
303.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
303.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
303.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
303.15 + * version 2 for more details (a copy is included in the LICENSE file that
303.16 + * accompanied this code).
303.17 + *
303.18 + * You should have received a copy of the GNU General Public License version
303.19 + * 2 along with this work; if not, write to the Free Software Foundation,
303.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
303.21 + *
303.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
303.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
303.24 + * have any questions.
303.25 + */
303.26 +
303.27 +
303.28 +/*
303.29 + test
303.30 + @bug 6391770
303.31 + @summary Content of the Window should be laid out in the area left after WarningWindow was added.
303.32 + @author yuri nesterenko: area=
303.33 + @run applet WindowWithWarningTest.html
303.34 +*/
303.35 +
303.36 +// Note there is no @ in front of test above. This is so that the
303.37 +// harness will not mistake this file as a test file. It should
303.38 +// only see the html file as a test file. (the harness runs all
303.39 +// valid test files, so it would run this test twice if this file
303.40 +// were valid as well as the html file.)
303.41 +// Also, note the area= after Your Name in the author tag. Here, you
303.42 +// should put which functional area the test falls in. See the
303.43 +// AWT-core home page -> test areas and/or -> AWT team for a list of
303.44 +// areas.
303.45 +// Note also the 'AutomaticAppletTest.html' in the run tag. This should
303.46 +// be changed to the name of the test.
303.47 +
303.48 +
303.49 +/**
303.50 + * WindowWithWarningTest.java
303.51 + *
303.52 + * summary:
303.53 + */
303.54 +
303.55 +import java.applet.Applet;
303.56 +import java.awt.*;
303.57 +import java.awt.event.*;
303.58 +import javax.swing.*;
303.59 +
303.60 +//Automated tests should run as applet tests if possible because they
303.61 +// get their environments cleaned up, including AWT threads, any
303.62 +// test created threads, and any system resources used by the test
303.63 +// such as file descriptors. (This is normally not a problem as
303.64 +// main tests usually run in a separate VM, however on some platforms
303.65 +// such as the Mac, separate VMs are not possible and non-applet
303.66 +// tests will cause problems). Also, you don't have to worry about
303.67 +// synchronisation stuff in Applet tests they way you do in main
303.68 +// tests...
303.69 +
303.70 +
303.71 +public class WindowWithWarningTest extends Applet
303.72 +{
303.73 + //Declare things used in the test, like buttons and labels here
303.74 + boolean buttonClicked = false;
303.75 + public static final int MAX_COUNT = 100;
303.76 +
303.77 + public void init()
303.78 + {
303.79 + //Create instructions for the user here, as well as set up
303.80 + // the environment -- set the layout manager, add buttons,
303.81 + // etc.
303.82 +
303.83 + this.setLayout (new BorderLayout ());
303.84 +
303.85 + String[] instructions =
303.86 + {
303.87 + "This is an AUTOMATIC test",
303.88 + "simply wait until it is done"
303.89 + };
303.90 + //Sysout.createDialog( );
303.91 + //Sysout.printInstructions( instructions );
303.92 +
303.93 + }//End init()
303.94 + public void start ()
303.95 + {
303.96 + //Get things going. Request focus, set size, et cetera
303.97 + System.setSecurityManager( new SecurityManager() {
303.98 + // deny AWTPermission("showWindowWithoutWarningBanner")
303.99 + public boolean checkTopLevelWindow(Object window) {
303.100 + return false;
303.101 + }
303.102 + });
303.103 + JFrame frame = new JFrame("Window Test");
303.104 + frame.setBounds(50, 50, 200, 200);
303.105 + frame.show();
303.106 +
303.107 + JWindow window = new JWindow( frame );
303.108 + JButton jbutton1 = new JButton( "First" );
303.109 + jbutton1.addMouseListener( new MouseAdapter() {
303.110 + public void mousePressed( MouseEvent me ) {
303.111 + buttonClicked = true;
303.112 + }
303.113 + });
303.114 + JButton jbutton2 = new JButton( "Second" );
303.115 + window.setLocation( 300, 300 );
303.116 +
303.117 + window.add("North", jbutton1);
303.118 + window.add("South", jbutton2);
303.119 +
303.120 + window.pack();
303.121 + window.show();
303.122 + //wait for frame to show:
303.123 + getLocation( frame );
303.124 + window.toFront();
303.125 +
303.126 + Dimension size0 = window.getSize();
303.127 + Dimension size1 = null;
303.128 + try {
303.129 + Robot robot = new Robot();
303.130 +
303.131 + robot.delay(500);
303.132 + window.pack();
303.133 + robot.delay(500);
303.134 + window.pack();
303.135 + // size1 must be the same as size0
303.136 + size1 = window.getSize();
303.137 + robot.delay(500);
303.138 + Point pt = jbutton1.getLocationOnScreen();
303.139 + robot.mouseMove((int) jbutton1.getLocationOnScreen().x + jbutton1.getWidth() / 2,
303.140 + (int) jbutton1.getLocationOnScreen().y + jbutton1.getHeight() / 2);
303.141 + robot.delay(500);
303.142 + robot.mousePress(MouseEvent.BUTTON1_MASK);
303.143 + robot.delay(100);
303.144 + robot.mouseRelease(MouseEvent.BUTTON1_MASK);
303.145 + robot.delay(2000);
303.146 + }catch(Exception e) {
303.147 + throw new RuntimeException( "Exception "+e );
303.148 + }
303.149 + if( !size0.equals(size1) ) {
303.150 + throw new RuntimeException( "Wrong Window size after multiple pack()s");
303.151 + }
303.152 + if( !buttonClicked ) {
303.153 + throw new RuntimeException( "Button was not clicked");
303.154 + }
303.155 + window.dispose();
303.156 + frame.dispose();
303.157 +
303.158 + System.out.println("Test Passed.");
303.159 + }// start()
303.160 + public static Point getLocation( Component co ) throws RuntimeException {
303.161 + Point pt = null;
303.162 + boolean bFound = false;
303.163 + int count = 0;
303.164 + while( !bFound ) {
303.165 + try {
303.166 + pt = co.getLocationOnScreen();
303.167 + bFound = true;
303.168 + }catch( Exception ex ) {
303.169 + bFound = false;
303.170 + count++;
303.171 + }
303.172 + if( !bFound && count > MAX_COUNT ) {
303.173 + throw new RuntimeException("don't see a component to get location");
303.174 + }
303.175 + }
303.176 + return pt;
303.177 + }
303.178 +
303.179 +
303.180 +}// class AutomaticAppletTest
303.181 +
303.182 +
303.183 +/****************************************************
303.184 + Standard Test Machinery
303.185 + DO NOT modify anything below -- it's a standard
303.186 + chunk of code whose purpose is to make user
303.187 + interaction uniform, and thereby make it simpler
303.188 + to read and understand someone else's test.
303.189 + ****************************************************/
303.190 +
303.191 +/**
303.192 + This is part of the standard test machinery.
303.193 + It creates a dialog (with the instructions), and is the interface
303.194 + for sending text messages to the user.
303.195 + To print the instructions, send an array of strings to Sysout.createDialog
303.196 + WithInstructions method. Put one line of instructions per array entry.
303.197 + To display a message for the tester to see, simply call Sysout.println
303.198 + with the string to be displayed.
303.199 + This mimics System.out.println but works within the test harness as well
303.200 + as standalone.
303.201 + */
303.202 +
303.203 +class Sysout
303.204 +{
303.205 + private static TestDialog dialog;
303.206 +
303.207 + public static void createDialogWithInstructions( String[] instructions )
303.208 + {
303.209 + dialog = new TestDialog( new Frame(), "Instructions" );
303.210 + dialog.printInstructions( instructions );
303.211 + dialog.setVisible(true);
303.212 + println( "Any messages for the tester will display here." );
303.213 + }
303.214 +
303.215 + public static void createDialog( )
303.216 + {
303.217 + dialog = new TestDialog( new Frame(), "Instructions" );
303.218 + String[] defInstr = { "Instructions will appear here. ", "" } ;
303.219 + dialog.printInstructions( defInstr );
303.220 + dialog.setVisible(true);
303.221 + println( "Any messages for the tester will display here." );
303.222 + }
303.223 +
303.224 +
303.225 + public static void printInstructions( String[] instructions )
303.226 + {
303.227 + dialog.printInstructions( instructions );
303.228 + }
303.229 +
303.230 +
303.231 + public static void println( String messageIn )
303.232 + {
303.233 + dialog.displayMessage( messageIn );
303.234 + }
303.235 +
303.236 +}// Sysout class
303.237 +
303.238 +/**
303.239 + This is part of the standard test machinery. It provides a place for the
303.240 + test instructions to be displayed, and a place for interactive messages
303.241 + to the user to be displayed.
303.242 + To have the test instructions displayed, see Sysout.
303.243 + To have a message to the user be displayed, see Sysout.
303.244 + Do not call anything in this dialog directly.
303.245 + */
303.246 +class TestDialog extends Dialog
303.247 +{
303.248 +
303.249 + TextArea instructionsText;
303.250 + TextArea messageText;
303.251 + int maxStringLength = 80;
303.252 +
303.253 + //DO NOT call this directly, go through Sysout
303.254 + public TestDialog( Frame frame, String name )
303.255 + {
303.256 + super( frame, name );
303.257 + int scrollBoth = TextArea.SCROLLBARS_BOTH;
303.258 + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
303.259 + add( "North", instructionsText );
303.260 +
303.261 + messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
303.262 + add("Center", messageText);
303.263 +
303.264 + pack();
303.265 +
303.266 + show();
303.267 + }// TestDialog()
303.268 +
303.269 + //DO NOT call this directly, go through Sysout
303.270 + public void printInstructions( String[] instructions )
303.271 + {
303.272 + //Clear out any current instructions
303.273 + instructionsText.setText( "" );
303.274 +
303.275 + //Go down array of instruction strings
303.276 +
303.277 + String printStr, remainingStr;
303.278 + for( int i=0; i < instructions.length; i++ )
303.279 + {
303.280 + //chop up each into pieces maxSringLength long
303.281 + remainingStr = instructions[ i ];
303.282 + while( remainingStr.length() > 0 )
303.283 + {
303.284 + //if longer than max then chop off first max chars to print
303.285 + if( remainingStr.length() >= maxStringLength )
303.286 + {
303.287 + //Try to chop on a word boundary
303.288 + int posOfSpace = remainingStr.
303.289 + lastIndexOf( ' ', maxStringLength - 1 );
303.290 +
303.291 + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
303.292 +
303.293 + printStr = remainingStr.substring( 0, posOfSpace + 1 );
303.294 + remainingStr = remainingStr.substring( posOfSpace + 1 );
303.295 + }
303.296 + //else just print
303.297 + else
303.298 + {
303.299 + printStr = remainingStr;
303.300 + remainingStr = "";
303.301 + }
303.302 +
303.303 + instructionsText.append( printStr + "\n" );
303.304 +
303.305 + }// while
303.306 +
303.307 + }// for
303.308 +
303.309 + }//printInstructions()
303.310 +
303.311 + //DO NOT call this directly, go through Sysout
303.312 + public void displayMessage( String messageIn )
303.313 + {
303.314 + messageText.append( messageIn + "\n" );
303.315 + System.out.println(messageIn);
303.316 + }
303.317 +
303.318 +}// TestDialog class
304.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
304.2 +++ b/test/java/awt/List/ListFlickers/ListFlickers.java Fri May 16 12:25:57 2008 -0700
304.3 @@ -0,0 +1,402 @@
304.4 +/*
304.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
304.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
304.7 + *
304.8 + * This code is free software; you can redistribute it and/or modify it
304.9 + * under the terms of the GNU General Public License version 2 only, as
304.10 + * published by the Free Software Foundation.
304.11 + *
304.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
304.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
304.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
304.15 + * version 2 for more details (a copy is included in the LICENSE file that
304.16 + * accompanied this code).
304.17 + *
304.18 + * You should have received a copy of the GNU General Public License version
304.19 + * 2 along with this work; if not, write to the Free Software Foundation,
304.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
304.21 + *
304.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
304.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
304.24 + * have any questions.
304.25 + */
304.26 +
304.27 +/*
304.28 + @test
304.29 + @bug 6471693
304.30 + @summary Moving the vertical scroll bar of List leads flickering.
304.31 + @author Dmitry Cherepanov area=awt.list
304.32 + @run main/manual ListFlickers
304.33 +*/
304.34 +
304.35 +import java.awt.*;
304.36 +import java.awt.event.*;
304.37 +
304.38 +public class ListFlickers
304.39 +{
304.40 +
304.41 + //*** test-writer defined static variables go here ***
304.42 +
304.43 +
304.44 + private static void init()
304.45 + {
304.46 + //*** Create instructions for the user here ***
304.47 +
304.48 + String[] instructions =
304.49 + {
304.50 + "drag the scrollbar of the list up and down,",
304.51 + "if the list flickers then the test fails,",
304.52 + "otherwise it passes."
304.53 + };
304.54 + Sysout.createDialog( );
304.55 + Sysout.printInstructions( instructions );
304.56 +
304.57 +
304.58 + Frame f = new Frame();
304.59 + List list = new List(10, false);
304.60 + for (int i = 0; i < 100; i++) {
304.61 + list.add(" item "+i);
304.62 + }
304.63 + f.add(list);
304.64 + f.setBounds(100,100,300,300);
304.65 + f.setVisible(true);
304.66 +
304.67 + }//End init()
304.68 +
304.69 +
304.70 +
304.71 + /*****************************************************
304.72 + * Standard Test Machinery Section
304.73 + * DO NOT modify anything in this section -- it's a
304.74 + * standard chunk of code which has all of the
304.75 + * synchronisation necessary for the test harness.
304.76 + * By keeping it the same in all tests, it is easier
304.77 + * to read and understand someone else's test, as
304.78 + * well as insuring that all tests behave correctly
304.79 + * with the test harness.
304.80 + * There is a section following this for test-defined
304.81 + * classes
304.82 + ******************************************************/
304.83 + private static boolean theTestPassed = false;
304.84 + private static boolean testGeneratedInterrupt = false;
304.85 + private static String failureMessage = "";
304.86 +
304.87 + private static Thread mainThread = null;
304.88 +
304.89 + private static int sleepTime = 300000;
304.90 +
304.91 + public static void main( String args[] ) throws InterruptedException
304.92 + {
304.93 + mainThread = Thread.currentThread();
304.94 + try
304.95 + {
304.96 + init();
304.97 + }
304.98 + catch( TestPassedException e )
304.99 + {
304.100 + //The test passed, so just return from main and harness will
304.101 + // interepret this return as a pass
304.102 + return;
304.103 + }
304.104 + //At this point, neither test passed nor test failed has been
304.105 + // called -- either would have thrown an exception and ended the
304.106 + // test, so we know we have multiple threads.
304.107 +
304.108 + //Test involves other threads, so sleep and wait for them to
304.109 + // called pass() or fail()
304.110 + try
304.111 + {
304.112 + Thread.sleep( sleepTime );
304.113 + //Timed out, so fail the test
304.114 + throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
304.115 + }
304.116 + catch (InterruptedException e)
304.117 + {
304.118 + if( ! testGeneratedInterrupt ) throw e;
304.119 +
304.120 + //reset flag in case hit this code more than once for some reason (just safety)
304.121 + testGeneratedInterrupt = false;
304.122 + if ( theTestPassed == false )
304.123 + {
304.124 + throw new RuntimeException( failureMessage );
304.125 + }
304.126 + }
304.127 +
304.128 + }//main
304.129 +
304.130 + public static synchronized void setTimeoutTo( int seconds )
304.131 + {
304.132 + sleepTime = seconds * 1000;
304.133 + }
304.134 +
304.135 + public static synchronized void pass()
304.136 + {
304.137 + Sysout.println( "The test passed." );
304.138 + Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
304.139 + //first check if this is executing in main thread
304.140 + if ( mainThread == Thread.currentThread() )
304.141 + {
304.142 + //Still in the main thread, so set the flag just for kicks,
304.143 + // and throw a test passed exception which will be caught
304.144 + // and end the test.
304.145 + theTestPassed = true;
304.146 + throw new TestPassedException();
304.147 + }
304.148 + //pass was called from a different thread, so set the flag and interrupt
304.149 + // the main thead.
304.150 + theTestPassed = true;
304.151 + testGeneratedInterrupt = true;
304.152 + if (mainThread != null){
304.153 + mainThread.interrupt();
304.154 + }
304.155 + }//pass()
304.156 +
304.157 + public static synchronized void fail()
304.158 + {
304.159 + //test writer didn't specify why test failed, so give generic
304.160 + fail( "it just plain failed! :-)" );
304.161 + }
304.162 +
304.163 + public static synchronized void fail( String whyFailed )
304.164 + {
304.165 + Sysout.println( "The test failed: " + whyFailed );
304.166 + Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
304.167 + //check if this called from main thread
304.168 + if ( mainThread == Thread.currentThread() )
304.169 + {
304.170 + //If main thread, fail now 'cause not sleeping
304.171 + throw new RuntimeException( whyFailed );
304.172 + }
304.173 + theTestPassed = false;
304.174 + testGeneratedInterrupt = true;
304.175 + failureMessage = whyFailed;
304.176 + mainThread.interrupt();
304.177 + }//fail()
304.178 +
304.179 +}// class ManualMainTest
304.180 +
304.181 +//This exception is used to exit from any level of call nesting
304.182 +// when it's determined that the test has passed, and immediately
304.183 +// end the test.
304.184 +class TestPassedException extends RuntimeException
304.185 +{
304.186 +}
304.187 +
304.188 +//*********** End Standard Test Machinery Section **********
304.189 +
304.190 +
304.191 +//************ Begin classes defined for the test ****************
304.192 +
304.193 +// make listeners in a class defined here, and instantiate them in init()
304.194 +
304.195 +/* Example of a class which may be written as part of a test
304.196 +class NewClass implements anInterface
304.197 + {
304.198 + static int newVar = 0;
304.199 +
304.200 + public void eventDispatched(AWTEvent e)
304.201 + {
304.202 + //Counting events to see if we get enough
304.203 + eventCount++;
304.204 +
304.205 + if( eventCount == 20 )
304.206 + {
304.207 + //got enough events, so pass
304.208 +
304.209 + ManualMainTest.pass();
304.210 + }
304.211 + else if( tries == 20 )
304.212 + {
304.213 + //tried too many times without getting enough events so fail
304.214 +
304.215 + ManualMainTest.fail();
304.216 + }
304.217 +
304.218 + }// eventDispatched()
304.219 +
304.220 + }// NewClass class
304.221 +
304.222 +*/
304.223 +
304.224 +
304.225 +//************** End classes defined for the test *******************
304.226 +
304.227 +
304.228 +
304.229 +
304.230 +/****************************************************
304.231 + Standard Test Machinery
304.232 + DO NOT modify anything below -- it's a standard
304.233 + chunk of code whose purpose is to make user
304.234 + interaction uniform, and thereby make it simpler
304.235 + to read and understand someone else's test.
304.236 + ****************************************************/
304.237 +
304.238 +/**
304.239 + This is part of the standard test machinery.
304.240 + It creates a dialog (with the instructions), and is the interface
304.241 + for sending text messages to the user.
304.242 + To print the instructions, send an array of strings to Sysout.createDialog
304.243 + WithInstructions method. Put one line of instructions per array entry.
304.244 + To display a message for the tester to see, simply call Sysout.println
304.245 + with the string to be displayed.
304.246 + This mimics System.out.println but works within the test harness as well
304.247 + as standalone.
304.248 + */
304.249 +
304.250 +class Sysout
304.251 +{
304.252 + private static TestDialog dialog;
304.253 + private static boolean numbering = false;
304.254 + private static int messageNumber = 0;
304.255 +
304.256 + public static void createDialogWithInstructions( String[] instructions )
304.257 + {
304.258 + dialog = new TestDialog( new Frame(), "Instructions" );
304.259 + dialog.printInstructions( instructions );
304.260 + dialog.setVisible(true);
304.261 + println( "Any messages for the tester will display here." );
304.262 + }
304.263 +
304.264 + public static void createDialog( )
304.265 + {
304.266 + dialog = new TestDialog( new Frame(), "Instructions" );
304.267 + String[] defInstr = { "Instructions will appear here. ", "" } ;
304.268 + dialog.printInstructions( defInstr );
304.269 + dialog.setVisible(true);
304.270 + println( "Any messages for the tester will display here." );
304.271 + }
304.272 +
304.273 +
304.274 + /* Enables message counting for the tester. */
304.275 + public static void enableNumbering(boolean enable){
304.276 + numbering = enable;
304.277 + }
304.278 +
304.279 + public static void printInstructions( String[] instructions )
304.280 + {
304.281 + dialog.printInstructions( instructions );
304.282 + }
304.283 +
304.284 +
304.285 + public static void println( String messageIn )
304.286 + {
304.287 + if (numbering) {
304.288 + messageIn = "" + messageNumber + " " + messageIn;
304.289 + messageNumber++;
304.290 + }
304.291 + dialog.displayMessage( messageIn );
304.292 + }
304.293 +
304.294 +}// Sysout class
304.295 +
304.296 +/**
304.297 + This is part of the standard test machinery. It provides a place for the
304.298 + test instructions to be displayed, and a place for interactive messages
304.299 + to the user to be displayed.
304.300 + To have the test instructions displayed, see Sysout.
304.301 + To have a message to the user be displayed, see Sysout.
304.302 + Do not call anything in this dialog directly.
304.303 + */
304.304 +class TestDialog extends Dialog implements ActionListener
304.305 +{
304.306 +
304.307 + TextArea instructionsText;
304.308 + TextArea messageText;
304.309 + int maxStringLength = 80;
304.310 + Panel buttonP = new Panel();
304.311 + Button passB = new Button( "pass" );
304.312 + Button failB = new Button( "fail" );
304.313 +
304.314 + //DO NOT call this directly, go through Sysout
304.315 + public TestDialog( Frame frame, String name )
304.316 + {
304.317 + super( frame, name );
304.318 + int scrollBoth = TextArea.SCROLLBARS_BOTH;
304.319 + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
304.320 + add( "North", instructionsText );
304.321 +
304.322 + messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
304.323 + add("Center", messageText);
304.324 +
304.325 + passB = new Button( "pass" );
304.326 + passB.setActionCommand( "pass" );
304.327 + passB.addActionListener( this );
304.328 + buttonP.add( "East", passB );
304.329 +
304.330 + failB = new Button( "fail" );
304.331 + failB.setActionCommand( "fail" );
304.332 + failB.addActionListener( this );
304.333 + buttonP.add( "West", failB );
304.334 +
304.335 + add( "South", buttonP );
304.336 + pack();
304.337 +
304.338 + setVisible(true);
304.339 + }// TestDialog()
304.340 +
304.341 + //DO NOT call this directly, go through Sysout
304.342 + public void printInstructions( String[] instructions )
304.343 + {
304.344 + //Clear out any current instructions
304.345 + instructionsText.setText( "" );
304.346 +
304.347 + //Go down array of instruction strings
304.348 +
304.349 + String printStr, remainingStr;
304.350 + for( int i=0; i < instructions.length; i++ )
304.351 + {
304.352 + //chop up each into pieces maxSringLength long
304.353 + remainingStr = instructions[ i ];
304.354 + while( remainingStr.length() > 0 )
304.355 + {
304.356 + //if longer than max then chop off first max chars to print
304.357 + if( remainingStr.length() >= maxStringLength )
304.358 + {
304.359 + //Try to chop on a word boundary
304.360 + int posOfSpace = remainingStr.
304.361 + lastIndexOf( ' ', maxStringLength - 1 );
304.362 +
304.363 + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
304.364 +
304.365 + printStr = remainingStr.substring( 0, posOfSpace + 1 );
304.366 + remainingStr = remainingStr.substring( posOfSpace + 1 );
304.367 + }
304.368 + //else just print
304.369 + else
304.370 + {
304.371 + printStr = remainingStr;
304.372 + remainingStr = "";
304.373 + }
304.374 +
304.375 + instructionsText.append( printStr + "\n" );
304.376 +
304.377 + }// while
304.378 +
304.379 + }// for
304.380 +
304.381 + }//printInstructions()
304.382 +
304.383 + //DO NOT call this directly, go through Sysout
304.384 + public void displayMessage( String messageIn )
304.385 + {
304.386 + messageText.append( messageIn + "\n" );
304.387 + System.out.println(messageIn);
304.388 + }
304.389 +
304.390 + //catch presses of the passed and failed buttons.
304.391 + //simply call the standard pass() or fail() static methods of
304.392 + //ManualMainTest
304.393 + public void actionPerformed( ActionEvent e )
304.394 + {
304.395 + if( e.getActionCommand() == "pass" )
304.396 + {
304.397 + ListFlickers.pass();
304.398 + }
304.399 + else
304.400 + {
304.401 + ListFlickers.fail();
304.402 + }
304.403 + }
304.404 +
304.405 +}// TestDialog class
305.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
305.2 +++ b/test/java/awt/TextField/ScrollSelectionTest/ScrollSelectionTest.html Fri May 16 12:25:57 2008 -0700
305.3 @@ -0,0 +1,20 @@
305.4 +<html>
305.5 +<!--
305.6 + @test
305.7 + @bug 4118621
305.8 + @summary tests that selected text isn't scrolled if there is enough room.
305.9 + @author prs: area=TextField
305.10 + @run applet/manual=yesno ScrollSelectionTest.html
305.11 + -->
305.12 +<head>
305.13 +<title> ScrollSelectionTest </title>
305.14 +</head>
305.15 +<body>
305.16 +
305.17 +<h1>ScrollSelectionTest<br>4118621: </h1>
305.18 +
305.19 +<p> See the dialog box (usually in upper left corner) for instructions</p>
305.20 +
305.21 +<APPLET CODE="ScrollSelectionTest.class" WIDTH=300 HEIGHT=300></APPLET>
305.22 +</body>
305.23 +</html>
306.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
306.2 +++ b/test/java/awt/TextField/ScrollSelectionTest/ScrollSelectionTest.java Fri May 16 12:25:57 2008 -0700
306.3 @@ -0,0 +1,213 @@
306.4 +/*
306.5 + * Copyright 1999-2008 Sun Microsystems, Inc. All Rights Reserved.
306.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
306.7 + *
306.8 + * This code is free software; you can redistribute it and/or modify it
306.9 + * under the terms of the GNU General Public License version 2 only, as
306.10 + * published by the Free Software Foundation.
306.11 + *
306.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
306.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
306.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
306.15 + * version 2 for more details (a copy is included in the LICENSE file that
306.16 + * accompanied this code).
306.17 + *
306.18 + * You should have received a copy of the GNU General Public License version
306.19 + * 2 along with this work; if not, write to the Free Software Foundation,
306.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
306.21 + *
306.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
306.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
306.24 + * have any questions.
306.25 + */
306.26 +
306.27 +/*
306.28 + test
306.29 + @bug 4118621
306.30 + @summary tests that selected text isn't scrolled when there is enough room.
306.31 + @author prs: area=TextField
306.32 + @run applet/manual=yesno ScrollSelectionTest.html
306.33 +*/
306.34 +
306.35 +/**
306.36 + * ScrollSelectionTest.java
306.37 + *
306.38 + * summary: tests that selected text isn't scrolled when there is enough room.
306.39 + */
306.40 +
306.41 +import java.applet.Applet;
306.42 +import java.awt.Dialog;
306.43 +import java.awt.Frame;
306.44 +import java.awt.TextField;
306.45 +import java.awt.TextArea;
306.46 +
306.47 +public class ScrollSelectionTest extends Applet
306.48 + {
306.49 +
306.50 + Frame frame = new Frame("ScrollSelectionTest frame");
306.51 + TextField tf = new TextField(40);
306.52 +
306.53 + public void init()
306.54 + {
306.55 + tf.setText("abcdefghijklmnopqrstuvwxyz");
306.56 + frame.add(tf);
306.57 + tf.select(0, 20);
306.58 +
306.59 + String[] instructions =
306.60 + {
306.61 + "INSTRUCTIONS:",
306.62 + "This is a test for a win32 specific problem",
306.63 + "If you see all the letters from 'a' to 'z' and",
306.64 + "letters from 'a' to 't' are selected then test passes"
306.65 + };
306.66 + Sysout.createDialogWithInstructions( instructions );
306.67 +
306.68 + }// init()
306.69 +
306.70 + public void start ()
306.71 + {
306.72 + setSize (300,300);
306.73 + setVisible(true);
306.74 +
306.75 + frame.setVisible(true);
306.76 + frame.setBounds (400, 0, 300, 300);
306.77 +
306.78 + }// start()
306.79 +
306.80 + }// class ScrollSelectionTest
306.81 +
306.82 +/****************************************************
306.83 + Standard Test Machinery
306.84 + DO NOT modify anything below -- it's a standard
306.85 + chunk of code whose purpose is to make user
306.86 + interaction uniform, and thereby make it simpler
306.87 + to read and understand someone else's test.
306.88 + ****************************************************/
306.89 +
306.90 +/**
306.91 + This is part of the standard test machinery.
306.92 + It creates a dialog (with the instructions), and is the interface
306.93 + for sending text messages to the user.
306.94 + To print the instructions, send an array of strings to Sysout.createDialog
306.95 + WithInstructions method. Put one line of instructions per array entry.
306.96 + To display a message for the tester to see, simply call Sysout.println
306.97 + with the string to be displayed.
306.98 + This mimics System.out.println but works within the test harness as well
306.99 + as standalone.
306.100 + */
306.101 +
306.102 +class Sysout
306.103 + {
306.104 + private static TestDialog dialog;
306.105 +
306.106 + public static void createDialogWithInstructions( String[] instructions )
306.107 + {
306.108 + dialog = new TestDialog( new Frame(), "Instructions" );
306.109 + dialog.printInstructions( instructions );
306.110 + dialog.show();
306.111 + println( "Any messages for the tester will display here." );
306.112 + }
306.113 +
306.114 + public static void createDialog( )
306.115 + {
306.116 + dialog = new TestDialog( new Frame(), "Instructions" );
306.117 + String[] defInstr = { "Instructions will appear here. ", "" } ;
306.118 + dialog.printInstructions( defInstr );
306.119 + dialog.show();
306.120 + println( "Any messages for the tester will display here." );
306.121 + }
306.122 +
306.123 +
306.124 + public static void printInstructions( String[] instructions )
306.125 + {
306.126 + dialog.printInstructions( instructions );
306.127 + }
306.128 +
306.129 +
306.130 + public static void println( String messageIn )
306.131 + {
306.132 + dialog.displayMessage( messageIn );
306.133 + }
306.134 +
306.135 + }// Sysout class
306.136 +
306.137 +/**
306.138 + This is part of the standard test machinery. It provides a place for the
306.139 + test instructions to be displayed, and a place for interactive messages
306.140 + to the user to be displayed.
306.141 + To have the test instructions displayed, see Sysout.
306.142 + To have a message to the user be displayed, see Sysout.
306.143 + Do not call anything in this dialog directly.
306.144 + */
306.145 +class TestDialog extends Dialog
306.146 + {
306.147 +
306.148 + TextArea instructionsText;
306.149 + TextArea messageText;
306.150 + int maxStringLength = 80;
306.151 +
306.152 + //DO NOT call this directly, go through Sysout
306.153 + public TestDialog( Frame frame, String name )
306.154 + {
306.155 + super( frame, name );
306.156 + int scrollBoth = TextArea.SCROLLBARS_BOTH;
306.157 + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
306.158 + add( "North", instructionsText );
306.159 +
306.160 + messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
306.161 + add("South", messageText);
306.162 +
306.163 + pack();
306.164 +
306.165 + show();
306.166 + }// TestDialog()
306.167 +
306.168 + //DO NOT call this directly, go through Sysout
306.169 + public void printInstructions( String[] instructions )
306.170 + {
306.171 + //Clear out any current instructions
306.172 + instructionsText.setText( "" );
306.173 +
306.174 + //Go down array of instruction strings
306.175 +
306.176 + String printStr, remainingStr;
306.177 + for( int i=0; i < instructions.length; i++ )
306.178 + {
306.179 + //chop up each into pieces maxSringLength long
306.180 + remainingStr = instructions[ i ];
306.181 + while( remainingStr.length() > 0 )
306.182 + {
306.183 + //if longer than max then chop off first max chars to print
306.184 + if( remainingStr.length() >= maxStringLength )
306.185 + {
306.186 + //Try to chop on a word boundary
306.187 + int posOfSpace = remainingStr.
306.188 + lastIndexOf( ' ', maxStringLength - 1 );
306.189 +
306.190 + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
306.191 +
306.192 + printStr = remainingStr.substring( 0, posOfSpace + 1 );
306.193 + remainingStr = remainingStr.substring( posOfSpace + 1 );
306.194 + }
306.195 + //else just print
306.196 + else
306.197 + {
306.198 + printStr = remainingStr;
306.199 + remainingStr = "";
306.200 + }
306.201 +
306.202 + instructionsText.append( printStr + "\n" );
306.203 +
306.204 + }// while
306.205 +
306.206 + }// for
306.207 +
306.208 + }//printInstructions()
306.209 +
306.210 + //DO NOT call this directly, go through Sysout
306.211 + public void displayMessage( String messageIn )
306.212 + {
306.213 + messageText.append( messageIn + "\n" );
306.214 + }
306.215 +
306.216 + }// TestDialog class
307.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
307.2 +++ b/test/java/awt/Window/PropertyChangeListenerLockSerialization/PropertyChangeListenerLockSerialization.java Fri May 16 12:25:57 2008 -0700
307.3 @@ -0,0 +1,402 @@
307.4 +/*
307.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
307.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
307.7 + *
307.8 + * This code is free software; you can redistribute it and/or modify it
307.9 + * under the terms of the GNU General Public License version 2 only, as
307.10 + * published by the Free Software Foundation.
307.11 + *
307.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
307.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
307.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
307.15 + * version 2 for more details (a copy is included in the LICENSE file that
307.16 + * accompanied this code).
307.17 + *
307.18 + * You should have received a copy of the GNU General Public License version
307.19 + * 2 along with this work; if not, write to the Free Software Foundation,
307.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
307.21 + *
307.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
307.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
307.24 + * have any questions.
307.25 + */
307.26 +
307.27 +/*
307.28 + @test
307.29 + @bug 6681889
307.30 + @summary Showing a deserialized frame should not throw NPE
307.31 + @author anthony.petrov@...: area=awt.toplevel
307.32 + @run main PropertyChangeListenerLockSerialization
307.33 +*/
307.34 +
307.35 +
307.36 +/**
307.37 + * PropertyChangeListenerLockSerialization.java
307.38 + *
307.39 + * summary: Showing a deserialized frame should not throw NPE
307.40 + */
307.41 +
307.42 +import java.awt.*;
307.43 +import java.awt.event.*;
307.44 +import java.io.*;
307.45 +import java.net.*;
307.46 +
307.47 +public class PropertyChangeListenerLockSerialization
307.48 +{
307.49 +
307.50 + private static void init()
307.51 + {
307.52 + //*** Create instructions for the user here ***
307.53 +
307.54 + String[] instructions =
307.55 + {
307.56 + "This is an AUTOMATIC test, simply wait until it is done.",
307.57 + "The result (passed or failed) will be shown in the",
307.58 + "message window below."
307.59 + };
307.60 + Sysout.createDialog( );
307.61 + Sysout.printInstructions( instructions );
307.62 +
307.63 + File file =
307.64 + new File(System.getProperty("test.classes", "."), "frame.ser");
307.65 +
307.66 + Frame f = new Frame("Frame");
307.67 + f.setBounds(250, 50, 300, 300);
307.68 + try {
307.69 + OutputStream o = new FileOutputStream(file);
307.70 + ObjectOutputStream oo = new ObjectOutputStream(o);
307.71 +
307.72 + oo.writeObject(f);
307.73 + oo.close();
307.74 + } catch (IOException ex) {
307.75 + ex.printStackTrace();
307.76 + fail("Unable to serialize the frame: " + ex);
307.77 + }
307.78 +
307.79 + // Cleanup the frame
307.80 + f.dispose();
307.81 + f = null;
307.82 +
307.83 + try {
307.84 + ObjectInputStream i = new ObjectInputStream(new FileInputStream(file));
307.85 +
307.86 + f = (Frame)i.readObject();
307.87 + f.show();
307.88 + } catch (NullPointerException ex) {
307.89 + ex.printStackTrace();
307.90 + fail("The NullPointerException has been thrown: " + ex);
307.91 + } catch (Exception ex) {
307.92 + ex.printStackTrace();
307.93 + fail("Error while deserializing the frame: " + ex);
307.94 + }
307.95 +
307.96 + // Cleanup the frame
307.97 + f.dispose();
307.98 + f = null;
307.99 +
307.100 + pass();
307.101 +
307.102 + }//End init()
307.103 +
307.104 +
307.105 +
307.106 + /*****************************************************
307.107 + * Standard Test Machinery Section
307.108 + * DO NOT modify anything in this section -- it's a
307.109 + * standard chunk of code which has all of the
307.110 + * synchronisation necessary for the test harness.
307.111 + * By keeping it the same in all tests, it is easier
307.112 + * to read and understand someone else's test, as
307.113 + * well as insuring that all tests behave correctly
307.114 + * with the test harness.
307.115 + * There is a section following this for test-
307.116 + * classes
307.117 + ******************************************************/
307.118 + private static boolean theTestPassed = false;
307.119 + private static boolean testGeneratedInterrupt = false;
307.120 + private static String failureMessage = "";
307.121 +
307.122 + private static Thread mainThread = null;
307.123 +
307.124 + private static int sleepTime = 300000;
307.125 +
307.126 + // Not sure about what happens if multiple of this test are
307.127 + // instantiated in the same VM. Being static (and using
307.128 + // static vars), it aint gonna work. Not worrying about
307.129 + // it for now.
307.130 + public static void main( String args[] ) throws InterruptedException
307.131 + {
307.132 + mainThread = Thread.currentThread();
307.133 + try
307.134 + {
307.135 + init();
307.136 + }
307.137 + catch( TestPassedException e )
307.138 + {
307.139 + //The test passed, so just return from main and harness will
307.140 + // interepret this return as a pass
307.141 + return;
307.142 + }
307.143 + //At this point, neither test pass nor test fail has been
307.144 + // called -- either would have thrown an exception and ended the
307.145 + // test, so we know we have multiple threads.
307.146 +
307.147 + //Test involves other threads, so sleep and wait for them to
307.148 + // called pass() or fail()
307.149 + try
307.150 + {
307.151 + Thread.sleep( sleepTime );
307.152 + //Timed out, so fail the test
307.153 + throw new RuntimeException( "Timed out after " + sleepTime/1000 + " seconds" );
307.154 + }
307.155 + catch (InterruptedException e)
307.156 + {
307.157 + //The test harness may have interrupted the test. If so, rethrow the exception
307.158 + // so that the harness gets it and deals with it.
307.159 + if( ! testGeneratedInterrupt ) throw e;
307.160 +
307.161 + //reset flag in case hit this code more than once for some reason (just safety)
307.162 + testGeneratedInterrupt = false;
307.163 +
307.164 + if ( theTestPassed == false )
307.165 + {
307.166 + throw new RuntimeException( failureMessage );
307.167 + }
307.168 + }
307.169 +
307.170 + }//main
307.171 +
307.172 + public static synchronized void setTimeoutTo( int seconds )
307.173 + {
307.174 + sleepTime = seconds * 1000;
307.175 + }
307.176 +
307.177 + public static synchronized void pass()
307.178 + {
307.179 + Sysout.println( "The test passed." );
307.180 + Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
307.181 + //first check if this is executing in main thread
307.182 + if ( mainThread == Thread.currentThread() )
307.183 + {
307.184 + //Still in the main thread, so set the flag just for kicks,
307.185 + // and throw a test passed exception which will be caught
307.186 + // and end the test.
307.187 + theTestPassed = true;
307.188 + throw new TestPassedException();
307.189 + }
307.190 + theTestPassed = true;
307.191 + testGeneratedInterrupt = true;
307.192 + mainThread.interrupt();
307.193 + }//pass()
307.194 +
307.195 + public static synchronized void fail()
307.196 + {
307.197 + //test writer didn't specify why test failed, so give generic
307.198 + fail( "it just plain failed! :-)" );
307.199 + }
307.200 +
307.201 + public static synchronized void fail( String whyFailed )
307.202 + {
307.203 + Sysout.println( "The test failed: " + whyFailed );
307.204 + Sysout.println( "The test is over, hit Ctl-C to stop Java VM" );
307.205 + //check if this called from main thread
307.206 + if ( mainThread == Thread.currentThread() )
307.207 + {
307.208 + //If main thread, fail now 'cause not sleeping
307.209 + throw new RuntimeException( whyFailed );
307.210 + }
307.211 + theTestPassed = false;
307.212 + testGeneratedInterrupt = true;
307.213 + failureMessage = whyFailed;
307.214 + mainThread.interrupt();
307.215 + }//fail()
307.216 +
307.217 +}// class PropertyChangeListenerLockSerialization
307.218 +
307.219 +//This exception is used to exit from any level of call nesting
307.220 +// when it's determined that the test has passed, and immediately
307.221 +// end the test.
307.222 +class TestPassedException extends RuntimeException
307.223 +{
307.224 +}
307.225 +
307.226 +//*********** End Standard Test Machinery Section **********
307.227 +
307.228 +
307.229 +//************ Begin classes defined for the test ****************
307.230 +
307.231 +// if want to make listeners, here is the recommended place for them, then instantiate
307.232 +// them in init()
307.233 +
307.234 +/* Example of a class which may be written as part of a test
307.235 +class NewClass implements anInterface
307.236 + {
307.237 + static int newVar = 0;
307.238 +
307.239 + public void eventDispatched(AWTEvent e)
307.240 + {
307.241 + //Counting events to see if we get enough
307.242 + eventCount++;
307.243 +
307.244 + if( eventCount == 20 )
307.245 + {
307.246 + //got enough events, so pass
307.247 +
307.248 + PropertyChangeListenerLockSerialization.pass();
307.249 + }
307.250 + else if( tries == 20 )
307.251 + {
307.252 + //tried too many times without getting enough events so fail
307.253 +
307.254 + PropertyChangeListenerLockSerialization.fail();
307.255 + }
307.256 +
307.257 + }// eventDispatched()
307.258 +
307.259 + }// NewClass class
307.260 +
307.261 +*/
307.262 +
307.263 +
307.264 +//************** End classes defined for the test *******************
307.265 +
307.266 +
307.267 +
307.268 +
307.269 +/****************************************************
307.270 + Standard Test Machinery
307.271 + DO NOT modify anything below -- it's a standard
307.272 + chunk of code whose purpose is to make user
307.273 + interaction uniform, and thereby make it simpler
307.274 + to read and understand someone else's test.
307.275 + ****************************************************/
307.276 +
307.277 +/**
307.278 + This is part of the standard test machinery.
307.279 + It creates a dialog (with the instructions), and is the interface
307.280 + for sending text messages to the user.
307.281 + To print the instructions, send an array of strings to Sysout.createDialog
307.282 + WithInstructions method. Put one line of instructions per array entry.
307.283 + To display a message for the tester to see, simply call Sysout.println
307.284 + with the string to be displayed.
307.285 + This mimics System.out.println but works within the test harness as well
307.286 + as standalone.
307.287 + */
307.288 +
307.289 +class Sysout
307.290 +{
307.291 + private static TestDialog dialog;
307.292 +
307.293 + public static void createDialogWithInstructions( String[] instructions )
307.294 + {
307.295 + dialog = new TestDialog( new Frame(), "Instructions" );
307.296 + dialog.printInstructions( instructions );
307.297 + dialog.setVisible(true);
307.298 + println( "Any messages for the tester will display here." );
307.299 + }
307.300 +
307.301 + public static void createDialog( )
307.302 + {
307.303 + dialog = new TestDialog( new Frame(), "Instructions" );
307.304 + String[] defInstr = { "Instructions will appear here. ", "" } ;
307.305 + dialog.printInstructions( defInstr );
307.306 + dialog.setVisible(true);
307.307 + println( "Any messages for the tester will display here." );
307.308 + }
307.309 +
307.310 +
307.311 + public static void printInstructions( String[] instructions )
307.312 + {
307.313 + dialog.printInstructions( instructions );
307.314 + }
307.315 +
307.316 +
307.317 + public static void println( String messageIn )
307.318 + {
307.319 + dialog.displayMessage( messageIn );
307.320 + System.out.println(messageIn);
307.321 + }
307.322 +
307.323 +}// Sysout class
307.324 +
307.325 +/**
307.326 + This is part of the standard test machinery. It provides a place for the
307.327 + test instructions to be displayed, and a place for interactive messages
307.328 + to the user to be displayed.
307.329 + To have the test instructions displayed, see Sysout.
307.330 + To have a message to the user be displayed, see Sysout.
307.331 + Do not call anything in this dialog directly.
307.332 + */
307.333 +class TestDialog extends Dialog
307.334 +{
307.335 +
307.336 + TextArea instructionsText;
307.337 + TextArea messageText;
307.338 + int maxStringLength = 80;
307.339 +
307.340 + //DO NOT call this directly, go through Sysout
307.341 + public TestDialog( Frame frame, String name )
307.342 + {
307.343 + super( frame, name );
307.344 + int scrollBoth = TextArea.SCROLLBARS_BOTH;
307.345 + instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth );
307.346 + add( "North", instructionsText );
307.347 +
307.348 + messageText = new TextArea( "", 5, maxStringLength, scrollBoth );
307.349 + add("Center", messageText);
307.350 +
307.351 + pack();
307.352 +
307.353 + setVisible(true);
307.354 + }// TestDialog()
307.355 +
307.356 + //DO NOT call this directly, go through Sysout
307.357 + public void printInstructions( String[] instructions )
307.358 + {
307.359 + //Clear out any current instructions
307.360 + instructionsText.setText( "" );
307.361 +
307.362 + //Go down array of instruction strings
307.363 +
307.364 + String printStr, remainingStr;
307.365 + for( int i=0; i < instructions.length; i++ )
307.366 + {
307.367 + //chop up each into pieces maxSringLength long
307.368 + remainingStr = instructions[ i ];
307.369 + while( remainingStr.length() > 0 )
307.370 + {
307.371 + //if longer than max then chop off first max chars to print
307.372 + if( remainingStr.length() >= maxStringLength )
307.373 + {
307.374 + //Try to chop on a word boundary
307.375 + int posOfSpace = remainingStr.
307.376 + lastIndexOf( ' ', maxStringLength - 1 );
307.377 +
307.378 + if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1;
307.379 +
307.380 + printStr = remainingStr.substring( 0, posOfSpace + 1 );
307.381 + remainingStr = remainingStr.substring( posOfSpace + 1 );
307.382 + }
307.383 + //else just print
307.384 + else
307.385 + {
307.386 + printStr = remainingStr;
307.387 + remainingStr = "";
307.388 + }
307.389 +
307.390 + instructionsText.append( printStr + "\n" );
307.391 +
307.392 + }// while
307.393 +
307.394 + }// for
307.395 +
307.396 + }//printInstructions()
307.397 +
307.398 + //DO NOT call this directly, go through Sysout
307.399 + public void displayMessage( String messageIn )
307.400 + {
307.401 + messageText.append( messageIn + "\n" );
307.402 + System.out.println(messageIn);
307.403 + }
307.404 +
307.405 +}// TestDialog class
308.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
308.2 +++ b/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.java Fri May 16 12:25:57 2008 -0700
308.3 @@ -0,0 +1,64 @@
308.4 +/*
308.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
308.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
308.7 + *
308.8 + * This code is free software; you can redistribute it and/or modify it
308.9 + * under the terms of the GNU General Public License version 2 only, as
308.10 + * published by the Free Software Foundation.
308.11 + *
308.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
308.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
308.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
308.15 + * version 2 for more details (a copy is included in the LICENSE file that
308.16 + * accompanied this code).
308.17 + *
308.18 + * You should have received a copy of the GNU General Public License version
308.19 + * 2 along with this work; if not, write to the Free Software Foundation,
308.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
308.21 + *
308.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
308.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
308.24 + * have any questions.
308.25 + */
308.26 +
308.27 +/*
308.28 + test
308.29 + @bug 6193279
308.30 + @summary REGRESSION: AppletViewer throws IOException when path is encoded URL
308.31 + @author Dmitry Cherepanov: area=appletviewer
308.32 + @run compile IOExceptionIfEncodedURLTest.java
308.33 + @run main IOExceptionIfEncodedURLTest
308.34 + @run shell IOExceptionIfEncodedURLTest.sh
308.35 +*/
308.36 +
308.37 +import java.applet.Applet;
308.38 +import sun.net.www.ParseUtil;
308.39 +import java.io.File;
308.40 +import java.net.MalformedURLException;
308.41 +
308.42 +public class IOExceptionIfEncodedURLTest extends Applet{
308.43 + public void init(){
308.44 + }
308.45 +
308.46 + public void start(){
308.47 + // We check that appletviewer writes this message to log file
308.48 + System.err.println("the appletviewer started");
308.49 + }
308.50 +
308.51 + // We expect that sun.net.www.ParseUtil.fileToEncodedURL works like following
308.52 + // if relative file URL, like this "file:index.html" is processed
308.53 + static String url = "file:IOExceptionIfEncodedURLTest.java";
308.54 + public static final void main(String args[])
308.55 + throws MalformedURLException{
308.56 + System.err.println("prior checking...");
308.57 + String prefix = "file:";
308.58 + String path = ParseUtil.fileToEncodedURL(new File(System.getProperty("user.dir"))).getPath();
308.59 + String filename = url.substring(prefix.length());
308.60 + System.err.println("url="+url+" -> path="+path+",filename="+filename);
308.61 +
308.62 + if (!path.endsWith("/") && !filename.startsWith("/")) {
308.63 + throw new RuntimeException("Incorrect '/' processing");
308.64 + }
308.65 + }
308.66 +
308.67 +}
309.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
309.2 +++ b/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/IOExceptionIfEncodedURLTest.sh Fri May 16 12:25:57 2008 -0700
309.3 @@ -0,0 +1,231 @@
309.4 +#
309.5 +# Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
309.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
309.7 +#
309.8 +# This code is free software; you can redistribute it and/or modify it
309.9 +# under the terms of the GNU General Public License version 2 only, as
309.10 +# published by the Free Software Foundation. Sun designates this
309.11 +# particular file as subject to the "Classpath" exception as provided
309.12 +# by Sun in the LICENSE file that accompanied this code.
309.13 +#
309.14 +# This code is distributed in the hope that it will be useful, but WITHOUT
309.15 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
309.16 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
309.17 +# version 2 for more details (a copy is included in the LICENSE file that
309.18 +# accompanied this code).
309.19 +#
309.20 +# You should have received a copy of the GNU General Public License version
309.21 +# 2 along with this work; if not, write to the Free Software Foundation,
309.22 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
309.23 +#
309.24 +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
309.25 +# CA 95054 USA or visit www.sun.com if you need additional information or
309.26 +# have any questions.
309.27 +#
309.28 +
309.29 +#!/bin/ksh -p
309.30 +#
309.31 +# @test IOExceptionIfEncodedURLTest.sh
309.32 +# @bug 6193279 6619458
309.33 +# @summary REGRESSION: AppletViewer throws IOException when path is encoded URL
309.34 +# @author Dmitry Cherepanov: area=appletviewer
309.35 +# @run compile IOExceptionIfEncodedURLTest.java
309.36 +# @run main IOExceptionIfEncodedURLTest
309.37 +# @run shell IOExceptionIfEncodedURLTest.sh
309.38 +
309.39 +# Beginning of subroutines:
309.40 +status=1
309.41 +
309.42 +#Call this from anywhere to fail the test with an error message
309.43 +# usage: fail "reason why the test failed"
309.44 +fail()
309.45 + { echo "The test failed :-("
309.46 + echo "$*" 1>&2
309.47 + echo "exit status was $status"
309.48 + exit $status
309.49 + } #end of fail()
309.50 +
309.51 +#Call this from anywhere to pass the test with a message
309.52 +# usage: pass "reason why the test passed if applicable"
309.53 +pass()
309.54 + { echo "The test passed!!!"
309.55 + echo "$*" 1>&2
309.56 + exit 0
309.57 + } #end of pass()
309.58 +
309.59 +#Call this to run the test with a file name
309.60 +test()
309.61 + {
309.62 + ${TESTJAVA}${FILESEP}bin${FILESEP}appletviewer -Xnosecurity ${URL} > err 2>&1 &
309.63 + APPLET_ID=$!
309.64 + sleep 15
309.65 + kill -9 $APPLET_ID
309.66 +
309.67 + # these exceptions will be thrown if the test fails
309.68 + cat err | grep "I/O exception while reading"
309.69 + exception=$?
309.70 + if [ $exception = "0" ];
309.71 + then fail "test failed for "${URL}", see err file and CRs #6193279,6329251,6376334"
309.72 + fi
309.73 +
309.74 + cat err | grep "java.lang.ClassNotFoundException"
309.75 + exception=$?
309.76 + if [ $exception = "0" ];
309.77 + then fail "test failed for "${URL}", see err file and CRs #6193279,6329251,6376334"
309.78 + fi
309.79 +
309.80 + # the applet will log the same message
309.81 + cat err | grep "the appletviewer started"
309.82 + started=$?
309.83 +
309.84 + echo $started | grep "2"
309.85 + if [ $? = 0 ] ;
309.86 + then fail "test failed for "${URL}": syntax errors or inaccessible files"
309.87 + fi
309.88 +
309.89 + if [ $started = "0" ];
309.90 + then echo "the test passed for "${URL}
309.91 + else fail "test failed for "${URL}": the appletviewer behaviour is unexpected: "$started", see err file"
309.92 + fi
309.93 + }
309.94 +
309.95 +# end of subroutines
309.96 +
309.97 +
309.98 +# The beginning of the script proper
309.99 +
309.100 +# Checking for proper OS
309.101 +OS=`uname -s`
309.102 +case "$OS" in
309.103 + SunOS )
309.104 + VAR="One value for Sun"
309.105 + DEFAULT_JDK=/usr/local/java/jdk1.2.1/solaris
309.106 + FILESEP="/"
309.107 + ;;
309.108 +
309.109 + Linux )
309.110 + VAR="A different value for Linux"
309.111 + DEFAULT_JDK=/usr/local/java/jdk1.4/linux-i386
309.112 + FILESEP="/"
309.113 + ;;
309.114 +
309.115 + Windows_95 | Windows_98 | Windows_NT | Windows_ME | CYGWIN_NT-5.1)
309.116 + VAR="A different value for Win32"
309.117 + DEFAULT_JDK=/usr/local/java/jdk1.2.1/win32
309.118 + FILESEP="\\"
309.119 + ;;
309.120 +
309.121 + # catch all other OSs
309.122 + * )
309.123 + echo "Unrecognized system! $OS"
309.124 + fail "Unrecognized system! $OS"
309.125 + ;;
309.126 +esac
309.127 +
309.128 +# 6438730: Only a minimal set of env variables are set for shell tests.
309.129 +# To guarantee that env variable holds correct value we need to set it ourselves.
309.130 +if [ -z "${PWD}" ] ; then
309.131 + PWD=`pwd`
309.132 +fi
309.133 +
309.134 +# check that some executable or other file you need is available, abort if not
309.135 +# note that the name of the executable is in the fail string as well.
309.136 +# this is how to check for presence of the compiler, etc.
309.137 +#RESOURCE=`whence SomeProgramOrFileNeeded`
309.138 +#if [ "${RESOURCE}" = "" ] ;
309.139 +# then fail "Need SomeProgramOrFileNeeded to perform the test" ;
309.140 +#fi
309.141 +
309.142 +# Want this test to run standalone as well as in the harness, so do the
309.143 +# following to copy the test's directory into the harness's scratch directory
309.144 +# and set all appropriate variables:
309.145 +
309.146 +if [ -z "${TESTJAVA}" ] ; then
309.147 + # TESTJAVA is not set, so the test is running stand-alone.
309.148 + # TESTJAVA holds the path to the root directory of the build of the JDK
309.149 + # to be tested. That is, any java files run explicitly in this shell
309.150 + # should use TESTJAVA in the path to the java interpreter.
309.151 + # So, we'll set this to the JDK spec'd on the command line. If none
309.152 + # is given on the command line, tell the user that and use a cheesy
309.153 + # default.
309.154 + # THIS IS THE JDK BEING TESTED.
309.155 + if [ -n "$1" ] ;
309.156 + then TESTJAVA=$1
309.157 + else echo "no JDK specified on command line so using default!"
309.158 + TESTJAVA=$DEFAULT_JDK
309.159 + fi
309.160 + TESTSRC=.
309.161 + TESTCLASSES=.
309.162 + STANDALONE=1;
309.163 +fi
309.164 +echo "JDK under test is: $TESTJAVA"
309.165 +
309.166 +#Deal with .class files:
309.167 +if [ -n "${STANDALONE}" ] ;
309.168 + then
309.169 + #if standalone, remind user to cd to dir. containing test before running it
309.170 + echo "Just a reminder: cd to the dir containing this test when running it"
309.171 + # then compile all .java files (if there are any) into .class files
309.172 + if [ -a *.java ] ;
309.173 + then echo "Reminder, this test should be in its own directory with all"
309.174 + echo "supporting files it needs in the directory with it."
309.175 + ${TESTJAVA}/bin/javac ./*.java ;
309.176 + fi
309.177 + # else in harness so copy all the class files from where jtreg put them
309.178 + # over to the scratch directory this test is running in.
309.179 + else cp ${TESTCLASSES}/*.class . ;
309.180 +fi
309.181 +
309.182 +#if in test harness, then copy the entire directory that the test is in over
309.183 +# to the scratch directory. This catches any support files needed by the test.
309.184 +#if [ -z "${STANDALONE}" ] ;
309.185 +# then cp ${TESTSRC}/* .
309.186 +#fi
309.187 +
309.188 +#Just before executing anything, make sure it has executable permission!
309.189 +chmod 777 ./*
309.190 +
309.191 +############### YOUR TEST CODE HERE!!!!!!! #############
309.192 +
309.193 +#All files required for the test should be in the same directory with
309.194 +# this file. If converting a standalone test to run with the harness,
309.195 +# as long as all files are in the same directory and it returns 0 for
309.196 +# pass, you should be able to cut and paste it into here and it will
309.197 +# run with the test harness.
309.198 +
309.199 +# This is an example of running something -- test
309.200 +# The stuff below catches the exit status of test then passes or fails
309.201 +# this shell test as appropriate ( 0 status is considered a pass here )
309.202 +
309.203 +# The test verifies that appletviewer correctly works with the different
309.204 +# names of the files, including relative and absolute paths
309.205 +
309.206 +# 6619458: exclude left brace from the name of the files managed by the VCS
309.207 +NAME='test.html'
309.208 +
309.209 +ENCODED='te%7Bst.html'
309.210 +UNENCODED='te{st.html'
309.211 +
309.212 +# Copy needed files into the harness's scratch directory
309.213 +# or create a copy with the required name if the test is
309.214 +# running as stand-alone
309.215 +cp ${TESTSRC}${FILESEP}${NAME} ${UNENCODED}
309.216 +
309.217 +# the encoded name, the path is absolute
309.218 +URL="file:"${PWD}${FILESEP}${ENCODED}
309.219 +test
309.220 +
309.221 +# the encoded name, the path is relative
309.222 +URL="file:"${ENCODED}
309.223 +test
309.224 +
309.225 +# the unencoded name, the path is absolute
309.226 +URL="file:"${PWD}${FILESEP}${UNENCODED}
309.227 +test
309.228 +
309.229 +# the unencoded name, the path is relative
309.230 +URL="file:"${UNENCODED}
309.231 +test
309.232 +
309.233 +# pick up our toys from the scratch directory
309.234 +rm ${UNENCODED}
310.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
310.2 +++ b/test/java/awt/appletviewer/IOExceptionIfEncodedURLTest/test.html Fri May 16 12:25:57 2008 -0700
310.3 @@ -0,0 +1,21 @@
310.4 +<html>
310.5 +<!--
310.6 + test
310.7 + @bug 6193279
310.8 + @summary REGRESSION: AppletViewer throws IOException when path is encoded URL
310.9 + @author Dmitry.Cherepanov@SUN.COM : area=appletviewer
310.10 + @run compile IOExceptionIfEncodedURLTest.java
310.11 + @run shell IOExceptionIfEncodedURLTest.sh
310.12 + -->
310.13 +<head>
310.14 +<title>Started by shell script</title>
310.15 +</head>
310.16 +<body>
310.17 +
310.18 +<h1>IOExceptionIfEncodedURLTest<br>Bug ID: 6193279</h1>
310.19 +
310.20 +<p> See the dialog box (usually in upper left corner) for instructions</p>
310.21 +
310.22 +<APPLET CODE="IOExceptionIfEncodedURLTest.class" WIDTH=200 HEIGHT=200></APPLET>
310.23 +</body>
310.24 +</html>
310.25 \ No newline at end of file
311.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
311.2 +++ b/test/java/awt/xembed/server/JavaClient.java Fri May 16 12:25:57 2008 -0700
311.3 @@ -0,0 +1,126 @@
311.4 +/*
311.5 + * Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
311.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
311.7 + *
311.8 + * This code is free software; you can redistribute it and/or modify it
311.9 + * under the terms of the GNU General Public License version 2 only, as
311.10 + * published by the Free Software Foundation.
311.11 + *
311.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
311.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
311.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
311.15 + * version 2 for more details (a copy is included in the LICENSE file that
311.16 + * accompanied this code).
311.17 + *
311.18 + * You should have received a copy of the GNU General Public License version
311.19 + * 2 along with this work; if not, write to the Free Software Foundation,
311.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
311.21 + *
311.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
311.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
311.24 + * have any questions.
311.25 + */
311.26 +
311.27 +import java.awt.*;
311.28 +import sun.awt.*;
311.29 +import java.awt.event.*;
311.30 +import java.lang.reflect.*;
311.31 +import java.awt.dnd.*;
311.32 +import java.awt.datatransfer.*;
311.33 +
311.34 +public class JavaClient {
311.35 + ClientContainer cont;
311.36 + public static void main(String[] args) {
311.37 + if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
311.38 + return;
311.39 + }
311.40 +
311.41 + // Enable testing extensions in XEmbed server
311.42 + System.setProperty("sun.awt.xembed.testing", "true");
311.43 +
311.44 + boolean xtoolkit = "sun.awt.X11.XToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName());
311.45 + final EmbeddedFrame ef = createEmbeddedFrame(xtoolkit, Long.parseLong(args[0]));
311.46 + ef.setBackground(new Color(100, 100, 200));
311.47 + ef.setLayout(new BorderLayout());
311.48 + ef.add(new ClientContainer(ef), BorderLayout.CENTER);
311.49 + ef.pack();
311.50 + ef.registerListeners();
311.51 + ef.setVisible(true);
311.52 + }
311.53 + private static EmbeddedFrame createEmbeddedFrame(boolean xtoolkit, long window) {
311.54 + try {
311.55 + Class cl = (xtoolkit?Class.forName("sun.awt.X11.XEmbeddedFrame"):Class.forName("sun.awt.motif.MEmbeddedFrame"));
311.56 + Constructor cons = cl.getConstructor(new Class[]{Long.TYPE, Boolean.TYPE});
311.57 + return (EmbeddedFrame)cons.newInstance(new Object[] {window, true});
311.58 + } catch (Exception e) {
311.59 + e.printStackTrace();
311.60 + throw new RuntimeException("Can't create embedded frame");
311.61 + }
311.62 + }
311.63 +}
311.64 +
311.65 +class ClientContainer extends Container {
311.66 + Window parent;
311.67 + int width, height;
311.68 + public ClientContainer(Window w) {
311.69 + parent = w;
311.70 + width = 500;
311.71 + height = 50;
311.72 + final TextField tf = new TextField(30);
311.73 +
311.74 + DragSource ds = new DragSource();
311.75 + final DragSourceListener dsl = new DragSourceAdapter() {
311.76 + public void dragDropEnd(DragSourceDropEvent dsde) {
311.77 + }
311.78 + };
311.79 + final DragGestureListener dgl = new DragGestureListener() {
311.80 + public void dragGestureRecognized(DragGestureEvent dge) {
311.81 + dge.startDrag(null, new StringSelection(tf.getText()), dsl);
311.82 + }
311.83 + };
311.84 + ds.createDefaultDragGestureRecognizer(tf, DnDConstants.ACTION_COPY, dgl);
311.85 +
311.86 + final DropTargetListener dtl = new DropTargetAdapter() {
311.87 + public void drop(DropTargetDropEvent dtde) {
311.88 + dtde.acceptDrop(DnDConstants.ACTION_COPY);
311.89 + try {
311.90 + tf.setText(tf.getText() + (String)dtde.getTransferable().getTransferData(DataFlavor.stringFlavor));
311.91 + } catch (Exception e) {
311.92 + }
311.93 + }
311.94 + };
311.95 + final DropTarget dt = new DropTarget(tf, dtl);
311.96 +
311.97 + setLayout(new FlowLayout());
311.98 + add(tf);
311.99 + Button close = new Button("Close");
311.100 + close.addActionListener(new ActionListener() {
311.101 + public void actionPerformed(ActionEvent e) {
311.102 + parent.dispose();
311.103 + }
311.104 + });
311.105 + Button inc = new Button("Increase size");
311.106 + inc.addActionListener(new ActionListener() {
311.107 + public void actionPerformed(ActionEvent e) {
311.108 + changeSize(10);
311.109 + }
311.110 + });
311.111 + Button dec = new Button("Decrease size");
311.112 + dec.addActionListener(new ActionListener() {
311.113 + public void actionPerformed(ActionEvent e) {
311.114 + changeSize(-10);
311.115 + }
311.116 + });
311.117 + add(close);
311.118 + add(inc);
311.119 + add(dec);
311.120 + }
311.121 + void changeSize(int step) {
311.122 + width += step;
311.123 + height += step;
311.124 + parent.pack();
311.125 + }
311.126 + public Dimension getPreferredSize() {
311.127 + return new Dimension(width, height);
311.128 + }
311.129 +}
312.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
312.2 +++ b/test/java/awt/xembed/server/RunTestXEmbed.java Fri May 16 12:25:57 2008 -0700
312.3 @@ -0,0 +1,176 @@
312.4 +/*
312.5 + * Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
312.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
312.7 + *
312.8 + * This code is free software; you can redistribute it and/or modify it
312.9 + * under the terms of the GNU General Public License version 2 only, as
312.10 + * published by the Free Software Foundation.
312.11 + *
312.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
312.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
312.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
312.15 + * version 2 for more details (a copy is included in the LICENSE file that
312.16 + * accompanied this code).
312.17 + *
312.18 + * You should have received a copy of the GNU General Public License version
312.19 + * 2 along with this work; if not, write to the Free Software Foundation,
312.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
312.21 + *
312.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
312.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
312.24 + * have any questions.
312.25 + */
312.26 +
312.27 +/**
312.28 + * @test
312.29 + * @bug 4931668
312.30 + * @summary Tests XEmbed server/client functionality
312.31 + * @author Denis Mikhalkin: area=awt.xembed
312.32 + * @compile JavaClient.java TesterClient.java TestXEmbedServer.java
312.33 + * @run main/timeout=6000 RunTestXEmbed
312.34 + */
312.35 +
312.36 +import java.awt.Rectangle;
312.37 +import java.lang.reflect.Method;
312.38 +import java.util.logging.*;
312.39 +import java.util.*;
312.40 +import java.io.*;
312.41 +
312.42 +public class RunTestXEmbed extends TestXEmbedServer {
312.43 + private static final Logger log = Logger.getLogger("test.xembed");
312.44 + private Method test;
312.45 + private boolean passed = false;
312.46 + public RunTestXEmbed(Method test) {
312.47 + super(false);
312.48 + this.test = test;
312.49 + }
312.50 +
312.51 + public Process startClient(Rectangle bounds[], long window) {
312.52 + try {
312.53 + String java_home = System.getProperty("java.home");
312.54 + StringBuilder buf = new StringBuilder();
312.55 + for (int i = 0; i < bounds.length; i++) {
312.56 + buf.append(" " + bounds[i].x);
312.57 + buf.append(" " + bounds[i].y);
312.58 + buf.append(" " + bounds[i].width);
312.59 + buf.append(" " + bounds[i].height);
312.60 + }
312.61 + Map envs = System.getenv();
312.62 + String enva[] = new String[envs.size()];
312.63 + int ind = 0;
312.64 + Iterator iter = envs.entrySet().iterator();
312.65 + while (iter.hasNext()) {
312.66 + Map.Entry entry = (Map.Entry)iter.next();
312.67 + if (!"AWT_TOOLKIT".equals(entry.getKey())) {
312.68 + enva[ind++] = entry.getKey() + "=" + entry.getValue();
312.69 + } else {
312.70 + enva[ind++] = "AWT_TOOLKIT=sun.awt.X11.XToolkit";
312.71 + }
312.72 + }
312.73 + Process proc = Runtime.getRuntime().exec(java_home +
312.74 + "/bin/java -Dawt.toolkit=sun.awt.X11.XToolkit TesterClient "
312.75 + + test.getName() + " " + window + buf,
312.76 + enva);
312.77 + System.err.println("Test for " + test.getName() + " has started.");
312.78 + log.fine("Test for " + test.getName() + " has started.");
312.79 + new InputReader(proc.getInputStream());
312.80 + new InputReader(proc.getErrorStream());
312.81 + try {
312.82 + passed = (proc.waitFor() == 0);
312.83 + } catch (InterruptedException ie) {
312.84 + }
312.85 + log.fine("Test for " + test.getName() + " has finished.");
312.86 + File logFile = new File("java3.txt");
312.87 + if (logFile.exists()) {
312.88 + logFile.renameTo(new File(test.getName() + ".txt"));
312.89 + }
312.90 + return proc;
312.91 + } catch (IOException ex1) {
312.92 + ex1.printStackTrace();
312.93 + }
312.94 + return null;
312.95 + }
312.96 +
312.97 + public static void main(String[] args) throws Throwable {
312.98 + if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
312.99 + return;
312.100 + }
312.101 +
312.102 + // Enabled XEmbed
312.103 + System.setProperty("sun.awt.xembedserver", "true");
312.104 +
312.105 + if (args.length == 1) {
312.106 + Class cl = Class.forName("sun.awt.X11.XEmbedServerTester");
312.107 + Method meth = cl.getMethod(args[0], new Class[0]);
312.108 + System.err.println("Performing single test " + args[0]);
312.109 + boolean res = performTest(meth);
312.110 + if (!res) {
312.111 + System.err.println("Test " + args[0] + " has failed");
312.112 + } else {
312.113 + System.err.println("Test " + args[0] + " has passed");
312.114 + }
312.115 + } else {
312.116 + Class cl = Class.forName("sun.awt.X11.XEmbedServerTester");
312.117 + Method[] meths = cl.getMethods();
312.118 + LinkedList failed = new LinkedList();
312.119 + for (int i = 0; i < meths.length; i++) {
312.120 + Method meth = meths[i];
312.121 + if (meth.getReturnType() == Void.TYPE && meth.getName().startsWith("test") && meth.getParameterTypes().length == 0) {
312.122 + System.err.println("Performing " + meth.getName());
312.123 + boolean res = performTest(meth);
312.124 + if (!res) {
312.125 + failed.add(meth);
312.126 + }
312.127 + }
312.128 + }
312.129 + log.info("Testing finished.");
312.130 + if (failed.size() != 0) {
312.131 + System.err.println("Some tests have failed:");
312.132 + Iterator iter = failed.iterator();
312.133 + while(iter.hasNext()) {
312.134 + Method meth = (Method)iter.next();
312.135 + System.err.println(meth.getName());
312.136 + }
312.137 + throw new RuntimeException("TestFAILED: some of the testcases are failed");
312.138 + } else {
312.139 + System.err.println("All PASSED");
312.140 + }
312.141 + }
312.142 + }
312.143 +
312.144 + private static boolean performTest(Method meth) {
312.145 + RunTestXEmbed test = new RunTestXEmbed(meth);
312.146 + test.addClient();
312.147 + test.dispose();
312.148 + return test.isPassed();
312.149 + }
312.150 +
312.151 + public boolean isPassed() {
312.152 + return passed;
312.153 + }
312.154 +}
312.155 +
312.156 +class InputReader extends Thread {
312.157 + private InputStream stream;
312.158 + public InputReader(InputStream stream) {
312.159 + this.stream = stream;
312.160 + start();
312.161 + }
312.162 + public void run() {
312.163 + while (!interrupted()) {
312.164 + try {
312.165 + int inp = stream.read();
312.166 + if (inp != -1) {
312.167 + System.out.write(inp);
312.168 + } else {
312.169 + try {
312.170 + Thread.sleep(100);
312.171 + } catch (Exception iie) {
312.172 + }
312.173 + }
312.174 + } catch (IOException ie) {
312.175 + break;
312.176 + }
312.177 + }
312.178 + }
312.179 +}
313.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
313.2 +++ b/test/java/awt/xembed/server/TestXEmbedServer.java Fri May 16 12:25:57 2008 -0700
313.3 @@ -0,0 +1,228 @@
313.4 +/*
313.5 + * Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
313.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
313.7 + *
313.8 + * This code is free software; you can redistribute it and/or modify it
313.9 + * under the terms of the GNU General Public License version 2 only, as
313.10 + * published by the Free Software Foundation.
313.11 + *
313.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
313.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
313.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
313.15 + * version 2 for more details (a copy is included in the LICENSE file that
313.16 + * accompanied this code).
313.17 + *
313.18 + * You should have received a copy of the GNU General Public License version
313.19 + * 2 along with this work; if not, write to the Free Software Foundation,
313.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
313.21 + *
313.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
313.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
313.24 + * have any questions.
313.25 + */
313.26 +
313.27 +import java.awt.*;
313.28 +import java.awt.event.*;
313.29 +import javax.swing.*;
313.30 +import java.io.*;
313.31 +import java.util.logging.*;
313.32 +import sun.awt.WindowIDProvider;
313.33 +import java.awt.dnd.*;
313.34 +import java.awt.datatransfer.*;
313.35 +
313.36 +public abstract class TestXEmbedServer {
313.37 + private static final Logger log = Logger.getLogger("test.xembed");
313.38 + Frame f;
313.39 + Canvas client;
313.40 + Button toFocus;
313.41 + Button b_modal;
313.42 + JButton b_close;
313.43 + JDialog modal_d;
313.44 + JFrame dummy;
313.45 + Container clientCont;
313.46 + boolean passed;
313.47 +
313.48 + public boolean isPassed() {
313.49 + return passed;
313.50 + }
313.51 +
313.52 + public TestXEmbedServer(boolean manual) {
313.53 +
313.54 + // Enable testing extensions in XEmbed server
313.55 + System.setProperty("sun.awt.xembed.testing", "true");
313.56 +
313.57 + f = new Frame("Main frame");
313.58 + f.addWindowListener(new WindowAdapter() {
313.59 + public void windowClosing(WindowEvent e) {
313.60 + synchronized(TestXEmbedServer.this) {
313.61 + TestXEmbedServer.this.notifyAll();
313.62 + }
313.63 + dummy.dispose();
313.64 + f.dispose();
313.65 + }
313.66 + });
313.67 +
313.68 + f.setLayout(new BorderLayout());
313.69 +
313.70 + Container bcont = new Container();
313.71 +
313.72 + toFocus = new Button("Click to focus server");
313.73 + final TextField tf = new TextField(20);
313.74 + tf.setName("0");
313.75 + DragSource ds = new DragSource();
313.76 + final DragSourceListener dsl = new DragSourceAdapter() {
313.77 + public void dragDropEnd(DragSourceDropEvent dsde) {
313.78 + }
313.79 + };
313.80 + final DragGestureListener dgl = new DragGestureListener() {
313.81 + public void dragGestureRecognized(DragGestureEvent dge) {
313.82 + dge.startDrag(null, new StringSelection(tf.getText()), dsl);
313.83 + }
313.84 + };
313.85 + ds.createDefaultDragGestureRecognizer(tf, DnDConstants.ACTION_COPY, dgl);
313.86 +
313.87 + final DropTargetListener dtl = new DropTargetAdapter() {
313.88 + public void drop(DropTargetDropEvent dtde) {
313.89 + dtde.acceptDrop(DnDConstants.ACTION_COPY);
313.90 + try {
313.91 + tf.setText(tf.getText() + (String)dtde.getTransferable().getTransferData(DataFlavor.stringFlavor));
313.92 + } catch (Exception e) {
313.93 + }
313.94 + }
313.95 + };
313.96 + final DropTarget dt = new DropTarget(tf, dtl);
313.97 +
313.98 + Button b_add = new Button("Add client");
313.99 + b_add.addActionListener(new ActionListener() {
313.100 + public void actionPerformed(ActionEvent e) {
313.101 + addClient();
313.102 + }
313.103 + });
313.104 + Button b_remove = new Button("Remove client");
313.105 + b_remove.addActionListener(new ActionListener() {
313.106 + public void actionPerformed(ActionEvent e) {
313.107 + if (clientCont.getComponentCount() != 0) {
313.108 + clientCont.remove(clientCont.getComponentCount()-1);
313.109 + }
313.110 + }
313.111 + });
313.112 + b_close = new JButton("Close modal dialog");
313.113 + b_close.addActionListener(new ActionListener() {
313.114 + public void actionPerformed(ActionEvent e) {
313.115 + modal_d.dispose();
313.116 + }
313.117 + });
313.118 + b_modal = new Button("Show modal dialog");
313.119 + b_modal.addActionListener(new ActionListener() {
313.120 + public void actionPerformed(ActionEvent e) {
313.121 + modal_d = new JDialog(f, "Modal dialog", true);
313.122 + modal_d.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
313.123 + modal_d.setBounds(0, 100, 200, 50);
313.124 + modal_d.getContentPane().add(b_close);
313.125 + modal_d.validate();
313.126 + modal_d.show();
313.127 + }
313.128 + });
313.129 +
313.130 + bcont.add(tf);
313.131 + bcont.add(toFocus);
313.132 + bcont.add(b_add);
313.133 + bcont.add(b_remove);
313.134 + bcont.add(b_modal);
313.135 + if (manual) {
313.136 + Button pass = new Button("Pass");
313.137 + pass.addActionListener(new ActionListener() {
313.138 + public void actionPerformed(ActionEvent e) {
313.139 + passed = true;
313.140 + synchronized(TestXEmbedServer.this) {
313.141 + TestXEmbedServer.this.notifyAll();
313.142 + }
313.143 + }
313.144 + });
313.145 + bcont.add(pass);
313.146 + Button fail = new Button("Fail");
313.147 + fail.addActionListener(new ActionListener() {
313.148 + public void actionPerformed(ActionEvent e) {
313.149 + passed = false;
313.150 + synchronized(TestXEmbedServer.this) {
313.151 + TestXEmbedServer.this.notifyAll();
313.152 + }
313.153 + }
313.154 + });
313.155 + bcont.add(fail);
313.156 + }
313.157 + b_modal.setName("2");
313.158 + bcont.setLayout(new FlowLayout());
313.159 + f.add(bcont, BorderLayout.NORTH);
313.160 +
313.161 + clientCont = Box.createVerticalBox();
313.162 + f.add(clientCont, BorderLayout.CENTER);
313.163 +
313.164 + dummy = new JFrame("Dummy");
313.165 + dummy.getContentPane().add(new JButton("Button"));
313.166 + dummy.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
313.167 + dummy.setBounds(0, 0, 100, 100);
313.168 + dummy.setVisible(true);
313.169 +
313.170 + f.setBounds(300, 0, 800, 300);
313.171 + f.setVisible(true);
313.172 + }
313.173 +
313.174 + public abstract Process startClient(Rectangle bounds[], long window);
313.175 +
313.176 + public void addClient() {
313.177 + client = new Canvas() {
313.178 + public void paint(Graphics g) {
313.179 + super.paint(g);
313.180 + }
313.181 + };
313.182 + client.setBackground(new Color(30, 220, 40));
313.183 + clientCont.add(client);
313.184 + clientCont.validate();
313.185 + WindowIDProvider pid = (WindowIDProvider)client.getPeer();
313.186 + log.fine("Added XEmbed server(Canvas) with X window ID " + pid.getWindow());
313.187 + Rectangle toFocusBounds = toFocus.getBounds();
313.188 + toFocusBounds.setLocation(toFocus.getLocationOnScreen());
313.189 + f.validate();
313.190 +
313.191 + // KDE doesn't accept clicks on title as activation - click below title
313.192 + Rectangle fbounds = f.getBounds();
313.193 + fbounds.y += f.getInsets().top;
313.194 + fbounds.height -= f.getInsets().top;
313.195 +
313.196 + Process proc = startClient(new Rectangle[] {fbounds, dummy.getBounds(), toFocusBounds,
313.197 + new Rectangle(b_modal.getLocationOnScreen(), b_modal.getSize()),
313.198 + new Rectangle(10, 130, 20, 20)}, pid.getWindow());
313.199 + new ClientWatcher(client, proc, clientCont).start();
313.200 + }
313.201 +
313.202 + public void dispose() {
313.203 + f.dispose();
313.204 + f = null;
313.205 + dummy.dispose();
313.206 + dummy = null;
313.207 + if (modal_d != null) {
313.208 + modal_d.dispose();
313.209 + modal_d = null;
313.210 + }
313.211 + }
313.212 +}
313.213 +
313.214 +class ClientWatcher extends Thread {
313.215 + private Process clientProcess;
313.216 + private Canvas client;
313.217 + private Container parent;
313.218 + public ClientWatcher(Canvas client, Process proc, Container parent) {
313.219 + this.client = client;
313.220 + this.clientProcess = proc;
313.221 + this.parent = parent;
313.222 + }
313.223 +
313.224 + public void run() {
313.225 + try {
313.226 + clientProcess.waitFor();
313.227 + } catch (InterruptedException ie) {
313.228 + }
313.229 + parent.remove(client);
313.230 + }
313.231 +}
314.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
314.2 +++ b/test/java/awt/xembed/server/TestXEmbedServerJava.java Fri May 16 12:25:57 2008 -0700
314.3 @@ -0,0 +1,86 @@
314.4 +/*
314.5 + * Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
314.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
314.7 + *
314.8 + * This code is free software; you can redistribute it and/or modify it
314.9 + * under the terms of the GNU General Public License version 2 only, as
314.10 + * published by the Free Software Foundation.
314.11 + *
314.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
314.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
314.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
314.15 + * version 2 for more details (a copy is included in the LICENSE file that
314.16 + * accompanied this code).
314.17 + *
314.18 + * You should have received a copy of the GNU General Public License version
314.19 + * 2 along with this work; if not, write to the Free Software Foundation,
314.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
314.21 + *
314.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
314.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
314.24 + * have any questions.
314.25 + */
314.26 +
314.27 +/**
314.28 + * @test
314.29 + * @bug 4931668
314.30 + * @summary Tests XEmbed server/client functionality
314.31 + * @author denis mikhalkin: area=awt.xembed
314.32 + * @compile JavaClient.java TesterClient.java TestXEmbedServer.java
314.33 + * @run main/manual TestXEmbedServerJava
314.34 + */
314.35 +
314.36 +import java.awt.*;
314.37 +import java.awt.event.*;
314.38 +import javax.swing.*;
314.39 +import java.io.*;
314.40 +
314.41 +public class TestXEmbedServerJava extends TestXEmbedServer {
314.42 + public static void main(String[] args) {
314.43 + if (System.getProperty("os.name").toLowerCase().startsWith("win")) {
314.44 + return;
314.45 + }
314.46 +
314.47 + // Enabled XEmbed
314.48 + System.setProperty("sun.awt.xembedserver", "true");
314.49 +
314.50 + String instruction =
314.51 + "This is a manual test for XEmbed server functionality. \n" +
314.52 + "You may start XEmbed client by pressing 'Add client' button.\n" +
314.53 + "Check that focus transfer with mouse works, that focus traversal with Tab/Shift-Tab works.\n" +
314.54 + "Check that XEmbed server client's growing and shrinking.\n" +
314.55 + "Check that Drag&Drop works in all combinations.\n" +
314.56 + "Check the keyboard input works in both text fields.\n";
314.57 + Frame f = new Frame("Instructions");
314.58 + f.setLayout(new BorderLayout());
314.59 + f.add(new TextArea(instruction), BorderLayout.CENTER);
314.60 + f.pack();
314.61 + f.setLocation(0, 400);
314.62 + f.setVisible(true);
314.63 +
314.64 + TestXEmbedServerJava lock = new TestXEmbedServerJava();
314.65 + try {
314.66 + synchronized(lock) {
314.67 + lock.wait();
314.68 + }
314.69 + } catch (InterruptedException e) {
314.70 + }
314.71 + if (!lock.isPassed()) {
314.72 + throw new RuntimeException("Test failed");
314.73 + }
314.74 + }
314.75 +
314.76 + public TestXEmbedServerJava() {
314.77 + super(true);
314.78 + }
314.79 +
314.80 + public Process startClient(Rectangle[] bounds, long window) {
314.81 + try {
314.82 + String java_home = System.getProperty("java.home");
314.83 + return Runtime.getRuntime().exec(java_home + "/bin/java JavaClient " + window);
314.84 + } catch (IOException ex1) {
314.85 + ex1.printStackTrace();
314.86 + }
314.87 + return null;
314.88 + }
314.89 +}
315.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
315.2 +++ b/test/java/awt/xembed/server/TesterClient.java Fri May 16 12:25:57 2008 -0700
315.3 @@ -0,0 +1,59 @@
315.4 +/*
315.5 + * Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
315.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
315.7 + *
315.8 + * This code is free software; you can redistribute it and/or modify it
315.9 + * under the terms of the GNU General Public License version 2 only, as
315.10 + * published by the Free Software Foundation.
315.11 + *
315.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
315.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
315.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
315.15 + * version 2 for more details (a copy is included in the LICENSE file that
315.16 + * accompanied this code).
315.17 + *
315.18 + * You should have received a copy of the GNU General Public License version
315.19 + * 2 along with this work; if not, write to the Free Software Foundation,
315.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
315.21 + *
315.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
315.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
315.24 + * have any questions.
315.25 + */
315.26 +
315.27 +import java.lang.reflect.*;
315.28 +import java.awt.Rectangle;
315.29 +import java.util.logging.*;
315.30 +
315.31 +public class TesterClient {
315.32 + private static final Logger log = Logger.getLogger("test.xembed.TesterClient");
315.33 + private static Method test;
315.34 + private static boolean passed = false;
315.35 + public static void main(String[] args) throws Throwable {
315.36 + // First parameter is the name of the test, second is the window, the rest are rectangles
315.37 + Class cl = Class.forName("sun.awt.X11.XEmbedServerTester");
315.38 + test = cl.getMethod(args[0], new Class[0]);
315.39 + long window = Long.parseLong(args[1]);
315.40 + Rectangle r[] = new Rectangle[(args.length-2)/4];
315.41 + for (int i = 0; i < r.length; i++) {
315.42 + r[i] = new Rectangle(Integer.parseInt(args[2+i*4]), Integer.parseInt(args[2+i*4+1]),
315.43 + Integer.parseInt(args[2+i*4+2]), Integer.parseInt(args[2+i*4+3]));
315.44 + }
315.45 + startClient(r, window);
315.46 + }
315.47 +
315.48 + public static void startClient(Rectangle bounds[], long window) throws Throwable {
315.49 + Method m_getTester = Class.forName("sun.awt.X11.XEmbedServerTester").
315.50 + getMethod("getTester", new Class[] {bounds.getClass(), Long.TYPE});
315.51 + final Object tester = m_getTester.invoke(null, new Object[] {bounds, window});
315.52 + try {
315.53 + log.info("Starting test " + test.getName());
315.54 + test.invoke(tester, (Object[])null);
315.55 + log.info("Test " + test.getName() + " PASSED.");
315.56 + passed = true;
315.57 + } catch (Exception e) {
315.58 + log.log(Level.WARNING, "Test " + test.getName() + " FAILED.", e);
315.59 + }
315.60 + System.exit(passed?0:1);
315.61 + }
315.62 +}
316.1 --- a/test/java/beans/Introspector/BeanUtils.java Mon May 12 18:06:23 2008 -0700
316.2 +++ b/test/java/beans/Introspector/BeanUtils.java Fri May 16 12:25:57 2008 -0700
316.3 @@ -1,5 +1,5 @@
316.4 /*
316.5 - * Copyright 2003-2007 Sun Microsystems, Inc. All Rights Reserved.
316.6 + * Copyright 2003-2008 Sun Microsystems, Inc. All Rights Reserved.
316.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
316.8 *
316.9 * This code is free software; you can redistribute it and/or modify it
316.10 @@ -21,6 +21,7 @@
316.11 * have any questions.
316.12 */
316.13
316.14 +import java.beans.BeanDescriptor;
316.15 import java.beans.EventSetDescriptor;
316.16 import java.beans.IndexedPropertyDescriptor;
316.17 import java.beans.IntrospectionException;
316.18 @@ -39,13 +40,26 @@
316.19 }
316.20
316.21 /**
316.22 + * Returns a bean descriptor for specified class.
316.23 + *
316.24 + * @param type the class to introspect
316.25 + * @return a bean descriptor
316.26 + */
316.27 + public static BeanDescriptor getBeanDescriptor(Class type) {
316.28 + try {
316.29 + return Introspector.getBeanInfo(type).getBeanDescriptor();
316.30 + } catch (IntrospectionException exception) {
316.31 + throw new Error("unexpected exception", exception);
316.32 + }
316.33 + }
316.34 +
316.35 + /**
316.36 * Returns an array of property descriptors for specified class.
316.37 *
316.38 * @param type the class to introspect
316.39 * @return an array of property descriptors
316.40 */
316.41 public static PropertyDescriptor[] getPropertyDescriptors(Class type) {
316.42 - System.out.println(type);
316.43 try {
316.44 return Introspector.getBeanInfo(type).getPropertyDescriptors();
316.45 } catch (IntrospectionException exception) {
316.46 @@ -54,6 +68,38 @@
316.47 }
316.48
316.49 /**
316.50 + * Returns an array of event set descriptors for specified class.
316.51 + *
316.52 + * @param type the class to introspect
316.53 + * @return an array of event set descriptors
316.54 + */
316.55 + public static EventSetDescriptor[] getEventSetDescriptors(Class type) {
316.56 + try {
316.57 + return Introspector.getBeanInfo(type).getEventSetDescriptors();
316.58 + } catch (IntrospectionException exception) {
316.59 + throw new Error("unexpected exception", exception);
316.60 + }
316.61 + }
316.62 +
316.63 + /**
316.64 + * Finds an event set descriptor for the class
316.65 + * that matches the event set name.
316.66 + *
316.67 + * @param type the class to introspect
316.68 + * @param name the name of the event set to search
316.69 + * @return the {@code EventSetDescriptor} or {@code null}
316.70 + */
316.71 + public static EventSetDescriptor findEventSetDescriptor(Class type, String name) {
316.72 + EventSetDescriptor[] esds = getEventSetDescriptors(type);
316.73 + for (EventSetDescriptor esd : esds) {
316.74 + if (esd.getName().equals(name)) {
316.75 + return esd;
316.76 + }
316.77 + }
316.78 + return null;
316.79 + }
316.80 +
316.81 + /**
316.82 * Finds a property descriptor for the class
316.83 * that matches the property name.
316.84 *
316.85 @@ -72,6 +118,22 @@
316.86 }
316.87
316.88 /**
316.89 + * Returns a event set descriptor for the class
316.90 + * that matches the property name.
316.91 + *
316.92 + * @param type the class to introspect
316.93 + * @param name the name of the event set to search
316.94 + * @return the {@code EventSetDescriptor}
316.95 + */
316.96 + public static EventSetDescriptor getEventSetDescriptor(Class type, String name) {
316.97 + EventSetDescriptor esd = findEventSetDescriptor(type, name);
316.98 + if (esd != null) {
316.99 + return esd;
316.100 + }
316.101 + throw new Error("could not find event set '" + name + "' in " + type);
316.102 + }
316.103 +
316.104 + /**
316.105 * Returns a property descriptor for the class
316.106 * that matches the property name.
316.107 *
317.1 --- a/test/java/beans/Introspector/Test4896879.java Mon May 12 18:06:23 2008 -0700
317.2 +++ b/test/java/beans/Introspector/Test4896879.java Fri May 16 12:25:57 2008 -0700
317.3 @@ -28,22 +28,16 @@
317.4 * @author Mark Davidson
317.5 */
317.6
317.7 -import java.beans.BeanInfo;
317.8 -import java.beans.EventSetDescriptor;
317.9 -import java.beans.IntrospectionException;
317.10 -import java.beans.Introspector;
317.11 import java.util.EventListener;
317.12
317.13 public class Test4896879 {
317.14 - public static void main(String[] args) throws IntrospectionException {
317.15 + public static void main(String[] args) {
317.16 test(A.class);
317.17 test(B.class);
317.18 }
317.19
317.20 - private static void test(Class type) throws IntrospectionException {
317.21 - BeanInfo info = Introspector.getBeanInfo(type);
317.22 - EventSetDescriptor[] descriptors = info.getEventSetDescriptors();
317.23 - if (descriptors.length != 0) {
317.24 + private static void test(Class type) {
317.25 + if (BeanUtils.getEventSetDescriptors(type).length != 0) {
317.26 throw new Error("Should not have any EventSetDescriptors");
317.27 }
317.28 }
318.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
318.2 +++ b/test/java/beans/Introspector/Test4935607.java Fri May 16 12:25:57 2008 -0700
318.3 @@ -0,0 +1,404 @@
318.4 +/*
318.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
318.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
318.7 + *
318.8 + * This code is free software; you can redistribute it and/or modify it
318.9 + * under the terms of the GNU General Public License version 2 only, as
318.10 + * published by the Free Software Foundation.
318.11 + *
318.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
318.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
318.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
318.15 + * version 2 for more details (a copy is included in the LICENSE file that
318.16 + * accompanied this code).
318.17 + *
318.18 + * You should have received a copy of the GNU General Public License version
318.19 + * 2 along with this work; if not, write to the Free Software Foundation,
318.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
318.21 + *
318.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
318.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
318.24 + * have any questions.
318.25 + */
318.26 +
318.27 +/*
318.28 + * @test %I% %G%
318.29 + * @bug 4935607
318.30 + * @summary Tests transient properties
318.31 + * @author Sergey Malenkov
318.32 + */
318.33 +
318.34 +import java.awt.Component;
318.35 +import java.awt.Dimension;
318.36 +import java.awt.Point;
318.37 +import java.awt.Rectangle;
318.38 +import java.awt.ScrollPane;
318.39 +import java.awt.geom.RectangularShape;
318.40 +import java.awt.im.InputContext;
318.41 +
318.42 +import java.beans.FeatureDescriptor;
318.43 +import java.beans.Transient;
318.44 +
318.45 +import java.util.EventListener;
318.46 +
318.47 +import javax.swing.AbstractButton;
318.48 +import javax.swing.DefaultListSelectionModel;
318.49 +import javax.swing.ImageIcon;
318.50 +import javax.swing.JComboBox;
318.51 +import javax.swing.JComponent;
318.52 +import javax.swing.JLabel;
318.53 +import javax.swing.JList;
318.54 +import javax.swing.JMenuBar;
318.55 +import javax.swing.JScrollPane;
318.56 +import javax.swing.JTabbedPane;
318.57 +import javax.swing.JViewport;
318.58 +import javax.swing.table.JTableHeader;
318.59 +import javax.swing.text.JTextComponent;
318.60 +
318.61 +public class Test4935607 {
318.62 + public static void main(String[] args) {
318.63 + // test all possible cases
318.64 + test(Null.class);
318.65 + test(True.class);
318.66 + test(False.class);
318.67 + test(NullNull.class);
318.68 + test(TrueNull.class);
318.69 + test(FalseNull.class);
318.70 + test(NullTrue.class);
318.71 + test(TrueTrue.class);
318.72 + test(FalseTrue.class);
318.73 + test(NullFalse.class);
318.74 + test(TrueFalse.class);
318.75 + test(FalseFalse.class);
318.76 + // test transient properties in AWT
318.77 + test(RectangularShape.class, "frame"); // NON-NLS: getFrame()
318.78 + test(Rectangle.class, "bounds"); // NON-NLS: getBounds()
318.79 + test(Dimension.class, "size"); // NON-NLS: getSize()
318.80 + test(Point.class, "location"); // NON-NLS: getLocation()
318.81 + test(Component.class, "foreground"); // NON-NLS: getForeground()
318.82 + test(Component.class, "background"); // NON-NLS: getBackground()
318.83 + test(Component.class, "font"); // NON-NLS: getFont()
318.84 + test(Component.class, "visible"); // NON-NLS: getVisible()
318.85 + test(ScrollPane.class, "scrollPosition"); // NON-NLS: getScrollPosition()
318.86 + test(InputContext.class, "compositionEnabled"); // NON-NLS: getCompositionEnabled()
318.87 + // test transient properties in Swing
318.88 + test(JComponent.class, "minimumSize"); // NON-NLS: getMinimumSize()
318.89 + test(JComponent.class, "preferredSize"); // NON-NLS: getPreferredSize()
318.90 + test(JComponent.class, "maximumSize"); // NON-NLS: getMaximumSize()
318.91 + test(ImageIcon.class, "image"); // NON-NLS: getImage()
318.92 + test(ImageIcon.class, "imageObserver"); // NON-NLS: getImageObserver()
318.93 + test(JMenuBar.class, "helpMenu"); // NON-NLS: getHelpMenu()
318.94 + test(JScrollPane.class, "verticalScrollBar"); // NON-NLS: getVerticalScrollBar()
318.95 + test(JScrollPane.class, "horizontalScrollBar"); // NON-NLS: getHorizontalScrollBar()
318.96 + test(JScrollPane.class, "rowHeader"); // NON-NLS: getRowHeader()
318.97 + test(JScrollPane.class, "columnHeader"); // NON-NLS: getColumnHeader()
318.98 + test(JViewport.class, "extentSize"); // NON-NLS: getExtentSize()
318.99 + test(JTableHeader.class, "defaultRenderer"); // NON-NLS: getDefaultRenderer()
318.100 + test(JList.class, "cellRenderer"); // NON-NLS: getCellRenderer()
318.101 + test(JList.class, "selectedIndices"); // NON-NLS: getSelectedIndices()
318.102 + test(DefaultListSelectionModel.class, "leadSelectionIndex"); // NON-NLS: getLeadSelectionIndex()
318.103 + test(DefaultListSelectionModel.class, "anchorSelectionIndex"); // NON-NLS: getAnchorSelectionIndex()
318.104 + test(JComboBox.class, "selectedIndex"); // NON-NLS: getSelectedIndex()
318.105 + test(JTabbedPane.class, "selectedIndex"); // NON-NLS: getSelectedIndex()
318.106 + test(JTabbedPane.class, "selectedComponent"); // NON-NLS: getSelectedComponent()
318.107 + test(AbstractButton.class, "disabledIcon"); // NON-NLS: getDisabledIcon()
318.108 + test(JLabel.class, "disabledIcon"); // NON-NLS: getDisabledIcon()
318.109 + test(JTextComponent.class, "caret"); // NON-NLS: getCaret()
318.110 + test(JTextComponent.class, "caretPosition"); // NON-NLS: getCaretPosition()
318.111 + test(JTextComponent.class, "selectionStart"); // NON-NLS: getSelectionStart()
318.112 + test(JTextComponent.class, "selectionEnd"); // NON-NLS: getSelectionEnd()
318.113 + }
318.114 +
318.115 + private static void test(Class type) {
318.116 + Object value = getExpectedValue(type);
318.117 + test(value, BeanUtils.getPropertyDescriptor(type, "property")); // NON-NLS: the property to check
318.118 + test(value, BeanUtils.getEventSetDescriptor(type, "eventSet")); // NON-NLS: the event set to check
318.119 + System.out.println();
318.120 + }
318.121 +
318.122 + private static void test(Class type, String property) {
318.123 + System.out.print(type.getName() + ": ");
318.124 + test(Boolean.TRUE, BeanUtils.getPropertyDescriptor(type, property));
318.125 + }
318.126 +
318.127 + private static void test(Object expected, FeatureDescriptor fd) {
318.128 + System.out.println(fd.getName());
318.129 + Object actual = fd.getValue("transient"); // NON-NLS: the attribute name
318.130 + if ((actual == null) ? (expected != null) : !actual.equals(expected))
318.131 + throw new Error("expected " + expected + " value, but actual value is " + actual);
318.132 + }
318.133 +
318.134 + private static Object getExpectedValue(Class type) {
318.135 + try {
318.136 + return type.getField("VALUE").get(type); // NON-NLS: the field name with expected value
318.137 + } catch (NoSuchFieldException exception) {
318.138 + return null;
318.139 + } catch (IllegalAccessException exception) {
318.140 + throw new Error("unexpected error", exception);
318.141 + }
318.142 + }
318.143 +
318.144 +
318.145 + public static class Null {
318.146 + public Object getProperty() {
318.147 + return this;
318.148 + }
318.149 +
318.150 + public void setProperty(Object object) {
318.151 + }
318.152 +
318.153 + public void addEventSetListener(EventSetListener listener) {
318.154 + }
318.155 +
318.156 + public void removeEventSetListener(EventSetListener listener) {
318.157 + }
318.158 + }
318.159 +
318.160 + public static class True {
318.161 + public static final Boolean VALUE = Boolean.TRUE;
318.162 +
318.163 + @Transient
318.164 + public Object getProperty() {
318.165 + return this;
318.166 + }
318.167 +
318.168 + @Transient
318.169 + public void setProperty(Object object) {
318.170 + }
318.171 +
318.172 + @Transient
318.173 + public void addEventSetListener(EventSetListener listener) {
318.174 + }
318.175 +
318.176 + @Transient
318.177 + public void removeEventSetListener(EventSetListener listener) {
318.178 + }
318.179 + }
318.180 +
318.181 + public static class False {
318.182 + public static final Boolean VALUE = Boolean.FALSE;
318.183 +
318.184 + @Transient(false)
318.185 + public Object getProperty() {
318.186 + return this;
318.187 + }
318.188 +
318.189 + @Transient(false)
318.190 + public void setProperty(Object object) {
318.191 + }
318.192 +
318.193 + @Transient(false)
318.194 + public void addEventSetListener(EventSetListener listener) {
318.195 + }
318.196 +
318.197 + @Transient(false)
318.198 + public void removeEventSetListener(EventSetListener listener) {
318.199 + }
318.200 + }
318.201 +
318.202 + public static class NullNull extends Null {
318.203 + @Override
318.204 + public Object getProperty() {
318.205 + return this;
318.206 + }
318.207 +
318.208 + @Override
318.209 + public void setProperty(Object object) {
318.210 + }
318.211 +
318.212 + @Override
318.213 + public void addEventSetListener(EventSetListener listener) {
318.214 + }
318.215 +
318.216 + @Override
318.217 + public void removeEventSetListener(EventSetListener listener) {
318.218 + }
318.219 + }
318.220 +
318.221 + public static class TrueNull extends Null {
318.222 + public static final Boolean VALUE = Boolean.TRUE;
318.223 +
318.224 + @Override
318.225 + @Transient
318.226 + public Object getProperty() {
318.227 + return this;
318.228 + }
318.229 +
318.230 + @Override
318.231 + @Transient
318.232 + public void setProperty(Object object) {
318.233 + }
318.234 +
318.235 + @Override
318.236 + @Transient
318.237 + public void addEventSetListener(EventSetListener listener) {
318.238 + }
318.239 +
318.240 + @Override
318.241 + @Transient
318.242 + public void removeEventSetListener(EventSetListener listener) {
318.243 + }
318.244 + }
318.245 +
318.246 + public static class FalseNull extends Null {
318.247 + public static final Boolean VALUE = Boolean.FALSE;
318.248 +
318.249 + @Override
318.250 + @Transient(false)
318.251 + public Object getProperty() {
318.252 + return this;
318.253 + }
318.254 +
318.255 + @Override
318.256 + @Transient(false)
318.257 + public void setProperty(Object object) {
318.258 + }
318.259 +
318.260 + @Override
318.261 + @Transient(false)
318.262 + public void addEventSetListener(EventSetListener listener) {
318.263 + }
318.264 +
318.265 + @Override
318.266 + @Transient(false)
318.267 + public void removeEventSetListener(EventSetListener listener) {
318.268 + }
318.269 + }
318.270 +
318.271 + public static class NullTrue extends True {
318.272 + @Override
318.273 + public Object getProperty() {
318.274 + return this;
318.275 + }
318.276 +
318.277 + @Override
318.278 + public void setProperty(Object object) {
318.279 + }
318.280 +
318.281 + @Override
318.282 + public void addEventSetListener(EventSetListener listener) {
318.283 + }
318.284 +
318.285 + @Override
318.286 + public void removeEventSetListener(EventSetListener listener) {
318.287 + }
318.288 + }
318.289 +
318.290 + public static class TrueTrue extends True {
318.291 + @Override
318.292 + @Transient
318.293 + public Object getProperty() {
318.294 + return this;
318.295 + }
318.296 +
318.297 + @Override
318.298 + @Transient
318.299 + public void setProperty(Object object) {
318.300 + }
318.301 +
318.302 + @Override
318.303 + @Transient
318.304 + public void addEventSetListener(EventSetListener listener) {
318.305 + }
318.306 +
318.307 + @Override
318.308 + @Transient
318.309 + public void removeEventSetListener(EventSetListener listener) {
318.310 + }
318.311 + }
318.312 +
318.313 + public static class FalseTrue extends True {
318.314 + public static final Boolean VALUE = Boolean.FALSE;
318.315 +
318.316 + @Override
318.317 + @Transient(false)
318.318 + public Object getProperty() {
318.319 + return this;
318.320 + }
318.321 +
318.322 + @Override
318.323 + @Transient(false)
318.324 + public void setProperty(Object object) {
318.325 + }
318.326 +
318.327 + @Override
318.328 + @Transient(false)
318.329 + public void addEventSetListener(EventSetListener listener) {
318.330 + }
318.331 +
318.332 + @Override
318.333 + @Transient(false)
318.334 + public void removeEventSetListener(EventSetListener listener) {
318.335 + }
318.336 + }
318.337 +
318.338 + public static class NullFalse extends False {
318.339 + @Override
318.340 + public Object getProperty() {
318.341 + return this;
318.342 + }
318.343 +
318.344 + @Override
318.345 + public void setProperty(Object object) {
318.346 + }
318.347 +
318.348 + @Override
318.349 + public void addEventSetListener(EventSetListener listener) {
318.350 + }
318.351 +
318.352 + @Override
318.353 + public void removeEventSetListener(EventSetListener listener) {
318.354 + }
318.355 + }
318.356 +
318.357 + public static class TrueFalse extends False {
318.358 + public static final Boolean VALUE = Boolean.TRUE;
318.359 +
318.360 + @Override
318.361 + @Transient
318.362 + public Object getProperty() {
318.363 + return this;
318.364 + }
318.365 +
318.366 + @Override
318.367 + @Transient
318.368 + public void setProperty(Object object) {
318.369 + }
318.370 +
318.371 + @Override
318.372 + @Transient
318.373 + public void addEventSetListener(EventSetListener listener) {
318.374 + }
318.375 +
318.376 + @Override
318.377 + @Transient
318.378 + public void removeEventSetListener(EventSetListener listener) {
318.379 + }
318.380 + }
318.381 +
318.382 + public static class FalseFalse extends False {
318.383 + @Override
318.384 + @Transient(false)
318.385 + public Object getProperty() {
318.386 + return this;
318.387 + }
318.388 +
318.389 + @Override
318.390 + @Transient(false)
318.391 + public void setProperty(Object object) {
318.392 + }
318.393 +
318.394 + @Override
318.395 + @Transient(false)
318.396 + public void addEventSetListener(EventSetListener listener) {
318.397 + }
318.398 +
318.399 + @Override
318.400 + @Transient(false)
318.401 + public void removeEventSetListener(EventSetListener listener) {
318.402 + }
318.403 + }
318.404 +
318.405 + public static final class EventSetListener implements EventListener {
318.406 + }
318.407 +}
319.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
319.2 +++ b/test/java/beans/XMLEncoder/Test4935607.java Fri May 16 12:25:57 2008 -0700
319.3 @@ -0,0 +1,83 @@
319.4 +/*
319.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
319.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
319.7 + *
319.8 + * This code is free software; you can redistribute it and/or modify it
319.9 + * under the terms of the GNU General Public License version 2 only, as
319.10 + * published by the Free Software Foundation.
319.11 + *
319.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
319.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
319.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
319.15 + * version 2 for more details (a copy is included in the LICENSE file that
319.16 + * accompanied this code).
319.17 + *
319.18 + * You should have received a copy of the GNU General Public License version
319.19 + * 2 along with this work; if not, write to the Free Software Foundation,
319.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
319.21 + *
319.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
319.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
319.24 + * have any questions.
319.25 + */
319.26 +
319.27 +/*
319.28 + * @test %I% %G%
319.29 + * @bug 4935607
319.30 + * @summary Tests transient properties
319.31 + * @author Sergey Malenkov
319.32 + */
319.33 +
319.34 +import java.beans.Transient;
319.35 +
319.36 +public class Test4935607 extends AbstractTest<Test4935607.TransientBean> {
319.37 + public static void main(String[] args) {
319.38 + new Test4935607().test(true);
319.39 + }
319.40 +
319.41 + @Override
319.42 + protected TransientBean getObject() {
319.43 + TransientBean bean = new TransientBean();
319.44 + bean.setName("some string"); // NON-NLS: some string
319.45 + return bean;
319.46 + }
319.47 +
319.48 + @Override
319.49 + protected TransientBean getAnotherObject() {
319.50 + TransientBean bean = new TransientBean();
319.51 + bean.setName("another string"); // NON-NLS: another string
319.52 + bean.setComment("some comment"); // NON-NLS: some comment
319.53 + return bean;
319.54 + }
319.55 +
319.56 + @Override
319.57 + protected void validate(TransientBean before, TransientBean after) {
319.58 + if (!before.getName().equals(after.getName()))
319.59 + throw new Error("the name property incorrectly encoded");
319.60 +
319.61 + if (null != after.getComment())
319.62 + throw new Error("the comment property should be encoded");
319.63 + }
319.64 +
319.65 + public static class TransientBean {
319.66 + private String name;
319.67 + private String comment;
319.68 +
319.69 + public String getName() {
319.70 + return this.name;
319.71 + }
319.72 +
319.73 + public void setName(String name) {
319.74 + this.name = name;
319.75 + }
319.76 +
319.77 + @Transient
319.78 + public String getComment() {
319.79 + return this.comment;
319.80 + }
319.81 +
319.82 + public void setComment(String comment) {
319.83 + this.comment = comment;
319.84 + }
319.85 + }
319.86 +}
320.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
320.2 +++ b/test/javax/swing/JColorChooser/Test6348456.html Fri May 16 12:25:57 2008 -0700
320.3 @@ -0,0 +1,9 @@
320.4 +<html>
320.5 +<body>
320.6 +When applet starts, you'll see that the preview is white.
320.7 +When you swap models, you'll see that the preview color is changed.
320.8 +
320.9 +<applet width="500" height="400" code="Test6348456.class">
320.10 +</applet>
320.11 +</body>
320.12 +</html>
321.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
321.2 +++ b/test/javax/swing/JColorChooser/Test6348456.java Fri May 16 12:25:57 2008 -0700
321.3 @@ -0,0 +1,63 @@
321.4 +/*
321.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
321.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
321.7 + *
321.8 + * This code is free software; you can redistribute it and/or modify it
321.9 + * under the terms of the GNU General Public License version 2 only, as
321.10 + * published by the Free Software Foundation.
321.11 + *
321.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
321.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
321.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
321.15 + * version 2 for more details (a copy is included in the LICENSE file that
321.16 + * accompanied this code).
321.17 + *
321.18 + * You should have received a copy of the GNU General Public License version
321.19 + * 2 along with this work; if not, write to the Free Software Foundation,
321.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
321.21 + *
321.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
321.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
321.24 + * have any questions.
321.25 + */
321.26 +
321.27 +/*
321.28 + * @test
321.29 + * @bug 6348456
321.30 + * @summary Tests model changing
321.31 + * @author Sergey Malenkov
321.32 + * @run applet/manual=yesno Test6348456.html
321.33 + */
321.34 +
321.35 +import java.awt.BorderLayout;
321.36 +import java.awt.Color;
321.37 +import java.awt.event.ActionEvent;
321.38 +import java.awt.event.ActionListener;
321.39 +import javax.swing.JApplet;
321.40 +import javax.swing.JButton;
321.41 +import javax.swing.JColorChooser;
321.42 +import javax.swing.colorchooser.DefaultColorSelectionModel;
321.43 +
321.44 +public final class Test6348456 extends JApplet implements ActionListener {
321.45 +
321.46 + private static final DefaultColorSelectionModel WHITE = new DefaultColorSelectionModel(Color.WHITE);
321.47 + private static final DefaultColorSelectionModel BLACK = new DefaultColorSelectionModel(Color.BLACK);
321.48 +
321.49 + private JColorChooser chooser;
321.50 +
321.51 + @Override
321.52 + public void init() {
321.53 + JButton button = new JButton("Swap models");
321.54 + button.addActionListener(this);
321.55 +
321.56 + this.chooser = new JColorChooser(Color.RED);
321.57 + this.chooser.setSelectionModel(WHITE);
321.58 +
321.59 + add(BorderLayout.NORTH, button);
321.60 + add(BorderLayout.CENTER, this.chooser);
321.61 + }
321.62 +
321.63 + public void actionPerformed(ActionEvent event){
321.64 + this.chooser.setSelectionModel(this.chooser.getSelectionModel() == BLACK ? WHITE : BLACK);
321.65 + }
321.66 +}
322.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
322.2 +++ b/test/javax/swing/JEditorPane/bug4714674.java Fri May 16 12:25:57 2008 -0700
322.3 @@ -0,0 +1,124 @@
322.4 +/* @test
322.5 + @bug 4714674
322.6 + @summary Tests that JEditorPane opens HTTP connection asynchronously
322.7 + @author Peter Zhelezniakov
322.8 + @run main bug4714674
322.9 +*/
322.10 +
322.11 +import javax.swing.*;
322.12 +
322.13 +import com.sun.net.httpserver.HttpExchange;
322.14 +import com.sun.net.httpserver.HttpHandler;
322.15 +import com.sun.net.httpserver.HttpServer;
322.16 +import java.io.IOException;
322.17 +import java.net.InetSocketAddress;
322.18 +import java.util.concurrent.Executors;
322.19 +
322.20 +
322.21 +public class bug4714674 {
322.22 +
322.23 + public static void main(String[] args) throws Exception {
322.24 + new bug4714674().test();
322.25 + }
322.26 +
322.27 + private void test() throws Exception {
322.28 + final DeafServer server = new DeafServer();
322.29 + final String baseURL = "http://localhost:" + server.getPort() + "/";
322.30 +
322.31 + SwingUtilities.invokeLater(new Runnable() {
322.32 + public void run() {
322.33 + try {
322.34 + JEditorPane pane = new JEditorPane();
322.35 + ((javax.swing.text.AbstractDocument)pane.getDocument()).
322.36 + setAsynchronousLoadPriority(1);
322.37 +
322.38 + // this will block EDT unless 4714674 is fixed
322.39 + pane.setPage(baseURL);
322.40 + } catch (IOException e) {
322.41 + // should not happen
322.42 + throw new Error(e);
322.43 + }
322.44 + }
322.45 + });
322.46 +
322.47 + // if 4714674 is fixed, this executes before connection times out
322.48 + SwingUtilities.invokeLater(new Runnable() {
322.49 + public void run() {
322.50 + synchronized (server) {
322.51 + server.wakeup = true;
322.52 + server.notifyAll();
322.53 + }
322.54 + pass();
322.55 + }
322.56 + });
322.57 +
322.58 + // wait, then check test status
322.59 + try {
322.60 + Thread.sleep(5000);
322.61 + if (!passed()) {
322.62 + throw new RuntimeException("Failed: EDT was blocked");
322.63 + }
322.64 + } finally {
322.65 + server.destroy();
322.66 + }
322.67 + }
322.68 +
322.69 + private boolean passed = false;
322.70 +
322.71 + private synchronized boolean passed() {
322.72 + return passed;
322.73 + }
322.74 +
322.75 + private synchronized void pass() {
322.76 + passed = true;
322.77 + }
322.78 +}
322.79 +
322.80 +/**
322.81 + * A "deaf" HTTP server that does not respond to requests.
322.82 + */
322.83 +class DeafServer {
322.84 + HttpServer server;
322.85 + boolean wakeup = false;
322.86 +
322.87 + /**
322.88 + * Create and start the HTTP server.
322.89 + */
322.90 + public DeafServer() throws IOException {
322.91 + InetSocketAddress addr = new InetSocketAddress(0);
322.92 + server = HttpServer.create(addr, 0);
322.93 + HttpHandler handler = new DeafHandler();
322.94 + server.createContext("/", handler);
322.95 + server.setExecutor(Executors.newCachedThreadPool());
322.96 + server.start();
322.97 + }
322.98 +
322.99 + /**
322.100 + * Stop server without any delay.
322.101 + */
322.102 + public void destroy() {
322.103 + server.stop(0);
322.104 + }
322.105 +
322.106 + /**
322.107 + * Return actual server port number, useful for constructing request URIs.
322.108 + */
322.109 + public int getPort() {
322.110 + return server.getAddress().getPort();
322.111 + }
322.112 +
322.113 +
322.114 + class DeafHandler implements HttpHandler {
322.115 + public void handle(HttpExchange r) throws IOException {
322.116 + synchronized (DeafServer.this) {
322.117 + while (! wakeup) {
322.118 + try {
322.119 + DeafServer.this.wait();
322.120 + } catch (InterruptedException e) {
322.121 + // just wait again
322.122 + }
322.123 + }
322.124 + }
322.125 + }
322.126 + }
322.127 +}
323.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
323.2 +++ b/test/javax/swing/JFileChooser/4252173/bug4252173.java Fri May 16 12:25:57 2008 -0700
323.3 @@ -0,0 +1,58 @@
323.4 +/*
323.5 + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
323.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
323.7 + *
323.8 + * This code is free software; you can redistribute it and/or modify it
323.9 + * under the terms of the GNU General Public License version 2 only, as
323.10 + * published by the Free Software Foundation.
323.11 + *
323.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
323.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
323.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
323.15 + * version 2 for more details (a copy is included in the LICENSE file that
323.16 + * accompanied this code).
323.17 + *
323.18 + * You should have received a copy of the GNU General Public License version
323.19 + * 2 along with this work; if not, write to the Free Software Foundation,
323.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
323.21 + *
323.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
323.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
323.24 + * have any questions.
323.25 + */
323.26 +
323.27 +/* @test
323.28 + @bug 4252173
323.29 + @summary Inability to reuse the HorizontalSliderThumbIcon
323.30 + @author Pavel Porvatov
323.31 + @run main bug4252173
323.32 +*/
323.33 +
323.34 +import javax.swing.*;
323.35 +import javax.swing.plaf.metal.DefaultMetalTheme;
323.36 +import javax.swing.plaf.metal.MetalLookAndFeel;
323.37 +import java.awt.*;
323.38 +import java.awt.image.BufferedImage;
323.39 +import java.lang.reflect.InvocationTargetException;
323.40 +
323.41 +public class bug4252173 {
323.42 + public static void main(String[] args) throws InvocationTargetException, InterruptedException {
323.43 + SwingUtilities.invokeAndWait(new Runnable() {
323.44 + public void run() {
323.45 + MetalLookAndFeel.setCurrentTheme(new DefaultMetalTheme());
323.46 +
323.47 + JComponent component = new JLabel();
323.48 +
323.49 + Icon horizontalThumbIcon = UIManager.getIcon("Slider.horizontalThumbIcon");
323.50 +
323.51 + Icon verticalThumbIcon = UIManager.getIcon("Slider.verticalThumbIcon");
323.52 +
323.53 + Graphics g = new BufferedImage(100, 100, BufferedImage.TYPE_4BYTE_ABGR).getGraphics();
323.54 +
323.55 + horizontalThumbIcon.paintIcon(component, g, 0, 0);
323.56 +
323.57 + verticalThumbIcon.paintIcon(component, g, 0, 0);
323.58 + }
323.59 + });
323.60 + }
323.61 +}
324.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
324.2 +++ b/test/javax/swing/JFileChooser/6524424/bug6524424.html Fri May 16 12:25:57 2008 -0700
324.3 @@ -0,0 +1,11 @@
324.4 +<html>
324.5 +<body>
324.6 +<applet code="bug6524424.class" width=200 height=200></applet>
324.7 +To test fix follow the next steps:
324.8 +1. Select a slider (do the next steps for every slider)
324.9 +2. Check that the next keyboard buttons work correctly:
324.10 + Up, Down, Left, Right, Page Up, Page Down
324.11 +3. Press left mouse button on a free space of the slider and check
324.12 + that thumb moves correctly
324.13 +</body>
324.14 +</html>
325.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
325.2 +++ b/test/javax/swing/JFileChooser/6524424/bug6524424.java Fri May 16 12:25:57 2008 -0700
325.3 @@ -0,0 +1,99 @@
325.4 +/*
325.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
325.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
325.7 + *
325.8 + * This code is free software; you can redistribute it and/or modify it
325.9 + * under the terms of the GNU General Public License version 2 only, as
325.10 + * published by the Free Software Foundation.
325.11 + *
325.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
325.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
325.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
325.15 + * version 2 for more details (a copy is included in the LICENSE file that
325.16 + * accompanied this code).
325.17 + *
325.18 + * You should have received a copy of the GNU General Public License version
325.19 + * 2 along with this work; if not, write to the Free Software Foundation,
325.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
325.21 + *
325.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
325.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
325.24 + * have any questions.
325.25 + */
325.26 +
325.27 +/* @test
325.28 + * @bug 6524424
325.29 + * @summary JSlider Clicking In Tracks Behavior Inconsistent For Different Tick Spacings
325.30 + * @author Pavel Porvatov
325.31 + * @run applet/manual=done bug6524424.html
325.32 + */
325.33 +
325.34 +import java.awt.*;
325.35 +import javax.swing.*;
325.36 +
325.37 +import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
325.38 +
325.39 +public class bug6524424 extends JApplet {
325.40 + public static void main(String[] args) {
325.41 + try {
325.42 + UIManager.setLookAndFeel(new WindowsLookAndFeel());
325.43 + } catch (UnsupportedLookAndFeelException e) {
325.44 + e.printStackTrace();
325.45 +
325.46 + return;
325.47 + }
325.48 +
325.49 + TestPanel panel = new TestPanel();
325.50 +
325.51 + JFrame frame = new JFrame();
325.52 +
325.53 + frame.setContentPane(panel);
325.54 + frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
325.55 + frame.pack();
325.56 + frame.setLocationRelativeTo(null);
325.57 +
325.58 + frame.setVisible(true);
325.59 + }
325.60 +
325.61 + public void init() {
325.62 + TestPanel panel = new TestPanel();
325.63 +
325.64 + setContentPane(panel);
325.65 + }
325.66 +
325.67 + private static class TestPanel extends JPanel {
325.68 +
325.69 + private TestPanel() {
325.70 + super(new GridBagLayout());
325.71 +
325.72 + JSlider slider1 = createSlider(1, 2);
325.73 + JSlider slider2 = createSlider(2, 4);
325.74 + JSlider slider3 = createSlider(3, 6);
325.75 +
325.76 + addComponent(this, slider1);
325.77 + addComponent(this, slider2);
325.78 + addComponent(this, slider3);
325.79 + }
325.80 +
325.81 + private JSlider createSlider(int tickMinor, int tickMajor) {
325.82 + JSlider result = new JSlider();
325.83 +
325.84 + result.setPaintLabels(true);
325.85 + result.setPaintTicks(true);
325.86 + result.setSnapToTicks(true);
325.87 + result.setMinimum(0);
325.88 + result.setMaximum(12);
325.89 + result.setMinorTickSpacing(tickMinor);
325.90 + result.setMajorTickSpacing(tickMajor);
325.91 +
325.92 + return result;
325.93 + }
325.94 + }
325.95 +
325.96 + private static void addComponent(JPanel panel, Component component) {
325.97 + panel.add(component, new GridBagConstraints(0,
325.98 + panel.getComponentCount(), 1, 1,
325.99 + 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL,
325.100 + new Insets(0, 0, 0, 0), 0, 0));
325.101 + }
325.102 +}
326.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
326.2 +++ b/test/javax/swing/JFileChooser/6688203/bug6688203.java Fri May 16 12:25:57 2008 -0700
326.3 @@ -0,0 +1,81 @@
326.4 +/*
326.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
326.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
326.7 + *
326.8 + * This code is free software; you can redistribute it and/or modify it
326.9 + * under the terms of the GNU General Public License version 2 only, as
326.10 + * published by the Free Software Foundation.
326.11 + *
326.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
326.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
326.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
326.15 + * version 2 for more details (a copy is included in the LICENSE file that
326.16 + * accompanied this code).
326.17 + *
326.18 + * You should have received a copy of the GNU General Public License version
326.19 + * 2 along with this work; if not, write to the Free Software Foundation,
326.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
326.21 + *
326.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
326.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
326.24 + * have any questions.
326.25 + */
326.26 +
326.27 +/* @test
326.28 + @bug 6688203
326.29 + @summary Memory leak and performance problems in the method getFileSystemView of FileSystemView
326.30 + @author Pavel Porvatov
326.31 + @run main bug6688203
326.32 +*/
326.33 +
326.34 +import javax.swing.*;
326.35 +import javax.swing.filechooser.FileSystemView;
326.36 +import java.io.File;
326.37 +import java.lang.reflect.Field;
326.38 +
326.39 +public class bug6688203 {
326.40 + public static void main(String[] args) {
326.41 + // Create an instance of FileSystemView
326.42 + FileSystemView.getFileSystemView();
326.43 +
326.44 + int startCount = UIManager.getPropertyChangeListeners().length;
326.45 +
326.46 + for (int i = 0; i < 100; i++) {
326.47 + FileSystemView.getFileSystemView();
326.48 + }
326.49 +
326.50 + if (startCount != UIManager.getPropertyChangeListeners().length) {
326.51 + throw new RuntimeException("New listeners were added into UIManager");
326.52 + }
326.53 +
326.54 + FileSystemView fileSystemView = FileSystemView.getFileSystemView();
326.55 + File file = new File("Some file");
326.56 +
326.57 + for (UIManager.LookAndFeelInfo lafInfo : UIManager.getInstalledLookAndFeels()) {
326.58 + try {
326.59 + UIManager.setLookAndFeel(lafInfo.getClassName());
326.60 + } catch (Exception e) {
326.61 + // Ignore such errors
326.62 + System.out.println("Cannot set LAF " + lafInfo.getName());
326.63 +
326.64 + continue;
326.65 + }
326.66 +
326.67 + fileSystemView.getSystemDisplayName(file);
326.68 +
326.69 + try {
326.70 + Field field = FileSystemView.class.getDeclaredField("useSystemExtensionHiding");
326.71 +
326.72 + field.setAccessible(true);
326.73 +
326.74 + Boolean value = field.getBoolean(fileSystemView);
326.75 +
326.76 + if (value != UIManager.getDefaults().getBoolean("FileChooser.useSystemExtensionHiding")) {
326.77 + throw new RuntimeException("Invalid cached value of the FileSystemView.useSystemExtensionHiding field");
326.78 + }
326.79 + } catch (Exception e) {
326.80 + throw new RuntimeException("Cannot read the FileSystemView.useSystemExtensionHiding field", e);
326.81 + }
326.82 + }
326.83 + }
326.84 +}
327.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
327.2 +++ b/test/javax/swing/JPopupMenu/6675802/bug6675802.java Fri May 16 12:25:57 2008 -0700
327.3 @@ -0,0 +1,43 @@
327.4 +/*
327.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
327.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
327.7 + *
327.8 + * This code is free software; you can redistribute it and/or modify it
327.9 + * under the terms of the GNU General Public License version 2 only, as
327.10 + * published by the Free Software Foundation.
327.11 + *
327.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
327.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
327.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
327.15 + * version 2 for more details (a copy is included in the LICENSE file that
327.16 + * accompanied this code).
327.17 + *
327.18 + * You should have received a copy of the GNU General Public License version
327.19 + * 2 along with this work; if not, write to the Free Software Foundation,
327.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
327.21 + *
327.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
327.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
327.24 + * have any questions.
327.25 + */
327.26 +
327.27 +/*
327.28 + * @test
327.29 + * @bug 6675802
327.30 + * @summary Checks that there is no AccessControlException when
327.31 + * a heaviweight popup menu is shown from an applet.
327.32 + * @author Mikhail Lapshin
327.33 + * @run main bug6675802
327.34 + */
327.35 +
327.36 +import javax.swing.*;
327.37 +
327.38 +public class bug6675802 {
327.39 + public static void main(String[] args) {
327.40 + System.setSecurityManager(new SecurityManager());
327.41 + final JPopupMenu popupMenu = new JPopupMenu();
327.42 + popupMenu.add(new JMenuItem("Click"));
327.43 + popupMenu.show(null, 0, 0);
327.44 + System.out.println("Test passed");
327.45 + }
327.46 +}
328.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
328.2 +++ b/test/javax/swing/JPopupMenu/6690791/bug6690791.java Fri May 16 12:25:57 2008 -0700
328.3 @@ -0,0 +1,44 @@
328.4 +/*
328.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
328.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
328.7 + *
328.8 + * This code is free software; you can redistribute it and/or modify it
328.9 + * under the terms of the GNU General Public License version 2 only, as
328.10 + * published by the Free Software Foundation.
328.11 + *
328.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
328.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
328.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
328.15 + * version 2 for more details (a copy is included in the LICENSE file that
328.16 + * accompanied this code).
328.17 + *
328.18 + * You should have received a copy of the GNU General Public License version
328.19 + * 2 along with this work; if not, write to the Free Software Foundation,
328.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
328.21 + *
328.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
328.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
328.24 + * have any questions.
328.25 + */
328.26 +
328.27 +/*
328.28 + * @test
328.29 + * @bug 6690791
328.30 + * @summary Checks that there is no ClassCastException
328.31 + * in MenuSelectionManager.processMouseEvent()
328.32 + * @author Mikhail Lapshin
328.33 + * @run main bug6690791
328.34 + */
328.35 +
328.36 +import javax.swing.*;
328.37 +import java.awt.event.MouseEvent;
328.38 +
328.39 +public class bug6690791 {
328.40 + public static void main(String[] args) throws Exception {
328.41 + MouseEvent me = new MouseEvent(new JLabel(), MouseEvent.MOUSE_CLICKED,
328.42 + System.currentTimeMillis(), MouseEvent.ALT_MASK,
328.43 + 10, 10, 100, 100, 1, false, MouseEvent.BUTTON1);
328.44 + me.setSource(new Object());
328.45 + MenuSelectionManager.defaultManager().processMouseEvent(me);
328.46 + }
328.47 +}
329.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
329.2 +++ b/test/javax/swing/JPopupMenu/6691503/bug6691503.java Fri May 16 12:25:57 2008 -0700
329.3 @@ -0,0 +1,113 @@
329.4 +/*
329.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
329.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
329.7 + *
329.8 + * This code is free software; you can redistribute it and/or modify it
329.9 + * under the terms of the GNU General Public License version 2 only, as
329.10 + * published by the Free Software Foundation.
329.11 + *
329.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
329.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
329.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
329.15 + * version 2 for more details (a copy is included in the LICENSE file that
329.16 + * accompanied this code).
329.17 + *
329.18 + * You should have received a copy of the GNU General Public License version
329.19 + * 2 along with this work; if not, write to the Free Software Foundation,
329.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
329.21 + *
329.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
329.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
329.24 + * have any questions.
329.25 + */
329.26 +
329.27 +/*
329.28 + * @test
329.29 + * @bug 6691503
329.30 + * @summary Checks that there is no opportunity for a malicious applet
329.31 + * to show a popup menu which has whole screen size.
329.32 + * a heaviweight popup menu is shown from an applet.
329.33 + * @author Mikhail Lapshin
329.34 + * @run main bug6691503
329.35 + */
329.36 +
329.37 +import sun.awt.SunToolkit;
329.38 +
329.39 +import javax.swing.*;
329.40 +import java.awt.*;
329.41 +
329.42 +public class bug6691503 {
329.43 + private JPopupMenu popupMenu;
329.44 + private JFrame frame;
329.45 + private boolean isAlwaysOnTop1 = false;
329.46 + private boolean isAlwaysOnTop2 = true;
329.47 +
329.48 + public static void main(String[] args) {
329.49 + bug6691503 test = new bug6691503();
329.50 + test.setupUI();
329.51 + test.testApplication();
329.52 + test.testApplet();
329.53 + test.checkResult();
329.54 + test.stopEDT();
329.55 + }
329.56 +
329.57 + private void setupUI() {
329.58 + SwingUtilities.invokeLater(new Runnable() {
329.59 + public void run() {
329.60 + frame = new JFrame();
329.61 + frame.setVisible(true);
329.62 + popupMenu = new JPopupMenu();
329.63 + JMenuItem click = new JMenuItem("Click");
329.64 + popupMenu.add(click);
329.65 + }
329.66 + });
329.67 + }
329.68 +
329.69 + private void testApplication() {
329.70 + SwingUtilities.invokeLater(new Runnable() {
329.71 + public void run() {
329.72 + popupMenu.show(frame, 0, 0);
329.73 + Window popupWindow = (Window)
329.74 + (popupMenu.getParent().getParent().getParent().getParent());
329.75 + isAlwaysOnTop1 = popupWindow.isAlwaysOnTop();
329.76 + System.out.println(
329.77 + "Application: popupWindow.isAlwaysOnTop() = " + isAlwaysOnTop1);
329.78 + popupMenu.setVisible(false);
329.79 + }
329.80 + });
329.81 + }
329.82 +
329.83 + private void testApplet() {
329.84 + SwingUtilities.invokeLater(new Runnable() {
329.85 + public void run() {
329.86 + System.setSecurityManager(new SecurityManager());
329.87 + popupMenu.show(frame, 0, 0);
329.88 + Window popupWindow = (Window)
329.89 + (popupMenu.getParent().getParent().getParent().getParent());
329.90 + isAlwaysOnTop2 = popupWindow.isAlwaysOnTop();
329.91 + System.out.println(
329.92 + "Applet: popupWindow.isAlwaysOnTop() = " + isAlwaysOnTop2);
329.93 + popupMenu.setVisible(false);
329.94 + }
329.95 + });
329.96 + }
329.97 +
329.98 + private void checkResult() {
329.99 + ((SunToolkit)(Toolkit.getDefaultToolkit())).realSync();
329.100 + if (!isAlwaysOnTop1 || isAlwaysOnTop2) {
329.101 + throw new RuntimeException("Malicious applet can show always-on-top " +
329.102 + "popup menu which has whole screen size");
329.103 + }
329.104 + System.out.println("Test passed");
329.105 + }
329.106 +
329.107 + private void stopEDT() {
329.108 + SwingUtilities.invokeLater(new Runnable() {
329.109 + public void run() {
329.110 + frame.dispose();
329.111 + }
329.112 + });
329.113 + }
329.114 +}
329.115 +
329.116 +
330.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
330.2 +++ b/test/javax/swing/JScrollPane/6612531/bug6612531.java Fri May 16 12:25:57 2008 -0700
330.3 @@ -0,0 +1,42 @@
330.4 +/*
330.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
330.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
330.7 + *
330.8 + * This code is free software; you can redistribute it and/or modify it
330.9 + * under the terms of the GNU General Public License version 2 only, as
330.10 + * published by the Free Software Foundation.
330.11 + *
330.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
330.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
330.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
330.15 + * version 2 for more details (a copy is included in the LICENSE file that
330.16 + * accompanied this code).
330.17 + *
330.18 + * You should have received a copy of the GNU General Public License version
330.19 + * 2 along with this work; if not, write to the Free Software Foundation,
330.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
330.21 + *
330.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
330.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
330.24 + * have any questions.
330.25 + */
330.26 +
330.27 +/*
330.28 + * @test
330.29 + * @bug 6612531
330.30 + * @summary Checks that ScrollPaneLayout.preferredLayoutSize() doesn't throw NPE.
330.31 + * @author Mikhail Lapshin
330.32 + * @run main bug6612531
330.33 + */
330.34 +
330.35 +import javax.swing.*;
330.36 +
330.37 +public class bug6612531 {
330.38 + public static void main(String[] args) {
330.39 + ScrollPaneLayout c = new ScrollPaneLayout();
330.40 + JViewport vp = new JViewport();
330.41 + c.addLayoutComponent("VIEWPORT", vp);
330.42 + c.preferredLayoutSize(new JScrollPane());
330.43 + System.out.println("Test passed");
330.44 + }
330.45 +}
331.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
331.2 +++ b/test/javax/swing/border/Test6625450.java Fri May 16 12:25:57 2008 -0700
331.3 @@ -0,0 +1,67 @@
331.4 +/*
331.5 + * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved.
331.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
331.7 + *
331.8 + * This code is free software; you can redistribute it and/or modify it
331.9 + * under the terms of the GNU General Public License version 2 only, as
331.10 + * published by the Free Software Foundation.
331.11 + *
331.12 + * This code is distributed in the hope that it will be useful, but WITHOUT
331.13 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
331.14 + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
331.15 + * version 2 for more details (a copy is included in the LICENSE file that
331.16 + * accompanied this code).
331.17 + *
331.18 + * You should have received a copy of the GNU General Public License version
331.19 + * 2 along with this work; if not, write to the Free Software Foundation,
331.20 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
331.21 + *
331.22 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
331.23 + * CA 95054 USA or visit www.sun.com if you need additional information or
331.24 + * have any questions.
331.25 + */
331.26 +
331.27 +/*
331.28 + * @test
331.29 + * @bug 6625450
331.30 + * @summary Tests the baseline of the titled border
331.31 + * @author Sergey Malenkov
331.32 + */
331.33 +
331.34 +import java.awt.Component;
331.35 +import javax.swing.border.TitledBorder;
331.36 +
331.37 +public class Test6625450 {
331.38 +
331.39 + public static void main(String[] args) {
331.40 + // test height
331.41 + test(false, 0, Integer.MAX_VALUE);
331.42 + test(false, 0, 1);
331.43 + test(true, 0, -1);
331.44 + test(true, 0, Integer.MIN_VALUE);
331.45 + // test width
331.46 + test(false, Integer.MAX_VALUE, 0);
331.47 + test(false, 1, 0);
331.48 + test(true, -1, 0);
331.49 + test(true, Integer.MIN_VALUE, 0);
331.50 + }
331.51 +
331.52 + private static final TitledBorder BORDER = new TitledBorder("123");
331.53 + private static final Component COMPONENT = new Component() {
331.54 + };
331.55 +
331.56 + private static void test(boolean expected, int width, int height) {
331.57 + try {
331.58 + BORDER.getBaseline(COMPONENT, width, height);
331.59 +
331.60 + if (expected) {
331.61 + throw new Error("expected IllegalArgumentException");
331.62 + }
331.63 + }
331.64 + catch (IllegalArgumentException exception) {
331.65 + if (!expected) {
331.66 + throw new Error("unexpected exception", exception);
331.67 + }
331.68 + }
331.69 + }
331.70 +}