public class IlvTextSelection extends IlvDrawSelection
IlvTextInterface
. This object gives a visual feedback by showing
the selected characters with a different background color and a caret to indicate
the current insert position.
This selection object works closely with IlvTextEditor
and
allows users to do in-place WYSIWYG editing.
IlvTextEditor
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
IlvTextSelection.Range
This inner class is used to indicate the selection interval while editing a graphic
object implementing
IlvTextInterface . |
CIRCLE_SHAPE, defaultHandleBackgroundColor, defaultHandleColor, defaultHandleShape, defaultHandleSize, FILLED_CIRCLE_SHAPE, FILLED_SQUARE_SHAPE, SQUARE_SHAPE
Constructor and Description |
---|
IlvTextSelection(IlvGraphic graphic)
Creates an
IlvTextSelection for the specified IlvTextInterface . |
IlvTextSelection(IlvGraphic graphic,
boolean resizable)
Creates an
IlvTextSelection for the specified IlvTextInterface . |
IlvTextSelection(IlvGraphic graphic,
boolean resizable,
boolean editable)
Creates an
IlvTextSelection for the specified IlvTextInterface . |
Modifier and Type | Method and Description |
---|---|
IlvRect |
boundingBox(IlvTransformer t)
Returns the bounding rectangle of the object.
|
boolean |
contains(IlvPoint p,
IlvPoint tp,
IlvTransformer t)
Tests if a point lies within the outline of the object.
|
void |
draw(Graphics dst,
IlvTransformer t)
Draws the selection.
|
void |
drawWithoutHandles(Graphics dst,
IlvTransformer t)
Draws the decorations without the handles.
|
String |
getDefaultInteractor()
Returns the class name of
IlvTextEditor . |
IlvTextSelection.Range |
getRange()
Gets the range indicating the selection or the insert position.
|
boolean |
isOnBorder(IlvPoint click,
IlvTransformer t)
This function is used to test if the click point is on the border of the
selection object.
|
void |
setRange(IlvTextSelection.Range range)
Sets the selection range.
|
void |
setResizable(boolean resizable)
Defines that if users can use this selection object to resize the selected text object.
|
boolean |
supportsResize()
Returns
true if this object allows resizing
of the selected graphic object. |
direction, getHandle, getHandle, getHandleCardinal, getHandlesRectangle, isOptimizedDrawingEnabled
afterLoopAllHandles, beforeLoopAllHandles, getActiveHandlesColor, getHandlesColor, getHandlesShape, getHandlesSize, isActive, onEnter, onExit, setActiveHandlesColor, setHandlesColor, setHandlesShape, setHandlesSize, zoomable
applyTransform, copy, getObject, isVisible, SetDefaultInteractor
addActionListener, addNamedPropertyListener, allViewsRemoved, baseTextDirectionChanged, blinkingStateOn, boundingBox, callDraw, componentOrientationChanged, getAndAssociateObjectInteractor, getBaseTextDirection, getBlinkingAction, getBlinkingObjectOwner, getBlinkingOffPeriod, getBlinkingOnPeriod, getCenter, getComponentOrientation, getGraphicBag, GetGraphicObject, getIntersectionWithOutline, getLocale, getName, getNamedProperty, getObjectInteractor, getPopupMenu, getPopupMenu, getPopupMenuName, getProperty, getResolvedBaseTextDirection, getToolTipBaseTextDirection, getToolTipText, getToolTipText, getTopLevelGraphicBag, getTransferData, getTransferDataFlavors, getULocale, getZOrderIndex, hasProperty, inside, intersects, invalidateBBoxCache, invalidateBidiCache, isBaseTextDirectionSensitive, isComponentOrientationSensitive, isDataFlavorSupported, isEditable, isInApplyToObject, isLocaleSensitive, isMovable, isPersistent, isSelectable, localeChanged, makeSelection, move, move, moveResize, needsViewNotification, notifyObjectInteractorToManager, processActionEvent, reDraw, registerBlinkingResource, removeActionListener, removeNamedProperty, removeNamedPropertyListener, removeProperty, replaceProperty, resize, rotate, scale, setBackground, setBaseTextDirection, setBaseTextDirectionDuringConstruction, setBlinkingAction, setBlinkingOffPeriod, setBlinkingOnPeriod, setEditable, setFillOn, setForeground, setGraphicBag, setInApplyToObject, setMovable, setName, setNamedProperty, setNameImpl, setObjectInteractor, setPopupMenu, setPopupMenuName, setProperty, setSelectable, setStrokeOn, setToolTipBaseTextDirection, setToolTipText, setVisible, setZOrderIndex, toString, translate, updateNeedsViewNotification, usesBidiMarkers, viewAddedOrRemoved, write
public IlvTextSelection(IlvGraphic graphic)
IlvTextSelection
for the specified IlvTextInterface
.graphic
- The graphic object to be edited and must implement
IlvTextInterface
.public IlvTextSelection(IlvGraphic graphic, boolean resizable)
IlvTextSelection
for the specified IlvTextInterface
.graphic
- The graphic object to be edited and must implement
IlvTextInterface
.resizable
- Indicates whether this selection object can be used to resize the selected
text object. The default is True
.public IlvTextSelection(IlvGraphic graphic, boolean resizable, boolean editable)
IlvTextSelection
for the specified IlvTextInterface
.graphic
- The graphic object to be edited and must implement
IlvTextInterface
.resizable
- Indicates whether this selection object can be used to resize the selected
text object. The default is True
.editable
- Specifies whether the selected text can be edited. The default is
True
.public void setResizable(boolean resizable)
IlvLabel
is not resizable.resizable
- Indicates whether the selected text object is resizable.supportsResize()
public boolean supportsResize()
true
if this object allows resizing
of the selected graphic object. Returns false
otherwise. For example, an IlvLabel
is not resizable.supportsResize
in class IlvDrawSelection
setResizable(boolean)
public IlvTextSelection.Range getRange()
setRange(ilog.views.graphic.IlvTextSelection.Range)
,
IlvTextSelection.Range
public void setRange(IlvTextSelection.Range range)
range
- The selection range, if collapsed, indicates the insert position.IlvTextSelection.Range
,
getRange()
public IlvRect boundingBox(IlvTransformer t)
boundingBox
in class IlvDrawSelection
t
- The transformer used to draw the object. The value
null
can be used for the identity transformer.IlvGraphic.draw(java.awt.Graphics, ilog.views.IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public boolean contains(IlvPoint p, IlvPoint tp, IlvTransformer t)
contains
in class IlvHandlesSelection
p
- The point to be tested.tp
- The point p
transformed by the transformer
t
.t
- The transformation used to draw the object.true
if the point lies inside this graphic object.IlvGraphic
public boolean isOnBorder(IlvPoint click, IlvTransformer t)
click
- The point position in view coordinates.t
- The transformer of the view.public void draw(Graphics dst, IlvTransformer t)
draw
in class IlvDrawSelection
dst
- The destination Graphics
instance.t
- The transformation used to draw the object.IlvGraphic.callDraw(Graphics,IlvTransformer)
,
IlvGraphic.boundingBox(IlvTransformer)
,
IlvGraphic.zoomable()
,
IlvGraphic
public void drawWithoutHandles(Graphics dst, IlvTransformer t)
drawWithoutHandles
in class IlvHandlesSelection
dst
- The destination Graphics.t
- The transformation used to draw the object.public String getDefaultInteractor()
IlvTextEditor
.getDefaultInteractor
in class IlvSelection
IlvTextEditor
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.