本文整理汇总了Java中org.insightech.er.Resources.getColor方法的典型用法代码示例。如果您正苦于以下问题:Java Resources.getColor方法的具体用法?Java Resources.getColor怎么用?Java Resources.getColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.insightech.er.Resources
的用法示例。
在下文中一共展示了Resources.getColor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: paint
import org.insightech.er.Resources; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void paint(final IFigure figure, final Graphics graphics, final Insets insets) {
if (getColor() != null) {
graphics.setForegroundColor(getColor());
}
tempRect.setBounds(getPaintRectangle(figure, insets));
if (getWidth() % 2 == 1) {
tempRect.width--;
tempRect.height--;
}
tempRect.shrink(getWidth() / 2, getWidth() / 2);
graphics.setLineWidth(1);
int g = 9 * DELTA;
int b = 9 * DELTA;
for (int i = 0; i <= 5; i++) {
final Color color = Resources.getColor(new int[] {b, g, 255});
paint1(i, color, tempRect, graphics);
g -= DELTA;
b -= DELTA;
}
}
示例2: refreshVisuals
import org.insightech.er.Resources; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void refreshVisuals() {
final ERDiagram element = (ERDiagram) getModel();
final int[] color = element.getColor();
if (color != null) {
final Color bgColor = Resources.getColor(color);
getViewer().getControl().setBackground(bgColor);
}
for (final Object child : getChildren()) {
if (child instanceof NodeElementEditPart) {
final NodeElementEditPart part = (NodeElementEditPart) child;
part.refreshVisuals();
}
}
}
示例3: paint
import org.insightech.er.Resources; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void paint(IFigure figure, Graphics graphics, Insets insets) {
if (getColor() != null) {
graphics.setForegroundColor(getColor());
}
tempRect.setBounds(getPaintRectangle(figure, insets));
if (getWidth() % 2 == 1) {
tempRect.width--;
tempRect.height--;
}
tempRect.shrink(getWidth() / 2, getWidth() / 2);
graphics.setLineWidth(1);
int g = 9 * DELTA;
int b = 9 * DELTA;
for (int i = 0; i <= 5; i++) {
Color color = Resources.getColor(new int[] { b, g, 255 });
this.paint1(i, color, tempRect, graphics);
g -= DELTA;
b -= DELTA;
}
}
示例4: refreshVisuals
import org.insightech.er.Resources; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void refreshVisuals() {
ERDiagram element = (ERDiagram) this.getModel();
int[] color = element.getColor();
if (color != null) {
Color bgColor = Resources.getColor(color);
this.getViewer().getControl().setBackground(bgColor);
}
for (Object child : this.getChildren()) {
if (child instanceof NodeElementEditPart) {
NodeElementEditPart part = (NodeElementEditPart) child;
part.refreshVisuals();
}
}
}
示例5: drawShadow
import org.insightech.er.Resources; //导入方法依赖的package包/类
private void drawShadow(final Rectangle rectangle, final Graphics graphics) {
int rgb = 255;
final int delta = 255 / SHADOW_INSET;
for (int i = 0; i < SHADOW_INSET - 1; i++) {
rgb -= delta;
final Color color = Resources.getColor(new int[] {rgb, rgb, rgb});
drawShadowLayer(rectangle, graphics, SHADOW_INSET - 1 - i, color);
}
}
示例6: drawShadow
import org.insightech.er.Resources; //导入方法依赖的package包/类
private void drawShadow(Rectangle rectangle, Graphics graphics) {
int rgb = 255;
int delta = 255 / SHADOW_INSET;
for (int i = 0; i < SHADOW_INSET - 1; i++) {
rgb -= delta;
Color color = Resources.getColor(new int[] { rgb, rgb, rgb });
this.drawShadowLayer(rectangle, graphics, SHADOW_INSET - 1 - i,
color);
}
}
示例7: refreshVisuals
import org.insightech.er.Resources; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
final public void refreshVisuals() {
refreshChildren();
doRefreshVisuals();
setVisible();
final NodeElement element = (NodeElement) getModel();
final IFigure figure = getFigure();
final int[] color = element.getColor();
if (color != null) {
final ChangeTrackingList changeTrackingList = getDiagram().getChangeTrackingList();
if (changeTrackingList.isCalculated() && (element instanceof Note || element instanceof ERTable)) {
if (changeTrackingList.isAdded(element)) {
figure.setBackgroundColor(Resources.ADDED_COLOR);
} else if (changeTrackingList.getUpdatedNodeElement(element) != null) {
figure.setBackgroundColor(Resources.UPDATED_COLOR);
} else {
figure.setBackgroundColor(ColorConstants.white);
}
} else {
final Color bgColor = Resources.getColor(color);
figure.setBackgroundColor(bgColor);
}
}
final Rectangle rectangle = getRectangle();
final GraphicalEditPart parent = (GraphicalEditPart) getParent();
parent.setLayoutConstraint(this, figure, rectangle);
getFigure().getUpdateManager().performValidation();
element.setActualLocation(toLocation(getFigure().getBounds()));
refreshMovedAnchor();
}
示例8: refreshVisuals
import org.insightech.er.Resources; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
final public void refreshVisuals() {
this.refreshChildren();
this.doRefreshVisuals();
this.setVisible();
NodeElement element = (NodeElement) this.getModel();
IFigure figure = this.getFigure();
int[] color = element.getColor();
if (color != null) {
ChangeTrackingList changeTrackingList = this.getDiagram()
.getChangeTrackingList();
if (changeTrackingList.isCalculated()
&& (element instanceof Note || element instanceof ERTable)) {
if (changeTrackingList.isAdded(element)) {
figure.setBackgroundColor(Resources.ADDED_COLOR);
} else if (changeTrackingList.getUpdatedNodeElement(element) != null) {
figure.setBackgroundColor(Resources.UPDATED_COLOR);
} else {
figure.setBackgroundColor(ColorConstants.white);
}
} else {
Color bgColor = Resources.getColor(color);
figure.setBackgroundColor(bgColor);
}
}
Rectangle rectangle = this.getRectangle();
GraphicalEditPart parent = (GraphicalEditPart) this.getParent();
parent.setLayoutConstraint(this, figure, rectangle);
this.getFigure().getUpdateManager().performValidation();
this.refreshMovedAnchor();
}
示例9: refreshVisuals
import org.insightech.er.Resources; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
final public void refreshVisuals() {
this.refreshChildren();
this.doRefreshVisuals();
this.setVisible();
NodeElement element = (NodeElement) this.getModel();
IFigure figure = this.getFigure();
int[] color = element.getColor();
if (color != null) {
ChangeTrackingList changeTrackingList = this.getDiagram()
.getChangeTrackingList();
if (changeTrackingList.isCalculated()
&& (element instanceof Note || element instanceof ERTable)) {
if (changeTrackingList.isAdded(element)) {
figure.setBackgroundColor(Resources.ADDED_COLOR);
} else if (changeTrackingList.getUpdatedNodeElement(element) != null) {
figure.setBackgroundColor(Resources.UPDATED_COLOR);
} else {
figure.setBackgroundColor(ColorConstants.white);
}
} else {
Color bgColor = Resources.getColor(color);
figure.setBackgroundColor(bgColor);
}
}
Rectangle rectangle = this.getRectangle();
GraphicalEditPart parent = (GraphicalEditPart) this.getParent();
parent.setLayoutConstraint(this, figure, rectangle);
this.getFigure().getUpdateManager().performValidation();
element.setActualLocation(this.toLocation(this.getFigure().getBounds()));
this.refreshMovedAnchor();
}