|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.TextComponent java.awt.TextArea soc.client.SnippingTextArea
public class SnippingTextArea
Limits lines displayed to MaximumLines. Note that the empty string is also considered a line.
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
(package private) static boolean |
isJava142
A bug in Java 1.4.2: the first time replaceRange() is called, it deletes one char beyond what is requested, but only because it's a newline (java bug 5025532 and possibly 4910757). |
(package private) static boolean |
isJavaOnOSX105
Bug in Mac OS X java display: If multiple threads try to update display at once, can hang the GUI (with rainbow "beach ball"). |
(package private) int |
lines
|
(package private) int |
maximumLines
|
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 | |
---|---|
SnippingTextArea(int rows,
int columns,
int maxLines)
Creates a SnippingTextArea which limits hard line breaks to maxLines, and uses SCROLLBARS_VERTICAL_ONLY. |
|
SnippingTextArea(java.lang.String text,
int maxLines)
Creates a new SnippingTextArea object with specified text, which limits hard line breaks to maxLines, and uses SCROOBARS_VERTICAL_ONLY. |
|
SnippingTextArea(java.lang.String text,
int rows,
int columns,
int scrollbars,
int maxLines)
Creates a new SnippingTextArea object with specified text, rows, columns, and scroll bar visibility, which limits hard line breaks to maxLines. |
Method Summary | |
---|---|
void |
append(java.lang.String newString)
|
protected int |
countNewLines(java.lang.String s)
Count the lines in a string of text. |
int |
getMaximumLines()
Maximum lines this text area will display. |
void |
insert(java.lang.String newString,
int x)
|
int |
lines()
|
void |
replaceRange(java.lang.String newString,
int x,
int y)
|
void |
setMaximumLines(int newMax)
Set the maximum lines this text area will display, contents are snipped if necessary. |
void |
setText(java.lang.String newString)
|
void |
snipText()
Remove lines at the beginning of the text, until there are only maxLines in the component. |
Methods inherited from class java.awt.TextArea |
---|
addNotify, appendText, getAccessibleContext, getColumns, getMinimumSize, getMinimumSize, getPreferredSize, getPreferredSize, getRows, getScrollbarVisibility, insertText, minimumSize, minimumSize, paramString, preferredSize, preferredSize, 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 |
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, getBaseline, getBaselineResizeBehavior, 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 |
Field Detail |
---|
static final boolean isJava142
static final boolean isJavaOnOSX105
int maximumLines
int lines
Constructor Detail |
---|
public SnippingTextArea(int rows, int columns, int maxLines)
public SnippingTextArea(java.lang.String text, int maxLines)
public SnippingTextArea(java.lang.String text, int rows, int columns, int scrollbars, int maxLines)
Method Detail |
---|
public int getMaximumLines()
public void setMaximumLines(int newMax)
public int lines()
public void setText(java.lang.String newString)
setText
in class java.awt.TextComponent
public void replaceRange(java.lang.String newString, int x, int y)
replaceRange
in class java.awt.TextArea
public void insert(java.lang.String newString, int x)
insert
in class java.awt.TextArea
public void append(java.lang.String newString)
append
in class java.awt.TextArea
protected int countNewLines(java.lang.String s)
public void snipText()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |