enkonyito
Advanced Member
Joined: May 28, 2015
Post Count: 607
Status:
Offline
|
|
Re: Saved property not taken into account correctly
|
But why don't you manage your additional information with the methods setProperty / getProperty available on subclasses of HomeObject, like the Room class? This would prevent you from subclassing classes which handle XML files. Indeed, it's more practical!
<room level='level0' areaVisible='true' areaXOffset='-130.0' areaYOffset='55.99997' floorColor='FF586178' ceilingVisible='false'> <point x='503.75' y='50.30641'/> <point x='503.75' y='426.80637'/> <point x='11.25' y='426.8065'/> <point x='11.25' y='50.30641'/> </room> <room level='level1' areaVisible='true' areaXOffset='-132.15613' areaYOffset='109.9032' floorVisible='false' floorColor='FF586178'> <property name='ceilingLightEnabled' value='true'/> <point x='503.8' y='50.3'/> <point x='503.8' y='426.8'/> <point x='11.2' y='426.8'/> <point x='11.2' y='50.3'/> </room>
By selecting rooms of different state: - with NullableCheckBox, I get the error
Caused by: java.lang.NullPointerException at com.eteks.sweethome3d.viewcontroller.RoomController.setCeilingLightEnabled(RoomController.java:982) at com.eteks.sweethome3d.viewcontroller.RoomController.updateProperties(RoomController.java:420) at com.eteks.sweethome3d.viewcontroller.RoomController.<init>(RoomController.java:119) at com.eteks.sweethome3d.viewcontroller.PlanController.modifySelectedRooms(PlanController.java:1691) - with JCheckBox or by capturing the exception, the global state is not indicated (empty).
----------------------------------------
EnkoNyito
|
[Apr 5, 2019, 11:49:38 PM]
|
|
[Link]
|
|