/* * @(#)NullHandle.java * * Project: JHotdraw - a GUI framework for technical drawings * http://www.jhotdraw.org * http://jhotdraw.sourceforge.net * Copyright: © by the original author(s) and all contributors * License: Lesser GNU Public License (LGPL) * http://www.opensource.org/licenses/lgpl-license.html */ package org.jhotdraw.standard; import java.awt.*; import org.jhotdraw.framework.*; /** * A handle that doesn't change the owned figure. Its only purpose is * to show feedback that a figure is selected. *
* Design Patterns

*  o * NullObject
* NullObject enables to treat handles that don't do * anything in the same way as other handles. * * @version <$CURRENT_VERSION$> */ public class NullHandle extends LocatorHandle { /** * The handle's locator. */ protected Locator fLocator; public NullHandle(Figure owner, Locator locator) { super(owner, locator); } /** * Draws the NullHandle. NullHandles are drawn as a * red framed rectangle. */ public void draw(Graphics g) { Rectangle r = displayBox(); g.setColor(Color.black); g.drawRect(r.x, r.y, r.width, r.height); } public org.jhotdraw.framework.Cursor getCursor() { return new AWTCursor(java.awt.Cursor.DEFAULT_CURSOR); } }