Game Development Reference
In-Depth Information
short-cut ( Alt-Insert ); using either of these will bring up a floating Generate menu,
which is shown highlighted in red in the bottom center of Figure 8-9 .
Figure 8-9 . Use Source
Insert Code menu (or Alt+Insert) to bring up a Generate Getter and Setter dialog and
select all
Click on the Getter and Setter option, shown highlighted in the middle of the
Generate floating menu, and a Generate Getters and Setters dialog will appear,
which is shown on the right side of Figure 8-9 . Make sure that the hierarchy is open,
and that the check box next to Actor is selected, which will automatically select all of
the variables inside of the class, in this case, a dozen variables also shown selected on
the right hand side of Figure 8-9 .
Once all of these are selected, click on the Generate button at the bottom of the
dialog and generate the 24 .get() and .set() methods that you would have to type in
manually if NetBeans 8.0 did not offer this handy IDE feature.
These .get() and .set() methods, which are generated by the NetBeans 8.0 Source
Insert Code Generate Getters and Setters menu sequence, will give you
the following twenty-four Java method code constructs, which equates to two methods
for each of the twelve variables that we defined within the public abstract Actor class:
public List<Image> getImageStates() {
return imageStates;
}
 
Search WWH ::




Custom Search