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

项目:OpenSPIFe    文件:HeatMapDataEditPart.java   
@Override
protected IFigure createFigure() {
    Plot plot = getModel();
    HeatMapFigure figure = new HeatMapFigure();
    font = TimelineUtils.deriveRowElementHeightFont(figure.getFont());
    figure.setFont(font);
    updateFigureBounds(figure);
    figure.setForegroundColor(PlotUtil.getColor(plot));
    figure.setBackgroundColor(PlotUtil.getColor(plot));
    figure.addFigureListener(new FigureListener() {
        @Override
        public void figureMoved(IFigure source) {
            try {
                updatePointList();
            } catch (ProfileUpdatedException e) {
                // okay to fall out because we will respond to the profile change later from the listener
            }
        }
    });
    return figure;
}
项目:chrysalix    文件:FocusTreeLightweight.java   
void constructFocusLine( final String description,
                         final Color color,
                         final int y,
                         final int height ) {
    focusLine = new Panel();
    canvas.add( focusLine );
    focusLine.setToolTip( new Label( description ) );
    focusLine.setBackgroundColor( color );
    // Make focus line extend horizontally across entire canvas
    focusLine.setBounds( new Rectangle( 0, y, 0, height ) );
    canvas.addFigureListener( new FigureListener() {

        @Override
        public void figureMoved( final IFigure source ) {
            focusTree.controller.treeResized();
        }
    } );
}
项目:cogtool    文件:PERTPanel.java   
public SelectionHalo()
        {
            super();

            color = new Color(null,
                                   GraphicsUtil.getRGBFromColor(0x00CCFF));

            setToolTip(new Label(""));
            setVisible(true);
//            setCursor(WindowUtil.getCursor(SWT.CURSOR_HAND));

            targetListener =
                new FigureListener()
                    {
                        public void figureMoved(IFigure source)
                        {
                            setBoundsFromFigure(source);
                        }
                    };
        }
