• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ParagraphTextLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.eclipse.draw2d.text.ParagraphTextLayout的典型用法代码示例。如果您正苦于以下问题:Java ParagraphTextLayout类的具体用法?Java ParagraphTextLayout怎么用?Java ParagraphTextLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ParagraphTextLayout类属于org.eclipse.draw2d.text包,在下文中一共展示了ParagraphTextLayout类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: ComponentLabelFigure

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的package包/类
/**
 * Creates a new LabelFigure 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 ComponentLabelFigure(int borderSize) {
	setBorder(new MarginBorder(borderSize));
	flowPage = new FlowPage();

	textFlow.setLayoutManager(new ParagraphTextLayout(textFlow,
			ParagraphTextLayout.WORD_WRAP_SOFT));
	

	flowPage.add(textFlow);
	flowPage.setHorizontalAligment(PositionConstants.CENTER);

	setLayoutManager(new StackLayout());
	add(flowPage);
	font = new Font( Display.getDefault(), "Arial", 9,
			SWT.NORMAL );
	setFont(font);
	setForegroundColor(ColorConstants.black);
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:27,代码来源:ComponentLabelFigure.java


示例2: CommentBoxFigure

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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);

}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:26,代码来源:CommentBoxFigure.java


示例3: createTextFlow

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:26,代码来源:TextFigure.java


示例4: createTextFlow

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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;
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:27,代码来源:NoteFigure.java


示例5: DetailedLabelFigure

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:26,代码来源:DetailedLabelFigure.java


示例6: TextAreaModelFigure

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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));
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:17,代码来源:TextAreaModelFigure.java


示例7: create

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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);
}
 
开发者ID:winture,项目名称:wt-studio,代码行数:17,代码来源:NoteModelFigure.java


示例8: GrlNodeFigure

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:28,代码来源:GrlNodeFigure.java


示例9: create

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:15,代码来源:NoteFigure.java


示例10: create

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:16,代码来源:NoteFigure.java


示例11: create

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的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);
}
 
开发者ID:dbflute-session,项目名称:erflute,代码行数:12,代码来源:WalkerNoteFigure.java


示例12: LabelFigure

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的package包/类
/**
 * Creates a new LabelFigure with a MarginBorder that is the given size and
 * a FlowPage containing a TextFlow with the style WORD_WRAP_HARD.
 * 
 * @param borderSize
 *            the size of the MarginBorder
 */
