X-Git-Url: http://git.nikiroo.be/?p=jvcard.git;a=blobdiff_plain;f=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2FWindowShadowRenderer.java;fp=src%2Fcom%2Fgooglecode%2Flanterna%2Fgui2%2FWindowShadowRenderer.java;h=0000000000000000000000000000000000000000;hp=fc8c34d0f2bc5eb9a3c92df49282426b0aadd06d;hb=f06c81000632cfb5f525ca458f719338f55f9f66;hpb=a73a906356c971b080c36368e71a15d87e8b8d31 diff --git a/src/com/googlecode/lanterna/gui2/WindowShadowRenderer.java b/src/com/googlecode/lanterna/gui2/WindowShadowRenderer.java deleted file mode 100644 index fc8c34d..0000000 --- a/src/com/googlecode/lanterna/gui2/WindowShadowRenderer.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * This file is part of lanterna (http://code.google.com/p/lanterna/). - * - * lanterna is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - * - * Copyright (C) 2010-2015 Martin - */ -package com.googlecode.lanterna.gui2; - -import com.googlecode.lanterna.SGR; -import com.googlecode.lanterna.TerminalPosition; -import com.googlecode.lanterna.TerminalSize; -import com.googlecode.lanterna.TextColor; -import com.googlecode.lanterna.graphics.TextGraphics; - -/** - * This WindowPostRenderer implementation draws a shadow under the window - * - * @author Martin - */ -public class WindowShadowRenderer implements WindowPostRenderer { - @Override - public void postRender( - TextGraphics textGraphics, - TextGUI textGUI, - Window window) { - - TerminalPosition windowPosition = window.getPosition(); - TerminalSize decoratedWindowSize = window.getDecoratedSize(); - textGraphics.setForegroundColor(TextColor.ANSI.BLACK); - textGraphics.setBackgroundColor(TextColor.ANSI.BLACK); - textGraphics.enableModifiers(SGR.BOLD); - TerminalPosition lowerLeft = windowPosition.withRelativeColumn(2).withRelativeRow(decoratedWindowSize.getRows()); - TerminalPosition lowerRight = lowerLeft.withRelativeColumn(decoratedWindowSize.getColumns() - 1); - textGraphics.drawLine(lowerLeft, lowerRight, ' '); - TerminalPosition upperRight = lowerRight.withRelativeRow(-decoratedWindowSize.getRows() + 1); - textGraphics.drawLine(lowerRight, upperRight, ' '); - - //Fill the remaining hole - upperRight = upperRight.withRelativeColumn(-1); - lowerRight = lowerRight.withRelativeColumn(-1); - textGraphics.drawLine(upperRight, lowerRight, ' '); - - } -}