view org.eclipse.draw2d/src/org/eclipse/draw2d/text/FlowFigureLayout.d @ 12:bc29606a740c

Added dwt-addons in original directory structure of eclipse.org
author Frank Benoit <benoit@tionex.de>
date Sat, 14 Mar 2009 18:23:29 +0100
parents
children
line wrap: on
line source

/*******************************************************************************
 * Copyright (c) 2000, 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 org.eclipse.draw2d.text.FlowFigureLayout;

import java.lang.all;

import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.LayoutManager;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.text.FlowContext;
import org.eclipse.draw2d.text.FlowFigure;

/**
 * A LayoutManager for use with FlowFigure.
 *
 * <P>WARNING: This class is not intended to be subclassed by clients.
 * @author hudsonr
 * @since 2.1
 */
public abstract class FlowFigureLayout
    : LayoutManager
{

/**
 * The flow context in which this LayoutManager exists.
 */
private FlowContext context;

/**
 * The figure passed by layout(Figure) is held for convenience.
 */
private final FlowFigure flowFigure;

/**
 * Constructs a new FlowFigureLayout with the given FlowFigure.
 * @param flowfigure the FlowFigure
 */
protected this(FlowFigure flowfigure) {
    this.flowFigure = flowfigure;
}

/**
 * Not applicable.
 * @see org.eclipse.draw2d.LayoutManager#getConstraint(org.eclipse.draw2d.IFigure)
 */
public Object getConstraint(IFigure child) {
    return null;
}

/**
 * Returns this layout's context or <code>null</code>.
 * @return <code>null</code> or a context
 * @since 3.1
 */
protected FlowContext getContext() {
    return context;
}

/**
 * @return the FlowFigure
 */
protected FlowFigure getFlowFigure() {
    return flowFigure;
}

/**
 * Not applicable.
 * @see org.eclipse.draw2d.LayoutManager#getMinimumSize(org.eclipse.draw2d.IFigure, int, int)
 */
public Dimension getMinimumSize(IFigure container, int wHint, int hHint) {
    return null;
}

/**
 * Not applicable.
 * @see org.eclipse.draw2d.LayoutManager#getPreferredSize(org.eclipse.draw2d.IFigure, int, int)
 */
public Dimension getPreferredSize(IFigure container, int wHint, int hHint) {
    return null;
}

/**
 * Not applicable.
 * @see org.eclipse.draw2d.LayoutManager#invalidate()
 */
public void invalidate() { }

/**
 * Called during {@link #layout(IFigure)}.
 */
protected abstract void layout();

/**
 * @see org.eclipse.draw2d.LayoutManager#layout(IFigure)
 */
public final void layout(IFigure figure) {
    layout ();
}

/**
 * Not applicable.
 * @see org.eclipse.draw2d.LayoutManager#remove(org.eclipse.draw2d.IFigure)
 */
public void remove(IFigure child) { }

/**
 * Not applicable.
 * @see org.eclipse.draw2d.LayoutManager#setConstraint(org.eclipse.draw2d.IFigure, java.lang.Object)
 */
public void setConstraint(IFigure child, Object constraint) { }

/**
 * Sets the context for this layout manager.
 * @param flowContext the context of this layout
 */
public void setFlowContext(FlowContext flowContext) {
    context = flowContext;
}

}