本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
});
}
}
示例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]);
}
}
}
}