当前位置: 首页>>代码示例>>Java>>正文


Java Resources.getColor方法代码示例

本文整理汇总了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;
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:29,代码来源:ERDiagramLineBorder.java

示例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();
        }
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:22,代码来源:ERDiagramEditPart.java

示例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;
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:29,代码来源:ERDiagramLineBorder.java

示例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();
		}
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:22,代码来源:ERDiagramEditPart.java

示例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);
    }
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:11,代码来源:DropShadowRectangle.java

示例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);
	}
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:12,代码来源:DropShadowRectangle.java

示例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();
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:48,代码来源:NodeElementEditPart.java

示例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();
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:48,代码来源:NodeElementEditPart.java

示例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();
}
 
开发者ID:justinkwony,项目名称:ermaster-nhit,代码行数:50,代码来源:NodeElementEditPart.java


注:本文中的org.insightech.er.Resources.getColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。