From a2855f1dd3ca42b61ac4c47a18e2253ea32dd56e Mon Sep 17 00:00:00 2001 From: Kevin Lamonte Date: Sat, 7 Apr 2018 12:35:15 -0400 Subject: [PATCH] #33 expose SwingComponent --- src/jexer/backend/SwingBackend.java | 9 +++++++++ src/jexer/backend/SwingSessionInfo.java | 9 +++++++++ src/jexer/backend/SwingTerminal.java | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/jexer/backend/SwingBackend.java b/src/jexer/backend/SwingBackend.java index bfbd07e2..797caa82 100644 --- a/src/jexer/backend/SwingBackend.java +++ b/src/jexer/backend/SwingBackend.java @@ -155,4 +155,13 @@ public class SwingBackend extends GenericBackend { return ((SwingTerminal) terminal).getBlinkMillis(); } + /** + * Getter for the underlying Swing component. + * + * @return the SwingComponent + */ + public SwingComponent getSwingComponent() { + return ((SwingTerminal) terminal).getSwingComponent(); + } + } diff --git a/src/jexer/backend/SwingSessionInfo.java b/src/jexer/backend/SwingSessionInfo.java index b19c60f6..6d1c644f 100644 --- a/src/jexer/backend/SwingSessionInfo.java +++ b/src/jexer/backend/SwingSessionInfo.java @@ -207,4 +207,13 @@ public class SwingSessionInfo implements SessionInfo { this.textHeight = textHeight; } + /** + * Getter for the underlying Swing component. + * + * @return the SwingComponent + */ + public SwingComponent getSwingComponent() { + return swing; + } + } diff --git a/src/jexer/backend/SwingTerminal.java b/src/jexer/backend/SwingTerminal.java index f588679d..3f5b58e3 100644 --- a/src/jexer/backend/SwingTerminal.java +++ b/src/jexer/backend/SwingTerminal.java @@ -1387,6 +1387,15 @@ public class SwingTerminal extends LogicalScreen return sessionInfo; } + /** + * Getter for the underlying Swing component. + * + * @return the SwingComponent + */ + public SwingComponent getSwingComponent() { + return swing; + } + // ------------------------------------------------------------------------ // KeyListener ------------------------------------------------------------ // ------------------------------------------------------------------------ -- 2.27.0