JHotDraw 7.4.1

org.jhotdraw.gui.event
Class SelectionComponentDisplayer

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

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

Calls setVisible(true/false) on components, which show attributes of the drawing editor and of its views based on the current selection.

Holds a WeakReference on the component. Automatically disposes itself if the component no longer exists.

Author:
Werner Randelshofer  @version $Id: SelectionComponentDisplayer.java 582 2009-10-24 08:00:49Z rawcoder $

Field Summary
protected  DrawingEditor editor
           
protected  boolean isVisibleIfCreationTool
           
protected  int minSelectionCount
           
protected  DrawingView view
           
protected  java.lang.ref.WeakReference<javax.swing.JComponent> weakRef
           
 
Constructor Summary
SelectionComponentDisplayer(DrawingEditor editor, javax.swing.JComponent component)
           
 
Method Summary
 void dispose()
           
protected  javax.swing.JComponent getComponent()
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void selectionChanged(FigureSelectionEvent evt)
           
 void setMinSelectionCount(int newValue)
           
 void setVisibleIfCreationTool(boolean newValue)
           
 void updateVisibility()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

protected DrawingView view

editor

protected DrawingEditor editor

weakRef

protected java.lang.ref.WeakReference<javax.swing.JComponent> weakRef

minSelectionCount

protected int minSelectionCount

isVisibleIfCreationTool

protected boolean isVisibleIfCreationTool
Constructor Detail

SelectionComponentDisplayer

public SelectionComponentDisplayer(DrawingEditor editor,
                                   javax.swing.JComponent component)
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

updateVisibility

public void updateVisibility()

getComponent

protected javax.swing.JComponent getComponent()

dispose

public void dispose()

setMinSelectionCount

public void setMinSelectionCount(int newValue)

setVisibleIfCreationTool

public void setVisibleIfCreationTool(boolean newValue)

Copyright 1996-2010 (c) by the authors and contributors of the JHotDraw project.
Some rights reserved.