项目:ARXPlugin    文件:ComponentMeterFigure.java   
public ComponentMeterFigure() {
    super();
    setTransparent(false);
    scale.setScaleLineVisible(false);

    ((RoundScale)scale).setStartAngle(180-SPACE_ANGLE);
    ((RoundScale)scale).setEndAngle(SPACE_ANGLE);
    ramp.setRampWidth(12);
    setLoColor(XYGraphMediaFactory.getInstance().getColor(XYGraphMediaFactory.COLOR_YELLOW));
    setHiColor(XYGraphMediaFactory.getInstance().getColor(XYGraphMediaFactory.COLOR_YELLOW));

    valueLabel = new Label();       
    valueLabel.setFont(DEFAULT_LABEL_FONT);
    needle = new Needle();
    needle.setFill(true);
    needle.setOutline(false);

    setLayoutManager(new XMeterLayout());
    add(ramp, XMeterLayout.RAMP);
    add(scale, XMeterLayout.SCALE);         
    add(needle, XMeterLayout.NEEDLE);
    add(valueLabel, XMeterLayout.VALUE_LABEL);

    addFigureListener(new FigureListener() {            
        public void figureMoved(IFigure source) {
            ramp.setDirty(true);
            revalidate();   
        }
    }); 

}
项目:OpenSPIFe    文件:LineFigure.java   
public LineFigure() {
    addFigureListener(new FigureListener() {
        @Override
        public void figureMoved(IFigure source) {
            if (norms != null) {
                setNormalizedPointList(norms);
            }
        }
    });
}
项目:OpenSPIFe    文件:SplitEditPart.java   
public SplitHandle(GraphicalEditPart owner, IFigure figure) {
    super(owner, new MoveHandleLocator(figure));
    figure.addFigureListener(new FigureListener() {
        @Override
        public void figureMoved(IFigure source) {
            revalidate();
        }
    });
}
项目:arx    文件:ComponentMeterFigure.java   
public ComponentMeterFigure() {
    super();
    setTransparent(false);
    scale.setScaleLineVisible(false);

    ((RoundScale)scale).setStartAngle(180-SPACE_ANGLE);
    ((RoundScale)scale).setEndAngle(SPACE_ANGLE);
    ramp.setRampWidth(12);
    setLoColor(XYGraphMediaFactory.getInstance().getColor(XYGraphMediaFactory.COLOR_YELLOW));
    setHiColor(XYGraphMediaFactory.getInstance().getColor(XYGraphMediaFactory.COLOR_YELLOW));

    valueLabel = new Label();       
    valueLabel.setFont(DEFAULT_LABEL_FONT);
    needle = new Needle();
    needle.setFill(true);
    needle.setOutline(false);

    setLayoutManager(new XMeterLayout());
    add(ramp, XMeterLayout.RAMP);
    add(scale, XMeterLayout.SCALE);         
    add(needle, XMeterLayout.NEEDLE);
    add(valueLabel, XMeterLayout.VALUE_LABEL);

    addFigureListener(new FigureListener() {            
        public void figureMoved(IFigure source) {
            ramp.setDirty(true);
            revalidate();   
        }
    }); 

}
项目:NEXCORE-UML-Modeler    文件:RealizationEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel())
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                    }
                }
            }
        }
    });
    // PolygonDecoration polygonDecoreation = new PolygonDecoration();
    // polygonDecoreation.setScale(10,5);
    // connection.setTargetDecoration(polygonDecoreation);
    // connection.setLineStyle(SWT.LINE_DOT);
    // connection.addRoutingListener(RoutingAnimator.getDefault());
    // connection.setConnectionRouter(new BendpointConnectionRouter());

    connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    PolygonDecoration polygonDecoreation = new PolygonDecoration();
    polygonDecoreation.setBackgroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
    polygonDecoreation.setScale(10, 5);
    connection.setLineStyle(SWT.LINE_DOT);
    connection.setTargetDecoration(polygonDecoreation);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    return connection;
}
项目:NEXCORE-UML-Modeler    文件:DependencyEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.setLineStyle(Graphics.LINE_DOT);
    ArrowDecoration arrow = new ArrowDecoration();
    connection.setTargetDecoration(arrow);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel())
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                    }
                }
            }
        }
    });

    return connection;
}
项目:NEXCORE-UML-Modeler    文件:AssociationEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {

    settingLineCondition();

    PolylineConnection polylineConnection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    polylineConnection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel()) {
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                        }

                    }
                }
            }
        }
    });

    return drawDecoration(polylineConnection);

}
项目:NEXCORE-UML-Modeler    文件:ControlFlowEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
    PolygonDecoration polygonDecoreation = new PolygonDecoration();
    connection.setTargetDecoration(polygonDecoreation);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel())
                            ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                    }
                }
            }
        }
    });
    return connection;
}
项目:NEXCORE-UML-Modeler    文件:IncludeEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel()) {
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                        }
                    }
                }
            }
        }
    });

    connection.setTargetDecoration(new ArrowDecoration());
    connection.setLineStyle(Graphics.LINE_DOT);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    return connection;
}
项目:NEXCORE-UML-Modeler    文件:ExtendEditPart.java   
/**
 * @see nexcore.tool.uml.ui.core.diagram.edit.part.AbstractDiagramConnectionEditPart#createFigure()
 */
@Override
protected IFigure createFigure() {
    PolylineConnection connection = new PolylineConnection() {
        @Override
        public void paintFigure(Graphics graphics) {
            graphics.setAntialias(SWT.ON);
            super.paintFigure(graphics);
        }
    };
    connection.addFigureListener(new FigureListener() {

        /**
         * @see org.eclipse.draw2d.FigureListener#figureMoved(org.eclipse.draw2d.IFigure)
         */
        @SuppressWarnings("unchecked")
        public void figureMoved(IFigure source) {
            Point sourcePoint = ((PolylineConnection) source).getStart();
            Point targetPoint = ((PolylineConnection) source).getEnd();

            RootEditPart rootEditPart = (RootEditPart) getParent();
            List<EditPart> diagramEditparts = new ArrayList<EditPart>();
            diagramEditparts = rootEditPart.getChildren();
            List<EditPart> editParts = new ArrayList<EditPart>();

            for (EditPart diagramEditPart : diagramEditparts) {
                editParts = diagramEditPart.getChildren();
                for (EditPart editpart : editParts) {
                    if (editpart.getModel() instanceof LabelNode) {
                        if (((LabelNode) editpart.getModel()).getOwner() == getModel()) {
                            if (editpart instanceof LabelNodeEditPart) {
                                ((LabelNodeEditPart) editpart).setConnectionAnchorPoints(sourcePoint, targetPoint);
                            }
                        }
                    }
                }
            }
        }
    });

    connection.setTargetDecoration(new ArrowDecoration());
    connection.setLineStyle(Graphics.LINE_DOT);
    connection.addRoutingListener(RoutingAnimator.getDefault());
    connection.setConnectionRouter(new BendpointConnectionRouter());
    return connection;
}