@@ -201,11 +201,13 @@ public abstract class JComponent extends Container {
201201 /*
202202 * The following fields support set methods for the corresponding
203203 * java.awt.Component properties.
204+ *
205+ * SwingJS
204206 */
205- private boolean isAlignmentXSet ;
206- private float alignmentX ;
207- private boolean isAlignmentYSet ;
208- private float alignmentY ;
207+ private boolean _isAlignmentXSet ;
208+ private float _alignmentX ;
209+ private boolean _isAlignmentYSet ;
210+ private float _alignmentY ;
209211
210212 /**
211213 * Backing store for JComponent properties and listeners
@@ -220,9 +222,9 @@ public abstract class JComponent extends Container {
220222 /**
221223 * Whether or not autoscroll has been enabled.
222224 */
223- private boolean autoscrolls ;
224- private Border border ;
225- private int flags ;
225+ private boolean _autoscrolls ;
226+ private Border _border ;
227+ private int _flags ;
226228
227229 /* Input verifier for this component */
228230 // private InputVerifier inputVerifier = null;
@@ -285,7 +287,7 @@ public abstract class JComponent extends Container {
285287 /**
286288 * <code>JPopupMenu</code> assigned to this component and all of its childrens
287289 */
288- private JPopupMenu popupMenu ;
290+ private JPopupMenu _popupMenu ;
289291
290292 /** Private flags **/
291293 private static final int IS_DOUBLE_BUFFERED = 0 ;
@@ -323,7 +325,7 @@ public abstract class JComponent extends Container {
323325 /**
324326 * Temporary rectangles.
325327 */
326- private static Lst <Rectangle > tempRectangles = new Lst <Rectangle >();
328+ private static Lst <Rectangle > _tempRect = new Lst <Rectangle >();
327329
328330 /** Used for <code>WHEN_FOCUSED</code> bindings. */
329331 private InputMap focusInputMap ;
@@ -420,11 +422,11 @@ static Set<KeyStroke> getManagingFocusBackwardTraversalKeys() {
420422 }
421423
422424 private static Rectangle fetchRectangle () {
423- synchronized (tempRectangles ) {
425+ synchronized (_tempRect ) {
424426 Rectangle rect ;
425- int size = tempRectangles .size ();
427+ int size = _tempRect .size ();
426428 if (size > 0 ) {
427- rect = (Rectangle ) tempRectangles .removeItemAt (size - 1 );
429+ rect = (Rectangle ) _tempRect .removeItemAt (size - 1 );
428430 } else {
429431 rect = new Rectangle (0 , 0 , 0 , 0 );
430432 }
@@ -433,8 +435,8 @@ private static Rectangle fetchRectangle() {
433435 }
434436
435437 private static void recycleRectangle (Rectangle rect ) {
436- synchronized (tempRectangles ) {
437- tempRectangles .addLast (rect );
438+ synchronized (_tempRect ) {
439+ _tempRect .addLast (rect );
438440 }
439441 }
440442
@@ -496,8 +498,8 @@ public void setComponentPopupMenu(JPopupMenu popup) {
496498 if (popup != null ) {
497499 enableEvents (AWTEvent .MOUSE_EVENT_MASK );
498500 }
499- JPopupMenu oldPopup = this .popupMenu ;
500- this .popupMenu = popup ;
501+ JPopupMenu oldPopup = this ._popupMenu ;
502+ this ._popupMenu = popup ;
501503 firePropertyChange ("componentPopupMenu" , oldPopup , popup );
502504 }
503505
@@ -516,10 +518,10 @@ public void setComponentPopupMenu(JPopupMenu popup) {
516518 public JPopupMenu getComponentPopupMenu () {
517519
518520 if (!getInheritsPopupMenu ()) {
519- return popupMenu ;
521+ return _popupMenu ;
520522 }
521523
522- if (popupMenu == null ) {
524+ if (_popupMenu == null ) {
523525 // Search parents for its popup
524526 Container parent = getParent ();
525527 while (parent != null ) {
@@ -535,7 +537,7 @@ public JPopupMenu getComponentPopupMenu() {
535537 return null ;
536538 }
537539
538- return popupMenu ;
540+ return _popupMenu ;
539541 }
540542
541543 /**
@@ -1588,9 +1590,9 @@ public boolean contains(int x, int y) {
15881590 * description: The component's border.
15891591 */
15901592 public void setBorder (Border border ) {
1591- Border oldBorder = this .border ;
1593+ Border oldBorder = this ._border ;
15921594
1593- this .border = border ;
1595+ this ._border = border ;
15941596 firePropertyChange ("border" , oldBorder , border );
15951597 if (border != oldBorder ) {
15961598 if (border == null
@@ -1611,7 +1613,7 @@ public void setBorder(Border border) {
16111613 * @see #setBorder
16121614 */
16131615 public Border getBorder () {
1614- return border ;
1616+ return _border ;
16151617 }
16161618
16171619 /**
@@ -1623,8 +1625,8 @@ public Border getBorder() {
16231625 */
16241626 @ Override
16251627 public Insets getInsets () {
1626- if (border != null ) {
1627- return border .getBorderInsets (this );
1628+ if (_border != null ) {
1629+ return _border .getBorderInsets (this );
16281630 }
16291631 return super .getInsets ();
16301632 }
@@ -1651,17 +1653,17 @@ public Insets getInsets(Insets insets) {
16511653 // because AWT components do not have this method
16521654 in = getInsets ();
16531655 } else {
1654- if (border == null ) {
1656+ if (_border == null ) {
16551657 // super.getInsets() always returns an Insets object with
16561658 // all of its value zeroed. No need for a new object here.
16571659 insets .left = insets .top = insets .right = insets .bottom = 0 ;
16581660 } else {
1659- if (border instanceof AbstractBorder ) {
1660- in = ((AbstractBorder ) border ).getBorderInsets (this , insets );
1661+ if (_border instanceof AbstractBorder ) {
1662+ in = ((AbstractBorder ) _border ).getBorderInsets (this , insets );
16611663 }
16621664 // Can't reuse border insets because the Border interface
16631665 // can't be enhanced.
1664- in = border .getBorderInsets (this );
1666+ in = _border .getBorderInsets (this );
16651667 }
16661668 }
16671669 if (in != null ) {
@@ -1683,8 +1685,8 @@ public Insets getInsets(Insets insets) {
16831685 */
16841686 @ Override
16851687 public float getAlignmentY () {
1686- if (isAlignmentYSet ) {
1687- return alignmentY ;
1688+ if (_isAlignmentYSet ) {
1689+ return _alignmentY ;
16881690 }
16891691 return super .getAlignmentY ();
16901692 }
@@ -1698,9 +1700,9 @@ public float getAlignmentY() {
16981700 * @beaninfo description: The preferred vertical alignment of the component.
16991701 */
17001702 public void setAlignmentY (float alignmentY ) {
1701- this .alignmentY = alignmentY > 1.0f ? 1.0f : alignmentY < 0.0f ? 0.0f
1703+ this ._alignmentY = alignmentY > 1.0f ? 1.0f : alignmentY < 0.0f ? 0.0f
17021704 : alignmentY ;
1703- isAlignmentYSet = true ;
1705+ _isAlignmentYSet = true ;
17041706 }
17051707
17061708 /**
@@ -1713,8 +1715,8 @@ public void setAlignmentY(float alignmentY) {
17131715 */
17141716 @ Override
17151717 public float getAlignmentX () {
1716- if (isAlignmentXSet ) {
1717- return alignmentX ;
1718+ if (_isAlignmentXSet ) {
1719+ return _alignmentX ;
17181720 }
17191721 return super .getAlignmentX ();
17201722 }
@@ -1728,9 +1730,9 @@ public float getAlignmentX() {
17281730 * @beaninfo description: The preferred horizontal alignment of the component.
17291731 */
17301732 public void setAlignmentX (float alignmentX ) {
1731- this .alignmentX = alignmentX > 1.0f ? 1.0f : alignmentX < 0.0f ? 0.0f
1733+ this ._alignmentX = alignmentX > 1.0f ? 1.0f : alignmentX < 0.0f ? 0.0f
17321734 : alignmentX ;
1733- isAlignmentXSet = true ;
1735+ _isAlignmentXSet = true ;
17341736 }
17351737
17361738 /**
@@ -2958,8 +2960,8 @@ public void scrollRectToVisible(Rectangle aRect) {
29582960 */
29592961 public void setAutoscrolls (boolean autoscrolls ) {
29602962 setFlag (AUTOSCROLLS_SET , true );
2961- if (this .autoscrolls != autoscrolls ) {
2962- this .autoscrolls = autoscrolls ;
2963+ if (this ._autoscrolls != autoscrolls ) {
2964+ this ._autoscrolls = autoscrolls ;
29632965 if (autoscrolls ) {
29642966 enableEvents (AWTEvent .MOUSE_EVENT_MASK );
29652967 enableEvents (AWTEvent .MOUSE_MOTION_EVENT_MASK );
@@ -2977,7 +2979,7 @@ public void setAutoscrolls(boolean autoscrolls) {
29772979 * @see #setAutoscrolls
29782980 */
29792981 public boolean getAutoscrolls () {
2980- return autoscrolls ;
2982+ return _autoscrolls ;
29812983 }
29822984
29832985 /**
@@ -2993,7 +2995,7 @@ public boolean getAutoscrolls() {
29932995 */
29942996 @ Override
29952997 protected void processMouseEvent (MouseEvent e ) {
2996- if (autoscrolls && e .getID () == MouseEvent .MOUSE_RELEASED ) {
2998+ if (_autoscrolls && e .getID () == MouseEvent .MOUSE_RELEASED ) {
29972999 Autoscroller .stop (this );
29983000 }
29993001 super .processMouseEvent (e );
@@ -3009,7 +3011,7 @@ protected void processMouseEvent(MouseEvent e) {
30093011 @ Override
30103012 protected void processMouseMotionEvent (MouseEvent e ) {
30113013 boolean dispatch = true ;
3012- if (autoscrolls && e .getID () == MouseEvent .MOUSE_DRAGGED ) {
3014+ if (_autoscrolls && e .getID () == MouseEvent .MOUSE_DRAGGED ) {
30133015 // We don't want to do the drags when the mouse moves if we're
30143016 // autoscrolling. It makes it feel spastic.
30153017 dispatch = !Autoscroller .isRunning (this );
@@ -4164,7 +4166,7 @@ public void removeNotify() {
41644166 RepaintManager .currentManager (this ).resetDoubleBuffer ();
41654167 setCreatedDoubleBuffer (false );
41664168 }
4167- if (autoscrolls ) {
4169+ if (_autoscrolls ) {
41684170 Autoscroller .stop (this );
41694171 }
41704172 }
@@ -4680,15 +4682,15 @@ boolean checkIfChildObscuredBySibling() {
46804682
46814683 private void setFlag (int aFlag , boolean aValue ) {
46824684 if (aValue ) {
4683- flags |= (1 << aFlag );
4685+ _flags |= (1 << aFlag );
46844686 } else {
4685- flags &= ~(1 << aFlag );
4687+ _flags &= ~(1 << aFlag );
46864688 }
46874689 }
46884690
46894691 private boolean getFlag (int aFlag ) {
46904692 int mask = (1 << aFlag );
4691- return ((flags & mask ) == mask );
4693+ return ((_flags & mask ) == mask );
46924694 }
46934695
46944696 // // These functions must be static so that they can be called from
@@ -4754,11 +4756,11 @@ protected String paramString() {
47544756 .toString () : "" );
47554757 String maximumSizeString = (isMaximumSizeSet () ? getMaximumSize ()
47564758 .toString () : "" );
4757- String borderString = (border == null ? "" : (border == this ? "this"
4758- : border .toString ()));
4759+ String borderString = (_border == null ? "" : (_border == this ? "this"
4760+ : _border .toString ()));
47594761
4760- return super .paramString () + ",alignmentX=" + alignmentX + ",alignmentY="
4761- + alignmentY + ",border=" + borderString + ",flags=" + flags
4762+ return super .paramString () + ",alignmentX=" + _alignmentX + ",alignmentY="
4763+ + _alignmentY + ",border=" + borderString + ",flags=" + _flags
47624764 + // should beef this up a bit
47634765 ",maximumSize=" + maximumSizeString + ",minimumSize="
47644766 + minimumSizeString + ",preferredSize=" + preferredSizeString ;
0 commit comments