< prev index next >

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

Print this page




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





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




1122 
1123     final GraphicsConfiguration getGraphicsConfiguration_NoClientCode() {
1124         return graphicsConfig;
1125     }
1126 
1127     void setGraphicsConfiguration(GraphicsConfiguration gc) {
1128         synchronized(getTreeLock()) {
1129             if (updateGraphicsData(gc)) {
1130                 removeNotify();
1131                 addNotify();
1132             }
1133         }
1134     }
1135 
1136     boolean updateGraphicsData(GraphicsConfiguration gc) {
1137         checkTreeLock();
1138 
1139         if (graphicsConfig == gc) {
1140             return false;
1141         }
1142         // If component is moved from one screen(hidpi) to another sceeen(lowdpi)
1143         // graphicsConfig property is fired to enable the component to recalculate
1144         // any rendering data, if needed
1145         if (graphicsConfig != null && gc != null) {
1146             firePropertyChange("graphicsConfig", graphicsConfig, gc);
1147         }
1148         graphicsConfig = gc;
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         }


< prev index next >