Package snap.text
Class TextEditor
java.lang.Object
snap.props.PropObject
snap.view.View
snap.view.TextArea
snap.text.TextEditor
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
This class provides the event and drawing code necessary to edit text in a TextDoc.
-
Field Summary
Fields inherited from class snap.view.TextArea
Editable_Prop, FireActionOnEnterKey_Prop, FireActionOnFocusLost_Prop, isSpellChecking, Selection_Prop, SNAP_RICHTEXT_TYPE, SourceText_Prop, WrapLines_Prop
Fields inherited from class snap.view.View
_align, _borderRadius, _effect, _font, _margin, _padding, _repaintRect, _showing, _spacing, _vertical, Action, Align_Prop, Border_Prop, BorderRadius_Prop, Clip_Prop, Cursor_Prop, DEFAULT_ALIGN, DEFAULT_MARGIN, DEFAULT_PADDING, DEFAULT_SPACING, Disabled_Prop, DragEvents, Effect_Prop, Fill_Prop, Focusable_Prop, Focused_Prop, FocusWhenPressed_Prop, Font_Prop, GrowHeight_Prop, GrowWidth_Prop, Height_Prop, KeyEvents, KeyPress, KeyRelease, KeyType, LeanX_Prop, LeanY_Prop, Managed_Prop, Margin_Prop, MaxHeight_Prop, MaxWidth_Prop, MinHeight_Prop, MinWidth_Prop, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Name_Prop, Opacity_Prop, Padding_Prop, Paintable_Prop, Parent_Prop, Pickable_Prop, PrefHeight_Prop, PrefWidth_Prop, Rotate_Prop, ScaleX_Prop, ScaleY_Prop, Scroll, Showing_Prop, Spacing_Prop, Text_Prop, ToolTip_Prop, TransX_Prop, TransY_Prop, Vertical_Prop, Visible_Prop, Width_Prop, X_Prop, Y_Prop
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the character spacing of the current selection or cursor.double
Returns the line gap for current selection.double
Returns the maximum line height for a line of text (even if font size would dictate higher).double
Returns the min line height for current selection.double
Returns the line spacing for current selection.void
paintActiveText
(Painter aPntr) Paints a given TextEditor.void
setActive
(boolean aValue) Sets whether TextEditor is showing and focused.void
setCharSpacing
(double aValue) Returns the character spacing of the current selection or cursor.void
setLineGap
(double aHeight) Sets the line gap for current selection.void
setLineHeightMax
(double aHeight) Sets the maximum line height for a line of text (even if font size would dictate higher).void
setLineHeightMin
(double aHeight) Sets the min line height for current selection.void
setLineSpacing
(double aHeight) Sets the line spacing for current selection.Methods inherited from class snap.view.TextArea
addChars, addChars, addChars, charAt, clear, copy, createTextAreaKeys, cut, delete, delete, deleteBackward, deleteForward, deleteToLineEnd, fromXML, fromXMLTextArea, getCharIndexForXY, getClipboardContent, getDefaultFill, getDefaultLineStyle, getDefaultStyle, getFontScale, getFormat, getLine, getLineAlign, getLineCount, getLineForCharIndex, getPrefHeightImpl, getPrefWidthImpl, getSel, getSelAnchor, getSelColor, getSelEnd, getSelIndex, getSelLineStyle, getSelPath, getSelStart, getSelStyle, getSourceText, getText, getTextBlock, getTextBounds, getTextColor, getTextFont, getTextLinkForXY, getTextStyleForCharIndex, getTokenForCharIndex, getUndoer, getValuePropName, handleSourceTextPropChange, hideCursor, isCaretAnim, isCaretNeeded, isEditable, isFireActionOnEnterKey, isFireActionOnFocusLost, isHyphenating, isLineJustify, isRichText, isSelEmpty, isShowCaret, isSpellChecking, isSyncTextFont, isUnderlined, isWrapLines, keyPressed, keyReleased, keyTyped, length, mouseDragged, mouseMoved, mousePressed, mouseReleased, openLink, paintFront, paintSel, parentFontChanged, paste, processActionEvent, processEvent, redo, repaintSel, replaceChars, replaceChars, replaceChars, replaceCharsWithContent, scaleTextToFit, scrollSelToVisible, selectAll, selectBackward, selectDown, selectForward, selectLineEnd, selectLineStart, selectUp, setAlign, setCaretAnim, setCaretAnim, setDefaultLineStyle, setDefaultStyle, setEditable, setFireActionOnEnterKey, setFireActionOnFocusLost, setFocused, setFont, setFontScale, setFormat, setHeight, setHyphenating, setLineAlign, setLineJustify, setParent, setSel, setSel, setSelLineStyleValue, setSelStyleValue, setShowCaret, setShowing, setSourceText, setSubscript, setSuperscript, setSyncTextFont, setText, setTextBlock, setTextColor, setTextFont, setUnderlined, setWidth, setWrapLines, showCursor, textDidChange, toString, toXML, toXMLTextArea, undo, updateTextBlockBounds
Methods inherited from class snap.view.View
addBinding, addEventFilter, addEventHandler, clone, contains, contains, containsShape, createActionEvent, disableEvents, enableEvents, fireActionEvent, getAlign, getAlignX, getAlignY, getAnim, getAnimCleared, getAnimTimeDeep, getBestHeight, getBestSize, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBorder, getBorderRadius, getBounds, getBoundsLocal, getBoundsParent, getBoundsShape, getBoundsShapeParent, getClip, getClipAll, getClipAllBounds, getClipBounds, getClippedRect, getCursor, getDefaultBorder, getDefaultFont, getEffect, getEnv, getEventAdapter, getFill, getFillColor, getFocusNext, getFocusPrev, getFont, getHeight, getHost, getInsetsAll, getLean, getLeanX, getLeanY, getLocalToParent, getLocalToParent, getMargin, getMaxHeight, getMaxSize, getMaxWidth, getMaxX, getMaxY, getMidX, getMidY, getMinHeight, getMinHeightImpl, getMinSize, getMinWidth, getMinWidthImpl, getName, getOpacity, getOpacityAll, getOwner, getOwner, getPadding, getParent, getParent, getParentCount, getParentToLocal, getParentToLocal, getPhysics, getPhysics, getPrefHeight, getPrefHeight, getPrefSize, getPrefWidth, getPrefWidth, getProp, getPropDefault, getProps, getPropValue, getRealClassName, getRepaintRect, getRepaintRectExpanded, getRootView, getRotate, getScale, getScaleX, getScaleY, getSize, getSpacing, getToolTip, getToolTip, getTransX, getTransY, getUpdater, getVisRect, getWidth, getWindow, getX, getXY, getY, indexInHost, indexInParent, initProps, intersectsShape, isActionable, isAncestor, isClipToBounds, isDisabled, isEnabled, isFocusable, isFocused, isFocusKeysEnabled, isFocusPainted, isFocusWhenPressed, isFontSet, isGrowHeight, isGrowWidth, isGuest, isHorizontal, isLocalToParentSimple, isManaged, isManagedVisible, isMaxHeightSet, isMaxWidthSet, isMinHeightSet, isMinWidthSet, isMouseDown, isMouseOver, isNeedsRepaint, isPaintable, isPickable, isPickableVisible, isPrefHeightSet, isPrefWidthSet, isShowing, isToolTipEnabled, isVertical, isVisible, localToParent, localToParent, localToParent, localToParent, localToScreen, paintAll, paintBack, parentToLocal, parentToLocal, parentToLocal, parentToLocal, playAnimDeep, processEventAll, processEventFilters, processEventHandlers, relayout, relayoutParent, removeBinding, removeBinding, removeEventFilter, removeEventHandler, repaint, repaint, repaint, repaintInParent, requestFocus, runDelayed, runIntervals, runLater, scrollToVisible, setActionable, setAlignX, setAlignY, setAnimProps, setAnimString, setAnimTimeDeep, setBorder, setBorder, setBorderRadius, setBounds, setBounds, setBoundsLocal, setClip, setClipToBounds, setCursor, setDisabled, setEffect, setEnabled, setFill, setFocusable, setFocusKeysEnabled, setFocusPainted, setFocusWhenPressed, setGrowHeight, setGrowWidth, setLean, setLeanX, setLeanY, setManaged, setMargin, setMargin, setMaxHeight, setMaxSize, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinSize, setMinWidth, setName, setOpacity, setOwner, setPadding, setPadding, setPaintable, setPickable, setPrefHeight, setPrefSize, setPrefSize, setPrefWidth, setProp, setPropValue, setRealClassName, setRotate, setScale, setScaleX, setScaleY, setSize, setSize, setSizeLocal, setSizeToBestSize, setSizeToPrefSize, setSpacing, setToolTip, setToolTipEnabled, setTransX, setTransY, setVertical, setVisible, setX, setXY, setXYLocal, setY, stopAnimDeep, stopIntervals, themeChanged, toStringProps
Methods inherited from class snap.props.PropObject
addDeepChangeListener, addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, isPropDefault, processPropChange, removeDeepChangeListener, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues
-
Constructor Details
-
TextEditor
public TextEditor()Constructor.
-
-
Method Details
-
getCharSpacing
public double getCharSpacing()Returns the character spacing of the current selection or cursor. -
setCharSpacing
public void setCharSpacing(double aValue) Returns the character spacing of the current selection or cursor. -
getLineSpacing
public double getLineSpacing()Returns the line spacing for current selection. -
setLineSpacing
public void setLineSpacing(double aHeight) Sets the line spacing for current selection. -
getLineGap
public double getLineGap()Returns the line gap for current selection. -
setLineGap
public void setLineGap(double aHeight) Sets the line gap for current selection. -
getLineHeightMin
public double getLineHeightMin()Returns the min line height for current selection. -
setLineHeightMin
public void setLineHeightMin(double aHeight) Sets the min line height for current selection. -
getLineHeightMax
public double getLineHeightMax()Returns the maximum line height for a line of text (even if font size would dictate higher). -
setLineHeightMax
public void setLineHeightMax(double aHeight) Sets the maximum line height for a line of text (even if font size would dictate higher). -
setActive
public void setActive(boolean aValue) Sets whether TextEditor is showing and focused. -
paintActiveText
Paints a given TextEditor.
-