本文整理匯總了Java中org.eclipse.draw2d.Label.setFont方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setFont方法的具體用法?Java Label.setFont怎麽用?Java Label.setFont使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.draw2d.Label
的用法示例。
在下文中一共展示了Label.setFont方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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;
}
示例2: 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;
}
示例3: 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);
}
}
});
}