JHotDraw 7.1

org.jhotdraw.gui
Class AttributeFieldEventHandler

java.lang.Object
  extended by org.jhotdraw.gui.AttributeFieldEventHandler
All Implemented Interfaces:
java.beans.PropertyChangeListener, java.util.EventListener, FigureListener, FigureSelectionListener

public class AttributeFieldEventHandler
extends java.lang.Object
implements java.beans.PropertyChangeListener, FigureSelectionListener, FigureListener

Helper class for AttributeField. Listens for the current view of the DrawingEditor.

Version:
1.0 15. Mai 2007 Created.
Author:
Werner Randelshofer

Constructor Summary
AttributeFieldEventHandler(AttributeField field)
           
 
Method Summary
 void areaInvalidated(FigureEvent e)
          Sent when the drawing area used by the figure needs to be repainted.
 void attributeChanged(FigureEvent e)
          Sent when an attribute of the figure has changed.
 void dispose()
           
 void figureAdded(FigureEvent e)
          Sent when a figure was added to a drawing.
 void figureChanged(FigureEvent e)
          Sent when the geometry (for example the bounds) of the figure has changed.
 void figureHandlesChanged(FigureEvent e)
          Sent when handles of a Figure have been added, removed or replaced.
 void figureRemoved(FigureEvent e)
          Sent when a figure was removed from a drawing.
 void figureRequestRemove(FigureEvent e)
          Sent when the figure requests to be removed from a drawing.
protected  java.util.Set<Figure> getCurrentSelection()
           
 DrawingView getCurrentView()
           
 DrawingEditor getEditor()
           
 DrawingView getView()
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void selectionChanged(FigureSelectionEvent evt)
           
 void setEditor(DrawingEditor newValue)
          Sets the drawing editor.
 void setView(DrawingView newValue)
          Sets the drawing view.
protected  void updateField()
           
protected  void updateFieldEnabledState()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AttributeFieldEventHandler

public AttributeFieldEventHandler(AttributeField field)
Method Detail

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
Specified by:
propertyChange in interface java.beans.PropertyChangeListener

selectionChanged

public void selectionChanged(FigureSelectionEvent evt)
Specified by:
selectionChanged in interface FigureSelectionListener

updateFieldEnabledState

protected void updateFieldEnabledState()

updateField

protected void updateField()

getCurrentSelection

protected java.util.Set<Figure> getCurrentSelection()

areaInvalidated

public void areaInvalidated(FigureEvent e)
Description copied from interface: FigureListener
Sent when the drawing area used by the figure needs to be repainted.

Specified by:
areaInvalidated in interface FigureListener

attributeChanged

public void attributeChanged(FigureEvent e)
Description copied from interface: FigureListener
Sent when an attribute of the figure has changed.

Specified by:
attributeChanged in interface FigureListener

figureHandlesChanged

public void figureHandlesChanged(FigureEvent e)
Description copied from interface: FigureListener
Sent when handles of a Figure have been added, removed or replaced.

DrawingViews listen to this event to repopulate the Handles.

A Figure should not fire this event, if just the state or the location of Handle has changed.

Specified by:
figureHandlesChanged in interface FigureListener

figureChanged

public void figureChanged(FigureEvent e)
Description copied from interface: FigureListener
Sent when the geometry (for example the bounds) of the figure has changed.

Specified by:
figureChanged in interface FigureListener

figureAdded

public void figureAdded(FigureEvent e)
Description copied from interface: FigureListener
Sent when a figure was added to a drawing.

Specified by:
figureAdded in interface FigureListener

figureRemoved

public void figureRemoved(FigureEvent e)
Description copied from interface: FigureListener
Sent when a figure was removed from a drawing.

Specified by:
figureRemoved in interface FigureListener

figureRequestRemove

public void figureRequestRemove(FigureEvent e)
Description copied from interface: FigureListener
Sent when the figure requests to be removed from a drawing.

Specified by:
figureRequestRemove in interface FigureListener

setEditor

public void setEditor(DrawingEditor newValue)
Sets the drawing editor. This must be set to a non-null value to make the attribute field functional.


getEditor

public DrawingEditor getEditor()

setView

public void setView(DrawingView newValue)
Sets the drawing view. Setting this to a non-null value, makes the attribute field local to the drawing view. Setting this to null, makes the attribute field global to all drawing views in the drawing editor.


getView

public DrawingView getView()

getCurrentView

public DrawingView getCurrentView()

dispose

public void dispose()

Copyright 1996-2007 (c) JHotDraw.org.
Some rights reserved.