Package com.inductiveautomation.rm.text
Class RMTextArea
- java.lang.Object
- 
- java.awt.Component
- 
- java.awt.Container
- 
- javax.swing.JComponent
- 
- com.inductiveautomation.rm.text.RMTextArea
 
 
 
 
- 
- All Implemented Interfaces:
- java.awt.dnd.DropTargetListener,- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.beans.PropertyChangeListener,- java.io.Serializable,- java.util.EventListener,- javax.swing.Scrollable
 
 public class RMTextArea extends javax.swing.JComponent implements javax.swing.Scrollable, java.awt.dnd.DropTargetListener, java.beans.PropertyChangeListenerA text editor subclass for editing text in a Swing component.- See Also:
- Serialized Form
 
- 
- 
Field Summary- 
Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
- 
 - 
Constructor SummaryConstructors Constructor Description RMTextArea()Creates a new text area.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappend(RMXString anXString)Appends an XString.voidappend(java.lang.String aString)Append Text.voidappendln(java.lang.String aString)Append Text.RMTextEditorcreateTextEditor()Creates a new text editor.voiddragEnter(java.awt.dnd.DropTargetDragEvent dtde)DropTargetListener method.voiddragExit(java.awt.dnd.DropTargetEvent dte)DropTargetListener method.voiddragOver(java.awt.dnd.DropTargetDragEvent dtde)DropTargetListener method.voiddrop(java.awt.dnd.DropTargetDropEvent dtde)DropTargetListener method.voiddropActionChanged(java.awt.dnd.DropTargetDragEvent dtde)DropTargetListener method.intgetCharIndex(java.awt.geom.Point2D aPoint)Returns the char index for given point in text coordinate space.RMDateFormatgetDateFormat()java.awt.FontgetFont()Return AWT Font for current selection.doublegetFontScale()Convenience - returns text editor font scale.booleangetLineWrap()Returns whether to wrap lines to pane width.java.awt.InsetsgetMargin()Returns the text margins.java.awt.DimensiongetMinimumSize()Overrides JComponent method to declare minimum size to be current size.RMNumberFormatgetNumberFormat()java.awt.DimensiongetPreferredScrollableViewportSize()Scrollable method.java.awt.DimensiongetPreferredSize()Overrides JComponent method to declare preferred size to be text editor's optimal height.intgetScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)Scrollable method.booleangetScrollableTracksViewportHeight()Scrollable method.booleangetScrollableTracksViewportWidth()Scrollable method.intgetScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)Scrollable method.intgetSelAnchor()Returns the selection anchor.intgetSelEnd()Returns the selection end.intgetSelStart()Returns the selection start.java.lang.StringgetText()Returns text string of text editor.java.awt.geom.Rectangle2DgetTextBounds()Returns the text rect.RMTextEditorgetTextEditor()Returns the text editor associated with this text area.RMXStringgetXString()Convenience - returns text editor string.voidhideCursor()Hides the cursor.booleanisManagingFocus()Overrides JComponent method so we get VK_TAB events.intlength()Returns the text length.protected voidpaintBackground(java.awt.Graphics2D aGraphics)Paints background.voidpaintComponent(java.awt.Graphics g)Overrides JComponent to paint text editor text.protected voidpaintText(java.awt.Graphics2D aGraphics)Paints the layout in a given graphics.voidpaintTextEditor(java.awt.Graphics2D g)Paints a given layout in a given graphics.protected voidpaintTextRun(java.awt.Graphics2D g, RMTextRun aRun)Paints the layout in a given graphics.protected voidprocessComponentKeyEvent(java.awt.event.KeyEvent anEvent)Overrides JComponent to forward key event to text editor.protected voidprocessFocusEvent(java.awt.event.FocusEvent e)Override to show hidden cursor.voidprocessMouseEvent(java.awt.event.MouseEvent anEvent)Overrides JComponent method to forward mouse pressed/released to text editor.voidprocessMouseMotionEvent(java.awt.event.MouseEvent anEvent)Overrides JComponent method to forward mouse drags to text editor.voidpropertyChange(java.beans.PropertyChangeEvent anEvent)When text editor changes Selection or XString changes Runs or XStringRuns change Chars/Attribute, repaint.voidsetBounds(int x, int y, int w, int h)Overrides JComponent method to tell text editor the bounds.voidsetDateFormat(RMDateFormat format)voidsetFont(java.awt.Font aFont)Set AWT Font for current selection.voidsetFontScale(double aScale)Convenience - sets text editor font scale.voidsetLineWrap(boolean aValue)Sets whether to wrap lines to pane width.voidsetMargin(java.awt.Insets theInsets)Sets the text margins.voidsetNumberFormat(RMNumberFormat format)protected voidsetRenderingHints(java.awt.Graphics2D aGraphics)Sets rendering hints for text render.voidsetSel(int newStartEnd)Sets the character index of the text cursor.voidsetSel(int aStart, int anEnd)Sets the character index of the start and end of the text selection.voidsetText(java.lang.String aString)Set text string of text editor.voidsetTextEditor(RMTextEditor aTE)Sets the text editor associated with this text area.voidsetXString(RMXString aString)Convenience - sets text editor string.voidshowCursor()Shows the cursor.- 
Methods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processKeyBinding, processKeyEvent, 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, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 - 
Methods inherited from class java.awt.Containeradd, 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
 - 
