/** * Show menu to display/hide the extension point compartment. * @return the menu * @see org.argouml.uml.diagram.ui.FigNodeModelElement#buildShowPopUp() */ @Override protected ArgoJMenu buildShowPopUp() { ArgoJMenu showMenu = super.buildShowPopUp(); Iterator i = ActionCompartmentDisplay.getActions().iterator(); while (i.hasNext()) { showMenu.add((Action) i.next()); } return showMenu; }
/** * Build a collection of menu items relevant for a right-click * pop-up menu on a Stereotype. * {@inheritDoc} */ @Override public Vector getPopUpActions(MouseEvent me) { Vector popUpActions = super.getPopUpActions(me); // Add... ArgoJMenu addMenu = new ArgoJMenu("menu.popup.add"); // TODO: Add Tags & Constraints // addMenu.add(TargetManager.getInstance().getAddAttributeAction()); // addMenu.add(TargetManager.getInstance().getAddOperationAction()); addMenu.add(new ActionAddNote()); addMenu.add(new ActionNewTagDefinition()); addMenu.add(ActionEdgesDisplay.getShowEdges()); addMenu.add(ActionEdgesDisplay.getHideEdges()); popUpActions.add(popUpActions.size() - getPopupAddOffset(), addMenu); // Show ... ArgoJMenu showMenu = new ArgoJMenu("menu.popup.show"); for (Action action : ActionCompartmentDisplay.getActions()) { showMenu.add(action); } if (showMenu.getComponentCount() > 0) { popUpActions.add(popUpActions.size() - getPopupAddOffset(), showMenu); } // Modifiers ... popUpActions.add(popUpActions.size() - getPopupAddOffset(), buildModifierPopUp(ABSTRACT | LEAF | ROOT)); // Visibility ... popUpActions.add(popUpActions.size() - getPopupAddOffset(), buildVisibilityPopUp()); return popUpActions; }
Clone fragments detected by clone detection tool
File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/use_case/ui/FigUseCase.java File path: /ArgoUML-0.34-src/argouml/src/argouml-app/src/org/argouml/uml/diagram/static_structure/ui/FigStereotypeDeclaration.java
Method name: ArgoJMenu buildShowPopUp() Method name: Vector getPopUpActions(MouseEvent)
Number of AST nodes: 2 Number of AST nodes: 2
1
/**
1
/**
2
     * Show menu to display/hide the extension point compartment.
2
     * Build a collection of menu items relevant for a right-click
3
     * @return the menu
3
     * pop-up menu on a Stereotype.
4
     * @see org.argouml.uml.diagram.ui.FigNodeModelElement#buildShowPopUp()
4
     * {@inheritDoc}
5
     */
5
     */
6
    @Override
6
    @Override
7
    protected ArgoJMenu buildShowPopUp() {
7
    public Vector getPopUpActions(MouseEvent me) {
8
        ArgoJMenu showMenu = super.buildShowPopUp();
8
        Vector popUpActions = super.getPopUpActions(me);
9
        Iterator i = ActionCompartmentDisplay.getActions().iterator();
9
10
        while (i.hasNext()) {
10
        // Add...
11
            showMenu.add((Action) i.next());
11
        ArgoJMenu addMenu = new ArgoJMenu("menu.popup.add");
12
        }
12
        // TODO: Add Tags & Constraints
13
        return showMenu;
13
//        addMenu.add(TargetManager.getInstance().getAddAttributeAction());
14
    }
14
//        addMenu.add(TargetManager.getInstance().getAddOperationAction());
15
        addMenu.add(new ActionAddNote());
16
        addMenu.add(new ActionNewTagDefinition());
17
        addMenu.add(ActionEdgesDisplay.getShowEdges());
18
        addMenu.add(ActionEdgesDisplay.getHideEdges());
19
        popUpActions.add(popUpActions.size() - getPopupAddOffset(), addMenu);
20
21
        // Show ...
22
        ArgoJMenu showMenu = new ArgoJMenu("menu.popup.show");
23
        for (Action action : ActionCompartmentDisplay.getActions()) {
24
            showMenu.add(action);
25
        }
26
        if (showMenu.getComponentCount() > 0) {
27
            popUpActions.add(popUpActions.size() - getPopupAddOffset(),
28
                    showMenu);
29
        }
30
31
        // Modifiers ...
32
        popUpActions.add(popUpActions.size() - getPopupAddOffset(),
33
                buildModifierPopUp(ABSTRACT | LEAF | ROOT));
34
35
        // Visibility ...
36
        popUpActions.add(popUpActions.size() - getPopupAddOffset(),
37
                buildVisibilityPopUp());
38
39
        return popUpActions;
40
    }
  1. {Non-refactorable}
    Mapping Summary
    Number of mapped statements3
    Number of unmapped statements in the first code fragment0
    Number of unmapped statements in the second code fragment0
    Time elapsed for statement mapping (ms)0.0
    Similarity Score1.000
    Clone typeType 2
    Mapped Statements
    ID Statement ID Statement
    3
    while (i.hasNext())
    9
    for (Action action : ActionCompartmentDisplay.getActions())
    4
    showMenu.add((Action)i.next());
    4
    showMenu.add((Action)i.next());
    10
    showMenu.add(action);
    Differences
    Expression1Expression2Difference
    (Action)i.next()actionTYPE_COMPATIBLE_REPLACEMENT
    Preondition Violations
    Expression action cannot be parameterized, because it has dependencies to/from statements that will be extracted
    10
    showMenu.add(action);
    Precondition Violations (1)
    Row Violation
    1Expression action cannot be parameterized, because it has dependencies to/from statements that will be extracted