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

📄 igroupstrategy.java

📁 利用它可以做出非常漂亮的swt界面,包含的组件有PShelf Plist
💻 JAVA
字号:
package com.swtplus.widgets.group;

import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Point;

import com.swtplus.widgets.PGroup;


/**
 * The IGroupStrategy provides painting and sizing for a PGroup.
 * <P>
 * Implementing this interface and providing all the necessary code for a 
 * strategy is not recommended.  It is suggested to use the AbstractGroupStrategy
 * which handles alot of the complexity and behavior for you.
 */
public interface IGroupStrategy  {
	
	/**
	 * Initialize the strategy.  A reference to the Group itself is passed here
	 * and should be held if the strategy needs to refer back to the Group at
	 * any time.
	 * 
	 * @param group the parent PGroup
	 */
	public void initialize(PGroup group);
	
	/**
	 * Paint the PGroup.  The GC is set on the PGroup.
	 * 
	 * @param gc GC for painting on the PGroup
	 */
	public abstract void paint(GC gc);
	
	/**
	 * Called when the PGroup is resized.  The strategy is responsible for 
	 * sizing and placement of the body composite.
	 * 
	 * @param e ControlEvent from the PGroup's resize event.
	 */
	public abstract void resize(ControlEvent e);
	
	/**
	 * Returns the size of the PGroup.  The strategy is responsible for sizing
	 * the PGroup.  This method should also take into account the preferred
	 * sizing of the body composite.
	 * 
	 * @param wHint 
	 * @param hHint
	 * @param changed
	 * @return
	 */
	public abstract Point computeSize(int wHint, int hHint, boolean changed);
	
	/**
	 * Returns the expanded/collapsed state.  The strategy is responsible for 
	 * managing this state.
	 * 
	 * @return true for expanded, false for collapsed
	 */
	public boolean isExpanded();
	
	/**
	 * Sets the expanded/collapsed state.  The strategy is responsible for 
	 * managing this state.
	 * 
	 * @param expanded
	 */
	public void setExpanded(boolean expanded);
	
	/**
	 * Called when the PGroup's text is updated.
	 */
	public abstract void textChanged();
	
	/**
	 * Called when the PGroup's image is updated.
	 */
	public abstract void imageChanged();
	
	/**
	 * Called when the PGroup's font is updated.
	 */
	public abstract void fontChanged();
	
	/**
	 * Clean up any necessary resources.
	 */
	public abstract void dispose();
	
}

⌨️ 快捷键说明

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