本文整理汇总了Java中org.eclipse.draw2d.XYLayout类的典型用法代码示例。如果您正苦于以下问题:Java XYLayout类的具体用法?Java XYLayout怎么用?Java XYLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XYLayout类属于org.eclipse.draw2d包,在下文中一共展示了XYLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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 );
}
示例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);
}
示例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);
}
示例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);
}
示例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));
}
示例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
}
示例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( ) ) );
}
示例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( ) ) );
}
示例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));
}
示例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);
}
示例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;
}
示例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));
}
示例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);
}
示例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);
}