本文整理汇总了Java中org.eclipse.draw2d.IFigure类的典型用法代码示例。如果您正苦于以下问题:Java IFigure类的具体用法?Java IFigure怎么用?Java IFigure使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IFigure类属于org.eclipse.draw2d包,在下文中一共展示了IFigure类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: XYContainerController
import org.eclipse.draw2d.IFigure; //导入依赖的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 );
}
示例2: handleIllustration
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
private void handleIllustration(GraphNode source, IFigure sourceFig, GraphNode target, IFigure targetFig, ReferenceModel reference) {
if(source.getData() instanceof ReferenceModel &&
target.getData() instanceof ArrayModel &&
targetFig instanceof ArrayPrimitiveFigure2) {
ReferenceModel r = (ReferenceModel) source.getData();
if(r.hasIndexVars()) {
IllustrationBorder b = new IllustrationBorder(r, (ArrayPrimitiveFigure2) targetFig);
targetFig.setBorder(b);
}
}
else if(source.getData() instanceof ArrayReferenceModel &&
target.getData() instanceof ArrayPrimitiveModel) {
ArrayReferenceModel array = (ArrayReferenceModel) source.getData();
targetFig.setBorder(new IllustrationBorder(reference, (ArrayPrimitiveFigure2) targetFig));
}
}
示例3: BorderContainerController
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
public BorderContainerController ( final SymbolController controller, final BorderContainer element, final BasicViewElementFactory factory ) throws Exception
{
this.figure = new Layer ();
this.figure.setOpaque ( false );
this.figure.setLayoutManager ( this.layout = new BorderLayout () );
this.layout.setHorizontalSpacing ( element.getHorizontalSpacing () );
this.layout.setVerticalSpacing ( element.getVerticalSpacing () );
for ( final BorderChild child : element.getChildren () )
{
final Controller elementController = factory.create ( controller, child.getElement () );
final IFigure childFigure = elementController.getFigure ();
controller.addRawElement ( child.getName (), new BorderChildController ( childFigure ) );
this.figure.add ( childFigure, convert ( child.getAlignment () ) );
}
controller.addElement ( element, this );
}
示例4: createFigure
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
@Override
protected IFigure createFigure() {
ComponentFigure componentFigure = ((ComponentEditPart) getParent()).getComponentFigure();
Component component = ((ComponentEditPart) getParent()).getCastedModel();
PortFigure port = null;
Color borderColor = CustomColorRegistry.INSTANCE.getColorFromRegistry( ELTColorConstants.DARK_GREY_RGB[0], ELTColorConstants.DARK_GREY_RGB[1], ELTColorConstants.DARK_GREY_RGB[2]);
Point portPoint = null;
int height = component.getSize().height-componentFigure.getComponentLabelMargin();
int width = component.getSize().width;
int margin = componentFigure.getComponentLabelMargin();
port = new PortFigure(borderColor, getCastedModel().getSequence(), getCastedModel().getNumberOfPortsOfThisType(),getCastedModel().getTerminal(),
getCastedModel().getLabelOfPort(), getCastedModel().getPortAlignment());
portPoint = getPortLocation(getCastedModel().getNumberOfPortsOfThisType(), getCastedModel().getPortType(),
getCastedModel().getSequence(), height, width, margin, getCastedModel().getPortAlignment());
Point tmpPoint = new Point(componentFigure.getLocation().x+portPoint.x , componentFigure.getLocation().y+portPoint.y);
port.setLocation(tmpPoint);
componentFigure.setAnchors(port.getAnchor());
return port;
}
示例5: createFigure
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
@Override
public IFigure createFigure(IObjectModel e) {
Label label = new Label();
label.setForegroundColor(PandionJConstants.Colors.OBJECT_HEADER_FONT);
FontManager.setFont(label, PandionJConstants.OBJECT_HEADER_FONT_SIZE);
IType type = e.getType();
if(type != null) {
IMethod method = type.getMethod("toString", new String[0]);
if(!method.exists()) {
label.setText(":" + type.getElementName());
return label;
}
}
invokeToString(e, label);
label.setToolTip(new Label("returned by toString()"));
e.getRuntimeModel().registerDisplayObserver((event) -> {
if(event.type == IRuntimeModel.Event.Type.STEP ||event.type == IRuntimeModel.Event.Type.EVALUATION) {
invokeToString(e, label);
// label.setText(e.getStringValue());
}
});
return label;
}
示例6: createSourceValue
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
private IFigure createSourceValue ()
{
this.sourceRect = new RoundedRectangle ();
this.sourceRect.setLayoutManager ( new BorderLayout () );
this.sourceRect.setBackgroundColor ( ColorConstants.lightGray );
this.sourceRect.setForegroundColor ( ColorConstants.black );
this.sourceRect.setBorder ( new MarginBorder ( 10 ) );
this.sourceRect.add ( this.sourceLabel = new Label (), BorderLayout.CENTER );
return this.sourceRect;
}
示例7: createEntryGrid
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
private IFigure createEntryGrid ( final Figure connLayer )
{
final Figure figure = new Figure ();
figure.setLayoutManager ( new GridLayout ( 1, false ) );
figure.add ( this.presetCeil = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetHH = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetH = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.currentLabel = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetL = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetLL = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
figure.add ( this.presetFloor = new Label ( "" ), new GridData ( GridData.CENTER, GridData.FILL, true, true ) ); //$NON-NLS-1$
createConnection ( connLayer, this.presetCeil, this.rectCeil );
createConnection ( connLayer, this.presetHH, this.triHH );
createConnection ( connLayer, this.presetH, this.triH );
createConnection ( connLayer, this.presetL, this.triL );
createConnection ( connLayer, this.presetLL, this.triLL );
createConnection ( connLayer, this.presetFloor, this.rectFloor );
this.blinkerCeil = new LevelBlinker ( this.rectCeil );
this.blinkerHH = new LevelBlinker ( this.triHH );
this.blinkerH = new LevelBlinker ( this.triH );
this.blinkerL = new LevelBlinker ( this.triL );
this.blinkerLL = new LevelBlinker ( this.triLL );
this.blinkerFloor = new LevelBlinker ( this.rectFloor );
this.stylerCeil = new StateStyler ( this.blinkerCeil );
this.stylerHH = new StateStyler ( this.blinkerHH );
this.stylerH = new StateStyler ( this.blinkerH );
this.stylerL = new StateStyler ( this.blinkerL );
this.stylerLL = new StateStyler ( this.blinkerLL );
this.stylerFloor = new StateStyler ( this.blinkerFloor );
return figure;
}
示例8: createRoot
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
protected IFigure createRoot ()
{
this.rootFigure = createMain ();
this.naFigure = createNaPanel ();
final Figure baseFigure = new LayeredPane ();
baseFigure.add ( this.rootFigure );
baseFigure.add ( this.naFigure );
return baseFigure;
}
示例9: createNaPanel
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
private IFigure createNaPanel ()
{
final Figure naPanel = new Figure ();
final BorderLayout layout = new BorderLayout ();
naPanel.setLayoutManager ( layout );
final Label label = new Label ();
label.setText ( Messages.AbstractBaseDraw2DDetailsPart_Label_NotAvail_Text );
naPanel.add ( label, BorderLayout.CENTER );
return naPanel;
}
示例10: createDrawerEditPart
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
@Override
protected EditPart createDrawerEditPart(EditPart parentEditPart, Object model) {
return new DrawerEditPart((PaletteDrawer) model) {
@Override
public IFigure createFigure() {
DrawerFigure drawerFigure = (DrawerFigure) super.createFigure();
drawerFigure.getContentPane().setBackgroundColor(palatteBackgroundColor);
drawerFigures.add(drawerFigure);
return drawerFigure;
}
};
}
示例11: addChildFigures
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
private void addChildFigures(IObjectModel m, String attName) {
IArrayModel<?> array = m.getArray(attName);
if(array != null) {
IArrayWidgetExtension ext = getArrayExtension(array, tags.get(attName));
if(ext != IArrayWidgetExtension.NULL_EXTENSION) {
IFigure f = ext.createFigure(array);
f.setToolTip(new Label(attName));
figs.put(attName, f);
compositeFig.add(f);
}
}
}
示例12: createFigure
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
@Override
protected IFigure createFigure() {
Figure f = new FreeformLayer();
f.setBorder(new MarginBorder(3));
f.setLayoutManager(new FreeformLayout());
// Create the static router for the connection layer
ConnectionLayer connLayer = (ConnectionLayer) getLayer(LayerConstants.CONNECTION_LAYER);
connLayer.setConnectionRouter(new ManhattanConnectionRouter());
return f;
}
示例13: createFigure
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
protected IFigure createFigure() {
ComponentLabelFigure label = new ComponentLabelFigure(1);
Component component = ((ComponentEditPart) getParent()).getCastedModel();
String compLabel = component.getComponentLabel().getLabelContents();
label.setText(compLabel);
Point p = new Point(((component.getSize().width/2) - 49), 1);
label.setLocation(p);
return label;
}
示例14: createSelectionHandles
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
protected List<Figure> createSelectionHandles() {
List<Figure> list=super.createSelectionHandles();
List<IFigure> figures=this.getHostFigure().getChildren();
for(IFigure figure:figures){
if(figure instanceof Label){
list.add(new MoveHandle((GraphicalEditPart)this.getHost(),new MoveHandleLocator(figure)));
}
}
return list;
}
示例15: createErrorController
import org.eclipse.draw2d.IFigure; //导入依赖的package包/类
public static Controller createErrorController ( final Throwable e )
{
return new Controller () {
@Override
public IFigure getFigure ()
{
return createErrorFigure ( e );
}
};
}