| * and the view. | ||
| */ | ||
| -public class EventHandler implements PropertyChangeListener { | ||
| +public final class EventHandler implements PropertyChangeListener { | ||
| /** |
| * @param <S> The type of state associated with an image. | ||
| */ | ||
| -public class HardwareComponent<S, I extends Image> extends JComponent { | ||
| +public final class HardwareComponent<S, I extends Image> extends JComponent { | ||
| private final Map<S, I> mStateImages = new HashMap<>(); |
| * what key or mouse events have been triggered. | ||
| */ | ||
| -public class HardwareImages { | ||
| +public final class HardwareImages { | ||
| private final static String DIR_IMAGES = "/images"; | ||
| private final static String DIR_IMAGES_KEYBOARD = DIR_IMAGES + "/key"; |
| * hardware switch's value (if any). | ||
| */ | ||
| -public class HardwareSwitchState { | ||
| +public final class HardwareSwitchState { | ||
| private final HardwareSwitch mHardwareSwitch; | ||
| private final HardwareState mHardwareState; |
| ) | ||
| @SuppressWarnings("FieldMayBeFinal") | ||
| -public class KmCaster extends JFrame implements Callable<Integer> { | ||
| +public final class KmCaster extends JFrame implements Callable<Integer> { | ||
| /** |
| * Responsible for converting SVG images into rasterized PNG images. | ||
| */ | ||
| -public class SvgRasterizer { | ||
| +public final class SvgRasterizer { | ||
| public final static Map<Object, Object> RENDERING_HINTS = Map.of( | ||
| KEY_ANTIALIASING, |
| * Responsible for moving the window when the user drags it around the screen. | ||
| */ | ||
| -public class FrameDragListener extends MouseAdapter { | ||
| +public final class FrameDragListener extends MouseAdapter { | ||
| /** | ||
| * |
| */ | ||
| private Rectangle getParentBounds() { | ||
| - return mParentBounds == null | ||
| - ? mParentBounds = getBounds( getParent() ) | ||
| - : mParentBounds; | ||
| + final var bounds = mParentBounds; | ||
| + | ||
| + return bounds == null | ||
| + ? mParentBounds = calculateBounds( getParent() ) | ||
| + : bounds; | ||
| } | ||
| /** | ||
| * Returns the safe area for writing on the {@link Container} parameter | ||
| * provided during construction. | ||
| * | ||
| * @return The {@link Container}'s safe area, based on the | ||
| * {@link Container}'s bounded dimensions and insets. | ||
| */ | ||
| - public static Rectangle getBounds( final Container container ) { | ||
| + public static Rectangle calculateBounds( final Container container ) { | ||
| final var insets = container.getInsets(); | ||
| * Responsible for containing shared constants required by the GUI. | ||
| */ | ||
| -public class Constants { | ||
| +public final class Constants { | ||
| /** | ||
| * Use with {@code setOpaque( false )}. |
| * Convenience class for pairing two dimensions together. | ||
| */ | ||
| -public class DimensionTuple extends Pair<Dimension, Dimension> { | ||
| +public final class DimensionTuple extends Pair<Dimension, Dimension> { | ||
| /** | ||
| * Associates a new {@link Dimension} tuple. |
| * Responsible for finding file resources. | ||
| */ | ||
| -public class ResourceWalker { | ||
| +public final class ResourceWalker { | ||
| private final PathMatcher mPathMatcher; | ||
| * Renders a panel---and its borders---as a translucent colour. | ||
| */ | ||
| -public class TranslucentPanel extends JPanel { | ||
| +public final class TranslucentPanel extends JPanel { | ||
| public TranslucentPanel() { | ||
| setOpaque( true ); |
| * </p> | ||
| */ | ||
| -public class ConsecutiveEventCounter<Event> { | ||
| +public final class ConsecutiveEventCounter<Event> { | ||
| /** | ||
| * Previous event in the event chain, used to decide when the sequence breaks. |
| Author | DaveJarvis <email> |
|---|---|
| Date | 2020-07-29 14:52:20 GMT-0700 |
| Commit | 09ce84921d1860885f8e2ec38697f9945099f6c5 |
| Parent | 2ba150d |
| Delta | 18 lines added, 16 lines removed, 2-line increase |