< prev index next >

src/java.desktop/share/classes/java/awt/Component.java

Print this page




1118 
1119     final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
1120         return graphicsConfig;
1121     }
1122 
1123     void setGraphicsConfiguration(GraphicsConfiguration gc) {
1124         synchronized(getTreeLock()) {
1125             if (updateGraphicsData(gc)) {
1126                 removeNotify();
1127                 addNotify();
1128             }
1129         }
1130     }
1131 
1132     boolean updateGraphicsData(GraphicsConfiguration gc) {
1133         checkTreeLock();
1134 
1135         if (graphicsConfig == gc) {
1136             return false;
1137         }
1138 
1139         graphicsConfig = gc;
1140 









1141         ComponentPeer peer = this.peer;
1142         if (peer != null) {
1143             return peer.updateGraphicsData(gc);
1144         }
1145         return false;
1146     }
1147 
1148     /**
1149      * Checks that this component's {@code GraphicsDevice}
1150      * {@code idString} matches the string argument.
1151      */
1152     void checkGD(String stringID) {
1153         if (graphicsConfig != null) {
1154             if (!graphicsConfig.getDevice().getIDstring().equals(stringID)) {
1155                 throw new IllegalArgumentException(
1156                                                    "adding a container to a container on a different GraphicsDevice");
1157             }
1158         }
1159     }
1160 




1118 
1119     final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
1120         return graphicsConfig;
1121     }
1122 
1123     void setGraphicsConfiguration(GraphicsConfiguration gc) {
1124         synchronized(getTreeLock()) {
1125             if (updateGraphicsData(gc)) {
1126                 removeNotify();
1127                 addNotify();
1128             }
1129         }
1130     }
1131 
1132     boolean updateGraphicsData(GraphicsConfiguration gc) {
1133         checkTreeLock();
1134 
1135         if (graphicsConfig == gc) {
1136             return false;
1137         }
1138         GraphicsConfiguration oldConfig = graphicsConfig;        
1139         graphicsConfig = gc;
1140         
1141         /* 
1142          * If component is moved from one screen to another sceeen
1143          * graphicsConfiguration property is fired to enable the component 
1144          * to recalculate any rendering data, if needed
1145          */
1146         if (oldConfig != null && gc != null) {
1147             firePropertyChange("graphicsConfiguration", oldConfig, gc);
1148         }
1149 
1150         ComponentPeer peer = this.peer;
1151         if (peer != null) {            
1152             return peer.updateGraphicsData(gc);
1153         }
1154         return false;
1155     }
1156 
1157     /**
1158      * Checks that this component's {@code GraphicsDevice}
1159      * {@code idString} matches the string argument.
1160      */
1161     void checkGD(String stringID) {
1162         if (graphicsConfig != null) {
1163             if (!graphicsConfig.getDevice().getIDstring().equals(stringID)) {
1164                 throw new IllegalArgumentException(
1165                                                    "adding a container to a container on a different GraphicsDevice");
1166             }
1167         }
1168     }
1169 


< prev index next >