[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool ShiftActionListener.java,NONE,1.1
Status: Pre-Alpha
Brought to you by:
henryml
From: Nordholt <nor...@us...> - 2005-10-27 14:58:29
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14678 Added Files: ShiftActionListener.java Log Message: Listener for the space shift menu item --- NEW FILE: ShiftActionListener.java --- //--------------------------------------------------------------------------------- // $Id: ShiftActionListener.java,v 1.1 2005/10/27 14:58:06 nordholt Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.tool; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import net.sourceforge.bprocessor.model.Surface; import net.sourceforge.bprocessor.model.Domain; import net.sourceforge.bprocessor.model.Project; import org.apache.log4j.Logger; /** * The shift action listener. */ public class ShiftActionListener implements ActionListener { /** * The logger */ private static Logger log = Logger.getLogger(SelectTool.class); /** * The surface this listener shifts spaces on */ private Surface surface; /** * Constructs a listener * @param surface the surface */ public ShiftActionListener (Surface surface) { this.surface = surface; } /** * Invoked when an action is performed * @param e The action event */ public void actionPerformed(ActionEvent e) { Domain back = surface.getBackDomain(); Domain front = surface.getFrontDomain(); surface.setFrontDomain(back); surface.setBackDomain(front); Project.getInstance().update(surface); if (back != null) { back.addSurface(surface); Project.getInstance().update(back); } if (front != null) { front.addSurface(surface); Project.getInstance().update(front); } } } |