org.scijava.menu
Class AbstractMenuCreator<T,M>

java.lang.Object
  extended by org.scijava.menu.AbstractMenuCreator<T,M>
Type Parameters:
T - Top-level menu class to populate (e.g., JMenuBar or JMenu or MenuBar)
M - Hierarchical menu class (e.g., JMenu or Menu)
All Implemented Interfaces:
MenuCreator<T>

public abstract class AbstractMenuCreator<T,M>
extends Object
implements MenuCreator<T>

Abstract helper class for generating a menu structure.

The class differentiates between top-level menu components (such as JMenuBar), and hierarchical menu components (such as JMenu).

Author:
Curtis Rueden

Constructor Summary
AbstractMenuCreator()
           
 
Method Summary
protected abstract  void addLeafToMenu(ShadowMenu shadow, M target)
           
protected abstract  void addLeafToTop(ShadowMenu shadow, T target)
           
protected abstract  M addNonLeafToMenu(ShadowMenu shadow, M target)
           
protected abstract  M addNonLeafToTop(ShadowMenu shadow, T target)
           
protected abstract  void addSeparatorToMenu(M target)
           
protected abstract  void addSeparatorToTop(T target)
           
 void createMenus(ShadowMenu root, T target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMenuCreator

public AbstractMenuCreator()
Method Detail

createMenus

public void createMenus(ShadowMenu root,
                        T target)
Specified by:
createMenus in interface MenuCreator<T>

addLeafToMenu

protected abstract void addLeafToMenu(ShadowMenu shadow,
                                      M target)

addLeafToTop

protected abstract void addLeafToTop(ShadowMenu shadow,
                                     T target)

addNonLeafToMenu

protected abstract M addNonLeafToMenu(ShadowMenu shadow,
                                      M target)

addNonLeafToTop

protected abstract M addNonLeafToTop(ShadowMenu shadow,
                                     T target)

addSeparatorToMenu

protected abstract void addSeparatorToMenu(M target)

addSeparatorToTop

protected abstract void addSeparatorToTop(T target)


Copyright © 2009–2015 SciJava. All rights reserved.