Add 'src/jexer/' from commit 'cf01c92f5809a0732409e280fb0f32f27393618d'
[nikiroo-utils.git] / src / jexer / backend / SwingBackend.java
index a98627ec3f860d79df7bd71c55be2fab50b63f29..8a342b604f8d438988df943c741b91f0d54b2f06 100644 (file)
@@ -3,7 +3,7 @@
  *
  * The MIT License (MIT)
  *
- * Copyright (C) 2017 Kevin Lamonte
+ * Copyright (C) 2019 Kevin Lamonte
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -35,7 +35,11 @@ import javax.swing.JComponent;
  * This class uses standard Swing calls to handle screen, keyboard, and mouse
  * I/O.
  */
-public final class SwingBackend extends GenericBackend {
+public class SwingBackend extends GenericBackend {
+
+    // ------------------------------------------------------------------------
+    // Constructors -----------------------------------------------------------
+    // ------------------------------------------------------------------------
 
     /**
      * Public constructor.  The window will be 80x25 with font size 20 pts.
@@ -127,6 +131,10 @@ public final class SwingBackend extends GenericBackend {
         screen = (SwingTerminal) terminal;
     }
 
+    // ------------------------------------------------------------------------
+    // SwingBackend -----------------------------------------------------------
+    // ------------------------------------------------------------------------
+
     /**
      * Set to a new font, and resize the screen to match its dimensions.
      *
@@ -147,4 +155,13 @@ public final class SwingBackend extends GenericBackend {
         return ((SwingTerminal) terminal).getBlinkMillis();
     }
 
+    /**
+     * Getter for the underlying Swing component.
+     *
+     * @return the SwingComponent
+     */
+    public SwingComponent getSwingComponent() {
+        return ((SwingTerminal) terminal).getSwingComponent();
+    }
+
 }