X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2FTPasswordField.java;h=1b78fc8b8db65256bf18b555004c078333da1b98;hb=1dac6b8d395e2bf3c1b58915f8f4f481d9e46793;hp=85f64e1b111abebbb4b46ff7552889cfba79a4cc;hpb=a2018e9964f6c58742cd1e6dd0a0c63e244a89d6;p=fanfix.git diff --git a/src/jexer/TPasswordField.java b/src/jexer/TPasswordField.java index 85f64e1..1b78fc8 100644 --- a/src/jexer/TPasswordField.java +++ b/src/jexer/TPasswordField.java @@ -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"), @@ -34,7 +34,11 @@ import jexer.bits.GraphicsChars; /** * TField implements an editable text field. */ -public final class TPasswordField extends TField { +public class TPasswordField extends TField { + + // ------------------------------------------------------------------------ + // Constructors ----------------------------------------------------------- + // ------------------------------------------------------------------------ /** * Public constructor. @@ -87,6 +91,10 @@ public final class TPasswordField extends TField { super(parent, x, y, width, fixed, text, enterAction, updateAction); } + // ------------------------------------------------------------------------ + // TField ----------------------------------------------------------------- + // ------------------------------------------------------------------------ + /** * Draw the text field. */ @@ -107,13 +115,11 @@ public final class TPasswordField extends TField { end = text.length(); } - getScreen().hLineXY(0, 0, getWidth(), GraphicsChars.HATCH, fieldColor); + hLineXY(0, 0, getWidth(), backgroundChar, fieldColor); if (showStars) { - getScreen().hLineXY(0, 0, getWidth() - 2, '*', - fieldColor); + hLineXY(0, 0, getWidth() - 2, '*', fieldColor); } else { - getScreen().putStringXY(0, 0, text.substring(windowStart, end), - fieldColor); + putStringXY(0, 0, text.substring(windowStart, end), fieldColor); } // Fix the cursor, it will be rendered by TApplication.drawAll().