public class TextPanel extends Panel implements AdjustmentListener, MouseListener, MouseMotionListener, KeyListener, ClipboardOwner, ActionListener, MouseWheelListener, Runnable
Panel.AccessibleAWTPanel
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
TextPanel()
Constructs a new TextPanel.
|
TextPanel(String title)
Constructs a new TextPanel.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(ActionEvent e) |
void |
addKeyListener(KeyListener listener)
Unused keyPressed and keyTyped events will be passed to 'listener'.
|
void |
addMouseListener(MouseListener listener) |
void |
adjustmentValueChanged(AdjustmentEvent e) |
void |
append(ArrayList list)
Adds strings contained in an ArrayList to the end of this TextPanel.
|
void |
append(String text)
Adds one or more lines to the end of this TextPanel.
|
void |
appendLine(String text)
Adds a single line to the end of this TextPanel.
|
void |
appendWithoutUpdate(String data)
Adds a single line to the end of this TextPanel without updating the display.
|
void |
clear()
Deletes all the lines.
|
void |
clearSelection()
Deletes the selected lines.
|
int |
copySelection()
Copies the current selection to the system clipboard.
|
void |
doClear()
Implements the Clear command.
|
String |
getColumnHeadings()
Returns the column headings as a tab-delimited string.
|
String |
getLine(int index)
Returns the specified line as a string.
|
int |
getLineCount()
Returns the number of lines of text in this TextPanel.
|
ResultsTable |
getOrCreateResultsTable()
Returns the ResultsTable associated with this TextPanel, or
attempts to create one and returns the created table.
|
ResultsTable |
getResultsTable()
Returns the ResultsTable associated with this TextPanel, or null.
|
int |
getSelectionEnd()
Returns the index of the last selected line, or -1
if there is no slection.
|
int |
getSelectionStart()
Returns the index of the first selected line, or -1
if there is no slection.
|
String |
getText()
Returns all the text as a string.
|
void |
keyPressed(KeyEvent e) |
void |
keyReleased(KeyEvent e) |
void |
keyTyped(KeyEvent e) |
void |
lostOwnership(Clipboard clip,
Transferable cont) |
void |
mouseClicked(MouseEvent e) |
void |
mouseDragged(MouseEvent e) |
void |
mouseEntered(MouseEvent e) |
void |
mouseExited(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent e) |
void |
mouseReleased(MouseEvent e) |
void |
mouseWheelMoved(MouseWheelEvent event) |
void |
resetSelection()
Clears the selection, if any.
|
int |
rowIndex(int y)
Converts a y coordinate in pixels into a row index.
|
void |
run()
For better performance, open double-clicked files on
separate thread instead of on event dispatch thread.
|
void |
save(PrintWriter pw)
Writes all the text in this TextPanel to a file.
|
boolean |
saveAs(String path)
Saves the text in this TextPanel to a file.
|
void |
scrollToTop() |
void |
selectAll()
Selects all the lines in this TextPanel.
|
void |
setColumnHeadings(String labels)
Clears this TextPanel and sets the column headings to
those in the tab-delimited 'headings' String.
|
void |
setFont(Font font,
boolean antialiased) |
void |
setLine(int index,
String s)
Replaces the contents of the specified line, where 'index'
must be greater than or equal to zero and less than
the value returned by getLineCount().
|
void |
setResultsTable(ResultsTable rt)
Sets the ResultsTable associated with this TextPanel.
|
void |
setSelection(int startLine,
int endLine)
Creates a selection and insures that it is visible.
|
void |
setTitle(String title) |
void |
updateColumnHeadings(String labels) |
void |
updateDisplay() |
addNotify, getAccessibleContext
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, isValidateRoot, layout, list, list, locate, minimumSize, paint, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusDownCycle, update, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, revalidate, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public TextPanel()
public TextPanel(String title)
public void setColumnHeadings(String labels)
public String getColumnHeadings()
public void updateColumnHeadings(String labels)
public void setFont(Font font, boolean antialiased)
public void appendLine(String text)
public void append(String text)
public void append(ArrayList list)
public void appendWithoutUpdate(String data)
public void updateDisplay()
public void adjustmentValueChanged(AdjustmentEvent e)
adjustmentValueChanged
in interface AdjustmentListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void run()
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseWheelMoved(MouseWheelEvent event)
mouseWheelMoved
in interface MouseWheelListener
public void addKeyListener(KeyListener listener)
addKeyListener
in class Component
public void addMouseListener(MouseListener listener)
addMouseListener
in class Component
public void keyPressed(KeyEvent e)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent e)
keyReleased
in interface KeyListener
public void keyTyped(KeyEvent e)
keyTyped
in interface KeyListener
public void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void lostOwnership(Clipboard clip, Transferable cont)
lostOwnership
in interface ClipboardOwner
public int rowIndex(int y)
public int copySelection()
public void doClear()
public void clearSelection()
public void clear()
public void selectAll()
public void resetSelection()
public void setSelection(int startLine, int endLine)
public void save(PrintWriter pw)
public boolean saveAs(String path)
public String getText()
public void setTitle(String title)
public int getLineCount()
public String getLine(int index)
public void setLine(int index, String s)
public int getSelectionStart()
public int getSelectionEnd()
public void setResultsTable(ResultsTable rt)
public ResultsTable getResultsTable()
public ResultsTable getOrCreateResultsTable()
public void scrollToTop()
Copyright © 1997–2020 NIH. All rights reserved.