本文整理汇总了Java中org.eclipse.draw2d.text.TextFlow.setText方法的典型用法代码示例。如果您正苦于以下问题:Java TextFlow.setText方法的具体用法?Java TextFlow.setText怎么用?Java TextFlow.setText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.text.TextFlow
的用法示例。
在下文中一共展示了TextFlow.setText方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createTextFlow
import org.eclipse.draw2d.text.TextFlow; //导入方法依赖的package包/类
/**
* createTextFlow
*
* @return TextFlow
*/
public TextFlow createTextFlow() {
flowPage = new FlowPage();
flow = new TextFlow();
flow.setLayoutManager(new ParagraphTextLayout(flow, ParagraphTextLayout.WORD_WRAP_SOFT));
flow.setForegroundColor(new Color(null, 0, 0, 0));
if (getName() != null)
flow.setText(getName());
else
flow.setText(""); //$NON-NLS-1$
flowPage.add(flow);
flowPage.setHorizontalAligment(PositionConstants.LEFT);
flowPage.setBorder(new MarginBorder(new Insets(15, 7, 7, 7)));
setLayoutManager(new StackLayout());
add(flowPage);
return flow;
}
示例2: createToolTip
import org.eclipse.draw2d.text.TextFlow; //导入方法依赖的package包/类
/**
* Create the tool tip for this palette edit part.
*
* @return the tool tip figure.
*/
protected IFigure createToolTip() {
String message = getToolTipText();
if (message == null || message.length() == 0)
return null;
FlowPage fp = new FlowPage() {
public Dimension getPreferredSize(int w, int h) {
Dimension d = super.getPreferredSize(-1, -1);
if (d.width > 150)
d = super.getPreferredSize(150, -1);
return d;
}
};
fp.setOpaque(true);
fp.setBorder(TOOLTIP_BORDER);
TextFlow tf = new TextFlow();
tf.setText(message);
fp.add(tf);
return fp;
}
示例3: TooltipFigure
import org.eclipse.draw2d.text.TextFlow; //导入方法依赖的package包/类
public TooltipFigure() {
setOpaque(true);
setBorder(TOOLTIP_BORDER);
message = new TextFlow();
message.setText("");
add(message);
}
示例4: TooltipFigure
import org.eclipse.draw2d.text.TextFlow; //导入方法依赖的package包/类
public TooltipFigure() {
setOpaque(true);
setBorder(TOOLTIP_BORDER);
message = new TextFlow();
message.setText("");
add(message);
}
示例5: DwTooltipFigure
import org.eclipse.draw2d.text.TextFlow; //导入方法依赖的package包/类
public DwTooltipFigure() {
setOpaque(true);
setBackgroundColor(ColorConstants.white);
setBorder( new CompoundBorder(
new LineBorder( ColorConstants.black, 2 ),
new MarginBorder( 12 )));
message = new TextFlow();
message.setText("");
add(message);
}
示例6: createFigure
import org.eclipse.draw2d.text.TextFlow; //导入方法依赖的package包/类
/**
* An ellipse that fills 2/3 of the area.
*
* @see seg.jUCMNav.figures.PathNodeFigure#createFigure()
*/
protected void createFigure() {
int width = preferredSize.width;
int height = preferredSize.height;
ellipse = new Ellipse();
ellipse.setBounds(new Rectangle(13, 13, 16, 16));
ellipse.setBackgroundColor(ColorManager.LINE);
ellipse.setAntialias(GeneralPreferencePage.getAntialiasingPref());
add(ellipse);
// create the text inside the main figure
flowPage = new FlowPage();
stubTypeText = new TextFlow();
stubTypeText.setLayoutManager(new SimpleTextLayout(stubTypeText));
// TODO CONCERNS: should use default font?
stubTypeText.setFont(new Font(null, "Verdana", 12, SWT.BOLD)); //$NON-NLS-1$
stubTypeText.setText("F"); //$NON-NLS-1$
stubTypeText.setForegroundColor(ColorManager.WHITE);
flowPage.add(stubTypeText);
// TODO CONCERNS: depends on font size!
flowPage.setBounds(new Rectangle(16, 12, 20, 20));
flowPage.setVisible(false);
add(flowPage);
// The lightning for an abort failure point
PointList pts = new PointList();
pts.addPoint(23, 27);
pts.addPoint(27, 33);
pts.addPoint(20, 32);
pts.addPoint(28, 42);
pts.addPoint(28, 37);
pts.addPoint(28, 42);
pts.addPoint(23, 41);
lightning = new Polyline();
lightning.setLineWidth(2);
lightning.setAntialias(GeneralPreferencePage.getAntialiasingPref());
lightning.setPoints(pts);
lightning.setVisible(false);
add(lightning);
bar = new Polyline();
bar.addPoint(new Point(15, 15));
bar.addPoint(new Point(27, 27));
bar.setLineWidth(3);
bar.setVisible(false);
bar.setForegroundColor(ColorManager.WHITE);
add(bar);
}