org.strbio.io
Class OldBufferedPrintfTextArea

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.TextComponent
          extended by java.awt.TextArea
              extended by org.strbio.io.OldBufferedPrintfTextArea
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, Printf

public class OldBufferedPrintfTextArea
extends java.awt.TextArea
implements Printf

A TextArea that you can do printf() on, like a civilized (C) programmer. This uses the sprintf routines in StringUtil. These routines are not thread-safe. This is faster than a PrintfTextArea because things you printf are not actually appended to the area until flush() is called. Until then, they sit in a string buffer. This class triggers the IRIX scrollbar bug less frequently than the PrintfTextArea class. This is AWT 1.0 compliant.

  Version 1.01, 3/29/99 - fixed so it doesn't convert \n.

  Version 1.0, 8/19/98 - original version.
  

Version:
1.01, 3/29/99
Author:
JMC
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.TextArea
java.awt.TextArea.AccessibleAWTTextArea
 
Nested classes/interfaces inherited from class java.awt.TextComponent
java.awt.TextComponent.AccessibleAWTTextComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class java.awt.TextArea
SCROLLBARS_BOTH, SCROLLBARS_HORIZONTAL_ONLY, SCROLLBARS_NONE, SCROLLBARS_VERTICAL_ONLY
 
Fields inherited from class java.awt.TextComponent
textListener
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
OldBufferedPrintfTextArea()
           
OldBufferedPrintfTextArea(int r, int c)
           
OldBufferedPrintfTextArea(java.lang.String text)
           
OldBufferedPrintfTextArea(java.lang.String text, int r, int c)
           
 
Method Summary
 void flush()
          Text is not actually appended until you call flush().
 void printf(java.lang.String fmt)
          Prints a string to the output, without any formatting or parameter substitution (because there are no parameters)
 void printf(java.lang.String fmt, char x)
          Prints an integer to the output with some formatting.
 void printf(java.lang.String fmt, double x)
          Prints a double to the output with some formatting.
 void printf(java.lang.String fmt, float x)
          Prints a float to the output with some formatting.
 void printf(java.lang.String fmt, int x)
          Prints an integer to the output with some formatting.
 void printf(java.lang.String fmt, long x)
          Prints a long to the output with some formatting.
 void printf(java.lang.String fmt, java.lang.String x)
          Prints a String to the output with some formatting.
 
Methods inherited from class java.awt.TextArea
addNotify, append, appendText, getAccessibleContext, getColumns, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, getRows, getScrollbarVisibility, insert, insertText, minimumSize, minimumSize, paramString, preferredSize, preferredSize, replaceRange, replaceText, setColumns, setRows
 
Methods inherited from class java.awt.TextComponent
addTextListener, enableInputMethods, getBackground, getCaretPosition, getInputMethodRequests, getListeners, getSelectedText, getSelectionEnd, getSelectionStart, getText, getTextListeners, isEditable, processEvent, processTextEvent, removeNotify, removeTextListener, select, selectAll, setBackground, setCaretPosition, setEditable, setSelectionEnd, setSelectionStart, setText
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OldBufferedPrintfTextArea

public OldBufferedPrintfTextArea()

OldBufferedPrintfTextArea

public OldBufferedPrintfTextArea(java.lang.String text)

OldBufferedPrintfTextArea

public OldBufferedPrintfTextArea(int r,
                                 int c)

OldBufferedPrintfTextArea

public OldBufferedPrintfTextArea(java.lang.String text,
                                 int r,
                                 int c)
Method Detail

flush

public final void flush()
Text is not actually appended until you call flush().

Specified by:
flush in interface Printf

printf

public final void printf(java.lang.String fmt)
Prints a string to the output, without any formatting or parameter substitution (because there are no parameters)

Specified by:
printf in interface Printf

printf

public final void printf(java.lang.String fmt,
                         double x)
Prints a double to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %f or something to that effect. Note that you don't do %lf, just %f.
x - The double to print.

printf

public final void printf(java.lang.String fmt,
                         float x)
Prints a float to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %f or something to that effect.
x - The float to print.

printf

public final void printf(java.lang.String fmt,
                         long x)
Prints a long to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %d or something to that effect. Note that you don't do %ld, just %d.
x - The long to print.

printf

public final void printf(java.lang.String fmt,
                         int x)
Prints an integer to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %d or something to that effect.
x - The int to print.

printf

public final void printf(java.lang.String fmt,
                         char x)
Prints an integer to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %c or something to that effect.
x - The char to print.

printf

public final void printf(java.lang.String fmt,
                         java.lang.String x)
Prints a String to the output with some formatting.

Specified by:
printf in interface Printf
Parameters:
fmt - The format string, like in C... should contain %s or something to that effect. Note that unless you actually do some formatting (i.e %-3s) it's ususally faster to use the + operator.
x - The String to print.