當前位置: 首頁>>代碼示例>>Java>>正文


Java Color.equals方法代碼示例

本文整理匯總了Java中org.eclipse.swt.graphics.Color.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java Color.equals方法的具體用法?Java Color.equals怎麽用?Java Color.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.graphics.Color的用法示例。


在下文中一共展示了Color.equals方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: changeColor

import org.eclipse.swt.graphics.Color; //導入方法依賴的package包/類
/**
 * this methods allow to change the color of future message
 * (this is because a simple change of current stream color, change the color for all messages, even previous ones ...) 
 * @param c
 */
@Override
public void changeColor(Color c){
	Color previousColor = ((IOConsoleOutputStream) getOutputStream()).getColor();
	if( (c==null && c!= previousColor) || (c!=null && !c.equals(previousColor)) ){
		// need to change to another stream for the new color
		changeStream(); // reset the stream
		((IOConsoleOutputStream) getOutputStream()).setColor(c);
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:15,代碼來源:EclipseConsoleIO.java

示例2: changeStyle

import org.eclipse.swt.graphics.Color; //導入方法依賴的package包/類
/**
 * this methods allow to change the color and font style of future message
 * (this is because a simple change of current stream color, change the color for all messages, even previous ones ...) 
 * @param c
 */
@Override
public void changeStyle(Color c, int style){
	Color previousColor = ((IOConsoleOutputStream) getOutputStream()).getColor();
	int previousStyle = ((IOConsoleOutputStream) getOutputStream()).getFontStyle();
	if( (c==null && c!= previousColor) || (c!=null && !c.equals(previousColor)) || style!= previousStyle ){
		// need to change to another stream for the new color
		changeStream(); // reset the stream
		((IOConsoleOutputStream) getOutputStream()).setColor(c);
		((IOConsoleOutputStream) getOutputStream()).setFontStyle(style);
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:17,代碼來源:EclipseConsoleIO.java

示例3: safeChangeStyle

import org.eclipse.swt.graphics.Color; //導入方法依賴的package包/類
/**
 * does the same as changeStyle() but ensure to do it in the UI Thread
 * @param c
 * @param style
 */
protected void safeChangeStyle(final Color c, final int style) {
	Color previousColor = ((IOConsoleOutputStream) getOutputStream()).getColor();
	int previousStyle = ((IOConsoleOutputStream) getOutputStream()).getFontStyle();
	if( (c==null && c!= previousColor) || (c!=null && !c.equals(previousColor)) || style!= previousStyle ){
		Display.getDefault().syncExec(new Runnable() {
			public void run() {
				// need to change to another stream for the new color
				changeStream(); // reset the stream
				((IOConsoleOutputStream) getOutputStream()).setColor(c);
				((IOConsoleOutputStream) getOutputStream()).setFontStyle(style);
			}
		});
	}
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:20,代碼來源:EclipseConsoleIO.java

示例4: tableRefresh

import org.eclipse.swt.graphics.Color; //導入方法依賴的package包/類
@Override
public void tableRefresh() {
	if (getComposite() == null || getComposite().isDisposed()){

		return;
   	}

 	UIFunctions uiFunctions = UIFunctionsManager.getUIFunctions();
 	if (uiFunctions != null) {
 		uiFunctions.refreshIconBar();
 	}

	// Store values for columns that are calculate from peer information, so
	// that we only have to do one loop.  (As opposed to each cell doing a loop)
	// Calculate code copied from TrackerTableItem
	TableRowCore[] rows = tv.getRows();
	for (int x = 0; x < rows.length; x++) {
	  TableRowSWT row = (TableRowSWT)rows[x];

	  if (row == null){
	    continue;
	  }

	  TRHostTorrent	host_torrent = (TRHostTorrent)rows[x].getDataSource(true);

	  if (host_torrent == null){
		  continue;
	  }

	  long	uploaded	= host_torrent.getTotalUploaded();
	  long	downloaded	= host_torrent.getTotalDownloaded();
	  long	left		= host_torrent.getTotalLeft();

	  int		seed_count	= host_torrent.getSeedCount();

	  host_torrent.setData("GUI_PeerCount", new Long(host_torrent.getLeecherCount()));
	  host_torrent.setData("GUI_SeedCount", new Long(seed_count));
	  host_torrent.setData("GUI_BadNATCount", new Long(host_torrent.getBadNATCount()));
	  host_torrent.setData("GUI_Uploaded", new Long(uploaded));
	  host_torrent.setData("GUI_Downloaded", new Long(downloaded));
	  host_torrent.setData("GUI_Left", new Long(left));

	  if ( seed_count != 0 ){
		  Color fg = row.getForeground();

		  if (fg != null && fg.equals(Colors.blues[Colors.BLUES_MIDDARK])) {
			  row.setForeground(Colors.blues[Colors.BLUES_MIDDARK]);
		  }
	  }
	}
}
 
開發者ID:BiglySoftware,項目名稱:BiglyBT,代碼行數:52,代碼來源:MyTrackerView.java


注:本文中的org.eclipse.swt.graphics.Color.equals方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。