Code Search for Developers
 
 
  

UnitContextFactory.java from Magellan-Client at Krugle


Show UnitContextFactory.java syntax highlighted

/*
 *  Copyright (C) 2000-2004 Roger Butenuth, Andreas Gampe,
 *                          Stefan Goetz, Sebastian Pappert,
 *                          Klaas Prause, Enno Rehling,
 *                          Sebastian Tusk, Ulrich Kuester,
 *                          Ilja Pavkovic
 *
 * This file is part of the Eressea Java Code Base, see the
 * file LICENSING for the licensing information applying to
 * this file.
 *
 */

package com.eressea.swing.context;

import java.util.Collection;

import javax.swing.JPopupMenu;
import javax.swing.tree.DefaultMutableTreeNode;

import com.eressea.GameData;
import com.eressea.Unit;
import com.eressea.event.EventDispatcher;
import com.eressea.swing.tree.UnitNodeWrapper;

/**
 * Context Factory for unit contexts.
 *
 * @author Andreas
 * @version
 */
public class UnitContextFactory implements ContextFactory {
	/**
	 * TODO: DOCUMENT ME!
	 *
	 * @param data TODO: DOCUMENT ME!
	 * @param argument TODO: DOCUMENT ME!
	 * @param selectedObjects TODO: DOCUMENT ME!
	 * @param node TODO: DOCUMENT ME!
	 *
	 * @return TODO: DOCUMENT ME!
	 */
	public JPopupMenu createContextMenu(EventDispatcher dispatcher,
            GameData data, Object argument,
            Collection selectedObjects,
            DefaultMutableTreeNode node) {
		if(argument instanceof Unit) {
			return new UnitContextMenu((Unit) argument, selectedObjects,
									   dispatcher, data);
		} else if(argument instanceof UnitNodeWrapper) {
			return new UnitContextMenu(((UnitNodeWrapper) argument).getUnit(), selectedObjects,
									   dispatcher, data);
		}

		return null;
	}
}




See more files for this project here

Magellan-Client

The Magellan Client is basicly a GUI for the pbem game eressea but can be used for other pbems based on \"atlantis\" too.

Project homepage: http://sourceforge.net/projects/magellan-client
Programming language(s): Java
License: other

  actions/
    ContextAction.java
    CopyAction.java
  ContextChangeable.java
  ContextFactory.java
  ContextMenuProvider.java
  ContextObserver.java
  MapContextMenu.java
  UnitCapacityContextMenu.java
  UnitContainerContextFactory.java
  UnitContainerContextMenu.java
  UnitContextFactory.java
  UnitContextMenu.java