jdk/src/share/classes/sun/swing/SwingAccessor.java
changeset 23280 df31f522531f
parent 20127 a3a34675d847
child 23328 4c53a6ebc779
equal deleted inserted replaced
23279:16c1ddb7b66a 23280:df31f522531f
     1 /*
     1 /*
     2  * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    26 package sun.swing;
    26 package sun.swing;
    27 
    27 
    28 import sun.misc.Unsafe;
    28 import sun.misc.Unsafe;
    29 
    29 
    30 import java.awt.Point;
    30 import java.awt.Point;
       
    31 import javax.swing.RepaintManager;
    31 
    32 
    32 import javax.swing.text.JTextComponent;
    33 import javax.swing.text.JTextComponent;
    33 import javax.swing.TransferHandler;
    34 import javax.swing.TransferHandler;
    34 
    35 
    35 /**
    36 /**
    80          */
    81          */
    81         void updateCursor(JLightweightFrame frame);
    82         void updateCursor(JLightweightFrame frame);
    82     }
    83     }
    83 
    84 
    84     /**
    85     /**
       
    86      * An accessor for the RepaintManager class.
       
    87      */
       
    88     public interface RepaintManagerAccessor {
       
    89         void addRepaintListener(RepaintManager rm, SwingUtilities2.RepaintListener l);
       
    90         void removeRepaintListener(RepaintManager rm, SwingUtilities2.RepaintListener l);
       
    91     }
       
    92 
       
    93     /**
    85      * The javax.swing.text.JTextComponent class accessor object.
    94      * The javax.swing.text.JTextComponent class accessor object.
    86      */
    95      */
    87     private static JTextComponentAccessor jtextComponentAccessor;
    96     private static JTextComponentAccessor jtextComponentAccessor;
    88 
    97 
    89     /**
    98     /**
   118 
   127 
   119     /**
   128     /**
   120      * Retrieve the accessor object for the JLightweightFrame class
   129      * Retrieve the accessor object for the JLightweightFrame class
   121      */
   130      */
   122     public static JLightweightFrameAccessor getJLightweightFrameAccessor() {
   131     public static JLightweightFrameAccessor getJLightweightFrameAccessor() {
       
   132         if (jLightweightFrameAccessor == null) {
       
   133             unsafe.ensureClassInitialized(JLightweightFrame.class);
       
   134         }
   123         return jLightweightFrameAccessor;
   135         return jLightweightFrameAccessor;
   124     }
   136     }
       
   137 
       
   138     /**
       
   139      * The RepaintManager class accessor object.
       
   140      */
       
   141     private static RepaintManagerAccessor repaintManagerAccessor;
       
   142 
       
   143     /**
       
   144      * Set an accessor object for the RepaintManager class.
       
   145      */
       
   146     public static void setRepaintManagerAccessor(RepaintManagerAccessor accessor) {
       
   147         repaintManagerAccessor = accessor;
       
   148     }
       
   149 
       
   150     /**
       
   151      * Retrieve the accessor object for the RepaintManager class.
       
   152      */
       
   153     public static RepaintManagerAccessor getRepaintManagerAccessor() {
       
   154         if (repaintManagerAccessor == null) {
       
   155             unsafe.ensureClassInitialized(RepaintManager.class);
       
   156         }
       
   157         return repaintManagerAccessor;
       
   158     }
   125 }
   159 }