当前位置: 首页>>代码示例>>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;未经允许,请勿转载。