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 }
|
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 // If component is moved from one screen(hidpi) to another sceeen(lowdpi)
1139 // graphicsConfig property is fired to enable the component to recalculate
1140 // any rendering data, if needed
1141 if (graphicsConfig != null && gc != null) {
1142 firePropertyChange("graphicsConfig", graphicsConfig, gc);
1143 }
1144 graphicsConfig = gc;
1145
1146 ComponentPeer peer = this.peer;
1147 if (peer != null) {
1148 return peer.updateGraphicsData(gc);
1149 }
1150 return false;
1151 }
1152
1153 /**
1154 * Checks that this component's {@code GraphicsDevice}
1155 * {@code idString} matches the string argument.
1156 */
1157 void checkGD(String stringID) {
1158 if (graphicsConfig != null) {
1159 if (!graphicsConfig.getDevice().getIDstring().equals(stringID)) {
1160 throw new IllegalArgumentException(
1161 "adding a container to a container on a different GraphicsDevice");
1162 }
1163 }
|