CPD Results

The following document contains the results of PMD's CPD 4.2.2.

Duplications

File Line
edu/uci/ics/jung/visualization3d/control/MouseRotate.java 157
edu/uci/ics/jung/visualization3d/control/MouseTranslate.java 144
		if ((flags & INVERT_INPUT) == INVERT_INPUT) {
			invert = true;
			x_factor *= -1;
			y_factor *= -1;
		}
	}

	/**
	 * Return the x-axis movement multipler.
	 **/
	public double getXFactor() {
		return x_factor;
	}

	/**
	 * Return the y-axis movement multipler.
	 **/
	public double getYFactor() {
		return y_factor;
	}

	/**
	 * Set the x-axis amd y-axis movement multipler with factor.
	 **/
	public void setFactor( double factor) {
		x_factor = y_factor = factor;
	}

	/**
	 * Set the x-axis amd y-axis movement multipler with xFactor and yFactor
	 * respectively.
	 **/
	public void setFactor( double xFactor, double yFactor) {
		x_factor = xFactor;
		y_factor = yFactor;    
	}

	public void processStimulus (Enumeration criteria) {
		WakeupCriterion wakeup;
		AWTEvent[] events;
		MouseEvent evt;
//		int id;
//		int dx, dy;

		while (criteria.hasMoreElements()) {
			wakeup = (WakeupCriterion) criteria.nextElement();

			if (wakeup instanceof WakeupOnAWTEvent) {
				events = ((WakeupOnAWTEvent)wakeup).getAWTEvent();
				if (events.length > 0) {
					evt = (MouseEvent) events[events.length-1];
					doProcess(evt);
				}
			}

			else if (wakeup instanceof WakeupOnBehaviorPost) {
				while (true) {
					// access to the queue must be synchronized
					synchronized (mouseq) {
						if (mouseq.isEmpty()) break;
						evt = (MouseEvent)mouseq.remove(0);
						// consolodate MOUSE_DRAG events
						while ((evt.getID() == MouseEvent.MOUSE_DRAGGED) &&
								!mouseq.isEmpty() &&
								(((MouseEvent)mouseq.get(0)).getID() ==
									MouseEvent.MOUSE_DRAGGED)) {
							evt = (MouseEvent)mouseq.remove(0);
						}
					}
					doProcess(evt);
				}
			}

		}
		wakeupOn(mouseCriterion);
	}

	void doProcess(MouseEvent evt) {
		int id;
		int dx, dy;

		processMouseEvent(evt);

		if (((buttonPress)&&((flags & MANUAL_WAKEUP) == 0)) ||
				((wakeUp)&&((flags & MANUAL_WAKEUP) != 0))){
			id = evt.getID();
			if ((id == MouseEvent.MOUSE_DRAGGED) &&
					!evt.isAltDown() && !evt.isMetaDown()) {

File Line
edu/uci/ics/jung/visualization3d/control/MouseRotate.java 193
edu/uci/ics/jung/visualization3d/control/MouseZoom.java 163
    }

    public void processStimulus(Enumeration criteria)
    {
        WakeupCriterion wakeup;
        AWTEvent[] events;
        MouseEvent evt;
// int id;
// int dx, dy;

        while (criteria.hasMoreElements())
        {
            wakeup = (WakeupCriterion) criteria.nextElement();
            if (wakeup instanceof WakeupOnAWTEvent)
            {
                events = ((WakeupOnAWTEvent) wakeup).getAWTEvent();
                if (events.length > 0)
                {
                    evt = (MouseEvent) events[events.length - 1];
                    doProcess(evt);
                }
            }

            else if (wakeup instanceof WakeupOnBehaviorPost)
            {
                while (true)
                {
                    synchronized (mouseq)
                    {
                        if (mouseq.isEmpty())
                            break;
                        evt = (MouseEvent) mouseq.remove(0);
                        // consolodate MOUSE_DRAG events
                        while ((evt.getID() == MouseEvent.MOUSE_DRAGGED)
                                && !mouseq.isEmpty()
                                && (((MouseEvent) mouseq.get(0)).getID() == MouseEvent.MOUSE_DRAGGED))
                        {
                            evt = (MouseEvent) mouseq.remove(0);
                        }
                    }
                    doProcess(evt);
                }
            }

        }
        wakeupOn(mouseCriterion);
    }

    void doProcess(MouseEvent evt)
    {
        int id;
        int dx, dy;

        processMouseEvent(evt);

        if (((buttonPress) && ((flags & MANUAL_WAKEUP) == 0))
                || ((wakeUp) && ((flags & MANUAL_WAKEUP) != 0)))
        {
            id = evt.getID();
            if ((id == MouseEvent.MOUSE_DRAGGED) && evt.isAltDown()

File Line
edu/uci/ics/jung/visualization3d/control/MouseWheelZoom.java 141
edu/uci/ics/jung/visualization3d/control/MouseZoom.java 139
    public void initialize()
    {
        super.initialize();
        if ((flags & INVERT_INPUT) == INVERT_INPUT)
        {
            z_factor *= -1;
            invert = true;
        }
    }

    /**
     * Return the y-axis movement multipler.
     */
    public double getFactor()
    {
        return z_factor;
    }

    /**
     * Set the y-axis movement multipler with factor.
     */
    public void setFactor(double factor)
    {
        z_factor = factor;
    }

    public void processStimulus(Enumeration criteria)
    {
        WakeupCriterion wakeup;
        AWTEvent[] events;
        MouseEvent evt;
// int id;
// int dx, dy;

        while (criteria.hasMoreElements())
        {
            wakeup = (WakeupCriterion) criteria.nextElement();
            if (wakeup instanceof WakeupOnAWTEvent)
            {
                events = ((WakeupOnAWTEvent) wakeup).getAWTEvent();
                if (events.length > 0)
                {
                    evt = (MouseEvent) events[events.length - 1];
                    doProcess(evt);
                }
            }

            else if (wakeup instanceof WakeupOnBehaviorPost)
            {
                while (true)
                {
                    synchronized (mouseq)
                    {
                        if (mouseq.isEmpty())
                            break;
                        evt = (MouseEvent) mouseq.remove(0);
                        // consolodate MOUSE_DRAG events
                        while ((evt.getID() == MouseEvent.MOUSE_DRAGGED)

File Line
edu/uci/ics/jung/visualization3d/control/MouseRotate.java 193
edu/uci/ics/jung/visualization3d/control/MouseWheelZoom.java 161
    }
	
	
    public void processStimulus(Enumeration criteria) {
	WakeupCriterion wakeup;
	AWTEvent[] events;
	MouseEvent evt;

	while (criteria.hasMoreElements()) {
	    wakeup = (WakeupCriterion) criteria.nextElement();
	    if (wakeup instanceof WakeupOnAWTEvent) {
		events = ((WakeupOnAWTEvent)wakeup).getAWTEvent();
		if (events.length > 0) {
		    evt = (MouseEvent) events[events.length-1];
		    doProcess(evt);
		}
	    }
	    
	    else if (wakeup instanceof WakeupOnBehaviorPost) {
		while (true) {
		    synchronized (mouseq) {
			if (mouseq.isEmpty()) break;
			evt = (MouseEvent)mouseq.remove(0);
			// consolidate MOUSE_WHEEL events
			while((evt.getID() == MouseEvent.MOUSE_WHEEL) &&