public class RMTextArea
extends javax.swing.JComponent
implements javax.swing.Scrollable, java.awt.dnd.DropTargetListener, java.beans.PropertyChangeListener
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
RMTextArea()
Creates a new text area.
|
Modifier and Type | Method and Description |
---|---|
void |
append(RMXString anXString)
Appends an XString.
|
void |
append(java.lang.String aString)
Append Text.
|
void |
appendln(java.lang.String aString)
Append Text.
|
RMTextEditor |
createTextEditor()
Creates a new text editor.
|
void |
dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
DropTargetListener method.
|
void |
dragExit(java.awt.dnd.DropTargetEvent dte)
DropTargetListener method.
|
void |
dragOver(java.awt.dnd.DropTargetDragEvent dtde)
DropTargetListener method.
|
void |
drop(java.awt.dnd.DropTargetDropEvent dtde)
DropTargetListener method.
|
void |
dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
DropTargetListener method.
|
int |
getCharIndex(java.awt.geom.Point2D aPoint)
Returns the char index for given point in text coordinate space.
|
java.awt.Font |
getFont()
Return AWT Font for current selection.
|
double |
getFontScale()
Convenience - returns text editor font scale.
|
boolean |
getLineWrap()
Returns whether to wrap lines to pane width.
|
java.awt.Insets |
getMargin()
Returns the text margins.
|
java.awt.Dimension |
getMinimumSize()
Overrides JComponent method to declare minimum size to be current size.
|
java.awt.Dimension |
getPreferredScrollableViewportSize()
Scrollable method.
|
java.awt.Dimension |
getPreferredSize()
Overrides JComponent method to declare preferred size to be text editor's optimal height.
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Scrollable method.
|
boolean |
getScrollableTracksViewportHeight()
Scrollable method.
|
boolean |
getScrollableTracksViewportWidth()
Scrollable method.
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Scrollable method.
|
int |
getSelAnchor()
Returns the selection anchor.
|
int |
getSelEnd()
Returns the selection end.
|
int |
getSelStart()
Returns the selection start.
|
java.lang.String |
getText()
Returns text string of text editor.
|
java.awt.geom.Rectangle2D |
getTextBounds()
Returns the text rect.
|
RMTextEditor |
getTextEditor()
Returns the text editor associated with this text area.
|
RMXString |
getXString()
Convenience - returns text editor string.
|
void |
hideCursor()
Hides the cursor.
|
int |
length()
Returns the text length.
|
void |
paintComponent(java.awt.Graphics g)
Overrides JComponent to paint text editor text.
|
void |
paintTextEditor(java.awt.Graphics2D g)
Paints a given layout in a given graphics.
|
void |
processMouseEvent(java.awt.event.MouseEvent anEvent)
Overrides JComponent method to forward mouse pressed/released to text editor.
|
void |
processMouseMotionEvent(java.awt.event.MouseEvent anEvent)
Overrides JComponent method to forward mouse drags to text editor.
|
void |
propertyChange(java.beans.PropertyChangeEvent anEvent)
When text editor changes Selection or XString changes Runs or XStringRuns change Chars/Attribute, repaint.
|
void |
setBounds(int x,
int y,
int w,
int h)
Overrides JComponent method to tell text editor the bounds.
|
void |
setFont(java.awt.Font aFont)
Set AWT Font for current selection.
|
void |
setFontScale(double aScale)
Convenience - sets text editor font scale.
|
void |
setLineWrap(boolean aValue)
Sets whether to wrap lines to pane width.
|
void |
setMargin(java.awt.Insets theInsets)
Sets the text margins.
|
void |
setSel(int newStartEnd)
Sets the character index of the text cursor.
|
void |
setSel(int aStart,
int anEnd)
Sets the character index of the start and end of the text selection.
|
void |
setText(java.lang.String aString)
Set text string of text editor.
|
void |
setTextEditor(RMTextEditor aTE)
Sets the text editor associated with this text area.
|
void |
setXString(RMXString aString)
Convenience - sets text editor string.
|
void |
showCursor()
Shows the cursor.
|
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, paint, 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, 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, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public java.awt.Insets getMargin()
public void setMargin(java.awt.Insets theInsets)
public java.awt.geom.Rectangle2D getTextBounds()
public boolean getLineWrap()
public void setLineWrap(boolean aValue)
public RMTextEditor getTextEditor()
public void setTextEditor(RMTextEditor aTE)
public RMTextEditor createTextEditor()
public java.lang.String getText()
public void setText(java.lang.String aString)
public void append(java.lang.String aString)
public void appendln(java.lang.String aString)
public void append(RMXString anXString)
public int length()
public RMXString getXString()
public void setXString(RMXString aString)
public double getFontScale()
public void setFontScale(double aScale)
public void propertyChange(java.beans.PropertyChangeEvent anEvent)
propertyChange
in interface java.beans.PropertyChangeListener
public void processMouseEvent(java.awt.event.MouseEvent anEvent)
processMouseEvent
in class javax.swing.JComponent
public void processMouseMotionEvent(java.awt.event.MouseEvent anEvent)
processMouseMotionEvent
in class javax.swing.JComponent
public void showCursor()
public void hideCursor()
public void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
public void paintTextEditor(java.awt.Graphics2D g)
public java.awt.Dimension getMinimumSize()
getMinimumSize
in class javax.swing.JComponent
public java.awt.Dimension getPreferredSize()
getPreferredSize
in class javax.swing.JComponent
public void setBounds(int x, int y, int w, int h)
setBounds
in class java.awt.Component
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableBlockIncrement
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
public void dragEnter(java.awt.dnd.DropTargetDragEvent dtde)
dragEnter
in interface java.awt.dnd.DropTargetListener
public void dragExit(java.awt.dnd.DropTargetEvent dte)
dragExit
in interface java.awt.dnd.DropTargetListener
public void dragOver(java.awt.dnd.DropTargetDragEvent dtde)
dragOver
in interface java.awt.dnd.DropTargetListener
public void drop(java.awt.dnd.DropTargetDropEvent dtde)
drop
in interface java.awt.dnd.DropTargetListener
public void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)
dropActionChanged
in interface java.awt.dnd.DropTargetListener
public void setSel(int newStartEnd)
public void setSel(int aStart, int anEnd)
public int getSelStart()
public int getSelEnd()
public int getSelAnchor()
public int getCharIndex(java.awt.geom.Point2D aPoint)
public java.awt.Font getFont()
getFont
in interface java.awt.MenuContainer
getFont
in class java.awt.Component
public void setFont(java.awt.Font aFont)
setFont
in class javax.swing.JComponent