Methods inherited from class java.awt.Componentaction, 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, 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, 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, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
- 
 
- 
- 
- 
Method Detail- 
getMarginpublic java.awt.Insets getMargin() Returns the text margins.
 - 
setMarginpublic void setMargin(java.awt.Insets theInsets) Sets the text margins.
 - 
getTextBoundspublic java.awt.geom.Rectangle2D getTextBounds() Returns the text rect.
 - 
getLineWrappublic boolean getLineWrap() Returns whether to wrap lines to pane width.
 - 
setLineWrappublic void setLineWrap(boolean aValue) Sets whether to wrap lines to pane width.
 - 
getTextEditorpublic RMTextEditor getTextEditor() Returns the text editor associated with this text area.
 - 
setTextEditorpublic void setTextEditor(RMTextEditor aTE) Sets the text editor associated with this text area.
 - 
createTextEditorpublic RMTextEditor createTextEditor() Creates a new text editor.
 - 
getTextpublic java.lang.String getText() Returns text string of text editor.
 - 
setTextpublic void setText(java.lang.String aString) Set text string of text editor.
 - 
appendpublic void append(java.lang.String aString) Append Text.
 - 
appendlnpublic void appendln(java.lang.String aString) Append Text.
 - 
appendpublic void append(RMXString anXString) Appends an XString.
 - 
lengthpublic int length() Returns the text length.
 - 
getXStringpublic RMXString getXString() Convenience - returns text editor string.
 - 
setXStringpublic void setXString(RMXString aString) Convenience - sets text editor string.
 - 
getNumberFormat@Nonnull public RMNumberFormat getNumberFormat() 
 - 
getDateFormat@Nonnull public RMDateFormat getDateFormat() 
 - 
setDateFormatpublic void setDateFormat(RMDateFormat format) 
 - 
setNumberFormatpublic void setNumberFormat(RMNumberFormat format) 
 - 
getFontScalepublic double getFontScale() Convenience - returns text editor font scale.
 - 
setFontScalepublic void setFontScale(double aScale) Convenience - sets text editor font scale.
 - 
propertyChangepublic void propertyChange(java.beans.PropertyChangeEvent anEvent) When text editor changes Selection or XString changes Runs or XStringRuns change Chars/Attribute, repaint.- Specified by:
- propertyChangein interface- java.beans.PropertyChangeListener
 
 - 
processComponentKeyEventprotected void processComponentKeyEvent(java.awt.event.KeyEvent anEvent) Overrides JComponent to forward key event to text editor.- Overrides:
- processComponentKeyEventin class- javax.swing.JComponent
 
 - 
processMouseEventpublic void processMouseEvent(java.awt.event.MouseEvent anEvent) Overrides JComponent method to forward mouse pressed/released to text editor.- Overrides:
- processMouseEventin class- javax.swing.JComponent
 
 - 
processFocusEventprotected void processFocusEvent(java.awt.event.FocusEvent e) Override to show hidden cursor.- Overrides:
- processFocusEventin class- java.awt.Component
 
 - 
processMouseMotionEventpublic void processMouseMotionEvent(java.awt.event.MouseEvent anEvent) Overrides JComponent method to forward mouse drags to text editor.- Overrides:
- processMouseMotionEventin class- javax.swing.JComponent
 
 - 
showCursorpublic void showCursor() Shows the cursor.
 - 
hideCursorpublic void hideCursor() Hides the cursor.
 - 
isManagingFocuspublic boolean isManagingFocus() Overrides JComponent method so we get VK_TAB events.- Overrides:
- isManagingFocusin class- javax.swing.JComponent
 
 - 
