當前位置: 首頁>>代碼示例>>Java>>正文


Java Label.setBackgroundColor方法代碼示例

本文整理匯總了Java中org.eclipse.draw2d.Label.setBackgroundColor方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setBackgroundColor方法的具體用法?Java Label.setBackgroundColor怎麽用?Java Label.setBackgroundColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.draw2d.Label的用法示例。


在下文中一共展示了Label.setBackgroundColor方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: EdgeFigure

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

示例2: 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

示例3: createFigure

import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
@Override
public IFigure createFigure(IValueModel v) {
	label = new Label(""); 
	label.setOpaque(true);
	label.setBackgroundColor(ColorConstants.white);
	label.setBorder(new LineBorder(1));
	label.setFont(PandionJUI.getFont(14));
	update(v, Integer.parseInt(v.getCurrentValue()));
	v.registerDisplayObserver((value) -> {
		update(v, Integer.parseInt(v.getCurrentValue()));
	});
	return label;
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:14,代碼來源:BinaryWidget.java

示例4: createFigure

import org.eclipse.draw2d.Label; //導入方法依賴的package包/類
@Override
public IFigure createFigure(IObjectModel e) {
	int value = e.getInt("value");
	int r = (value >> 16) & 0xFF;
	int g = (value >> 8) & 0xFF;
	int b = (value >> 0) & 0xFF;
	Label label = new Label(r + ", " + g + ", " + b);
	label.setOpaque(true);
	label.setBackgroundColor(PandionJUI.getColor(r, g, b));
	return label;
}
 
開發者ID:andre-santos-pt,項目名稱:pandionj,代碼行數:12,代碼來源:ColorAwtWidget.java

示例5: 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.setBackgroundColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。