ilog.views.objectinteractor
Class IlvTextEditor

java.lang.Object
  extended by ilog.views.IlvObjectInteractor
      extended by ilog.views.IlvReshapeSelection
          extended by ilog.views.objectinteractor.IlvTextEditor
All Implemented Interfaces:
ClipboardOwner, Serializable
Direct Known Subclasses:
IlvText.Editor

public class IlvTextEditor
extends IlvReshapeSelection
implements ClipboardOwner

This is the object interactor designed for a IlvTextSelection. It can handle mouse and key events and then edit the selected graphic object implementing the interface IlvTextInterface.

While editing the selected label, you can perform the following actions with your mouse:

With the keyboard, you can use the arrow keys to navigate in the selected label.

Tips

You can combine the <Shift> key and arrow keys to extend the selection zone.

You can also do Copy/Paste by using the Ctrl+C and Ctrl+V keys.

During the edit session you can move and reshape the selected text object:

Since:
JViews 7.5
See Also:
IlvTextSelection, Serialized Form

Constructor Summary
IlvTextEditor()
          Creates a new IlvTextEditor.
 
Method Summary
protected  void copySelection(IlvTextInterface text, int startIndex, int endIndex)
          Copies the region from the input text object to the clipboard.
protected  void deleteSelection(IlvTextInterface text, int startIndex, int endIndex)
          Delete the region from the input text object.
 void lostOwnership(Clipboard aClipboard, Transferable aContents)
          Empty implementation of the ClipboardOwner interface.
 boolean processEvent(IlvGraphic obj, AWTEvent event, IlvObjectInteractorContext context)
          Handles mouse or key events to edit a selected graphic object implementing IlvTextInterface.
protected  void replaceSelection(IlvTextInterface text, int startIndex, int endIndex, AttributedString s)
          Replace the region from the input text object.
protected  void replaceSelection(IlvTextInterface text, int startIndex, int endIndex, String s)
          Replace the region from the input text object.
 
Methods inherited from class ilog.views.IlvReshapeSelection
drawGhost, drawGhost, getBoundingBox, getCursor, handleButtonDown, handleButtonDragged, handleButtonUp, handleExpose, isOpaqueMode, onEnter, onExit, reshapeObject, setOpaqueMode
 
Methods inherited from class ilog.views.IlvObjectInteractor
Get, Put
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlvTextEditor

public IlvTextEditor()
Creates a new IlvTextEditor.

Method Detail

processEvent

public boolean processEvent(IlvGraphic obj,
                            AWTEvent event,
                            IlvObjectInteractorContext context)
Handles mouse or key events to edit a selected graphic object implementing IlvTextInterface.

Overrides:
processEvent in class IlvReshapeSelection
Parameters:
obj - Should be an IlvTextSelection.
event - The mouse or key event.
context - The interaction context.
Returns:
true if the event is consumed by this interactor.

lostOwnership

public void lostOwnership(Clipboard aClipboard,
                          Transferable aContents)
Empty implementation of the ClipboardOwner interface. This method does nothing.

Specified by:
lostOwnership in interface ClipboardOwner

deleteSelection

protected void deleteSelection(IlvTextInterface text,
                               int startIndex,
                               int endIndex)
Delete the region from the input text object. The area label.substring(startIndex, endIndex) is removed from the label of the text object.

Parameters:
text - The text object
startIndex - The index of the first character to be removed.
endIndex - The index of the first character that is not anymore removed.
Since:
JViews 8.0

replaceSelection

protected void replaceSelection(IlvTextInterface text,
                                int startIndex,
                                int endIndex,
                                String s)
Replace the region from the input text object. The area label.substring(startIndex, endIndex) is replaced from the label of the text object.

Parameters:
text - The text object
startIndex - The index of the first character to be replaced.
endIndex - The index of the first character that is not anymore replaced.
s - The replacement string.
Since:
JViews 8.0

replaceSelection

protected void replaceSelection(IlvTextInterface text,
                                int startIndex,
                                int endIndex,
                                AttributedString s)
Replace the region from the input text object. The area label.substring(startIndex, endIndex) is replaced from the label of the text object. This variant is used when pasting an attributed string from the clipboard.

Parameters:
text - The text object
startIndex - The index of the first character to be replaced.
endIndex - The index of the first character that is not anymore replaced.
s - The replacement string as attributed text.
Since:
JViews 8.1

copySelection

protected void copySelection(IlvTextInterface text,
                             int startIndex,
                             int endIndex)
Copies the region from the input text object to the clipboard. The area label.substring(startIndex, endIndex) is copied from the label of the text object to the clipboard.

Parameters:
text - The text object
startIndex - The index of the first character to be removed.
endIndex - The index of the first character that is not anymore removed.
Since:
JViews 8.1


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.