paintComponentpublic void paintComponent(java.awt.Graphics g) Overrides JComponent to paint text editor text.- Overrides:
- paintComponentin class- javax.swing.JComponent
 
 - 
paintTextprotected void paintText(java.awt.Graphics2D aGraphics) Paints the layout in a given graphics.
 - 
paintTextRunprotected void paintTextRun(java.awt.Graphics2D g, RMTextRun aRun)Paints the layout in a given graphics.
 - 
paintTextEditorpublic void paintTextEditor(java.awt.Graphics2D g) Paints a given layout in a given graphics.
 - 
paintBackgroundprotected void paintBackground(java.awt.Graphics2D aGraphics) Paints background.
 - 
setRenderingHintsprotected void setRenderingHints(java.awt.Graphics2D aGraphics) Sets rendering hints for text render.
 - 
getMinimumSizepublic java.awt.Dimension getMinimumSize() Overrides JComponent method to declare minimum size to be current size.- Overrides:
- getMinimumSizein class- javax.swing.JComponent
 
 - 
getPreferredSizepublic java.awt.Dimension getPreferredSize() Overrides JComponent method to declare preferred size to be text editor's optimal height.- Overrides:
- getPreferredSizein class- javax.swing.JComponent
 
 - 
setBoundspublic void setBounds(int x, int y, int w, int h)Overrides JComponent method to tell text editor the bounds.- Overrides:
- setBoundsin class- java.awt.Component
 
 - 
getPreferredScrollableViewportSizepublic java.awt.Dimension getPreferredScrollableViewportSize() Scrollable method.- Specified by:
- getPreferredScrollableViewportSizein interface- javax.swing.Scrollable
 
 - 
getScrollableTracksViewportWidthpublic boolean getScrollableTracksViewportWidth() Scrollable method.- Specified by:
- getScrollableTracksViewportWidthin interface- javax.swing.Scrollable
 
 - 
getScrollableTracksViewportHeightpublic boolean getScrollableTracksViewportHeight() Scrollable method.- Specified by:
- getScrollableTracksViewportHeightin interface- javax.swing.Scrollable
 
 - 
getScrollableBlockIncrementpublic int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)Scrollable method.- Specified by:
- getScrollableBlockIncrementin interface- javax.swing.Scrollable
 
 - 
getScrollableUnitIncrementpublic int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)Scrollable method.- Specified by:
- getScrollableUnitIncrementin interface- javax.swing.Scrollable
 
 - 
dragEnterpublic void dragEnter(java.awt.dnd.DropTargetDragEvent dtde) DropTargetListener method.- Specified by:
- dragEnterin interface- java.awt.dnd.DropTargetListener
 
 - 
dragExitpublic void dragExit(java.awt.dnd.DropTargetEvent dte) DropTargetListener method.- Specified by:
- dragExitin interface- java.awt.dnd.DropTargetListener
 
 - 
dragOverpublic void dragOver(java.awt.dnd.DropTargetDragEvent dtde) DropTargetListener method.- Specified by:
- dragOverin interface- java.awt.dnd.DropTargetListener
 
 - 
droppublic void drop(java.awt.dnd.DropTargetDropEvent dtde) DropTargetListener method.- Specified by:
- dropin interface- java.awt.dnd.DropTargetListener
 
 - 
dropActionChangedpublic void dropActionChanged(java.awt.dnd.DropTargetDragEvent dtde) DropTargetListener method.- Specified by:
- dropActionChangedin interface- java.awt.dnd.DropTargetListener
 
 - 
setSelpublic void setSel(int newStartEnd) Sets the character index of the text cursor.
 - 
setSelpublic void setSel(int aStart, int anEnd)Sets the character index of the start and end of the text selection.
 - 
getSelStartpublic int getSelStart() Returns the selection start.
 - 
getSelEndpublic int getSelEnd() Returns the selection end.
 - 
getSelAnchorpublic int getSelAnchor() Returns the selection anchor.
 - 
getCharIndexpublic int getCharIndex(java.awt.geom.Point2D aPoint) Returns the char index for given point in text coordinate space.
 - 
getFontpublic java.awt.Font getFont() Return AWT Font for current selection.- Specified by:
- getFontin interface- java.awt.MenuContainer
- Overrides:
- getFontin class- java.awt.Component
 
 - 
setFontpublic void setFont(java.awt.Font aFont) Set AWT Font for current selection.- Overrides:
- setFontin class- javax.swing.JComponent
 
 
- 
 
-