The implementation of creating/accessing its inputMap looks strange to me:

// no field

// abstract getter
protected abstract InputMap getInputMap();

// implemented factory method
protected InputMap createInputMap() {
     return new InputMap(getNode());
}

Now all subclasses (need to) contain the exact same snippets (and we all know that code duplication is the worst smell of all :)

// have the field
private InputMap myMap;

// set the field in constructor
super(control);
myMap = createInputMap();

// implement getter
protected InputMap getInputMap() {
    return myMap;
}

Wondering why the field is defered to subclasses? If it were pulled up into base, all the duplicated code in subclasses could be deleted.

There must be a reason, but I don't see it - please enlighten me!

Cheers
Jeanette

Reply via email to