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


Java Label.setForegroundColor方法代码示例

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


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

示例1: createFigure

import org.eclipse.draw2d.Label; //导入方法依赖的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

示例2: update

import org.eclipse.draw2d.Label; //导入方法依赖的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

示例3: MethodWidget

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
MethodWidget(IMethod method) {
	setLayoutManager(new FlowLayout());
	button = new Button(shortSig(method));
	button.setToolTip(new Label(longSig(method)));
	button.setForegroundColor(ColorConstants.black);
	FontManager.setFont(button, PandionJConstants.BUTTON_FONT_SIZE);
	button.setEnabled(methodsEnabled);
	add(button);
	resultLabel = new Label();
	resultLabel.setForegroundColor(ColorConstants.black);
	add(resultLabel);
	button.addActionListener(new ActionListener() {
		public void actionPerformed(ActionEvent event) {
			invoke(model, method, resultLabel);
		}
	});
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:18,代码来源:ObjectFigure.java

示例4: ReferenceFigure

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
public ReferenceFigure(IReferenceModel model) {
	super(model, false);
	GridLayout layout = new GridLayout(2, false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.horizontalSpacing = 3;
	layout.verticalSpacing = 0;
	setLayoutManager(layout);
	label = new Label(model.getName());
	label.setForegroundColor(ColorConstants.black);
	FontManager.setFont(label, PandionJConstants.VAR_FONT_SIZE);
	
	String tooltip = Utils.getTooltip(model); 

	Collection<String> tags = model.getTags();
	if(!tags.isEmpty())
		tooltip += "\ntags: " + String.join(", ", tags);
		
	label.setToolTip(new Label(tooltip));

	add(label);
	refLabel = new ReferenceLabel(model);
	add(refLabel);
	layout.setConstraint(refLabel, new GridData(PandionJConstants.POSITION_WIDTH, PandionJConstants.POSITION_WIDTH));
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:26,代码来源:ReferenceFigure.java

示例5: createFigure

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
@Override
		public IFigure createFigure(IObjectModel e) {
			Label label = new Label();
			label.setForegroundColor(PandionJConstants.Colors.OBJECT_HEADER_FONT);
			FontManager.setFont(label, PandionJConstants.OBJECT_HEADER_FONT_SIZE);
			IType type = e.getType();
			if(type != null) {
				IMethod method = type.getMethod("toString", new String[0]);
				if(!method.exists()) {
					label.setText(":" + type.getElementName());
					return label;
				}
			}
			invokeToString(e, label);
			label.setToolTip(new Label("returned by toString()"));
			e.getRuntimeModel().registerDisplayObserver((event) -> {
				if(event.type == IRuntimeModel.Event.Type.STEP ||event.type == IRuntimeModel.Event.Type.EVALUATION) {
					invokeToString(e, label);
//					label.setText(e.getStringValue());
				}
			});
			return label;
		}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:24,代码来源:ITypeWidgetExtension.java

示例6: update

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
void update(int r, int g, int b) {
	boolean valid = 
			r >= 0 && r <= 255 && 
			g >= 0 && g <= 255 && 
			b >= 0 && b <= 255;
	colorFig.setOpaque(valid);
	colorFig.setBackgroundColor(valid ? PandionJUI.getColor(r, g, b) : null);
	colorFig.setBorder(new LineBorder(valid ? ColorConstants.black : PandionJConstants.Colors.ERROR));
	if(valid)
		colorFig.setToolTip(null);
	else {
		Label label = new Label("Invalid RGB values");
		label.setForegroundColor(PandionJConstants.Colors.ERROR);
		colorFig.setToolTip(label);
	}
	text.setText(r + ", " + g + ", " + b);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:18,代码来源:ColorRGBArrayWidget.java

示例7: createFigure

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
@Override
public IFigure createFigure(IObjectModel e) {
	Label label = new Label("\"" + e.getStringValue() + "\"");
	FontManager.setFont(label, PandionJConstants.VALUE_FONT_SIZE);
	label.setForegroundColor(ColorConstants.black);
	
	return label;
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:9,代码来源:ToStringWidget.java

示例8: createFigure

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
@Override
public IFigure createFigure(IObjectModel e) {
	Label label = new Label("\"" + e.getStringValue() + "\"");
	FontManager.setFont(label, PandionJConstants.VALUE_FONT_SIZE);
	label.setForegroundColor(ColorConstants.black);
	return label;
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:8,代码来源:StringWidget.java

示例9: updateLook

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
private void updateLook(IStackFrameModel model, boolean termination) {
	if(!invisible) {
		if(model.isObsolete() || termination) {
			setBackgroundColor(PandionJConstants.Colors.OBSOLETE);
			setBorder(new LineBorder(model.exceptionOccurred() ?  PandionJConstants.Colors.ERROR : ColorConstants.lightGray, 2, SWT.LINE_DASH));
		}
		else if(model.exceptionOccurred()) {
			setBackgroundColor(PandionJConstants.Colors.INST_POINTER);
			setBorder(new LineBorder(PandionJConstants.Colors.ERROR, PandionJConstants.STACKFRAME_LINE_WIDTH, SWT.LINE_DASH));


			if(model.getExceptionType().equals(NullPointerException.class.getName()))
				paintNullRefs();

			Label labelExc = new Label(PandionJConstants.Messages.prettyException(model.getExceptionType()));
			labelExc.setForegroundColor(PandionJConstants.Colors.ERROR);
			setToolTip(labelExc);
		}
		else if(model.isExecutionFrame())
			setBackgroundColor(PandionJConstants.Colors.INST_POINTER);
		else
			setBackgroundColor(PandionJConstants.Colors.VIEW_BACKGROUND);
	}
	layout.layout(this);
	if(label != null && frame.getSourceFile() != null && frame.getLineNumber() != -1) 
		label.setToolTip(new Label(frame.getSourceFile().getName() + " (line " + frame.getLineNumber() +")"));
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:28,代码来源:StackFrameFigure.java

示例10: ValueExtensionFigure

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
public ValueExtensionFigure(IValueModel model, IFigure figure) {
	super(model, false);
	
	layout = new GridLayout(1, false);
	layout.verticalSpacing = 0;
	layout.horizontalSpacing = 0;
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	
	setLayoutManager(layout);

	Figure comp = new Figure();
	GridLayout compLayout = new GridLayout(2,false);
	compLayout.marginHeight = 0;
	compLayout.marginWidth = 0;
	compLayout.horizontalSpacing = 3;
	compLayout.verticalSpacing = 0;
	
	comp.setLayoutManager(compLayout);
	
	String tooltip = Utils.getTooltip(model); 
	
	Label nameLabel = new Label(model.getName());
	nameLabel.setForegroundColor(ColorConstants.black);
	FontManager.setFont(nameLabel, PandionJConstants.VAR_FONT_SIZE);
	
	nameLabel.setToolTip(new Label(tooltip));
	comp.add(nameLabel);
	comp.add(figure);
	add(comp);
	
	layout.setConstraint(comp, new GridData(SWT.RIGHT, SWT.DEFAULT, true, false));
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:34,代码来源:ValueExtensionFigure.java

示例11: Position

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
public Position(Integer index) {
	int width = POSITION_WIDTH;
	if(model.isDecimal())
		width *= 2;

	GridData layoutData = new GridData(width, POSITION_WIDTH+20);
	arrayLayout.setConstraint(this, layoutData);
	GridLayout layout = Constants.getOneColGridLayout();
	setLayoutManager(layout);

	if(index != null) {
		IValueModel m = model.getElementModel(index); 
		valueLabel = new ValueLabel(m);
		layout.setConstraint(valueLabel, new GridData(width, POSITION_WIDTH));
		add(valueLabel);
	}else {
		Label emptyLabel = new Label("...");
		FontManager.setFont(this, Constants.VALUE_FONT_SIZE);
		IValueModel measure = model.getElementModel(model.getLength() - 1);
		setSize(measure.isDecimal() || measure.isBoolean() ? Constants.POSITION_WIDTH*2 : Constants.POSITION_WIDTH, Constants.POSITION_WIDTH);
		layout.setConstraint(emptyLabel, new GridData(width, POSITION_WIDTH));
		add(emptyLabel);
	}

	indexLabel = new Label(index == null ? "..." : Integer.toString(index));
	FontManager.setFont(indexLabel, INDEX_FONT_SIZE);
	indexLabel.setLabelAlignment(SWT.CENTER);
	indexLabel.setForegroundColor(ColorConstants.gray);
	layout.setConstraint(indexLabel, layoutCenter);
	add(indexLabel);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:32,代码来源:ArrayPrimitiveFigure.java

示例12: ColorFigure

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
ColorFigure() {
	setLayoutManager(new GridLayout(2, false));
	colorFig = new Figure();
	colorFig.setSize(PandionJConstants.POSITION_WIDTH, PandionJConstants.POSITION_WIDTH);
	add(colorFig);
	text = new Label();
	text.setForegroundColor(ColorConstants.black);
	add(text);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:10,代码来源:ColorRGBArrayWidget.java

示例13: PossibleStepFigure

import org.eclipse.draw2d.Label; //导入方法依赖的package包/类
/**
 * Constructor.
 */
public PossibleStepFigure() {
	final LineLayout layout = new LineLayout();
	layout.setHorizontal(true);
	layout.setMajorAlignment(FlowLayout.ALIGN_TOPLEFT);
	layout.setMinorAlignment(FlowLayout.ALIGN_CENTER);
	layout.setMinorSpacing(SPACING);

	setLayoutManager(layout);
	toolTip = new Label();
	toolTip.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
	toolTip.setBackgroundColor(ColorConstants.tooltipBackground);
	toolTip.setForegroundColor(ColorConstants.tooltipForeground);
	ellipse = createEllipse();
	add(ellipse);
	label = new Label();
	if (withLabel) {
		add(label);
		hasLabel = true;
	} else {
		ellipse.setToolTip(toolTip);
		hasLabel = false;
	}
	addMouseListener(new MouseListener.Stub() {

		/**
		 * {@inheritDoc}
		 * 
		 * @see org.eclipse.draw2d.MouseListener.Stub#mouseReleased(org.eclipse.draw2d.MouseEvent)
		 */
		@Override
		public void mousePressed(MouseEvent me) {
			if (me.button == 1) {
				final EditPartViewer viewer = getViewer();
				viewer.getSelectionManager().deselectAll();
				viewer.getSelectionManager().appendSelection(PossibleStepEditPart.this);
			}
		}

	});

}
 
开发者ID:eclipse,项目名称:gemoc-studio,代码行数:45,代码来源:PossibleStepEditPart.java


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