38 |
|
|
39 |
package javax.swing; |
package javax.swing; |
40 |
|
|
41 |
|
import gnu.classpath.SystemProperties; |
42 |
|
|
43 |
import java.awt.Component; |
import java.awt.Component; |
44 |
import java.awt.Dimension; |
import java.awt.Dimension; |
45 |
import java.awt.Graphics; |
import java.awt.Graphics; |
165 |
public static final int BACKINGSTORE_SCROLL_MODE = 2; |
public static final int BACKINGSTORE_SCROLL_MODE = 2; |
166 |
|
|
167 |
private static final long serialVersionUID = -6925142919680527970L; |
private static final long serialVersionUID = -6925142919680527970L; |
168 |
|
|
169 |
|
/** |
170 |
|
* The default scrollmode to be used by all JViewports as determined by |
171 |
|
* the system property gnu.javax.swing.JViewport.scrollMode. |
172 |
|
*/ |
173 |
|
private static final int defaultScrollMode; |
174 |
|
|
175 |
protected boolean scrollUnderway; |
protected boolean scrollUnderway; |
176 |
protected boolean isViewSizeSet; |
protected boolean isViewSizeSet; |
177 |
|
|
251 |
*/ |
*/ |
252 |
boolean sizeChanged = true; |
boolean sizeChanged = true; |
253 |
|
|
254 |
|
/** |
255 |
|
* Initializes the default setting for the scrollMode property. |
256 |
|
*/ |
257 |
|
static |
258 |
|
{ |
259 |
|
String scrollModeProp = |
260 |
|
SystemProperties.getProperty("gnu.javax.swing.JViewport.scrollMode", |
261 |
|
"BLIT"); |
262 |
|
int myScrollMode; |
263 |
|
if (scrollModeProp.equalsIgnoreCase("simple")) |
264 |
|
defaultScrollMode = SIMPLE_SCROLL_MODE; |
265 |
|
else if (scrollModeProp.equalsIgnoreCase("backingstore")) |
266 |
|
defaultScrollMode = BACKINGSTORE_SCROLL_MODE; |
267 |
|
else |
268 |
|
defaultScrollMode = BLIT_SCROLL_MODE; |
269 |
|
} |
270 |
|
|
271 |
public JViewport() |
public JViewport() |
272 |
{ |
{ |
273 |
setOpaque(true); |
setOpaque(true); |
274 |
setScrollMode(BLIT_SCROLL_MODE); |
setScrollMode(defaultScrollMode); |
275 |
updateUI(); |
updateUI(); |
276 |
setLayout(createLayoutManager()); |
setLayout(createLayoutManager()); |
277 |
lastPaintPosition = new Point(); |
lastPaintPosition = new Point(); |