|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Canvas | +--com.lyrisoft.awt.TextView
An alternative TextView (non-editable) that allows font colors, sytles, and word-wrap. Works in JDK1.0.2
Inner classes inherited from class java.awt.Canvas |
java.awt.Canvas.AccessibleAWTCanvas |
Inner classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent |
Field Summary | |
protected TextStyle |
_defaultStyle
|
protected int |
_firstRun
|
protected java.util.Vector |
_runs
|
protected int |
_yTranslation
|
static java.awt.Font |
DEFAULT_FONT
|
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 | |
TextView()
Construct a new scrollview that does not auto-scroll |
|
TextView(boolean autoScrolling)
Construct a new scrollview |
Method Summary | |
void |
append(java.lang.String s)
Append a string in the default style |
void |
append(java.lang.String s,
TextStyle style)
Append a string using the given TextStyle |
void |
append(TextRun run)
Append a TextRun object |
TextStyle |
getDefaultStyle()
Get the default TextStyle |
void |
paint(java.awt.Graphics g)
just called renderViewable(g) |
java.awt.Dimension |
preferredSize()
The preferredSize we return is the size we would have to be to fully render our contents given our current width. |
void |
reshape(int x,
int y,
int w,
int h)
Overridden. |
void |
setFont(java.awt.Font f)
Start using a new font (by font object) |
void |
setFont(java.lang.String name)
Start using a new font (by name) |
void |
setFontSize(int size)
Start using a new font size |
void |
setYTranslation(int y)
The the Y translation, or offset value |
void |
show()
Overridden so that we force a scroll to the very bottom, if auto-scrolling is enabled |
void |
update(java.awt.Graphics g)
overridden to just call paint(g) |
Methods inherited from class java.awt.Canvas |
addNotify, getAccessibleContext |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static java.awt.Font DEFAULT_FONT
protected java.util.Vector _runs
protected TextStyle _defaultStyle
protected int _yTranslation
protected int _firstRun
Constructor Detail |
public TextView(boolean autoScrolling)
autoScrolling
- indicates whether this TextView should automatically
scroll to the bottom when new text is addedpublic TextView()
Method Detail |
public TextStyle getDefaultStyle()
public void setFont(java.lang.String name)
public void setFontSize(int size)
public void setFont(java.awt.Font f)
setFont
in class java.awt.Component
public void append(java.lang.String s, TextStyle style)
public void append(TextRun run)
public void append(java.lang.String s)
public void setYTranslation(int y)
public void update(java.awt.Graphics g)
update
in class java.awt.Component
public void paint(java.awt.Graphics g)
paint
in class java.awt.Canvas
public void show()
show
in class java.awt.Component
public void reshape(int x, int y, int w, int h)
reshape
in class java.awt.Component
public java.awt.Dimension preferredSize()
preferredSize
in class java.awt.Component
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |