/**
* Creates a new {@code FreeColMenuBar}. This menu bar will include
* all of the submenus and items.
*
* @param freeColClient The main controller.
* @param listener An optional mouse motion listener.
*/
public InGameMenuBar(FreeColClient freeColClient, MouseMotionListener listener) {
// FIXME: FreeColClient should not have to be passed in to
// this class. This is only a menu bar, it doesn't need a
// reference to the main controller. The only reason it has
// one now is because DebugMenu needs it. And DebugMenu needs
// it because it is using inner classes for ActionListeners
// and those inner classes use the reference. If those inner
// classes were in seperate classes, when they were created,
// they could use the FreeColClient reference of the
// ActionManger. So DebugMenu needs to be refactored to remove
// inner classes so that this MenuBar can lose its unnecessary
// reference to the main controller. See FreeColMenuTest.
//
// Okay, I lied.. the update() and paintComponent() methods in
// this MenuBar use freeColClient, too. But so what. Move
// those to another class too. :)
super(freeColClient);
// Add a mouse listener so that autoscrolling can happen in
// this menubar
this.addMouseMotionListener(listener);
reset();
}
InGameMenuBar.java 文件源码
java
阅读 32
收藏 0
点赞 0
评论 0
项目:FreeCol
作者:
评论列表
文章目录