本文整理汇总了Java中org.eclipse.draw2d.text.TextFlow类的典型用法代码示例。如果您正苦于以下问题:Java TextFlow类的具体用法?Java TextFlow怎么用?Java TextFlow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TextFlow类属于org.eclipse.draw2d.text包,在下文中一共展示了TextFlow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CommentBoxFigure
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
/**
* Creates a new CommentBoxFigure with a MarginBorder that is the given size and a FlowPage containing a TextFlow
* with the style WORD_WRAP_SOFT.
*
* @param borderSize
* the size of the MarginBorder
*/
public CommentBoxFigure(int borderSize) {
setBorder(new MarginBorder(5));
FlowPage flowPage = new FlowPage();
textFlow = new TextFlow();
textFlow.setLayoutManager(new ParagraphTextLayout(textFlow, ParagraphTextLayout.WORD_WRAP_SOFT));
flowPage.add(textFlow);
setLayoutManager(new StackLayout());
add(flowPage);
font = new Font(Display.getDefault(), "Arial", 9, SWT.NORMAL);
setFont(font);
setForegroundColor(ColorConstants.black);
setOpaque(false);
}
示例2: createTextFlow
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
/**
* createTextFlow
*
* @return TextFlow
*/
public TextFlow createTextFlow() {
// FlowPage flowPage = new FlowPage();
// TextFlow 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);
setLayoutManager(new StackLayout());
add(flowPage);
return flow;
}
示例3: 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;
}
示例4: addAllPropertiesToFigure
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
/**
* @param fig
* @param object
*/
private void addAllPropertiesToFigure(AnnotationFigure fig, BTSObject object) {
// add name
String label = null;
if (object instanceof BTSCorpusObject)
{
label = passportConfigurationController.getAllPassportDataAsString((BTSCorpusObject) object);
}
else if (object instanceof BTSComment)
{
label = ((BTSComment)object).getComment();
}
if (label != null && !"".equals(label))
{
System.out.println(label);
TextFlow content = new TextFlow(label +"----------------------------------------------------");
FlowPage fp = new FlowPage();
fp.add(content);
fig.add(fp);
}
}
示例5: 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;
}
示例6: DetailedLabelFigure
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
/**
* Constructor
*/
public DetailedLabelFigure() {
image = new SelectableImageFigure();
image.setAlignment(PositionConstants.NORTH);
page = new FlowPage();
page.setBorder(PAGE_BORDER);
nameText = new TextFlow();
nameText.setLayoutManager(new ParagraphTextLayout(nameText,
ParagraphTextLayout.WORD_WRAP_TRUNCATE));
descText = new TextFlow();
descText.setLayoutManager(new ParagraphTextLayout(descText,
ParagraphTextLayout.WORD_WRAP_TRUNCATE));
page.add(nameText);
add(image);
add(page);
BorderLayout layout = new BorderLayout();
layout.setHorizontalSpacing(2);
layout.setVerticalSpacing(0);
setLayoutManager(layout);
}
示例7: TextAreaModelFigure
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
public TextAreaModelFigure()
{
this.setLayoutManager(new BorderLayout());
FlowPage page = new FlowPage();
label = new TextFlow();
ParagraphTextLayout layout = new ParagraphTextLayout(label,
ParagraphTextLayout.WORD_WRAP_SOFT);
label.setLayoutManager(layout);
label.setOpaque(false);
page.add(label);
this.add(page, BorderLayout.CENTER);
this.setBorder(new LineBorder());
this.setMinimumSize(new Dimension(RETURN_WIDTH * 2, RETURN_WIDTH * 2));
}
示例8: create
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
public void create() {
this.setBackgroundColor(ColorConstants.yellow);
this.setBorder(new MarginBorder(RETURN_WIDTH));
this.setLayoutManager(new BorderLayout());
FlowPage page = new FlowPage();
label = new TextFlow();
ParagraphTextLayout layout = new ParagraphTextLayout(label,
ParagraphTextLayout.WORD_WRAP_SOFT);
label.setLayoutManager(layout);
label.setOpaque(false);
page.add(label);
this.add(page, BorderLayout.CENTER);
}
示例9: GrlNodeFigure
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
/**
* Constructor of the node figure. Set the layout manager and the line width
*/
public GrlNodeFigure() {
super();
autoResize = true;
setAntialias(GeneralPreferencePage.getAntialiasingPref());
xylayout = new XYLayout();
this.setLayoutManager(xylayout);
setLineWidth(3);
initAnchor();
flowPage = new FlowPage();
// Center text in GRL nodes. Vertical centering not available...
flowPage.setHorizontalAligment(PositionConstants.CENTER);
textFlow = new TextFlow();
// Slightly larger font here used for GRL node labels.
textFlow.setFont(new Font(Display.getDefault(), new FontData("Tahoma", 9, SWT.NONE))); //$NON-NLS-1$
textFlow.setVisible(!shouldHideInnerText());
textFlow.setLayoutManager(new ParagraphTextLayout(textFlow, ParagraphTextLayout.WORD_WRAP_HARD));
flowPage.add(textFlow);
add(flowPage);
}
示例10: TooltipFigure
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
public TooltipFigure() {
setOpaque(true);
setBorder(TOOLTIP_BORDER);
message = new TextFlow();
message.setText("");
add(message);
}
示例11: TooltipFigure
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
public TooltipFigure() {
setOpaque(true);
setBorder(TOOLTIP_BORDER);
message = new TextFlow();
message.setText("");
add(message);
}
示例12: 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);
}
示例13: create
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
public void create() {
setBorder(new MarginBorder(RETURN_WIDTH));
setLayoutManager(new BorderLayout());
final FlowPage page = new FlowPage();
label = new TextFlow();
final ParagraphTextLayout layout = new ParagraphTextLayout(label, ParagraphTextLayout.WORD_WRAP_SOFT);
label.setLayoutManager(layout);
label.setOpaque(false);
page.add(label);
this.add(page, BorderLayout.CENTER);
}
示例14: create
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
public void create() {
this.setBorder(new MarginBorder(RETURN_WIDTH));
this.setLayoutManager(new BorderLayout());
FlowPage page = new FlowPage();
label = new TextFlow();
ParagraphTextLayout layout = new ParagraphTextLayout(label,
ParagraphTextLayout.WORD_WRAP_SOFT);
label.setLayoutManager(layout);
label.setOpaque(false);
page.add(label);
this.add(page, BorderLayout.CENTER);
}
示例15: create
import org.eclipse.draw2d.text.TextFlow; //导入依赖的package包/类
public void create() {
setBorder(new MarginBorder(RETURN_WIDTH));
setLayoutManager(new BorderLayout());
final FlowPage page = new FlowPage();
label = new TextFlow();
final ParagraphTextLayout layout = new ParagraphTextLayout(label, ParagraphTextLayout.WORD_WRAP_SOFT);
label.setLayoutManager(layout);
label.setOpaque(false);
page.add(label);
add(page, BorderLayout.CENTER);
}