equal
deleted
inserted
replaced
1328 * |
1328 * |
1329 * @return a <code>Dimension</code> containing the preferred size |
1329 * @return a <code>Dimension</code> containing the preferred size |
1330 */ |
1330 */ |
1331 public Dimension getPreferredSize() { |
1331 public Dimension getPreferredSize() { |
1332 Dimension d = super.getPreferredSize(); |
1332 Dimension d = super.getPreferredSize(); |
1333 JViewport port = SwingUtilities2.getViewport(this); |
1333 JViewport port = SwingUtilities.getParentViewport(this); |
1334 if (port != null) { |
1334 if (port != null) { |
1335 TextUI ui = getUI(); |
1335 TextUI ui = getUI(); |
1336 int prefWidth = d.width; |
1336 int prefWidth = d.width; |
1337 int prefHeight = d.height; |
1337 int prefHeight = d.height; |
1338 if (! getScrollableTracksViewportWidth()) { |
1338 if (! getScrollableTracksViewportWidth()) { |
1450 * |
1450 * |
1451 * @return true if a viewport should force the Scrollables width to |
1451 * @return true if a viewport should force the Scrollables width to |
1452 * match its own, false otherwise |
1452 * match its own, false otherwise |
1453 */ |
1453 */ |
1454 public boolean getScrollableTracksViewportWidth() { |
1454 public boolean getScrollableTracksViewportWidth() { |
1455 JViewport port = SwingUtilities2.getViewport(this); |
1455 JViewport port = SwingUtilities.getParentViewport(this); |
1456 if (port != null) { |
1456 if (port != null) { |
1457 TextUI ui = getUI(); |
1457 TextUI ui = getUI(); |
1458 int w = port.getWidth(); |
1458 int w = port.getWidth(); |
1459 Dimension min = ui.getMinimumSize(this); |
1459 Dimension min = ui.getMinimumSize(this); |
1460 Dimension max = ui.getMaximumSize(this); |
1460 Dimension max = ui.getMaximumSize(this); |
1472 * @return true if a viewport should force the |
1472 * @return true if a viewport should force the |
1473 * <code>Scrollable</code>'s height to match its own, |
1473 * <code>Scrollable</code>'s height to match its own, |
1474 * false otherwise |
1474 * false otherwise |
1475 */ |
1475 */ |
1476 public boolean getScrollableTracksViewportHeight() { |
1476 public boolean getScrollableTracksViewportHeight() { |
1477 JViewport port = SwingUtilities2.getViewport(this); |
1477 JViewport port = SwingUtilities.getParentViewport(this); |
1478 if (port != null) { |
1478 if (port != null) { |
1479 TextUI ui = getUI(); |
1479 TextUI ui = getUI(); |
1480 int h = port.getHeight(); |
1480 int h = port.getHeight(); |
1481 Dimension min = ui.getMinimumSize(this); |
1481 Dimension min = ui.getMinimumSize(this); |
1482 if (h >= min.height) { |
1482 if (h >= min.height) { |