-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
7
-
generic
-
generic
The spec for method javax.swing.plaf.LayerUI.getScrollableTracksViewportHeight() says:
/**
* Returns {@code false} to indicate that the height of the viewport does not
* determine the height of the layer, unless the preferred height
* of the layer is smaller than the height of the viewport.
*/
Failing JCK tests:
api/javax_swing/plaf/LayerUI/index.html#General[getScrollableTracksViewportHeight_viewPort]
api/javax_swing/plaf/LayerUI/index.html#General[getScrollableTracksViewportWidth_viewPort]
Platform: ALL
JDK 7 b75: FAIL
JDK 7 b70: PASS
Please see the following minimized code below (for getScrollableTracksViewportHeight, getScrollableTracksViewportWidth behaves the same way):
----------------------------------------------------------------
import javax.swing.*;
import javax.swing.plaf.LayerUI;
import java.awt.*;
/**
* Verifies that method returns false to indicate that the height of the viewport does not
* determine the height of the layer, unless the preferred height
* of the layer is smaller than the height of the viewport
*/
public class LayerUI_getSTVpHeight {
public static void main(String[] args) {
int layerPrefSizeHeight = 50;
final int vpHeight = 100;
JLayer layer = new JLayer();
layer.setPreferredSize(new Dimension(0, layerPrefSizeHeight));
JViewport viewport = new JViewport() {
@Override
public int getHeight() {
return vpHeight;
}
};
viewport.setView(layer);
System.out.println("vpHeight > layerPrefSizeHeight = " + (vpHeight > layerPrefSizeHeight));
System.out.println("getScrollableTracksViewportHeight(layer) = " +
new LayerUI().getScrollableTracksViewportHeight(layer));
}
}
----------------------------------------------------------------
/**
* Returns {@code false} to indicate that the height of the viewport does not
* determine the height of the layer, unless the preferred height
* of the layer is smaller than the height of the viewport.
*/
Failing JCK tests:
api/javax_swing/plaf/LayerUI/index.html#General[getScrollableTracksViewportHeight_viewPort]
api/javax_swing/plaf/LayerUI/index.html#General[getScrollableTracksViewportWidth_viewPort]
Platform: ALL
JDK 7 b75: FAIL
JDK 7 b70: PASS
Please see the following minimized code below (for getScrollableTracksViewportHeight, getScrollableTracksViewportWidth behaves the same way):
----------------------------------------------------------------
import javax.swing.*;
import javax.swing.plaf.LayerUI;
import java.awt.*;
/**
* Verifies that method returns false to indicate that the height of the viewport does not
* determine the height of the layer, unless the preferred height
* of the layer is smaller than the height of the viewport
*/
public class LayerUI_getSTVpHeight {
public static void main(String[] args) {
int layerPrefSizeHeight = 50;
final int vpHeight = 100;
JLayer layer = new JLayer();
layer.setPreferredSize(new Dimension(0, layerPrefSizeHeight));
JViewport viewport = new JViewport() {
@Override
public int getHeight() {
return vpHeight;
}
};
viewport.setView(layer);
System.out.println("vpHeight > layerPrefSizeHeight = " + (vpHeight > layerPrefSizeHeight));
System.out.println("getScrollableTracksViewportHeight(layer) = " +
new LayerUI().getScrollableTracksViewportHeight(layer));
}
}
----------------------------------------------------------------
- duplicates
-
JDK-6982661 Complete JLayer component
-
- Closed
-
- relates to
-
JDK-6900224 Spec for methods JLayer.getScrollableTracksViewportHeight/Width should be corrected
-
- Closed
-
-
JDK-6899434 Add affine transform support to JLayer
-
- Closed
-
-
JDK-6878741 several methods of LayerUI should mention that they are delegated to Scrollable JLayer's view
-
- Open
-