|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
edu.princeton.swing.PHighlightedTextArea.InternalTextArea
protected class PHighlightedTextArea.InternalTextArea
InternalTextArea is the subcomponent of PHighlightedTextArea which shows the editable program code.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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 | |
---|---|
protected |
PHighlightedTextArea.InternalTextArea()
|
Method Summary | |
---|---|
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,
short[] lineOffsets,
int lineCount,
Object extraInfo)
Paints the TextArea using the protected data of the document. |
Dimension |
getPreferredScrollableViewportSize()
Implement scrollable to make the viewport's preferred size that of the InternalTextArea's. |
int |
getScrollableBlockIncrement(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(Rectangle visibleRect,
int orientation,
int direction)
Implement scrollable to make the unit increment a tenth of a page. |
boolean |
isFocusTraversable()
|
boolean |
isManagingFocus()
|
void |
paintComponent(Graphics g)
Override the paintComponent() function of JComponent. |
void |
paste()
Implement ClipboardTarget to pass clipboard requests to the JHighlghtedTextArea. |
protected void |
processFocusEvent(FocusEvent e)
Intercept FocusEvents to notify the ClipboardTargetManager of the event. |
protected void |
processKeyEvent(KeyEvent e)
Intercept KeyEvents to perform the usual action. |
protected void |
processMouseEvent(MouseEvent e)
Intercept mouse clicks to perform the usual action. |
protected void |
processMouseMotionEvent(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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected PHighlightedTextArea.InternalTextArea()
Method Detail |
---|
public boolean isManagingFocus()
isManagingFocus
in class JComponent
JComponent.isManagingFocus()
public boolean isFocusTraversable()
isFocusTraversable
in class Component
Component.isFocusTraversable()
public void paintComponent(Graphics g)
paintComponent
in class 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, short[] lineOffsets, int lineCount, 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 Runnable
public Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface Scrollable
public int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface Scrollable
public int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface Scrollable
protected void processFocusEvent(FocusEvent e)
processFocusEvent
in class Component
protected void processKeyEvent(KeyEvent e)
processKeyEvent
in class JComponent
protected void processMouseEvent(MouseEvent e)
processMouseEvent
in class JComponent
protected void processMouseMotionEvent(MouseEvent e)
processMouseMotionEvent
in class JComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |