本文整理汇总了Java中org.eclipse.draw2d.XYLayout类的典型用法代码示例。如果您正苦于以下问题:Java XYLayout类的具体用法?Java XYLayout怎么用?Java XYLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XYLayout类属于org.eclipse.draw2d包,在下文中一共展示了XYLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createContents
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
private static Figure createContents() {
Figure contents = new Figure();
XYLayout layout = new XYLayout();
contents.setLayoutManager(layout);
Button button = new Button("Hello World");
layout.setConstraint(button, new Rectangle(0, 0, -1, -1));
contents.add(button);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionevent) {
setBrightness();
}
});
String path = "C:\\Users\\Public\\Pictures\\Sample Pictures\\Oryx Antelope.jpg";
image = new Image(Display.getDefault(), path);
imageFigure = new ImageFigure(image);
layout.setConstraint(imageFigure, new Rectangle(0, 30, -1, -1));
contents.add(imageFigure);
return contents;
}
开发者ID:kozake,项目名称:ermaster-k,代码行数:27,代码来源:ImageTest.java
示例2: XYContainerController
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
public XYContainerController ( final SymbolController controller, final XYContainer element, final BasicViewElementFactory factory ) throws Exception
{
this.figure = new Layer ();
this.figure.setOpaque ( false );
this.figure.setLayoutManager ( new XYLayout () );
for ( final XYChild child : element.getChildren () )
{
final Controller elementController = factory.create ( controller, child.getElement () );
final IFigure childFigure = elementController.getFigure ();
final Rectangle rect = factory.create ( child.getPosition (), child.getDimension () );
controller.addRawElement ( child.getName (), new XYChildController ( childFigure, rect ) );
this.figure.add ( childFigure, rect );
}
controller.addElement ( element, this );
}
开发者ID:eclipse,项目名称:neoscada,代码行数:20,代码来源:XYContainerController.java
示例3: DwHiddenChildrenIndicatorFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
public DwHiddenChildrenIndicatorFigure(DwFeatureWrapped feature, DwFeatureModelWrapped featureModel) {
DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme();
outlineWidth = theme.getLineWidth();
outlineColor = theme.getLineColor();
primaryColor = theme.getFeatureNameAreaSecondaryColor();
secondaryColor = theme.getFeatureNameAreaPrimaryColor();
this.feature = feature;
this.featureModel = featureModel;
setLayoutManager(new XYLayout());
label = new Label();
label.setForegroundColor(theme.getLineColor());
label.setFont(theme.getFeatureFont());
label.setLocation(new Point(0, (int)(HIDDEN_CHILDREN_INDICATOR_SIZE * 0.5)));
label.setSize(new Dimension(HIDDEN_CHILDREN_INDICATOR_SIZE, HIDDEN_CHILDREN_INDICATOR_SIZE));
add(label);
}
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:21,代码来源:DwHiddenChildrenIndicatorFigure.java
示例4: ORMNaturalTypeFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
/**
* The constructor of this class, where the constructor {@link ORMShapeFigure#ORMShapeFigure()}
* is called, the basic {@link ShadowRectangle} is initialized and the child figures for the name(
* {@link Label}) is added to the basic rectangle.
*
* */
public ORMNaturalTypeFigure() {
super();
rectangle = new ShadowRectangle();
ToolbarLayout layout = new ToolbarLayout();
layout.setSpacing(8); // set the initial heigth of the child figures
setLayoutManager(new XYLayout());
setBackgroundColor(ColorConstants.white);
rectangle.setAntialias(SWT.ON);
rectangle.setLayoutManager(layout);
rectangle.setOpaque(true);
setOpaque(true);
// add name figure
rectangle.add(getLabel());
add(rectangle);
}
开发者ID:leondart,项目名称:FRaMED,代码行数:29,代码来源:ORMNaturalTypeFigure.java
示例5: ORMGroupV1Figure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
/**
* The constructor of this class, where the constructor {@link ORMShapeFigure#ORMShapeFigure()}
* is called, the basic {@link ShadowRoundedRectangle} is initialized
* and the child figure for the name( {@link Label}) is added to the basic rectangle.
* */
public ORMGroupV1Figure() {
super();
rectangle = new ShadowRoundedRectangle();
ToolbarLayout layout = new ToolbarLayout();
layout.setSpacing(4); // set initial heigth of child figures
setLayoutManager(new XYLayout());
setBackgroundColor(ColorConstants.white);
rectangle.setAntialias(SWT.ON);
rectangle.setLayoutManager(layout);
rectangle.setOpaque(true);
// add name figure
rectangle.add(getLabel());
setOpaque(true);
add(rectangle);
}
开发者ID:leondart,项目名称:FRaMED,代码行数:28,代码来源:ORMGroupV1Figure.java
示例6: LifelineFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
public LifelineFigure(final IContourAttributes attributes)
{
isGutter = (attributes == null);
if (isGutter)
{
head = new Label("");
head.setOpaque(false);
head.setBorder(new MarginBorder(5));
}
else
{
head = new Label(attributes.getText(), attributes.getIcon());
final Label tooltip = new Label(attributes.getToolTipText(), attributes.getToolTipIcon());
head.setToolTip(tooltip);
head.setToolTip(tooltip);
head.setOpaque(true);
head.setBorder(LifelineFigure.HEAD_BORDER);
head.setIconAlignment(PositionConstants.BOTTOM);
head.setLabelAlignment(PositionConstants.LEFT);
head.setBackgroundColor(attributes.getLabelBackgroundColor());
}
setOpaque(false);
setLayoutManager(new XYLayout());
add(head, new Rectangle(0, 0, -1, -1));
}
开发者ID:UBPL,项目名称:jive,代码行数:26,代码来源:LifelineFigure.java
示例7: ExecutionOccurrenceFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
public ExecutionOccurrenceFigure(final IInitiatorEvent execution, final Color color)
{
super();
this.isGutter = execution instanceof ISystemStartEvent;
final int width = isGutter ? 0 : PreferencesPlugin.getDefault().getActivationWidth();
final int height = (int) execution.duration() * PreferencesPlugin.getDefault().eventHeight();
if (!isGutter)
{
final IContourAttributes attributes = createAttributes(execution, color);
setToolTip(new Label(attributes.getToolTipText(), attributes.getToolTipIcon()));
setBackgroundColor(color);
}
setBounds(new Rectangle(-1, -1, width, height));
setOpaque(false);
setOutline(false);
setLayoutManager(new XYLayout());
final Rectangle constraint = new Rectangle(width, height, -1, -1);
add(new Figure(), constraint); // Ensures the figure has the correct dimensions
}
开发者ID:UBPL,项目名称:jive,代码行数:20,代码来源:ExecutionOccurrenceFigure.java
示例8: createEditPolicies
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
protected void createEditPolicies( )
{
installEditPolicy( EditPolicy.COMPONENT_ROLE,
new ReportComponentEditPolicy( ) {
public boolean understandsRequest( Request request )
{
if ( RequestConstants.REQ_DIRECT_EDIT.equals( request.getType( ) )
|| RequestConstants.REQ_OPEN.equals( request.getType( ) )
|| ReportRequest.CREATE_ELEMENT.equals( request.getType( ) ) )
return true;
return super.understandsRequest( request );
}
} );
installEditPolicy( EditPolicy.CONTAINER_ROLE,
new ReportContainerEditPolicy( ) );
installEditPolicy( EditPolicy.LAYOUT_ROLE,
new CrosstabXYLayoutEditPolicy( (XYLayout) getContentPane( ).getLayoutManager( ) ) );
}
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:CrosstabTableEditPart.java
示例9: createEditPolicies
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
protected void createEditPolicies( )
{
installEditPolicy( EditPolicy.COMPONENT_ROLE,
new ReportComponentEditPolicy( ) {
public boolean understandsRequest( Request request )
{
if ( RequestConstants.REQ_DIRECT_EDIT.equals( request.getType( ) )
|| RequestConstants.REQ_OPEN.equals( request.getType( ) )
|| ReportRequest.CREATE_ELEMENT.equals( request.getType( ) ) )
return true;
return super.understandsRequest( request );
}
} );
installEditPolicy( EditPolicy.CONTAINER_ROLE,
new ReportContainerEditPolicy( ) );
// should add highlight policy
// installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new
// ContainerHighlightEditPolicy());
installEditPolicy( EditPolicy.LAYOUT_ROLE,
new TableXYLayoutEditPolicy( (XYLayout) getContentPane( ).getLayoutManager( ) ) );
}
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:TableEditPart.java
示例10: DepartmentNodeFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
public DepartmentNodeFigure() {
ToolbarLayout layout= new ToolbarLayout();
setLayoutManager(layout);
label = new Label();
label.setLabelAlignment(PositionConstants.LEFT);
label.setForegroundColor(ColorConstants.blue);
label.setIcon(Activator.getDefault().getImageRegistry().get(Activator.STATE_MACHINE));
label.setPreferredSize(700, 50);
label.setBorder(new MarginBorder(TOP_LEVEL_SPACE));
add(label);
Figure line = new RectangleFigure();
line.setBackgroundColor(ColorConstants.lightGray);
line.setForegroundColor(ColorConstants.lightGray);
line.setPreferredSize(700, 1);
add(line);
figure = new Figure();
figure.setLayoutManager(new XYLayout());
add(figure);
setBorder(new LineBorder(ColorConstants.lightGray, 1));
}
开发者ID:hejiehui,项目名称:xeda,代码行数:27,代码来源:DepartmentNodeFigure.java
示例11: GrlNodeFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的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
示例12: createFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
private Label createFigure(final String inTitle) {
setOpaque(true);
setLayoutManager(new XYLayout());
setBorder(new LineBorder(ColorConstants.black));
setBackgroundColor(GraphicalViewerCreator.BG_COLOR);
setSize(RelationsConstants.ITEM_WIDTH, RelationsConstants.ITEM_HEIGHT);
final Label outLabel = new Label(inTitle);
outLabel.setOpaque(true);
outLabel.setBackgroundColor(GraphicalViewerCreator.BG_COLOR);
outLabel.setLabelAlignment(PositionConstants.LEFT);
add(outLabel);
setConstraint(outLabel, new Rectangle(ICON_WIDTH, 0, LABEL_WIDTH, RelationsConstants.ITEM_HEIGHT));
final ImageFigure lImage = new ImageFigure(image);
add(lImage);
setConstraint(lImage, new Rectangle(-1, -1, ICON_WIDTH, ICON_WIDTH));
return outLabel;
}
开发者ID:aktion-hip,项目名称:relations,代码行数:20,代码来源:ItemFigure.java
示例13: setUpContents
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
protected void setUpContents()
{
contents =
new ScalableFrameFigure(GraphicsUtil.defaultWidgetColor);
contents.setScale(1.0);
contents.setLayoutManager(new XYLayout());
installFrames();
// Resize to preferred size.
DoubleSize s = getPreferredSize();
contents.setSize(PrecisionUtilities.round(s.width),
PrecisionUtilities.round(s.height));
}
开发者ID:cogtool,项目名称:cogtool,代码行数:17,代码来源:StructureViewUIModel.java
示例14: createLayout
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
protected void createLayout () {
setLayoutManager(new XYLayout());
setBackgroundColor(Activator.getStartVertexImageColor());
setOpaque(true);
this.setBorder(null);
ellipse = new Ellipse();
add(ellipse);
name = new Label("");
add(name);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:StartVertexFigure.java
示例15: createLayout
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
protected void createLayout() {
setLayoutManager(new XYLayout());
setBackgroundColor(Activator.getVertexImageColor());
setOpaque(true);
setBorder(null);
rectangle = new RoundedRectangle();
add(rectangle);
name = new Label("");
add(name);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:11,代码来源:VertexFigure.java
示例16: GraphFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
public GraphFigure() {
layout = new XYLayout();
setLayoutManager(layout);
name.setForegroundColor(ColorConstants.red);
add(name);
setConstraint(name, new Rectangle(5, 5, -1, -1));
setForegroundColor(ColorConstants.black);
setBorder(new LineBorder(2));
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:GraphFigure.java
示例17: createLayout
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
protected void createLayout () {
setLayoutManager(new XYLayout());
setBackgroundColor(Activator.getSharedVertexImageColor());
setOpaque(true);
this.setBorder(null);
rectangle = new RoundedRectangle();
add(rectangle);
name = new Label("");
add(name);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:SharedVertexFigure.java
示例18: createNodeFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
/**
* Creates figure for this edit part. Body of this method does not depend on settings in generation model so you may safely remove <i>generated</i> tag and
* modify it.
* @not-generated
*/
@Override
protected NodeFigure createNodeFigure() {
NodeFigure node = createNodePlate();
node.setLayoutManager(new XYLayout());
IFigure shape = createNodeShape();
node.add(shape);
contentPane = setupContentPane(shape);
return node;
}
开发者ID:polarsys,项目名称:time4sys,代码行数:15,代码来源:RotativeImageEditPart.java
示例19: main
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
public static void main(String[] args) {
Shell shell = new Shell(new Display());
shell.setSize(365, 280);
shell.setLayout(new GridLayout());
Figure root = new Figure();
root.setFont(shell.getFont());
XYLayout layout = new XYLayout();
root.setLayoutManager(layout);
Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
canvas.setBackground(ColorConstants.white);
canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
VarParser parser = new VarParser("src/pt/iscte/pandionj/tests/Test.java");
parser.run();
System.out.println(parser.toText());
createDiagram(root, parser);
LightweightSystem lws = new LightweightSystem(canvas);
lws.setContents(root);
Display display = shell.getDisplay();
shell.open();
while (!shell.isDisposed()) {
while (!display.readAndDispatch()) {
display.sleep();
}
}
}
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:33,代码来源:TestFigureParser.java
示例20: DwVersionFigure
import org.eclipse.draw2d.XYLayout; //导入依赖的package包/类
public DwVersionFigure(HyVersion version){
this.version = version;
setLayoutManager(new XYLayout());
createChildFigures();
update();
}
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:9,代码来源:DwVersionFigure.java
注:本文中的org.eclipse.draw2d.XYLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论