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

📄 iliststrategy.java

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

import org.eclipse.swt.graphics.Point;

import com.swtplus.internal.PGC;
import com.swtplus.widgets.PListItem;
import com.swtplus.widgets.PList;

/**
 * The IListStrategy draws items on a PList.
 * 
 */
public interface IListStrategy {
    

    /**
     * Returns the size for the given ListItem.  The PList currently only 
     * supports vertical scrolling and sizes each item's width to the available
     * width.  Therefore the x value returned from this method is ignored.
     * Accordingly, the hHint argument is always SWT.DEFAULT.  
     * 
     * @param item the item being sized
     * @param gc a GCPlus created on the PList (allowing string/text extents)
     * @param wHint width hint
     * @param hHint height hint (currently always SWT.DEFAULT)
     * @return the size of the item
     */
    public Point computeSize(PListItem item,PGC gc,int wHint, int hHint);
    
    /**
     * Paints the given item
     * 
     * @param item item to paint
     * @param gc GCPlus from the paint event
     * @param selected true if this item is selected
     * @param focused true if this item is focused
     * @param hovering true if the mouse is hovering over this item
     * @param size the size returned from the computeSize method for this item
     * 
     */
    public void paintItem(PListItem item,PGC gc,boolean selected, boolean focused, boolean hovering,Point size);

    /**
     * Checks a newly created item to verify that the item is as the strategy
     * requires.  This method is called when a list item is created.  
     * <p>
     * For example, if a strategy requires that all items be a subclass of 
     * ListItem called ThisStrategyListItem then the code might look like:
     * <p>
     * <code>
     * Assert.isTrue(item instanceof ThisStrategyListItem);<BR>
     * </code>
     * 
     * @param item Newly created item to verify
     */
    public void checkItem(PListItem item);
    
    /**
     * Initializes the strategy.
     *  
     * @param pList PList parent
     */
    public void initialize(PList pList);
    
    /**
     * Returns true if the strategy draws items differently when the mouse is
     * hovering over them.  This method is necessary to eliminate unnecessary
     * painting.  
     * 
     * @return true if items draw differently when hovered over.
     */
    public boolean isHoverOnUnselected();
    
    /**
     * Dispose of this strategy.
     */
    public void dispose();
    
	/**
	 * Called when the PList's font is updated.
	 */
	public abstract void fontChanged();
    
	/**
	 * Called when one of the PList's colors is updated.
	 */
	public abstract void colorChanged();
}

⌨️ 快捷键说明

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