本文整理匯總了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));
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
});
}