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


Java ColorConstants类代码示例

本文整理汇总了Java中org.eclipse.draw2d.ColorConstants的典型用法代码示例。如果您正苦于以下问题:Java ColorConstants类的具体用法?Java ColorConstants怎么用?Java ColorConstants使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ColorConstants类属于org.eclipse.draw2d包,在下文中一共展示了ColorConstants类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: paintCancel

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
protected void paintCancel(Graphics graphics){
	Rectangle barBounds = getBounds().getCopy();
	barBounds.crop(new Insets(getMargin()));
	if (barBounds.height > getMaxHeight()){
		int dy = (barBounds.height - getMaxHeight())/2;
		barBounds.crop(new Insets(dy,0,dy,0));
	}
	
	Rectangle cancelBounds = barBounds.getCopy();
	cancelBounds.x = cancelBounds.right() - getCancelButtonWidth();
	cancelBounds.width = getCancelButtonWidth();
	
	Color cancelColor = new Color(null,
			ColorUtils.darker(
					ColorUtils.darker(
							graphics.getBackgroundColor().getRGB())));
	graphics.setBackgroundColor(cancelColor);
	int radius = Math.min(15, cancelBounds.height);
	graphics.fillRoundRectangle(cancelBounds, radius, radius);
	graphics.drawRoundRectangle(cancelBounds, radius, radius);
	graphics.setForegroundColor(ColorConstants.white);
	paintString(graphics, "Cancel", cancelBounds);
	cancelColor.dispose();
}
 
开发者ID:ShoukriKattan,项目名称:ForgedUI-Eclipse,代码行数:25,代码来源:SearchBarFigure.java

示例2: paintFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
/**
 * @see nexcore.tool.uml.ui.core.diagram.figure.AbstractNotationNodeFigure#paintFigure(org.eclipse.draw2d.Graphics)
 */
