X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FSwingSessionInfo.java;h=b4c0b59d9f3c6868518dc470a39a7f06fc192401;hb=d36057dfab8def933a64be042b039d76708ac5ba;hp=7457f57a0d73b185f1f618e4a035faade6e7c88b;hpb=eb29bbb5ec70c43895dd0f053630c7e3cd402cba;p=fanfix.git diff --git a/src/jexer/backend/SwingSessionInfo.java b/src/jexer/backend/SwingSessionInfo.java index 7457f57..b4c0b59 100644 --- a/src/jexer/backend/SwingSessionInfo.java +++ b/src/jexer/backend/SwingSessionInfo.java @@ -37,6 +37,10 @@ import java.awt.Insets; */ public final class SwingSessionInfo implements SessionInfo { + // ------------------------------------------------------------------------ + // Variables -------------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * The Swing JFrame or JComponent. */ @@ -72,6 +76,48 @@ public final class SwingSessionInfo implements SessionInfo { */ private int windowHeight = 25; + // ------------------------------------------------------------------------ + // Constructors ----------------------------------------------------------- + // ------------------------------------------------------------------------ + + /** + * Public constructor. + * + * @param swing the Swing JFrame or JComponent + * @param textWidth the width of a cell in pixels + * @param textHeight the height of a cell in pixels + */ + public SwingSessionInfo(final SwingComponent swing, final int textWidth, + final int textHeight) { + + this.swing = swing; + this.textWidth = textWidth; + this.textHeight = textHeight; + } + + /** + * Public constructor. + * + * @param swing the Swing JFrame or JComponent + * @param textWidth the width of a cell in pixels + * @param textHeight the height of a cell in pixels + * @param width the number of columns + * @param height the number of rows + */ + public SwingSessionInfo(final SwingComponent swing, final int textWidth, + final int textHeight, final int width, final int height) { + + this.swing = swing; + this.textWidth = textWidth; + this.textHeight = textHeight; + this.windowWidth = width; + this.windowHeight = height; + } + + // ------------------------------------------------------------------------ + // SessionInfo ------------------------------------------------------------ + // ------------------------------------------------------------------------ + /** * Username getter. * @@ -126,53 +172,6 @@ public final class SwingSessionInfo implements SessionInfo { return windowHeight; } - /** - * Set the dimensions of a single text cell. - * - * @param textWidth the width of a cell in pixels - * @param textHeight the height of a cell in pixels - */ - public void setTextCellDimensions(final int textWidth, - final int textHeight) { - - this.textWidth = textWidth; - this.textHeight = textHeight; - } - - /** - * Public constructor. - * - * @param swing the Swing JFrame or JComponent - * @param textWidth the width of a cell in pixels - * @param textHeight the height of a cell in pixels - */ - public SwingSessionInfo(final SwingComponent swing, final int textWidth, - final int textHeight) { - - this.swing = swing; - this.textWidth = textWidth; - this.textHeight = textHeight; - } - - /** - * Public constructor. - * - * @param swing the Swing JFrame or JComponent - * @param textWidth the width of a cell in pixels - * @param textHeight the height of a cell in pixels - * @param width the number of columns - * @param height the number of rows - */ - public SwingSessionInfo(final SwingComponent swing, final int textWidth, - final int textHeight, final int width, final int height) { - - this.swing = swing; - this.textWidth = textWidth; - this.textHeight = textHeight; - this.windowWidth = width; - this.windowHeight = height; - } - /** * Re-query the text window size. */ @@ -191,4 +190,21 @@ public final class SwingSessionInfo implements SessionInfo { } + // ------------------------------------------------------------------------ + // SwingSessionInfo ------------------------------------------------------- + // ------------------------------------------------------------------------ + + /** + * Set the dimensions of a single text cell. + * + * @param textWidth the width of a cell in pixels + * @param textHeight the height of a cell in pixels + */ + public void setTextCellDimensions(final int textWidth, + final int textHeight) { + + this.textWidth = textWidth; + this.textHeight = textHeight; + } + }