edu.umd.cs.piccolox.event
Class PStyledTextEventHandler

java.lang.Object
  extended by edu.umd.cs.piccolo.event.PBasicInputEventHandler
      extended by edu.umd.cs.piccolox.event.PStyledTextEventHandler
All Implemented Interfaces:
PInputEventListener, java.util.EventListener

public class PStyledTextEventHandler
extends PBasicInputEventHandler

Author:
Lance Good

Field Summary
protected  PCanvas canvas
           
protected  javax.swing.event.DocumentListener docListener
           
protected  PStyledText editedText
           
protected  javax.swing.text.JTextComponent editor
           
 
Constructor Summary
PStyledTextEventHandler(PCanvas canvas)
          Basic constructor for PStyledTextEventHandler
PStyledTextEventHandler(PCanvas canvas, javax.swing.text.JTextComponent editor)
          Constructor for PStyledTextEventHandler that allows an editor to be specified
 
Method Summary
protected  javax.swing.text.JTextComponent createDefaultEditor()
           
protected  javax.swing.event.DocumentListener createDocumentListener()
           
 PStyledText createText()
           
 void dispatchEventToEditor(PInputEvent e)
           
protected  void initEditor(javax.swing.text.JTextComponent newEditor)
           
 void mousePressed(PInputEvent inputEvent)
           
 void reshapeEditor()
           
protected  void reshapeEditorLater()
          Sometimes we need to invoke this later because the document events seem to get fired before the text is actually incorporated into the document
 void startEditing(PInputEvent event, PStyledText text)
           
 void stopEditing()
           
 
Methods inherited from class edu.umd.cs.piccolo.event.PBasicInputEventHandler
acceptsEvent, getEventFilter, keyboardFocusGained, keyboardFocusLost, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, mouseWheelRotated, mouseWheelRotatedByBlock, paramString, processEvent, setEventFilter, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

canvas

protected PCanvas canvas

editor

protected javax.swing.text.JTextComponent editor

docListener

protected javax.swing.event.DocumentListener docListener

editedText

protected PStyledText editedText
Constructor Detail

PStyledTextEventHandler

public PStyledTextEventHandler(PCanvas canvas)
Basic constructor for PStyledTextEventHandler


PStyledTextEventHandler

public PStyledTextEventHandler(PCanvas canvas,
                               javax.swing.text.JTextComponent editor)
Constructor for PStyledTextEventHandler that allows an editor to be specified

Method Detail

initEditor

protected void initEditor(javax.swing.text.JTextComponent newEditor)

createDefaultEditor

protected javax.swing.text.JTextComponent createDefaultEditor()

createDocumentListener

protected javax.swing.event.DocumentListener createDocumentListener()

createText

public PStyledText createText()

mousePressed

public void mousePressed(PInputEvent inputEvent)
Overrides:
mousePressed in class PBasicInputEventHandler

startEditing

public void startEditing(PInputEvent event,
                         PStyledText text)

stopEditing

public void stopEditing()

dispatchEventToEditor

public void dispatchEventToEditor(PInputEvent e)

reshapeEditor

public void reshapeEditor()

reshapeEditorLater

protected void reshapeEditorLater()
Sometimes we need to invoke this later because the document events seem to get fired before the text is actually incorporated into the document



Copyright 2005 by University of Maryland, College Park, MD 20742, USA All rights reserved.

Web Accessibility