@Override
protected void paintFigure(Graphics graphics) {
    
    super.paintFigure(graphics);
    graphics.drawRectangle(getLocation().x, getLocation().y, getSize().width - 1, getSize().height - 1);

    graphics.setAntialias(SWT.ON);
    
    Rectangle bounds = getBounds();
    if(isDangling()){
        graphics.setForegroundColor(ColorConstants.red);
        graphics.drawOval(bounds.x, bounds.y, 12, 12);
        graphics.drawLine(bounds.x + 2, bounds.y + 2, bounds.x + 10, bounds.y + 10);
        graphics.drawLine(bounds.x + 10, bounds.y + 2, bounds.x + 2, bounds.y + 10);
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:20,代码来源:DataTypeFigure.java

示例3: paintFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
/**
 * @see Figure#paintFigure(Graphics)
 */
protected void paintFigure(Graphics graphics) {
    if (isOpaque())
        super.paintFigure(graphics);
    Rectangle bounds = getBounds();
    graphics.translate(bounds.x, bounds.y);
    if (icon != null)
        graphics.drawImage(icon, getIconLocation());
    if (!isEnabled()) {
        graphics.translate(1, 1);
        graphics.setForegroundColor(ColorConstants.buttonLightest);
        graphics.drawText(getSubStringText(), getTextLocation());
        graphics.translate(-1, -1);
        graphics.setForegroundColor(ColorConstants.buttonDarker);
    }
    graphics.drawText(getSubStringText(), getTextLocation());
    graphics.translate(-bounds.x, -bounds.y);
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:21,代码来源:CollapsedLabel.java

示例4: configureGraphicalViewer

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
@Override
protected void configureGraphicalViewer() {
	super.configureGraphicalViewer();
	getGraphicalViewer().getControl().setBackground(ColorConstants.button);

	GraphicalViewer graphicalViewer = getGraphicalViewer();
	MainDesignerRootEditPart rootEditPart = new MainDesignerRootEditPart();

	graphicalViewer.setRootEditPart(rootEditPart);
	// set EditPartFactory
	graphicalViewer.setEditPartFactory(new JasperDesignEditPartFactory());

	// set rulers providers
	RulerProvider provider = new ReportRulerProvider(new ReportRuler(true, RulerProvider.UNIT_PIXELS));
	graphicalViewer.setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER, provider);

	provider = new ReportRulerProvider(new ReportRuler(false, RulerProvider.UNIT_PIXELS));
	graphicalViewer.setProperty(RulerProvider.PROPERTY_VERTICAL_RULER, provider);

	Boolean isRulerVisible = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWRULER);

	graphicalViewer.setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY, isRulerVisible);

	createAdditionalActions();
	graphicalViewer.setKeyHandler(new JSSGraphicalViewerKeyHandler(graphicalViewer));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:27,代码来源:CrosstabEditor.java

示例5: createMain

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
@Override
protected IFigure createMain ()
{
    final Figure baseFigure = new LayeredPane ();

    final Layer rootFigure = new Layer ();

    this.connLayer = new ConnectionLayer ();
    this.connLayer.setAntialias ( 1 );
    this.connLayer.setConnectionRouter ( ConnectionRouter.NULL );

    baseFigure.add ( this.connLayer );
    baseFigure.add ( rootFigure );

    rootFigure.setLayoutManager ( new BorderLayout () );
    rootFigure.setBackgroundColor ( ColorConstants.white );

    rootFigure.add ( createArrowFigure (), BorderLayout.RIGHT );
    rootFigure.add ( createEntryGrid ( this.connLayer ), BorderLayout.CENTER );

    return baseFigure;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:23,代码来源:GenericLevelPresets.java

示例6: rebuildFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
@Override
public void rebuildFigure() {
	getDisplay().setForegroundColor(ColorConstants.black);
	add(getDisplay());
	setConstraint(getDisplay(), new Rectangle(10, 10, -1, -1));
	setOpaque(true);
	setVisible(true);
	setForegroundColor(ServiceNode.FONT_COLOR);
	if (node.getType().equalsIgnoreCase(Enums.ServiceTypes.PROVIDED.name()))
		setBackgroundColor(ColorConstants.green);
	else if (node.getType().equalsIgnoreCase(Enums.ServiceTypes.REQUIRED.name()))
		setBackgroundColor(ColorConstants.orange);
	else
		setBackgroundColor(ServiceNode.DEF_COLOR);
	TooltipFigure tooltip = new TooltipFigure();
	tooltip.setMessage("Service");
	setToolTip(tooltip);
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:19,代码来源:ServiceFigure.java

示例7: EdgeFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
public EdgeFigure() {
	tooltipFigure = new TooltipFigure();
	setToolTip(tooltipFigure);
	
	this.setLineWidth(this.getLineWidth() * 2);
	
	this.setTargetDecoration(new PolylineDecoration());

	label = new Label("e_"+ID.getId());
	label.setOpaque(true);
	label.setBackgroundColor(ColorConstants.buttonLightest);
	label.setBorder(new LineBorder());
 	add(label, new MidpointLocator(this, 0));
	
	guardedFigure = new GuardFigure();
	blockedFigure = new BlockedFigure();
	actionFigure = new ActionFigure ();
	add (actionFigure, new RelativeLocator(label,0.5,1.5));
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:20,代码来源:EdgeFigure.java

示例8: createFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
@Override
protected IFigure createFigure() {
	final LineLayout layout = new LineLayout();
	layout.setHorizontal(true);
	layout.setMajorAlignment(FlowLayout.ALIGN_TOPLEFT);
	layout.setMinorAlignment(FlowLayout.ALIGN_BOTTOMRIGHT);
	layout.setMinorSpacing(SPACING);
	layout.setMargin(MARGIN);

	FreeformLayer res = new FreeformLayer();
	final Label toolTip = new Label();
	toolTip.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
	toolTip.setBackgroundColor(ColorConstants.tooltipBackground);
	toolTip.setForegroundColor(ColorConstants.tooltipForeground);
	toolTip.setText(getModel().getTimelineWindow().getProvider().getTextAt(getModel().getBranch()));
	res.setToolTip(toolTip);
	res.setLayoutManager(layout);
	return res;
}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:20,代码来源:BranchEditPart.java

示例9: ComponentLabelFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
/**
 * Creates a new LabelFigure with a MarginBorder that is the given size and
 * a FlowPage containing a TextFlow with the style WORD_WRAP_SOFT.
 * 
 * @param borderSize
 *            the size of the MarginBorder
 */
public ComponentLabelFigure(int borderSize) {
	setBorder(new MarginBorder(borderSize));
	flowPage = new FlowPage();

	textFlow.setLayoutManager(new ParagraphTextLayout(textFlow,
			ParagraphTextLayout.WORD_WRAP_SOFT));
	

	flowPage.add(textFlow);
	flowPage.setHorizontalAligment(PositionConstants.CENTER);

	setLayoutManager(new StackLayout());
	add(flowPage);
	font = new Font( Display.getDefault(), "Arial", 9,
			SWT.NORMAL );
	setFont(font);
	setForegroundColor(ColorConstants.black);
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:ComponentLabelFigure.java

示例10: CommentBoxFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
/**
 * Creates a new CommentBoxFigure with a MarginBorder that is the given size and a FlowPage containing a TextFlow
 * with the style WORD_WRAP_SOFT.
 * 
 * @param borderSize
 *            the size of the MarginBorder
 */
public CommentBoxFigure(int borderSize) {
	setBorder(new MarginBorder(5));
	FlowPage flowPage = new FlowPage();

	textFlow = new TextFlow();

	textFlow.setLayoutManager(new ParagraphTextLayout(textFlow, ParagraphTextLayout.WORD_WRAP_SOFT));

	flowPage.add(textFlow);

	setLayoutManager(new StackLayout());
	add(flowPage);
	font = new Font(Display.getDefault(), "Arial", 9, SWT.NORMAL);
	setFont(font);
	setForegroundColor(ColorConstants.black);
	setOpaque(false);

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:26,代码来源:CommentBoxFigure.java

示例11: AbstractNodeFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
public AbstractNodeFigure(AbstractNodeElement node,Image icon){
	this.node=node;
	BorderLayout layout=new BorderLayout();
	this.setLayoutManager(layout);
	ImageFigure iconFigure=new ImageFigure(icon);
	this.add(iconFigure,BorderLayout.LEFT);
	this.label=new Label(this.node.getLabel());
	this.label.setForegroundColor(ColorConstants.black);
	this.add(this.label,BorderLayout.CENTER);
	this.setAntialias(SWT.ON);
	RGB rgb=Activator.getPreference().getBorderColor();
	this.setForegroundColor(new Color(null,rgb.red,rgb.green,rgb.blue));
	rgb=Activator.getPreference().getBackgroundColor();
	this.setBackgroundColor(new Color(null,rgb.red,rgb.green,rgb.blue));
	this.setLineWidth(2);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:17,代码来源:AbstractNodeFigure.java

示例12: TableFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
public TableFigure() {
	ToolbarLayout layout = new ToolbarLayout();
	setLayoutManager(layout);
	LineBorder lineBorder = new LineBorder(ColorConstants.lightGray, 2);
	setBorder(lineBorder);
	setOpaque(true);
	setBackgroundColor(ColorConstants.white);

	Font font = new Font(null, "宋体", 11, SWT.NORMAL);
	label.setFont(font);
	label.setBorder(new LineBorder(ColorConstants.lightGray));
	label.setIcon(Activator.getImage(Activator.IMAGE_TABLE_16));
	label.setOpaque(true);
	label.setBackgroundColor(ColorConstants.lightBlue);
	label.setForegroundColor(ColorConstants.black);
	add(label);
	add(columnFigure);
}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:19,代码来源:TableFigure.java

示例13: refreshFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
public void refreshFigure(BaseModel model) {
	Image imageBlank = Activator.getImage(Activator.IMAGE_BLANK);
	Column column = (Column) model;
	setForegroundColor(column.isPk() ? ColorConstants.red : ColorConstants.black);
	pkFigure.setImage(column.isPk() ? Activator.getImage(Activator.IMAGE_PK) : imageBlank);
	fkFigure.setImage(column.isFk() ? Activator.getImage(Activator.IMAGE_FK) : imageBlank);
	firstLabel.setText(" " + column.getLabel() + "/" + column.getName() + " ");

	String type = column.getType();
	DbDialect dbDialect = DbDialectManager.getDbDialect(column.getTable().getSchema().getCurrentDbType());
	ColumnType columnType = DbDialectManager.getColumnType(dbDialect, type);
	String length = column.getLength();
	String decimal = column.getDecimalLength();
	if (columnType.isLength() && columnType.isDecimal() && length.length() > 0 && decimal.length() > 0) {
		type += "(" + length + "," + decimal + ")";
	} else if (columnType.isLength() && length.length() > 0 && decimal.length() == 0) {
		type += "(" + length + ")";
	}
	lastLabel.setText(type);
	notNullFigure.setImage(column.isNotNull() ? Activator.getImage(Activator.IMAGE_NOTNULL) : imageBlank);
	uniqueFigure.setImage(column.isUnique() ? Activator.getImage(Activator.IMAGE_UNIQUE) : imageBlank);

}
 
开发者ID:bsteker,项目名称:bdf2,代码行数:24,代码来源:ColumnFigure.java

示例14: update

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
private void update() {
	removeAll();
	valid = model.isMatrix();
	if(valid) {
		Object[] array = (Object[]) model.getValues();
		for(Object line : array) {
			int len = Array.getLength(line);
			for(int i = 0; i < len; i++) {
				Object e = Array.get(line, i);
				Label label = new Label(e.toString()); // TODO array deepToString
				label.setForegroundColor(ColorConstants.black);
				add(label);
			}
		}
	}
	getLayoutManager().layout(this);
	repaint();
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:19,代码来源:MatrixWidget.java

示例15: paintFigure

import org.eclipse.draw2d.ColorConstants; //导入依赖的package包/类
@Override
protected void paintFigure(Graphics g) {
	super.paintFigure(g);
	final int LEG = 5;
	Rectangle r = getBounds();
	g.setLineWidth(1);
	g.setForegroundColor(valid ? ColorConstants.black : PandionJConstants.Colors.ERROR);
	
	g.drawLine(r.x, r.y, r.x, r.y+r.height-1);
	g.drawLine(r.x, r.y, r.x+LEG, r.y);
	g.drawLine(r.x, r.y+r.height-1, r.x+LEG, r.y+r.height-1);

	g.drawLine(r.x+r.width-1, r.y, r.x+r.width-1, r.y+r.height);
	g.drawLine(r.x+r.width-1, r.y, r.x+r.width-1-LEG, r.y);
	g.drawLine(r.x+r.width-1, r.y+r.height-1, r.x+r.width-1-LEG, r.y+r.height-1);

	if(!valid) {
		g.setForegroundColor(PandionJConstants.Colors.ERROR);
		String text = "Invalid matrix";
		int textWidth = FigureUtilities.getTextWidth(text, g.getFont());
		Point p = r.getLocation().translate(r.width/2 - textWidth/2, 5);
		g.drawText(text, p);
	}
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:25,代码来源:MatrixWidget.java


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