Java 类org.eclipse.draw2d.IFigure 实例源码

项目:neoscada    文件:XYContainerController.java   
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 );
}
项目:pandionj    文件:FigureProvider.java   
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));
    }

}
项目:neoscada    文件:BorderContainerController.java   
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 );
}
项目:Hydrograph    文件:PortEditPart.java   
@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;
}
项目:pandionj    文件:ITypeWidgetExtension.java   
@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;
        }
项目:neoscada    文件:RoundDetailsPart.java   
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;
}
项目:neoscada    文件:GenericLevelPresets.java   
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;
}
项目:neoscada    文件:AbstractBaseDraw2DDetailsPart.java   
protected IFigure createRoot ()
{
    this.rootFigure = createMain ();
    this.naFigure = createNaPanel ();

    final Figure baseFigure = new LayeredPane ();

    baseFigure.add ( this.rootFigure );
    baseFigure.add ( this.naFigure );

    return baseFigure;
}
项目:neoscada    文件:AbstractBaseDraw2DDetailsPart.java   
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;
}
项目:Hydrograph    文件:CustomPaletteEditPartFactory.java   
@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;
        }

    };
}
项目:pandionj    文件:ExtensionManager.java   
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);
        }
    }
}
项目:Hydrograph    文件:ContainerEditPart.java   
@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;
}
项目:Hydrograph    文件:ComponentLabelEditPart.java   
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;
}
项目:bdf2    文件:TransitionConnectionEndpointEditPolicy.java   
@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;
}
项目:neoscada    文件:Helper.java   
public static Controller createErrorController ( final Throwable e )
{
    return new Controller () {

        @Override
        public IFigure getFigure ()
        {
            return createErrorFigure ( e );
        }
    };
}
项目:Open_Source_ECOA_Toolset_AS5    文件:TriggerInstanceTerminalEditPart.java   
@Override
protected IFigure createFigure() {
    TriggerInstanceTerminalNode model = (TriggerInstanceTerminalNode) getModel();
    TriggerInstanceTerminalFigure figure = new TriggerInstanceTerminalFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ServiceOperationEditPart.java   
@Override
protected IFigure createFigure() {
    ServiceOperationNode model = (ServiceOperationNode) getModel();
    ServiceOperationFigure figure = new ServiceOperationFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:DynamicTriggerInstanceTerminalEditPart.java   
@Override
protected IFigure createFigure() {
    DynamicTriggerInstanceTerminalNode model = (DynamicTriggerInstanceTerminalNode) getModel();
    DynamicTriggerInstanceTerminalFigure figure = new DynamicTriggerInstanceTerminalFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ServiceEditPart.java   
@Override
protected IFigure createFigure() {
    ServiceNode model = (ServiceNode) getModel();
    ServiceFigure figure = new ServiceFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ModuleOperationEditPart.java   
@Override
protected IFigure createFigure() {
    ModuleOperationNode model = (ModuleOperationNode) getModel();
    ModuleOperationFigure figure = new ModuleOperationFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ModuleInstanceEditPart.java   
@Override
protected IFigure createFigure() {
    ModuleInstanceNode model = (ModuleInstanceNode) getModel();
    ModuleInstanceFigure figure = new ModuleInstanceFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:bdf2    文件:TransitionEditPart.java   
@Override
protected IFigure createFigure() {
    final PolylineConnection connection = new PolylineConnection();
    connection.setConnectionRouter(new BendpointConnectionRouter());
    PolygonDecoration decoration = new PolygonDecoration();
    decoration.setTemplate(new PointList(new int[]{0, 0, -2, 2, -2, 0, -2, -2, 0, 0}));
    RGB rgb=Activator.getPreference().getTransitionColor();
    decoration.setBackgroundColor(new Color(null,rgb));
    connection.setTargetDecoration(decoration);
    connection.setAntialias(SWT.ON);
    connection.setForegroundColor(new Color(null,rgb));
    return connection;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ComponentImplementationEditPart.java   
@Override
protected IFigure createFigure() {
    ComponentImplementationNode model = (ComponentImplementationNode) getModel();
    ComponentImplementationFigure figure = new ComponentImplementationFigure();
    figure.setNode(model);
    Dimension dim = getDimension(model);
    model.setConstraints(new Rectangle(new Point(0, 0), (dim != null) ? dim : new Dimension(1000, 1000)));
    figure.setBounds(model.getConstraints());
    figure.rebuildFigure();
    return figure;
}
项目:pandionj    文件:FrameViewer.java   
private static boolean containsChild(IFigure f, IFigure child) {
    for (Object object : f.getChildren()) {
        if(object == child)
            return true;
    }
    return false;
}
项目:pandionj    文件:ColorAwtWidget.java   
@Override
public IFigure createFigure(IObjectModel e) {
    int value = e.getInt("value");
    int r = (value >> 16) & 0xFF;
    int g = (value >> 8) & 0xFF;
    int b = (value >> 0) & 0xFF;
    Label label = new Label(r + ", " + g + ", " + b);
    label.setOpaque(true);
    label.setBackgroundColor(PandionJUI.getColor(r, g, b));
    return label;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ProtectionDomainEditPart.java   
@Override
protected IFigure createFigure() {
    ProtectionDomainNode model = (ProtectionDomainNode) getModel();
    ProtectionDomainFigure figure = new ProtectionDomainFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:DeploymentEditPart.java   
@Override
protected IFigure createFigure() {
    DeploymentNode model = (DeploymentNode) getModel();
    DeploymentFigure figure = new DeploymentFigure();
    figure.setNode(model);
    Dimension dim = getDimension(model);
    model.setConstraints(new Rectangle(new Point(0, 0), (dim != null) ? dim : new Dimension(1000, 1000)));
    figure.setBounds(model.getConstraints());
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ComputingNodeConfigurationEditPart.java   
@Override
protected IFigure createFigure() {
    ComputingNodeConfigurationNode model = (ComputingNodeConfigurationNode) getModel();
    ComputingNodeConfigurationFigure figure = new ComputingNodeConfigurationFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:PlatformConfigurationEditPart.java   
@Override
protected IFigure createFigure() {
    PlatformConfigurationNode model = (PlatformConfigurationNode) getModel();
    PlatformConfigurationFigure figure = new PlatformConfigurationFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:DeployedModuleInstanceEditPart.java   
@Override
protected IFigure createFigure() {
    DeployedModuleInstanceNode model = (DeployedModuleInstanceNode) getModel();
    DeployedModuleInstanceFigure figure = new DeployedModuleInstanceFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:LogicalComputingPlatformEditPart.java   
@Override
protected IFigure createFigure() {
    LogicalComputingPlatformNode model = (LogicalComputingPlatformNode) getModel();
    LogicalComputingPlatformFigure figure = new LogicalComputingPlatformFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:LogicalProcessorsEditPart.java   
@Override
protected IFigure createFigure() {
    LogicalProcessorsNode model = (LogicalProcessorsNode) getModel();
    LogicalProcessorsFigure figure = new LogicalProcessorsFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:time4sys    文件:RotativeImageEditPart.java   
/**
 * 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;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ComponentEditPart.java   
@Override
protected IFigure createFigure() {
    ComponentNode model = (ComponentNode) getModel();
    ComponentFigure figure = new ComponentFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:CompositeEditPart.java   
@Override
protected IFigure createFigure() {
    CompositeNode model = (CompositeNode) getModel();
    CompositeFigure figure = new CompositeFigure();
    figure.setNode(model);
    Dimension dim = getDimension(model);
    model.setConstraints(new Rectangle(new Point(0, 0), (dim != null) ? dim : new Dimension(1000, 1000)));
    figure.setBounds(model.getConstraints());
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ReferenceEditPart.java   
@Override
protected IFigure createFigure() {
    ReferenceNode model = (ReferenceNode) getModel();
    ReferenceFigure figure = new ReferenceFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ComponentPropertyEditPart.java   
@Override
protected IFigure createFigure() {
    ComponentPropertyNode model = (ComponentPropertyNode) getModel();
    ComponentPropertyFigure figure = new ComponentPropertyFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}
项目:pandionj    文件:ValueExtensionFigure.java   
public ValueExtensionFigure(IValueModel model, IFigure figure) {
    super(model, false);

    layout = new GridLayout(1, false);
    layout.verticalSpacing = 0;
    layout.horizontalSpacing = 0;
    layout.marginHeight = 0;
    layout.marginWidth = 0;

    setLayoutManager(layout);

    Figure comp = new Figure();
    GridLayout compLayout = new GridLayout(2,false);
    compLayout.marginHeight = 0;
    compLayout.marginWidth = 0;
    compLayout.horizontalSpacing = 3;
    compLayout.verticalSpacing = 0;

    comp.setLayoutManager(compLayout);

    String tooltip = Utils.getTooltip(model); 

    Label nameLabel = new Label(model.getName());
    nameLabel.setForegroundColor(ColorConstants.black);
    FontManager.setFont(nameLabel, PandionJConstants.VAR_FONT_SIZE);

    nameLabel.setToolTip(new Label(tooltip));
    comp.add(nameLabel);
    comp.add(figure);
    add(comp);

    layout.setConstraint(comp, new GridData(SWT.RIGHT, SWT.DEFAULT, true, false));
}
项目:pandionj    文件:StringWidget.java   
@Override
public IFigure createFigure(IObjectModel e) {
    Label label = new Label("\"" + e.getStringValue() + "\"");
    FontManager.setFont(label, PandionJConstants.VALUE_FONT_SIZE);
    label.setForegroundColor(ColorConstants.black);
    return label;
}
项目:Open_Source_ECOA_Toolset_AS5    文件:ComponentEditPart.java   
@Override
protected IFigure createFigure() {
    ComponentNode model = (ComponentNode) getModel();
    ComponentFigure figure = new ComponentFigure();
    figure.setNode(model);
    figure.rebuildFigure();
    return figure;
}