public class JAutoScrolledText
extends javax.swing.JTextField
javax.swing.JTextField.AccessibleJTextField
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.DropLocation, javax.swing.text.JTextComponent.KeyBinding
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
static int |
CENTER_ALIGNMENT
Specifies alignment to the center of the component.
|
static int |
CLASSIC_BEHAVIOR
Computes font size and return the minimun size to the layout manager
|
static int |
LEFT_ALIGNMENT
Specifies alignment to the left side of the component.
|
static int |
MATRIX_BEHAVIOR
Does not compute font size and let the layout manager size the component
|
static int |
RIGHT_ALIGNMENT
Specifies alignment to the right side of the component.
|
static int |
SCROLL_LOOP
Continuous scrolling
|
static int |
SCROLL_TO_SEE_END
Scroll the text until the end of the text is reached and restart
|
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
JAutoScrolledText()
Constructs an empty text.
|
Modifier and Type | Method and Description |
---|---|
void |
addTextListener(JAutoScrolledTextListener l)
Add the specified JAutoScrolledTextListener Listeners
|
int |
getHorizontalOffset()
Returns the current text horizontal offset.
|
java.awt.Insets |
getMargin()
Returns the margin of this components.
|
java.awt.Dimension |
getMinimumSize() |
java.awt.Dimension |
getPreferredSize() |
int |
getScrollingMode()
Returns the scrolling mode.
|
int |
getSizingBehavior()
Gets the sizing behavior.
|
int |
getSleepTime() |
java.lang.String |
getText() |
int |
getVerticalOffset()
Returns the current text vertical offset.
|
int |
getWaitTime() |
static void |
main(java.lang.String[] args)
Test function.
|
void |
paint(java.awt.Graphics g)
Paint the component.
|
void |
removeTextListener(JAutoScrolledTextListener l)
Remove the specified JAutoScrolledTextListener Listeners
|
void |
setAutoScroll(int time)
Set the autoscroll mode.
|
void |
setHorizontalAlignment(int a)
Sets alignment policiy (when no scroll)
|
void |
setHorizontalOffset(int y)
Sets the text horizontal offset in pixel.
|
void |
setMargin(java.awt.Insets i)
Sets the margin of this components.
|
void |
setScrollingMode(int scrollingMode)
Set the scrolling mode.
|
void |
setSizingBehavior(int s)
Sets the sizing behavior.
|
void |
setSleepTime(int sleepTime) |
void |
setText(java.lang.String txt)
Sets the text of this component.
|
void |
setValueOffsets(int x,
int y)
Deprecated.
|
void |
setVerticalOffset(int y)
Sets the text vertical offset in pixel.
|
void |
setWaitTime(int ms)
Sets the half time between scroll animations.
|
actionPropertyChanged, addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setScrollOffset
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getDropLocation, getDropMode, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getNavigationFilter, getPreferredScrollableViewportSize, getPrintable, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, print, print, print, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, restoreComposedText, saveComposedText, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setDropMode, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public static int CENTER_ALIGNMENT
public static int LEFT_ALIGNMENT
public static int RIGHT_ALIGNMENT
public static int CLASSIC_BEHAVIOR
public static int MATRIX_BEHAVIOR
public static final int SCROLL_TO_SEE_END
public static final int SCROLL_LOOP
public void setMargin(java.awt.Insets i)
setMargin
in class javax.swing.text.JTextComponent
i
- Margin valuepublic java.awt.Insets getMargin()
getMargin
in class javax.swing.text.JTextComponent
public void setWaitTime(int ms)
ms
- Half wait time (in millisecs)public void setSizingBehavior(int s)
s
- Sizing behaviorCLASSIC_BEHAVIOR
,
MATRIX_BEHAVIOR
public int getSizingBehavior()
setSizingBehavior(int)
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JTextField
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public void setAutoScroll(int time)
time
- Scrolling refresh rate (millisec), 0 will disable scrolling.public int getSleepTime()
public void setSleepTime(int sleepTime)
public int getWaitTime()
public void setText(java.lang.String txt)
setText
in class javax.swing.text.JTextComponent
txt
- Text to displaypublic java.lang.String getText()
getText
in class javax.swing.text.JTextComponent
public void setVerticalOffset(int y)
y
- Offset valuepublic int getVerticalOffset()
public void setHorizontalOffset(int y)
y
- Offset valuepublic int getHorizontalOffset()
public void setValueOffsets(int x, int y)
public void setHorizontalAlignment(int a)
setHorizontalAlignment
in class javax.swing.JTextField
a
- Alignment modeCENTER_ALIGNMENT
,
RIGHT_ALIGNMENT
,
LEFT_ALIGNMENT
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
public void addTextListener(JAutoScrolledTextListener l)
public void removeTextListener(JAutoScrolledTextListener l)
public int getScrollingMode()
setScrollingMode(int)
public void setScrollingMode(int scrollingMode)
scrollingMode
- Scrolling modeSCROLL_TO_SEE_END
,
SCROLL_LOOP
public static void main(java.lang.String[] args) throws java.lang.Exception
args
- Not usedjava.lang.Exception