X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fbackend%2FSwingBackend.java;h=acca7fa0b66c0e4d056e8b268d504b11de83f731;hb=c447c6e5759db7ac9bbb05cc1b3618dd38230335;hp=e7f4312b0858c7f35f15356acaaee7d5a5221d87;hpb=55d2b2c2b29ce51f4f910448a115073371deeae8;p=nikiroo-utils.git diff --git a/src/jexer/backend/SwingBackend.java b/src/jexer/backend/SwingBackend.java index e7f4312..acca7fa 100644 --- a/src/jexer/backend/SwingBackend.java +++ b/src/jexer/backend/SwingBackend.java @@ -3,7 +3,7 @@ * * The MIT License (MIT) * - * Copyright (C) 2016 Kevin Lamonte + * Copyright (C) 2017 Kevin Lamonte * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -46,14 +46,31 @@ public final class SwingBackend extends Backend { private SwingTerminal terminal; /** - * Public constructor. + * Public constructor. The window will be 80x25 with font size 20 pts. * * @param listener the object this backend needs to wake up when new * input comes in */ public SwingBackend(final Object listener) { + this(listener, 80, 25, 20); + } + + /** + * Public constructor. + * + * @param listener the object this backend needs to wake up when new + * input comes in + * @param windowWidth the number of text columns to start with + * @param windowHeight the number of text rows to start with + * @param fontSize the size in points. Good values to pick are: 16, 20, + * 22, and 24. + */ + public SwingBackend(final Object listener, final int windowWidth, + final int windowHeight, final int fontSize) { + // Create a screen - SwingScreen screen = new SwingScreen(); + SwingScreen screen = new SwingScreen(windowWidth, windowHeight, + fontSize); this.screen = screen; // Create the Swing event listeners