Changes between Version 47 and Version 48 of PRO_LIB_CORE_TUTORIAL
- Timestamp:
- 07/14/09 16:12:08 (16 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
PRO_LIB_CORE_TUTORIAL
v47 v48 893 893 }}} 894 894 895 * We have several buttons that need to be positioned at specified locations inside a rectangle. In order to do this we should set the location of every button, one by one upon updating the rectangle. The rectangle itself is kept in the bounds() property. The line "b.swingComponent().get().setLocation(haloBounds.getLocation().toPoint());" gets the JButton out of the HaloButton and sets its location. Since the JButton is not a ProObject but is depending on the bounds() property, we should manually set its location. This is just an example of using solely the setUp method of a resource property. Since this method depends on the bounds()'s property everything in it is reinvoked upon changing the bounds.895 * We have several buttons that need to be positioned at specified locations inside a rectangle. In order to do this we should set the location of every button, one by one upon updating the rectangle. The rectangle itself is kept in the bounds() property. The line "b.swingComponent().get().setLocation(haloBounds.getLocation().toPoint());" gets the JButton out of the HaloButton and sets its location. Since the JButton is not a ProObject but is depending on the bounds() property, we should manually set its location. It we had only one button, its location would have been set in a the resource property it is created. However we have several buttons and only one rectangle. This is just an example of using solely the setUp method of a resource property. Since this method depends on the bounds()'s property everything in it is reinvoked upon changing the bounds. 896 896 897 897 == TODO ==