Mercurial > projects > dwt-addons
view dwtx/draw2d/RoutingListener.d @ 172:d994a8b2cdf7
again compile fixes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 10 Sep 2008 23:14:02 +0200 |
parents | 95307ad235d9 |
children |
line wrap: on
line source
/******************************************************************************* * Copyright (c) 2005 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * IBM Corporation - initial API and implementation * Port to the D programming language: * Frank Benoit <benoit@tionex.de> *******************************************************************************/ module dwtx.draw2d.RoutingListener; import dwt.dwthelper.utils; import dwtx.draw2d.Connection; /** * Classes which implement this interface provide callback hooks for various routing * related events. * <P> * Instances can be hooked to a {@link PolylineConnection} by calling {@link * PolylineConnection#addRoutingListener(RoutingListener)}. * @since 3.2 */ public interface RoutingListener { /** * Called when the connection has been invalidated. * @param connection the connection * @since 3.2 */ void invalidate(Connection connection); /** * Called after normal routing has completed. * @param connection the routed connection * @since 3.2 */ void postRoute(Connection connection); /** * Called when a connection has been removed from its router. * @param connection the connection * @since 3.2 */ void remove(Connection connection); /** * Called prior to routing occurring. A listener may intercept routing by * returning <code>true</code>. If intercepted, the connection's * <code>ConnectionRouter</code> will not perform routing. * @param connection the connection being routed * @return <code>true</code> if routing has been performed by the listener * @since 3.2 */ bool route(Connection connection); /** * Called when the connection's routing constraint has been set or initialized. * @param connection the connection * @param constraint the new constraint * @since 3.2 */ void setConstraint(Connection connection, Object constraint); /** * A stub implementation which implements all required methods. * @since 3.2 */ class Stub : RoutingListener { public void invalidate(Connection connection) { } public void postRoute(Connection connection) { } public void remove(Connection connection) { } public bool route(Connection connection) { return false; } public void setConstraint(Connection connection, Object constraint) { } } }