|
What this is
Other links
The source code/* * 12/06/2003 * * AbstractLogWindow.java - Log window infrastructure * Copyright (C) 2003 Paolo Giarrusso * blaisorblade_work@yahoo.it * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package org.jext.scripting; import java.awt.BorderLayout; import java.awt.Container; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.KeyEvent; import java.awt.event.KeyAdapter; import java.awt.event.MouseEvent; import java.awt.event.MouseAdapter; import java.io.Writer; import javax.swing.*; import org.jext.*; import org.jext.gui.*; public abstract class AbstractLogWindow extends JFrame implements Logger { protected Dockable contDock; protected JextFrame parent; protected JTextArea textArea = new JTextArea(15, 40); public Dockable getContainingDock() { if (contDock.getFrame() != this) { System.err.println("contDock.getFrame() is: " + contDock.getFrame() + "\nwhile this is: " + this); throw new RuntimeException("Emulated assertion failed in AbstractLogWindow"); } return contDock; } public void log(String msg) { textArea.append(msg); textArea.setSelectionStart(textArea.getDocument().getLength()); textArea.setSelectionEnd(textArea.getDocument().getLength()); } public void logln(String msg) { log(msg + '\n'); } private Writer writerStdOut = new LoggingWriter(); private Writer writeStdErr = new LoggingWriter(); /** * Returns a writer in which external classes can send * |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.