本文整理匯總了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]);
}
}
}
}