motris.gui
Class FileHistory

java.lang.Object
  extended bymotris.gui.FileHistory
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener

public class FileHistory
extends java.lang.Object
implements java.awt.event.ActionListener

Provide a file history mechanism for the File menu of a parent frame).

Author:
dahlkamp

Nested Class Summary
private  class FileHistory.ItemListener
          Listen to menu item selections.
private  class FileHistory.MenuItemWithFixedTooltip
          Create a tooltip location directly over the menu item, * ie, left allign the tooltip text in "overlay" technique.
 
Field Summary
private  javax.swing.JMenu fileMenu
           
private  java.lang.Class forClass
           
private  ParameterizedObject forObject
           
private static int MAX_HISTORY_LENGTH
           
private static int MAX_ITEM_LEN
           
private  ParameterizedObject.ParameterizedObjectManager notifyObj
           
private  java.util.prefs.Preferences prefs
           
private  SceneDescription scene
           
(package private)  boolean showEditMenuItem
           
(package private)  boolean showLoadMenuItem
           
(package private)  boolean showSaveMenuItem
           
 
Constructor Summary
FileHistory(java.lang.String _menuName, java.lang.Class _forClass, ParameterizedObject.ParameterizedObjectManager _notifyObj, SceneDescription _scene, boolean _showLoadMenuItem, boolean _showEditMenuItem, boolean _showSaveMenuItem)
           
FileHistory(java.lang.String _menuName, ParameterizedObject _forObject, ParameterizedObject.ParameterizedObjectManager _notifyObj, SceneDescription _scene, boolean _showLoadMenuItem, boolean _showEditMenuItem, boolean _showSaveMenuItem)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
protected  java.lang.String getItemName(java.lang.String pathname)
          Return the itemname (abbreviated itemname if necessary) * to be shown in the file menu open item list.
 javax.swing.JMenu getMenu()
           
 javax.swing.JPopupMenu getPopupMenu()
           
 void insertPathname(java.lang.String pathName)
           
 void reCreateMenu()
           
 void setParameterizedObject(ParameterizedObject _forObject)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_ITEM_LEN

private static final int MAX_ITEM_LEN
See Also:
Constant Field Values

MAX_HISTORY_LENGTH

private static final int MAX_HISTORY_LENGTH
See Also:
Constant Field Values

fileMenu

private javax.swing.JMenu fileMenu

prefs

private java.util.prefs.Preferences prefs

forObject

private ParameterizedObject forObject

forClass

private java.lang.Class forClass

scene

private SceneDescription scene

notifyObj

private ParameterizedObject.ParameterizedObjectManager notifyObj

showLoadMenuItem

boolean showLoadMenuItem

showEditMenuItem

boolean showEditMenuItem

showSaveMenuItem

boolean showSaveMenuItem
Constructor Detail

FileHistory

public FileHistory(java.lang.String _menuName,
                   ParameterizedObject _forObject,
                   ParameterizedObject.ParameterizedObjectManager _notifyObj,
                   SceneDescription _scene,
                   boolean _showLoadMenuItem,
                   boolean _showEditMenuItem,
                   boolean _showSaveMenuItem)

FileHistory

public FileHistory(java.lang.String _menuName,
                   java.lang.Class _forClass,
                   ParameterizedObject.ParameterizedObjectManager _notifyObj,
                   SceneDescription _scene,
                   boolean _showLoadMenuItem,
                   boolean _showEditMenuItem,
                   boolean _showSaveMenuItem)
Method Detail

getPopupMenu

public javax.swing.JPopupMenu getPopupMenu()

getMenu

public javax.swing.JMenu getMenu()

setParameterizedObject

public void setParameterizedObject(ParameterizedObject _forObject)

reCreateMenu

public void reCreateMenu()

insertPathname

public final void insertPathname(java.lang.String pathName)

getItemName

protected java.lang.String getItemName(java.lang.String pathname)
Return the itemname (abbreviated itemname if necessary) * to be shown in the file menu open item list. * A maximum of MAX_ITEM_LEN characters is used for the * itemname because we do not want to make the JMenuItem * entry too wide. *


actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener