public class TextAreaPainter
extends JComponent
implements TabExpander
Modifier and Type | Class and Description |
---|---|
static interface |
TextAreaPainter.Highlight
Highlight interface.
|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
TextAreaPainter(JEditTextArea textArea,
TextAreaDefaults defaults)
Creates a new repaint manager.
|
Modifier and Type | Method and Description |
---|---|
CompositionTextPainter |
getCompositionTextpainter()
Get CompositionTextPainter, creating one if it doesn't exist.
|
Segment |
getCurrentLine()
Accessor used by tools that want to hook in and grab the formatting.
|
int |
getCurrentLineIndex()
Accessor used by tools that want to hook in and grab the formatting.
|
Token |
getCurrentLineTokens()
Accessor used by tools that want to hook in and grab the formatting.
|
FontMetrics |
getFontMetrics()
Returns the font metrics used by this component.
|
FontMetrics |
getFontMetrics(SyntaxStyle style) |
int |
getLineHeight() |
Dimension |
getMinimumSize() |
Dimension |
getPreferredSize() |
int |
getScrollWidth() |
SyntaxStyle[] |
getStyles()
Returns the syntax styles used to paint colorized text.
|
void |
invalidateLine(int line)
Marks a line as needing a repaint.
|
boolean |
isBlockCaretEnabled()
Returns true if the caret should be drawn as a block, false otherwise.
|
boolean |
isBracketHighlightEnabled()
Returns true if bracket highlighting is enabled, false otherwise.
|
float |
nextTabStop(float x,
int tabOffset)
Returns next tab stop after a specified point.
|
void |
paint(Graphics gfx)
Repaints the text.
|
void |
setCurrentLineIndex(int what)
Accessor used by tools that want to hook in and grab the formatting.
|
void |
setCurrentLineTokens(Token tokens)
Accessor used by tools that want to hook in and grab the formatting.
|
void |
setLineHighlightEnabled(boolean lineHighlight)
Enables or disables current line highlighting.
|
void |
updateAppearance() |
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public TextAreaPainter(JEditTextArea textArea, TextAreaDefaults defaults)
public void updateAppearance()
public CompositionTextPainter getCompositionTextpainter()
public final SyntaxStyle[] getStyles()
Token
public final void setLineHighlightEnabled(boolean lineHighlight)
lineHighlight
- True if current line highlight
should be enabled, false otherwisepublic final boolean isBracketHighlightEnabled()
public final boolean isBlockCaretEnabled()
public FontMetrics getFontMetrics()
public FontMetrics getFontMetrics(SyntaxStyle style)
public int getLineHeight()
public void paint(Graphics gfx)
paint
in class JComponent
gfx
- The graphics contextpublic final void invalidateLine(int line)
line
- The line to invalidatepublic float nextTabStop(float x, int tabOffset)
nextTabStop
in interface TabExpander
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public int getCurrentLineIndex()
public void setCurrentLineIndex(int what)
public Token getCurrentLineTokens()
public void setCurrentLineTokens(Token tokens)
public Segment getCurrentLine()
public int getScrollWidth()