public LabelFigure( int borderSize )
{
	setBorder( new MarginBorder( borderSize ) );

	label = new TextFlow( ) {

		public void postValidate( )
		{
			if ( DesignChoiceConstants.DISPLAY_BLOCK.equals( display )
					|| DesignChoiceConstants.DISPLAY_INLINE.equals( display ) )
			{
				List list = getFragments( );
				FlowBox box;

				int left = Integer.MAX_VALUE, top = left;
				int bottom = Integer.MIN_VALUE;

				for ( int i = 0; i < list.size( ); i++ )
				{
					box = (FlowBox) list.get( i );

					left = Math.min( left, box.getX( ) );
					top = Math.min( top, box.getBaseline( )
							- box.getAscent( ) );
					bottom = Math.max( bottom, box.getBaseline( )
							+ box.getDescent( ) );
				}
				int width = LabelFigure.this.getClientArea( ).width;
				if (isFixLayout)
				{
					int maxWidth = calcMaxSegment( )-getInsets( ).getWidth( );
					width = Math.max( width,  maxWidth);
				}
				
				
				setBounds( new Rectangle( left,
						top,
						width,
						Math.max( LabelFigure.this.getClientArea( ).height,
								bottom - top ) ) );

				if (isFixLayout( ))
				{
					Figure child = (Figure)getParent( );
					Rectangle rect = child.getBounds( );
					child.setBounds( new Rectangle(rect.x, rect.y, width, rect.height) );
				}
				
				list = getChildren( );
				for ( int i = 0; i < list.size( ); i++ )
				{
					( (FlowFigure) list.get( i ) ).postValidate( );
				}
			}
			else
			{
				super.postValidate( );
			}
		}
	};

	label.setLayoutManager( new ParagraphTextLayout( label,
			ParagraphTextLayout.WORD_WRAP_SOFT ) );

	flowPage = new FlowPage( );

	flowPage.add( label );

	setLayoutManager( new StackLayout( ) );

	add( flowPage );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:80,代码来源:LabelFigure.java


示例13: initializeFigure

import org.eclipse.draw2d.text.ParagraphTextLayout; //导入依赖的package包/类
private void initializeFigure() {
    xylayout = new XYLayout();
    this.setLayoutManager(xylayout);

    this.setBackgroundColor(ColorManager.WHITE);
    this.setSize(getDefaultDimension());
    this.setOpaque(true);
    this.setForegroundColor(ColorManager.BLACK);

    GroupBoxBorder border = new GroupBoxBorder();
    border.setLabel(kpiViewObject.getName() + " (" + kpiViewObject.getId() + ")"); //$NON-NLS-1$ //$NON-NLS-2$
    border.setTextColor(ColorManager.BLUE);
    this.setBorder(border);

    groupsFlowPage = new FlowPage();
    intElemsFlowPage = new FlowPage();
    kpiInformationFlowPage = new FlowPage();
    descFlowPage = new FlowPage();
    unitFlowPage = new FlowPage();
    targetValueFlowPage = new FlowPage();
    thresholdValueFlowPage = new FlowPage();
    worstValueFlowPage = new FlowPage();
    evalValueFlowPage = new FlowPage();

    groupsTextFlow = new TextFlow();
    intElemsTextFlow = new TextFlow();
    kpiInformationTextFlow = new TextFlow();
    descTextFlow = new TextFlow();
    unitTextFlow = new TextFlow();
    targetValueTextFlow = new TextFlow();
    thresholdValueTextFlow = new TextFlow();
    worstValueTextFlow = new TextFlow();
    evalValueTextFlow = new TextFlow();

    groupsTextFlow.setLayoutManager(new ParagraphTextLayout(groupsTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    intElemsTextFlow.setLayoutManager(new ParagraphTextLayout(intElemsTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    kpiInformationTextFlow.setLayoutManager(new ParagraphTextLayout(kpiInformationTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    descTextFlow.setLayoutManager(new ParagraphTextLayout(descTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    unitTextFlow.setLayoutManager(new ParagraphTextLayout(unitTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    targetValueTextFlow.setLayoutManager(new ParagraphTextLayout(targetValueTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    thresholdValueTextFlow.setLayoutManager(new ParagraphTextLayout(thresholdValueTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    worstValueTextFlow.setLayoutManager(new ParagraphTextLayout(worstValueTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));
    evalValueTextFlow.setLayoutManager(new ParagraphTextLayout(evalValueTextFlow, ParagraphTextLayout.WORD_WRAP_HARD));

    groupsFlowPage.add(groupsTextFlow);
    intElemsFlowPage.add(intElemsTextFlow);
    kpiInformationFlowPage.add(kpiInformationTextFlow);
    descFlowPage.add(descTextFlow);
    unitFlowPage.add(unitTextFlow);
    targetValueFlowPage.add(targetValueTextFlow);
    thresholdValueFlowPage.add(thresholdValueTextFlow);
    worstValueFlowPage.add(worstValueTextFlow);
    evalValueFlowPage.add(evalValueTextFlow);

    add(groupsFlowPage);
    add(intElemsFlowPage);
    add(kpiInformationFlowPage);
    add(descFlowPage);
    add(unitFlowPage);
    add(targetValueFlowPage);
    add(thresholdValueFlowPage);
    add(worstValueFlowPage);
    add(evalValueFlowPage);
}
 
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:65,代码来源:KPIViewObjectFigure.java



注:本文中的org.eclipse.draw2d.text.ParagraphTextLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CollectionUtils类代码示例发布时间:2022-05-22
下一篇:
Java IManaPool类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap