⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 layouter.java

📁 开源(Open Source)项目JHotDraw的文档和源程序
💻 JAVA
字号:
/*
 * @(#)Layouter.java 5.2
 *
 */
package CH.ifa.draw.contrib;

import CH.ifa.draw.util.Storable;
import java.io.Serializable;
import java.awt.*;

/**
 * A Layouter encapsulates a algorithm to layout
 * a figure. It is passed on to a figure which delegates the 
 * layout task to the Layouter's layout method. 
 * The Layouter might need access to some information 
 * specific to a certain figure in order to layout it out properly.
 *
 * Note: Currently, only the GraphicalCompositeFigure uses
 *       such a Layouter to layout its child components.
 *
 * @see		GraphicalCompositeFigure
 * @author	Wolfram Kaiser
 */
public interface Layouter extends Serializable, Storable {

	/*
	 * Calculate the layout for the figure and all its subelements. The
	 * layout is not actually performed but just its dimensions are calculated.
	 *
	 * @param origin start point for the layout
	 * @param corner minimum corner point for the layout
	 */	
	public Rectangle calculateLayout(Point origin, Point corner);

	/**
	 * Method which lays out a figure. It is called by the figure
	 * if a layout task is to be performed. Implementing classes
	 * specify a certain layout algorithm in this method.
	 *
	 * @param origin start point for the layout
	 * @param corner minimum corner point for the layout
	 */	
	public Rectangle layout(Point origin, Point corner);

	/**
	 * Set the insets for spacing between the figure and its subfigures
	 *
	 * @param newInsets new spacing dimensions
	 */
	public void setInsets(Insets newInsets);

	/**
	 * Get the insets for spacing between the figure and its subfigures
	 *
	 * @return spacing dimensions
	 */	
	public Insets getInsets();
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -