com.sas.swing.visuals
Class NodeViewTextEditor

com.sas.swing.visuals.NodeViewTextEditor
All Implemented Interfaces:
com.sas.lang.StringDataInterface

public class NodeViewTextEditor
implements com.sas.lang.StringDataInterface

Provides a node view for displaying and editing a paragraph of text.


Constructor Summary
NodeViewTextEditor()
          Constructs a new NodeViewTextEditor object.
 
Method Summary
 void applyText()
           
 void cancel()
           
 int getCaretPosition()
          Returns the current caret position in the text string.
 int getCaretPosition(int xPos)
           
 NodeView getNodeView()
           
 int getPreferredWidth(java.awt.Graphics g)
          Returns the preferred width of the current node in pixels.
 java.lang.String getText()
          Returns the text value of the current node.
 boolean hasChanged()
           
protected  boolean isCharacterValid(char ch)
           
 void paint(java.awt.Graphics g)
          Paints the NodeViewTextEditor
 void processFocusEvent(java.awt.event.FocusEvent event)
          Process focus events which occur on the NodeViewTextEditor.
 void processKeyEvent(java.awt.event.KeyEvent event)
          Process key events which occur on the NodeViewTextEditor.
 void processMouseEvent(java.awt.event.MouseEvent event)
          Process mouse events which occur on the NodeViewTextEditor.
 void processMouseMotionEvent(java.awt.event.MouseEvent event)
          Process mouse motion events which occur on the NodeViewTextEditor.
 void selectAll()
           
 void setNodeView(NodeView node)
           
 void setText(java.lang.String newValue)
          Sets the text value of the current node.
 

Constructor Detail

NodeViewTextEditor

public NodeViewTextEditor()
Constructs a new NodeViewTextEditor object.

Method Detail

getNodeView

public NodeView getNodeView()

setNodeView

public void setNodeView(NodeView node)

applyText

public void applyText()

hasChanged

public boolean hasChanged()

getCaretPosition

public int getCaretPosition()
Returns the current caret position in the text string. If NodeViewTextEditor is not in edit mode -1 is returned. Edit mode is determined by the node's activation level.

Returns:
the current caret position if in edit mode, otherwise -1

getCaretPosition

public int getCaretPosition(int xPos)

getPreferredWidth

public int getPreferredWidth(java.awt.Graphics g)
Returns the preferred width of the current node in pixels. The preferred width will be based on the size of the text within the specified height and measured using the current font.

Returns:
the preferred width of the current node in pixels

getText

public java.lang.String getText()
Returns the text value of the current node.

Specified by:
getText in interface com.sas.lang.StringDataInterface
Returns:
the text value of the current node
See Also:
setText(java.lang.String)

isCharacterValid

protected boolean isCharacterValid(char ch)

selectAll

public void selectAll()

paint

public void paint(java.awt.Graphics g)
Paints the NodeViewTextEditor

Parameters:
g - the graphics context to paint to

processFocusEvent

public void processFocusEvent(java.awt.event.FocusEvent event)
Process focus events which occur on the NodeViewTextEditor.

Parameters:
event - the event to handle

processKeyEvent

public void processKeyEvent(java.awt.event.KeyEvent event)
Process key events which occur on the NodeViewTextEditor.

Parameters:
event - the event to handle

processMouseEvent

public void processMouseEvent(java.awt.event.MouseEvent event)
Process mouse events which occur on the NodeViewTextEditor.

Parameters:
event - the event to handle

processMouseMotionEvent

public void processMouseMotionEvent(java.awt.event.MouseEvent event)
Process mouse motion events which occur on the NodeViewTextEditor.

Parameters:
event - the event to handle

cancel

public void cancel()

setText

public void setText(java.lang.String newValue)
Sets the text value of the current node.

Specified by:
setText in interface com.sas.lang.StringDataInterface
Parameters:
newValue - the new text value
See Also:
getText()



Copyright © 2009 SAS Institute Inc. All Rights Reserved.