本文整理汇总了Java中org.eclipse.draw2d.StackLayout类的典型用法代码示例。如果您正苦于以下问题:Java StackLayout类的具体用法?Java StackLayout怎么用?Java StackLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StackLayout类属于org.eclipse.draw2d包,在下文中一共展示了StackLayout类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
protected void createContents() {
// Name Label
nameFigure = new SyntaxColoringLabel();
nameFigure.setAlignment(PositionConstants.CENTER);
this.add(nameFigure, GridDataFactory.fillDefaults().grab(true, false)
.getData());
// Text compartment
textCompartmentPane = new Figure();
textCompartmentPane.setLayoutManager(new StackLayout());
this.add(textCompartmentPane,
GridDataFactory.fillDefaults().grab(true, true).getData());
figureCompartmentPane = new Figure();
figureCompartmentPane.setLayoutManager(new StackLayout());
this.add(figureCompartmentPane,
GridDataFactory.fillDefaults().grab(true, true).getData());
}
示例2: StackContainerController
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
public StackContainerController ( final SymbolController controller, final StackContainer element, final BasicViewElementFactory factory ) throws Exception
{
this.figure = new Layer ();
this.figure.setOpaque ( false );
this.figure.setLayoutManager ( this.layout = new StackLayout () );
this.layout.setObserveVisibility ( true );
for ( final Primitive child : element.getChildren () )
{
final Controller elementController = factory.create ( controller, child );
final IFigure childFigure = elementController.getFigure ();
controller.addRawElement ( child.getName (), elementController );
this.figure.add ( childFigure );
}
controller.addElement ( element, this );
}
示例3: ComponentLabelFigure
import org.eclipse.draw2d.StackLayout; //导入依赖的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);
}
示例4: CommentBoxFigure
import org.eclipse.draw2d.StackLayout; //导入依赖的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);
}
示例5: createTextFlow
import org.eclipse.draw2d.StackLayout; //导入依赖的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;
}
示例6: createTextFlow
import org.eclipse.draw2d.StackLayout; //导入依赖的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;
}
示例7: createNodeFigure
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
@Override
protected NodeFigure createNodeFigure() {
NodeFigure figure = new DefaultSizeNodeFigure(getDefaultSize()) {
@Override
// StateFigure is drawed smaller (Blurshadow size)
public Rectangle getHandleBounds() {
Insets insets = new Insets(0, 0, StateFigure.BLUR_SHADOW_WIDTH, StateFigure.BLUR_SHADOW_WIDTH);
return new Rectangle(getBounds().x + insets.left, getBounds().y + insets.top,
getBounds().width - (insets.right + insets.left),
getBounds().height - (insets.bottom + insets.top));
}
};
figure.setLayoutManager(new StackLayout());
figure.setMinimumSize(getDefaultSize());
figure.add(createPrimaryShape());
return figure;
}
示例8: createNodeFigure
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
@Override
protected NodeFigure createNodeFigure() {
final NodeFigure figure = new NodeFigure() {
@Override
public PointList getPolygonPoints() {
PointList points = new PointList(5);
Rectangle handleBounds = getHandleBounds();
points.addPoint(handleBounds.x + (handleBounds.width / 2), handleBounds.y);
points.addPoint(handleBounds.x + handleBounds.width, handleBounds.y + (handleBounds.height / 2));
points.addPoint(handleBounds.x + (handleBounds.width / 2), handleBounds.y + handleBounds.height);
points.addPoint(handleBounds.x, handleBounds.y + handleBounds.height / 2);
points.addPoint(handleBounds.x + (handleBounds.width / 2), handleBounds.y);
return points;
}
};
figure.setLayoutManager(new StackLayout());
figure.add(createPrimaryShape());
figure.setBackgroundColor(org.eclipse.draw2d.ColorConstants.white);
figure.setForegroundColor(org.eclipse.draw2d.ColorConstants.black);
figure.setMinimumSize(getDefaultSize());
return figure;
}
示例9: ChartController
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
public ChartController ( final SymbolController symbolController, final ResourceManager resourceManager, final ChartView view, final SymbolLoader symbolLoader, final FactoryContext context )
{
super ( symbolController, resourceManager );
this.context = context;
this.symbolLoader = symbolLoader;
this.wrapperFigure = new Figure () {
@Override
public void addNotify ()
{
super.addNotify ();
start ();
}
@Override
public void removeNotify ()
{
stop ();
super.removeNotify ();
}
};
this.wrapperFigure.setOpaque ( false );
this.figure = new ChartFigure ( Display.getCurrent (), resourceManager );
this.wrapperFigure.setLayoutManager ( new StackLayout () );
this.wrapperFigure.add ( this.figure );
this.errorFigure = new ErrorFigure ();
symbolController.addElement ( view, this );
applyCommon ( view );
}
示例10: FigureContainerController
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
public FigureContainerController ( final SymbolController controller, final FigureContainer element, final ResourceManager manager, final BasicViewElementFactory viewElementFactory ) throws Exception
{
super ( controller, manager );
this.figure = new Figure () {
@Override
public void addNotify ()
{
super.addNotify ();
start ();
}
@Override
public void removeNotify ()
{
stop ();
super.removeNotify ();
}
};
if ( element.getSize () != null )
{
final PrecisionRectangle rect = new PrecisionRectangle ();
rect.setPreciseSize ( element.getSize ().getWidth (), element.getSize ().getHeight () );
this.figure.setBounds ( rect );
}
controller.addElement ( element, this );
this.figure.setLayoutManager ( new StackLayout () );
this.figure.add ( viewElementFactory.create ( controller, element.getContent () ).getFigure () );
applyCommon ( element );
}
示例11: PickerColumnFigure
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
public PickerColumnFigure() {
pane = new FreeformLayer();
pane.setLayoutManager(new FreeformLayout());
setLayoutManager(new StackLayout());
container = new TitaniumFigure();
container.setLayoutManager(new FreeformLayout());
pane.add(container);
scrollpane = new ScrollPane();
scrollpane.setHorizontalScrollBarVisibility(ScrollPane.NEVER);
scrollpane.setVerticalScrollBarVisibility(ScrollPane.NEVER);
scrollpane.setViewport(new FreeformViewport());
scrollpane.setContents(pane);
add(scrollpane);
}
示例12: ScrollViewFigure
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
public ScrollViewFigure() {
pane = new FreeformLayer();
pane.setLayoutManager(new FreeformLayout());
setLayoutManager(new StackLayout());
container = new TitaniumFigure();
container.setLayoutManager(new FreeformLayout());
pane.add(container);
scrollpane = new ScrollPane();
scrollpane.setScrollBarVisibility(ScrollPane.AUTOMATIC);
scrollpane.setViewport(new FreeformViewport());
scrollpane.setContents(pane);
add(scrollpane);
}
示例13: PackageFigure
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
/**
* PackageFigure
* @param isDangling
*/
public PackageFigure(boolean isDangling) {
setDangling(isDangling);
setLayoutManager(new StackLayout() {
@SuppressWarnings("unchecked")
public void layout(IFigure figure) {
Rectangle rectangle = figure.getClientArea();
List children = figure.getChildren();
IFigure child;
org.eclipse.draw2d.geometry.Dimension dimension;
int sizeValue = children.size();
for (int i = 0; i < children.size(); i++) {
if (!(children.get(i) instanceof RectangleFigure)) {
child = (IFigure) children.get(i);
dimension = child.getPreferredSize(rectangle.width, rectangle.height);
dimension.width = Math.min(dimension.width, rectangle.width);
dimension.height = Math.min(dimension.height, rectangle.height);
Rectangle childRect = new Rectangle(rectangle.x + (rectangle.width - dimension.width) / 2,
rectangle.y + (rectangle.height - dimension.height) / 2 + (int) (i * dimension.height)
- (sizeValue * 3),
dimension.width,
dimension.height);
child.setBounds(childRect);
}
}
}
});
setOpaque(true);
}
示例14: StickMan
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
/**
* StickMan
* @param is3D
* @param backgroundColor
* @param foregroundColor
*/
public StickMan(boolean is3D, Color backgroundColor, Color foregroundColor) {
super(is3D, backgroundColor, foregroundColor);
setKeepingProportions(true);
setW2HRatio(BASE_W / BASE_H);
setLayoutManager(new StackLayout());
}
示例15: CollaborationFigure
import org.eclipse.draw2d.StackLayout; //导入依赖的package包/类
/**
* CollaborationFigure
*
* @param isDangling
*/
public CollaborationFigure(boolean isDangling) {
this.isDangling = isDangling;
this.setLineStyle(SWT.BORDER_DASH);
setLayoutManager(new StackLayout() {
@SuppressWarnings("unchecked")
public void layout(IFigure figure) {
Rectangle rectangle = figure.getClientArea();
List children = figure.getChildren();
IFigure child;
org.eclipse.draw2d.geometry.Dimension dimension;
for (int i = 0; i < children.size(); i++) {
child = (IFigure) children.get(i);
dimension = child.getPreferredSize(rectangle.width, rectangle.height);
dimension.width = Math.min(dimension.width, rectangle.width);
dimension.height = Math.min(dimension.height, rectangle.height);
Rectangle childRect = new Rectangle(rectangle.x + (rectangle.width - dimension.width) / 2,
rectangle.y + (rectangle.height - dimension.height) / 2 + (int) (i * dimension.height)
- (10 * (children.size() - 1)),
dimension.width,
dimension.height);
child.setBounds(childRect);
}
}
});
setOpaque(true);
}