Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/hartmath/HartMathTextArea.java


1   /*
2    *  HartMathTextArea.java
3    *  Copyright (C) 2000 Klaus Hartlage
4    *  webmaster@hartmath.com
5    *  www.hartmath.com
6    *
7    *  This program is free software; you can redistribute it and/or
8    *  modify it under the terms of the GNU General Public License
9    *  as published by the Free Software Foundation; either version 2
10   *  of the License, or any later version.
11   *
12   *  This program is distributed in the hope that it will be useful,
13   *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14   *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   *  GNU General Public License for more details.
16   *
17   *  You should have received a copy of the GNU General Public License
18   *  along with this program; if not, write to the Free Software
19   *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20   */
21  package org.hartmath;
22  
23  import java.awt.Color;
24  import java.io.*;
25  /**
26   *  A Writer class for abstraction of IO with the GUI
27   *
28   *@author     khartlage
29   *@created    16. Juli 2001
30   */
31  public class HartMathTextArea extends Writer {
32          // implements ResultOutput
33  
34          private HartMathPanel hmPanel;
35  
36  
37          /**
38           *  Constructor for the HartMathTextArea object
39           *
40           *@param  cons  Description of Parameter
41           */
42          public HartMathTextArea(HartMathPanel cons) {
43                  hmPanel = cons;
44          }
45  
46  
47          /**
48           *  Gets the hartMathPanel attribute of the HartMathTextArea object
49           *
50           *@return    The hartMathPanel value
51           */
52          public HartMathPanel getHartMathPanel() {
53                  return hmPanel;
54          }
55  
56  
57          /**
58           *  Description of the Method
59           *
60           *@param  str  Description of Parameter
61           */
62          public void append(String str) {
63                  //     hmPanel.append(str, Color.black);
64                  hmPanel.append(str);
65          }
66  
67  
68          /**
69           *  Description of the Method
70           *
71           *@param  str    Description of Parameter
72           *@param  color  Description of Parameter
73           */
74          public void append(String str, Color color) {
75                  //  hmPanel.append(str, color);
76                  hmPanel.append(str);
77          }
78  
79  
80          /**
81           *  Description of the Method
82           *
83           *@param  str  Description of Parameter
84           */
85          public void appendLine(String str) {
86                  hmPanel.append(str);
87                  hmPanel.append("\n");
88          }
89  
90  
91  // public void appendTeX(String str) {
92  //   hmPanel.appendTeX(str);
93  // }
94          /**
95           *  Write a portion of an array of characters.
96           *
97           *@param  cbuf             Array of characters
98           *@param  off              Offset from which to start writing characters
99           *@param  len              Number of characters to write
100          *@exception  IOException  If an I/O error occurs
101          */
102         public void write(char cbuf[], int off, int len) throws IOException {
103                 append(new String(cbuf, off, len));
104         }
105 
106 
107         /**
108          *  Flush the stream. If the stream has saved any characters from the various
109          *  write() methods in a buffer, write them immediately to their intended
110          *  destination. Then, if that destination is another character or byte stream,
111          *  flush it. Thus one flush() invocation will flush all the buffers in a chain
112          *  of Writers and OutputStreams.
113          *
114          *@exception  IOException  If an I/O error occurs
115          */
116         public void flush() throws IOException {
117         }
118 
119 
120         /**
121          *  Close the stream, flushing it first. Once a stream has been closed, further
122          *  write() or flush() invocations will cause an IOException to be thrown.
123          *  Closing a previously-closed stream, however, has no effect.
124          *
125          *@exception  IOException  If an I/O error occurs
126          */
127         public void close() throws IOException {
128         }
129         /*
130          *  public void scrollToEnd() {
131          *  hmPanel.scrollToEnd();
132          *  }
133          */
134 }
135