org.eclipse.swt.graphics.Color.equals()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(6.0k)|赞(0)|评价(0)|浏览(152)

本文整理了Java中org.eclipse.swt.graphics.Color.equals()方法的一些代码示例,展示了Color.equals()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Color.equals()方法的具体详情如下:
包路径:org.eclipse.swt.graphics.Color
类名称:Color
方法名:equals

Color.equals介绍

[英]Compares the argument to the receiver, and returns true if they represent the same object using a class specific comparison.
[中]将参数与接收方进行比较,如果它们使用特定于类的比较表示相同对象,则返回true。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

@VisibleForTesting
boolean isDisplayingNullValue( TableItem item, int column ) throws KettleException {
 return GUIResource.getInstance().getColorBlue().equals( item.getForeground( column ) );
}

代码示例来源:origin: pentaho/pentaho-kettle

if ( ti.getForeground().equals( dircolor ) ) {
 cat = ITEM_CATEGORY_TRANSFORMATION_DIRECTORY;
} else {
if ( ti.getForeground().equals( dircolor ) ) {
 cat = ITEM_CATEGORY_JOB_DIRECTORY;
} else {

代码示例来源:origin: pentaho/pentaho-kettle

if ( !bg.equals( defaultBackgroundColor ) ) {
 String colorName = "bg " + bg.toString();
 r[0] = colorName;
 if ( GUIResource.getInstance().getColorBlue().equals( item.getForeground( j ) ) ) {
  data = null;

代码示例来源:origin: pentaho/pentaho-kettle

TableItem item = table.getItem( i );
item.setForeground( GUIResource.getInstance().getColorBlack() );
if ( !item.getBackground().equals( GUIResource.getInstance().getColorRed() ) ) {
 item.setBackground(
  i % 2 == 0

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

/** Simplify testing for color equality */
public static boolean equals(Color c1, Color c2) {
  if (c1 == c2) {
    return true;
  }
  if (c1 == null || c2 == null) {
    return false;
  }
  return c1.equals(c2);
}

代码示例来源:origin: org.eclipse/org.eclipse.ui.console

/**
 * Sets the color to used to decorate input in the associated console.
 * 
 * @param newColor the color to used to decorate input in the associated console.
 */
public void setColor(Color newColor) {
  Color old = color;
  if (old == null || !old.equals(newColor)) {
    color = newColor;
    console.firePropertyChange(this, IConsoleConstants.P_STREAM_COLOR, old, newColor);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.views.properties.tabbed

/**
 * Sets default color for tab label text
 */
public void setDefaultTextColor() {
  if (!this.textColor.equals(widgetForeground)) {
    this.textColor = widgetForeground;
    redraw();
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.console

/**
 * Sets the color to used to decorate input in the associated console.
 *
 * @param newColor the color to used to decorate input in the associated console.
 */
public void setColor(Color newColor) {
  Color old = color;
  if (old == null || !old.equals(newColor)) {
    color = newColor;
    console.firePropertyChange(this, IConsoleConstants.P_STREAM_COLOR, old, newColor);
  }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.ui.console

/**
 * Sets the color of this stream. Use <code>null</code> to indicate
 * the default color.
 *
 * @param newColor color of this stream, or <code>null</code>
 */
public void setColor(Color newColor) {
  Color old = color;
  if (old == null || !old.equals(newColor)) {
    color = newColor;
    console.firePropertyChange(this, IConsoleConstants.P_STREAM_COLOR, old, newColor);
  }
}

代码示例来源:origin: org.eclipse.egit/ui

@Override
public boolean equals(Object o) {
  return super.equals(o) && color.equals(((SWTLane)o).color);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.ui.views.properties.tabbed

/**
 * Sets color to be used for drawing tab label text. The caller is
 * responsible for managing the color's resources and disposing it
 * appropriately after setDefaultTextColor() is later invoked.
 *
 * @param textColor
 */
public void setTextColor(Color textColor) {
  if (textColor != null && !this.textColor.equals(textColor)) {
    this.textColor = textColor;
    redraw();
  }
}

代码示例来源:origin: BiglySoftware/BiglyBT

@Override
  public void paintControl(PaintEvent arg0) {
    Color current_bg = textWidget.getBackground();
    if (!current_bg.equals(existing_bg)) {
      existing_bg = current_bg;
      cBubble.redraw();
    }
  }
});

代码示例来源:origin: org.apache.uima/uimaj-ep-configurator

/**
 * Checks if is local item.
 *
 * @param item the item
 * @return true, if is local item
 */
// ********************************
protected boolean isLocalItem(TableTreeItem item) {
 return !item.getForeground().equals(editor.getFadeColor());
}

代码示例来源:origin: com.github.insubstantial/trident

Color getInterpolatedColor(Color color1, Color color2,
      float color1Likeness) {
    if (color1.equals(color2))
      return color1;
    if (color1Likeness == 1.0)
      return color1;
    if (color1Likeness == 0.0)
      return color2;
    return new Color(Display.getDefault(), getInterpolatedRGB(color1,
        color2, color1Likeness));
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
void setForeground( Color color ) {
 if( !foreground.equals( color ) ) {
  GCOperation operation = new SetProperty( SetProperty.FOREGROUND, color.getRGB() );
  addGCOperation( operation );
 }
 foreground = color;
}

代码示例来源:origin: org.pushingpixels/trident

Color getInterpolatedColor(Color color1, Color color2,
      float color1Likeness) {
    if (color1.equals(color2))
      return color1;
    if (color1Likeness == 1.0)
      return color1;
    if (color1Likeness == 0.0)
      return color2;
    return new Color(Display.getDefault(), getInterpolatedRGB(color1,
        color2, color1Likeness));
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

@Override
void setBackground( Color color ) {
 if( !background.equals( color ) ) {
  GCOperation operation = new SetProperty( SetProperty.BACKGROUND, color.getRGB() );
  addGCOperation( operation );
 }
 background = color;
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

public void setScrollBarForegroundColor(Color newColor) {
  Color currForegroundColor = fScrollBarSettings.getForegroundColor();
  if (currForegroundColor != null && currForegroundColor.equals(newColor)) {
    // No need to reset if the color is still the same.
    return;
  }
  fScrollBarSettings.setForegroundColor(newColor);
  this.fPainter.redrawScrollBars();
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

public void setScrollBarBackgroundColor(Color newColor) {
  Color currBackgroundColor = fScrollBarSettings.getBackgroundColor();
  if (currBackgroundColor != null && currBackgroundColor.equals(newColor)) {
    // No need to reset if the color is still the same.
    return;
  }
  fScrollBarSettings.setBackgroundColor(newColor);
  this.fPainter.redrawScrollBars();
}

代码示例来源:origin: org.pushing-pixels/trident

Color getInterpolatedColor(Color color1, Color color2,
      float color1Likeness) {
    if (color1.equals(color2))
      return color1;
    if (color1Likeness == 1.0)
      return color1;
    if (color1Likeness == 0.0)
      return color2;
    return new Color(Display.getDefault(), getInterpolatedRGB(color1,
        color2, color1Likeness));
  }
}

相关文章