8585 * @author shannah
8686 * @since 3.4
8787 */
88- public class SignatureComponent extends Container implements ActionSource {
88+ public class SignatureComponent extends Container implements ActionSource < ActionEvent > {
8989
9090 private final SignaturePanel signaturePanel = new SignaturePanel ();
9191 private final Button lead ;
@@ -152,7 +152,7 @@ protected void paintBackground(Graphics g) {
152152 };
153153 lead .setText (localize ("SignatureComponent.LeadText" , "Press to sign" ));
154154 lead .setUIID ("SignatureButton" );
155- lead .addActionListener (new ActionListener () {
155+ lead .addActionListener (new ActionListener < ActionEvent > () {
156156 public void actionPerformed (ActionEvent evt ) {
157157 final Dialog dialog = new Dialog (localize ("SignatureComponent.DialogTitle" , "Sign Here" ));
158158 final SignatureDialogBody sigBody = new SignatureDialogBody () {
@@ -164,7 +164,7 @@ protected void onCancel() {
164164 };
165165 signaturePanel .clear ();
166166
167- sigBody .addActionListener (new ActionListener () {
167+ sigBody .addActionListener (new ActionListener < ActionEvent > () {
168168 public void actionPerformed (ActionEvent sigDoneEvent ) {
169169 dialog .dispose ();
170170 setSignatureImage (sigBody .getValue ());
@@ -179,7 +179,7 @@ public void actionPerformed(ActionEvent sigDoneEvent) {
179179 dialog .show ();
180180 }
181181 });
182- addComponent (BorderLayout .CENTER , lead );
182+ super . addComponent (BorderLayout .CENTER , lead );
183183 }
184184
185185 /**
@@ -208,7 +208,7 @@ protected void onSignatureReset() {
208208 *
209209 * @param l
210210 */
211- public void addActionListener (ActionListener l ) {
211+ public void addActionListener (ActionListener < ActionEvent > l ) {
212212 eventDispatcher .addListener (l );
213213 }
214214
@@ -217,7 +217,7 @@ public void addActionListener(ActionListener l) {
217217 *
218218 * @param l
219219 */
220- public void removeActionListener (ActionListener l ) {
220+ public void removeActionListener (ActionListener < ActionEvent > l ) {
221221 eventDispatcher .removeListener (l );
222222 }
223223
@@ -331,25 +331,22 @@ public void clearSignaturePanel() {
331331 */
332332 private class SignatureDialogBody extends Container {
333333 private final EventDispatcher eventDispatcher = new EventDispatcher ();
334- private final Button doneButton ;
335- private final Button resetButton ;
336- private final Button cancelButton ;
337334 private Image value ;
338335
339336 public SignatureDialogBody () {
340337 setLayout (new BorderLayout ());
341- addComponent (BorderLayout .CENTER , signaturePanel );
342- doneButton = new Button (
338+ super . addComponent (BorderLayout .CENTER , signaturePanel );
339+ Button doneButton = new Button (
343340 localize ("SignatureComponent.SaveButtonLabel" , "Save" ),
344341 getUIManager ().getThemeConstant ("sigButtonOKUIID" , "Button" ));
345- resetButton = new Button (
342+ Button resetButton = new Button (
346343 localize ("SignatureComponent.ResetButtonLabel" , "Reset" ),
347344 getUIManager ().getThemeConstant ("sigButtonResetUIID" , "Button" ));
348- cancelButton = new Button (
345+ Button cancelButton = new Button (
349346 localize ("SignatureComponent.CancelButtonLabel" , "Cancel" ),
350347 getUIManager ().getThemeConstant ("sigButtonCancelUIID" , "Button" ));
351348
352- doneButton .addActionListener (new ActionListener () {
349+ doneButton .addActionListener (new ActionListener < ActionEvent > () {
353350 public void actionPerformed (ActionEvent evt ) {
354351 value = signaturePanel .getImage ();
355352 if (value == null ) {
@@ -366,22 +363,22 @@ public void actionPerformed(ActionEvent evt) {
366363 }
367364 });
368365
369- resetButton .addActionListener (new ActionListener () {
366+ resetButton .addActionListener (new ActionListener < ActionEvent > () {
370367 public void actionPerformed (ActionEvent evt ) {
371368 signaturePanel .clear ();
372369 onSignatureReset ();
373370 repaint ();
374371 }
375372 });
376373
377- cancelButton .addActionListener (new ActionListener () {
374+ cancelButton .addActionListener (new ActionListener < ActionEvent > () {
378375 public void actionPerformed (ActionEvent evt ) {
379376 removeComponent (signaturePanel );
380377 onCancel ();
381378 }
382379 });
383380
384- addComponent (BorderLayout .SOUTH , GridLayout .encloseIn (3 , cancelButton , resetButton , doneButton ));
381+ super . addComponent (BorderLayout .SOUTH , GridLayout .encloseIn (3 , cancelButton , resetButton , doneButton ));
385382 }
386383
387384 /**
0 commit comments