.
+ * Instantiate it only within subclasses of {@code BasicDesktopIconUI}.
*/
public class MouseInputHandler extends MouseInputAdapter
{
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java
--- a/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicLabelUI.java Wed May 04 16:39:05 2011 -0700
@@ -455,6 +455,8 @@
}
int dka = label.getDisplayedMnemonic();
inputMap.put(KeyStroke.getKeyStroke(dka, ActionEvent.ALT_MASK, true), RELEASE);
+ // Need this when the sticky keys are enabled
+ inputMap.put(KeyStroke.getKeyStroke(dka, 0, true), RELEASE);
// Need this if ALT is released before the accelerator
inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ALT, 0, true), RELEASE);
label.requestFocus();
@@ -467,7 +469,9 @@
InputMap inputMap = SwingUtilities.getUIInputMap(label, JComponent.WHEN_FOCUSED);
if (inputMap != null) {
// inputMap should never be null.
- inputMap.remove(KeyStroke.getKeyStroke(label.getDisplayedMnemonic(), ActionEvent.ALT_MASK, true));
+ int dka = label.getDisplayedMnemonic();
+ inputMap.remove(KeyStroke.getKeyStroke(dka, ActionEvent.ALT_MASK, true));
+ inputMap.remove(KeyStroke.getKeyStroke(dka, 0, true));
inputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ALT, 0, true));
}
if (labelFor instanceof Container &&
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/plaf/basic/BasicListUI.java
--- a/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicListUI.java Wed May 04 16:39:05 2011 -0700
@@ -1555,9 +1555,8 @@
}
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of BasicTableUI.
+ * Instantiate it only within subclasses of {@code BasicListUI}.
*/
public class FocusHandler implements FocusListener
{
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java
--- a/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicOptionPaneUI.java Wed May 04 16:39:05 2011 -0700
@@ -911,9 +911,8 @@
* right. If syncAllWidths
is true, the widths of each
* component will be set to the largest preferred size width.
*
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of BasicOptionPaneUI.
+ * Instantiate it only within subclasses of {@code BasicOptionPaneUI}.
*/
public static class ButtonAreaLayout implements LayoutManager {
protected boolean syncAllWidths;
@@ -1115,9 +1114,8 @@
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of BasicOptionPaneUI.
+ * Instantiate it only within subclasses of {@code BasicOptionPaneUI}.
*/
public class PropertyChangeHandler implements PropertyChangeListener {
/**
@@ -1161,9 +1159,8 @@
}
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of BasicOptionPaneUI.
+ * Instantiate it only within subclasses of {@code BasicOptionPaneUI}.
*/
public class ButtonActionListener implements ActionListener {
protected int buttonIndex;
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java
--- a/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicProgressBarUI.java Wed May 04 16:39:05 2011 -0700
@@ -1211,9 +1211,8 @@
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of BasicProgressBarUI.
+ * Instantiate it only within subclasses of {@code BasicProgressBarUI}.
*/
public class ChangeHandler implements ChangeListener {
// NOTE: This class exists only for backward compatability. All
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java
--- a/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicTableHeaderUI.java Wed May 04 16:39:05 2011 -0700
@@ -88,9 +88,8 @@
};
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of BasicTableUI.
+ * Instantiate it only within subclasses of {@code BasicTableHeaderUI}.
*/
public class MouseInputHandler implements MouseInputListener {
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/plaf/basic/BasicTableUI.java
--- a/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/basic/BasicTableUI.java Wed May 04 16:39:05 2011 -0700
@@ -730,9 +730,8 @@
//
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of BasicTableUI.
+ * Instantiate it only within subclasses of {@code BasicTableUI}.
* As of Java 2 platform v1.3 this class is no longer used.
* Instead JTable
* overrides processKeyBinding
to dispatch the event to
@@ -761,9 +760,8 @@
//
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of BasicTableUI.
+ * Instantiate it only within subclasses of {@code BasicTableUI}.
*/
public class FocusHandler implements FocusListener {
// NOTE: This class exists only for backward compatability. All
@@ -784,7 +782,6 @@
//
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
* Instantiate it only within subclasses of BasicTableUI.
*/
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java
--- a/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalComboBoxUI.java Wed May 04 16:39:05 2011 -0700
@@ -199,9 +199,8 @@
}
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of .
+ * Instantiate it only within subclasses of {@code MetalComboBoxUI}.
*/
public class MetalPropertyChangeListener extends BasicComboBoxUI.PropertyChangeHandler {
public void propertyChange(PropertyChangeEvent e) {
@@ -244,9 +243,8 @@
}
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of .
+ * Instantiate it only within subclasses of {@code MetalComboBoxUI}.
*/
public class MetalComboBoxLayoutManager extends BasicComboBoxUI.ComboBoxLayoutManager {
public void layoutContainer( Container parent ) {
@@ -356,9 +354,8 @@
}
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of .
+ * Instantiate it only within subclasses of {@code MetalComboBoxUI}.
*
* This class is now obsolete and doesn't do anything and
* is only included for backwards API compatibility. Do not call or
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java
--- a/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/plaf/metal/MetalTabbedPaneUI.java Wed May 04 16:39:05 2011 -0700
@@ -1196,9 +1196,8 @@
}
/**
- * This inner class is marked "public" due to a compiler bug.
* This class should be treated as a "protected" inner class.
- * Instantiate it only within subclasses of MetalTabbedPaneUI.
+ * Instantiate it only within subclasses of {@code MetalTabbedPaneUI}.
*/
public class TabbedPaneLayout extends BasicTabbedPaneUI.TabbedPaneLayout {
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/text/GlyphPainter2.java
--- a/src/share/classes/javax/swing/text/GlyphPainter2.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/text/GlyphPainter2.java Wed May 04 16:39:05 2011 -0700
@@ -172,6 +172,11 @@
//italic carets and we do not.
TextHitInfo hit = layout.hitTestChar(x - (float)alloc.getX(), 0);
int pos = hit.getInsertionIndex();
+
+ if (pos == v.getEndOffset()) {
+ pos--;
+ }
+
biasReturn[0] = hit.isLeadingEdge() ? Position.Bias.Forward : Position.Bias.Backward;
return pos + v.getStartOffset();
}
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/text/GlyphView.java
--- a/src/share/classes/javax/swing/text/GlyphView.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/text/GlyphView.java Wed May 04 16:39:05 2011 -0700
@@ -541,7 +541,30 @@
*/
@Override
public float getMinimumSpan(int axis) {
- return super.getMinimumSpan(axis);
+ switch (axis) {
+ case View.X_AXIS:
+ if (minimumSpan < 0) {
+ minimumSpan = 0;
+ int p0 = getStartOffset();
+ int p1 = getEndOffset();
+ while (p1 > p0) {
+ int breakSpot = getBreakSpot(p0, p1);
+ if (breakSpot == BreakIterator.DONE) {
+ // the rest of the view is non-breakable
+ breakSpot = p0;
+ }
+ minimumSpan = Math.max(minimumSpan,
+ getPartialSpan(breakSpot, p1));
+ // Note: getBreakSpot returns the *last* breakspot
+ p1 = breakSpot - 1;
+ }
+ }
+ return minimumSpan;
+ case View.Y_AXIS:
+ return super.getMinimumSpan(axis);
+ default:
+ throw new IllegalArgumentException("Invalid axis: " + axis);
+ }
}
/**
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/text/ParagraphView.java
--- a/src/share/classes/javax/swing/text/ParagraphView.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/text/ParagraphView.java Wed May 04 16:39:05 2011 -0700
@@ -721,7 +721,34 @@
@Override
protected SizeRequirements calculateMinorAxisRequirements(int axis,
SizeRequirements r) {
- return super.calculateMinorAxisRequirements(axis, r);
+ r = super.calculateMinorAxisRequirements(axis, r);
+
+ float min = 0;
+ float glue = 0;
+ int n = getLayoutViewCount();
+ for (int i = 0; i < n; i++) {
+ View v = getLayoutView(i);
+ float span = v.getMinimumSpan(axis);
+ if (v.getBreakWeight(axis, 0, v.getMaximumSpan(axis)) > View.BadBreakWeight) {
+ // find the longest non-breakable fragments at the view edges
+ int p0 = v.getStartOffset();
+ int p1 = v.getEndOffset();
+ float start = findEdgeSpan(v, axis, p0, p0, p1);
+ float end = findEdgeSpan(v, axis, p1, p0, p1);
+ glue += start;
+ min = Math.max(min, Math.max(span, glue));
+ glue = end;
+ } else {
+ // non-breakable view
+ glue += span;
+ min = Math.max(min, glue);
+ }
+ }
+ r.minimum = Math.max(r.minimum, (int) min);
+ r.preferred = Math.max(r.minimum, r.preferred);
+ r.maximum = Math.max(r.preferred, r.maximum);
+
+ return r;
}
/**
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/text/Utilities.java
--- a/src/share/classes/javax/swing/text/Utilities.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/text/Utilities.java Wed May 04 16:39:05 2011 -0700
@@ -395,10 +395,10 @@
// the length of the string measured as a whole may differ from
// the sum of individual character lengths, for example if
// fractional metrics are enabled; and we must guard from this.
- while (metrics.charsWidth(txt, txtOffset, offset + 1) > (x - x0)) {
+ while (offset > 0 && metrics.charsWidth(txt, txtOffset, offset) > (x - x0)) {
offset--;
}
- return (offset < 0 ? 0 : offset);
+ return offset;
}
currX = nextX;
}
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/text/html/CSS.java
--- a/src/share/classes/javax/swing/text/html/CSS.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/text/html/CSS.java Wed May 04 16:39:05 2011 -0700
@@ -62,7 +62,6 @@
* background-repeat
* background-position
* background
- * background-repeat
* text-decoration (with the exception of blink and overline)
* vertical-align (only sup and super)
* text-align (justify is treated as center)
@@ -75,7 +74,18 @@
* padding-right
* padding-bottom
* padding-left
+ * padding
+ * border-top-style
+ * border-right-style
+ * border-bottom-style
+ * border-left-style
* border-style (only supports inset, outset and none)
+ * border-top-color
+ * border-right-color
+ * border-bottom-color
+ * border-left-color
+ * border-color
+ * list-style-image
* list-style-type
* list-style-position
*
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/javax/swing/text/html/parser/Parser.java
--- a/src/share/classes/javax/swing/text/html/parser/Parser.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/javax/swing/text/html/parser/Parser.java Wed May 04 16:39:05 2011 -0700
@@ -966,6 +966,9 @@
char data[] = {'&'};
return data;
}
+
+ boolean semicolon = false;
+
switch (ch) {
case '\n':
ln++;
@@ -985,6 +988,8 @@
break;
case ';':
+ semicolon = true;
+
ch = readCh();
break;
}
@@ -1006,7 +1011,7 @@
return new char[0];
}
/* given that there is not a match restore the entity reference */
- String str = "&" + nm + ";";
+ String str = "&" + nm + (semicolon ? ";" : "");
char b[] = new char[str.length()];
str.getChars(0, b.length, b, 0);
diff -r 3fedf261fb4f -r e6fdfb249e31 src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java
--- a/src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java Tue Apr 26 15:59:51 2011 -0700
+++ b/src/share/classes/sun/applet/resources/MsgAppletViewer_sv.java Wed May 04 16:39:05 2011 -0700
@@ -73,7 +73,7 @@
{"appletviewer.parse.warning.embed.requiresheight", "Varning: