295 /**
296 * The locale for the component.
297 *
298 * @serial
299 * @see #getLocale
300 * @see #setLocale
301 */
302 Locale locale;
303
304 /**
305 * A reference to a <code>GraphicsConfiguration</code> object
306 * used to describe the characteristics of a graphics
307 * destination.
308 * This value can be <code>null</code>.
309 *
310 * @since 1.3
311 * @serial
312 * @see GraphicsConfiguration
313 * @see #getGraphicsConfiguration
314 */
315 private transient GraphicsConfiguration graphicsConfig = null;
316
317 /**
318 * A reference to a <code>BufferStrategy</code> object
319 * used to manipulate the buffers on this component.
320 *
321 * @since 1.4
322 * @see java.awt.image.BufferStrategy
323 * @see #getBufferStrategy()
324 */
325 transient BufferStrategy bufferStrategy = null;
326
327 /**
328 * True when the object should ignore all repaint events.
329 *
330 * @since 1.4
331 * @serial
332 * @see #setIgnoreRepaint
333 * @see #getIgnoreRepaint
334 */
335 boolean ignoreRepaint = false;
1126 */
1127
1128 public synchronized DropTarget getDropTarget() { return dropTarget; }
1129
1130 /**
1131 * Gets the <code>GraphicsConfiguration</code> associated with this
1132 * <code>Component</code>.
1133 * If the <code>Component</code> has not been assigned a specific
1134 * <code>GraphicsConfiguration</code>,
1135 * the <code>GraphicsConfiguration</code> of the
1136 * <code>Component</code> object's top-level container is
1137 * returned.
1138 * If the <code>Component</code> has been created, but not yet added
1139 * to a <code>Container</code>, this method returns <code>null</code>.
1140 *
1141 * @return the <code>GraphicsConfiguration</code> used by this
1142 * <code>Component</code> or <code>null</code>
1143 * @since 1.3
1144 */
1145 public GraphicsConfiguration getGraphicsConfiguration() {
1146 synchronized(getTreeLock()) {
1147 return getGraphicsConfiguration_NoClientCode();
1148 }
1149 }
1150
1151 final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
1152 return graphicsConfig;
1153 }
1154
1155 void setGraphicsConfiguration(GraphicsConfiguration gc) {
1156 synchronized(getTreeLock()) {
1157 if (updateGraphicsData(gc)) {
1158 removeNotify();
1159 addNotify();
1160 }
1161 }
1162 }
1163
1164 boolean updateGraphicsData(GraphicsConfiguration gc) {
1165 checkTreeLock();
1166
1167 if (graphicsConfig == gc) {
1168 return false;
1169 }
|
295 /**
296 * The locale for the component.
297 *
298 * @serial
299 * @see #getLocale
300 * @see #setLocale
301 */
302 Locale locale;
303
304 /**
305 * A reference to a <code>GraphicsConfiguration</code> object
306 * used to describe the characteristics of a graphics
307 * destination.
308 * This value can be <code>null</code>.
309 *
310 * @since 1.3
311 * @serial
312 * @see GraphicsConfiguration
313 * @see #getGraphicsConfiguration
314 */
315 private transient volatile GraphicsConfiguration graphicsConfig;
316
317 /**
318 * A reference to a <code>BufferStrategy</code> object
319 * used to manipulate the buffers on this component.
320 *
321 * @since 1.4
322 * @see java.awt.image.BufferStrategy
323 * @see #getBufferStrategy()
324 */
325 transient BufferStrategy bufferStrategy = null;
326
327 /**
328 * True when the object should ignore all repaint events.
329 *
330 * @since 1.4
331 * @serial
332 * @see #setIgnoreRepaint
333 * @see #getIgnoreRepaint
334 */
335 boolean ignoreRepaint = false;
1126 */
1127
1128 public synchronized DropTarget getDropTarget() { return dropTarget; }
1129
1130 /**
1131 * Gets the <code>GraphicsConfiguration</code> associated with this
1132 * <code>Component</code>.
1133 * If the <code>Component</code> has not been assigned a specific
1134 * <code>GraphicsConfiguration</code>,
1135 * the <code>GraphicsConfiguration</code> of the
1136 * <code>Component</code> object's top-level container is
1137 * returned.
1138 * If the <code>Component</code> has been created, but not yet added
1139 * to a <code>Container</code>, this method returns <code>null</code>.
1140 *
1141 * @return the <code>GraphicsConfiguration</code> used by this
1142 * <code>Component</code> or <code>null</code>
1143 * @since 1.3
1144 */
1145 public GraphicsConfiguration getGraphicsConfiguration() {
1146 return getGraphicsConfiguration_NoClientCode();
1147 }
1148
1149 final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
1150 return graphicsConfig;
1151 }
1152
1153 void setGraphicsConfiguration(GraphicsConfiguration gc) {
1154 synchronized(getTreeLock()) {
1155 if (updateGraphicsData(gc)) {
1156 removeNotify();
1157 addNotify();
1158 }
1159 }
1160 }
1161
1162 boolean updateGraphicsData(GraphicsConfiguration gc) {
1163 checkTreeLock();
1164
1165 if (graphicsConfig == gc) {
1166 return false;
1167 }
|