Improve code readability (4) and clean up code

This further improves code readability and cleans up the code.
To not make review impossible by creating a single huge commit, I'm committing
this now and will go on cleaning up afterward.

The improvements and fixes include but are not limited to:
* use extended `for` loops if applicable (instead of classic `for` loops or
  object iterators if unnecessary)
* remove unnecessary curly braces if that improves readability (e.g. on short
  one-instruction loops or `if`-statements
* typize generic classes if possible (also gets rid of warnings)
* inline single-use variables if it improves readability
* reduce code duplication by introducing variables
* add `final` modifier to fields and variables if appropriate
* rename identifiers to comply with javaCamelCase convention (instead of
  underscores)
* move certain listener/action implementations into anonymous inner classes in
  order to place them close to the item they belong to
* use `==` operator instead of `equals()` method if checking a reference
* call static methods in a static way (e.g. use `MainFrame` instead of `mf`)
* add `else` to `if`-statement-chain if cases are mutually exclusive
* add line breaks to very long statements
* replace all tabs by spaces
* remove trailing whitespace
* remove unnecessary blank lines

As usual, I recommend reviewing and testing these changes, as I might easily have overlooked something that change more than cosmetics.

If there are single changes that ought to be reverted or changed further, please highlight and mention them (e.g. line comments) and I will append this PR.