edu.princeton.swing
protected class PHighlightedTextArea.InternalTextArea extends javax.swing.JComponent implements java.lang.Runnable, HighlightedDocumentRenderer, javax.swing.Scrollable, ClipboardTarget
javax.swing.JComponent.AccessibleJComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Modifier | Constructor and Description |
---|---|
protected |
PHighlightedTextArea.InternalTextArea() |
Modifier and Type | Method and Description |
---|---|
boolean |
canCopy()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea.
|
boolean |
canCut()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea.
|
boolean |
canPaste()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea.
|
boolean |
canSelectAll()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea.
|
void |
copy()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea.
|
void |
cut()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea.
|
void |
doRender(char[] chars,
byte[] charStyles,
int charCount,
int[] lineOffsets,
int lineCount,
java.lang.Object extraInfo)
Paints the TextArea using the protected data of the document.
|
java.awt.Dimension |
getPreferredScrollableViewportSize()
Implement scrollable to make the viewport's preferred size that of the
InternalTextArea's.
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Implement scrollable to make the block increment a full page.
|
boolean |
getScrollableTracksViewportHeight()
Implement scrollable to make the InternalTextArea's size the greater of its own size
and its viewport's size.
|
boolean |
getScrollableTracksViewportWidth()
Implement scrollable to make the InternalTextArea's size the greater of its own size
and its viewport's size.
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Implement scrollable to make the unit increment a tenth of a page.
|
boolean |
isFocusTraversable()
TODO: Stop using this method when more people switch to 1.4.
|
boolean |
isManagingFocus()
TODO: Stop using this method when more people switch to 1.4.
|
void |
paintComponent(java.awt.Graphics g)
Override the paintComponent() function of JComponent.
|
void |
paste()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea.
|
protected void |
processFocusEvent(java.awt.event.FocusEvent e)
Intercept FocusEvents to notify the ClipboardTargetManager of the event.
|
protected void |
processKeyEvent(java.awt.event.KeyEvent e)
Intercept KeyEvents to perform the usual action.
|
protected void |
processMouseEvent(java.awt.event.MouseEvent e)
Intercept mouse clicks to perform the usual action.
|
protected void |
processMouseMotionEvent(java.awt.event.MouseEvent e)
Intercept mouse dragging to perform the usual action.
|
void |
run()
Implement runnable to blink the caret.
|
void |
selectAll()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
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, addInputMethodListener, 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, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, 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
protected PHighlightedTextArea.InternalTextArea()
public boolean isManagingFocus()
isManagingFocus
in class javax.swing.JComponent
JComponent.isManagingFocus()
public boolean isFocusTraversable()
isFocusTraversable
in class java.awt.Component
Component.isFocusTraversable()
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public boolean canCut()
canCut
in interface ClipboardTarget
public void cut()
cut
in interface ClipboardTarget
public boolean canCopy()
canCopy
in interface ClipboardTarget
public void copy()
copy
in interface ClipboardTarget
public boolean canPaste()
canPaste
in interface ClipboardTarget
public void paste()
paste
in interface ClipboardTarget
public boolean canSelectAll()
canSelectAll
in interface ClipboardTarget
public void selectAll()
selectAll
in interface ClipboardTarget
public void doRender(char[] chars, byte[] charStyles, int charCount, int[] lineOffsets, int lineCount, java.lang.Object extraInfo)
doRender
in interface HighlightedDocumentRenderer
chars
- The characters in the document.charStyles
- The style index of each character in the document.charCount
- The number of characters in the document.lineOffsets
- The offsets of the first character of each line.lineCount
- The number of lines in the document.extraInfo
- The graphics object on which to paint.HighlightedDocument.allowRender(HighlightedDocumentRenderer, Object)
public void run()
run
in interface java.lang.Runnable
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
protected void processFocusEvent(java.awt.event.FocusEvent e)
processFocusEvent
in class java.awt.Component
protected void processKeyEvent(java.awt.event.KeyEvent e)
processKeyEvent
in class javax.swing.JComponent
protected void processMouseEvent(java.awt.event.MouseEvent e)
processMouseEvent
in class javax.swing.JComponent
protected void processMouseMotionEvent(java.awt.event.MouseEvent e)
processMouseMotionEvent
in class javax.swing.JComponent