CPD Report

=====================================================================
Found a 113 line (1235 tokens) duplication in the following files: 
Starting at line 67 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractArrowReadEdgePainter.java
Starting at line 51 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractArrowEdgePainter.java
	g.drawLine(_sp.x, _sp.y, _ep.x, _ep.y);

	// draw the arrow
	g.setColor(getPointerColor(grp, e));
	ArrowTools.getArrowShape(_sp, _ep, _al, _aw, _arrow);
	g.fillPolygon(_arrow);

	// draw the label
	String en = getEdgeLabel(grp, e);
	if (en != null) {
	    g.setColor(getTextColor(grp, e));
	    g.setFont(getFont(grp, e));
	    int lw = grp.getFontMetrics(g.getFont()).stringWidth(en);
	    if (_sp.x == _ep.x) {
		g.drawString(en, _sp.x-lw/2, _sp.y+(_ep.y-_sp.y)/2);
	    } else if (Math.abs(_ep.x-_sp.x)>Math.abs(_ep.y-_sp.y)) {
		double m = (double)(_ep.y-sp.y)/(double)(_ep.x-sp.x);
		int x = _sp.x+(int)((double)(_ep.x-_sp.x)/2d);
		int y = _sp.y+(int)(m*(double)(_ep.x-_sp.x)/2d);
		g.drawString(en, x-lw/2, y);
	    } else {
		double m = (double)(_ep.x-_sp.x)/(double)(_ep.y-_sp.y);
		int x = _sp.x+(int)(m*(double)(_ep.y-_sp.y)/2d);
		int y = _sp.y+(int)((double)(_ep.y-_sp.y)/2d);
		g.drawString(en, x-lw/2, y);
	    }
	}
    }

    public void getEdgeScreenBounds(JGraphPane grp,Edge e,Rectangle scr) {
	// get line bounds
	super.getEdgeScreenBounds(grp, e, scr);
	
	// prepare
	Point sp = grp.getScreenPointForNode(e.getFrom());
	Point ep = grp.getScreenPointForNode(e.getTo());

	getNodeScreenBounds(grp, e.getTo(), _bnde);	

	Point _sp = sp;
	Point _ep = getIntersection(_bnde, sp, ep);
	
	if (_sp == null || _ep == null || (_sp.x == _ep.x && _sp.y == _ep.y)) return;
	
	// add arrow bounds
	ArrowTools.getArrowShape(_sp, _ep, _al, _aw, _arrow);
	scr.add(_arrow.getBounds());

	// add label bounds
	String en = getEdgeLabel(grp, e);
	if (en!=null && !en.equals("")) {
	    int lw = grp.getFontMetrics(getFont(grp, e)).stringWidth(en);
	    int lh = grp.getFontMetrics(getFont(grp, e)).getHeight();
	    if (lw>scr.width) {
		scr.x -= (lw-scr.width)/2;
		scr.width = lw;
	    }
	    if (lh>scr.height) {
		scr.y -= (lh-scr.height)/2;	    
		scr.height = lh;
	    }
	}
    }

    protected void getNodeScreenBounds(JGraphPane grp, Node n, Rectangle r) {
	grp.getPainterForNode(n).getNodeScreenBounds(grp, n, r);
    }

    /** Get the Point of Intersection for a Rectangle and a Line. */
    private Point getIntersection(Rectangle r, Point p1, Point p2) {
	Point _ = null;
	// test the top bound
	_p1.setLocation(r.getX(), r.getY());
	_p2.setLocation(r.getX()+r.getWidth(), r.getY());
	_ = getLineIntersection(p1, p2, _p1, _p2);
	if (_!=null && !(_.x>r.getX()+r.getWidth() || _.x<r.getX())) return _;
	// test the left bound
	_p2.setLocation(r.getX(), r.getY()+r.getHeight());
	_ = getLineIntersection(p1, p2, _p1, _p2);
	if (_!=null && !(_.y>r.getY()+r.getHeight() || _.y<r.getY())) return _;
	// test the bottom bound
	_p1.setLocation(r.getX()+r.getWidth(), r.getY()+r.getHeight());
	_ = getLineIntersection(p1, p2, _p1, _p2);
	if (_!=null && !(_.x>r.getX()+r.getWidth() || _.x<r.getX())) return _;
	// test the right bound
	_p2.setLocation(r.getX()+r.getWidth(), r.getY());
	_ = getLineIntersection(p1, p2, _p1, _p2);
	return _;
    }

    private Point getLineIntersection(Point p1, Point p2, Point r1, Point r2) {
	Point p = null;
	double t = 
	    (r1.getX()*(r1.getY()-r2.getY()) + r1.getY()*(r2.getX()-r1.getX()) - p1.getX()*(r1.getY()-r2.getY()) - p1.getY()*(r2.getX()-r1.getX())) / 
	    ((p2.getX()-p1.getX())*(r1.getY()-r2.getY()) + (p2.getY()-p1.getY())*(r2.getX()-r1.getX()));
	if ((0<=t) && (t<=1)) {	    
	    p = new Point((int)(p1.getX() + t*(p2.getX()-p1.getX())), (int)(p1.getY() + t*(p2.getY()-p1.getY())));
	}
	return p;
    }    

    protected abstract Color getEdgeColor(JGraphPane grp, Edge e);

    protected abstract Color getPointerColor(JGraphPane grp, Edge e);

    protected abstract Color getTextColor(JGraphPane grp, Edge e);

    protected abstract Font getFont(JGraphPane grp, Edge e);

    protected abstract Stroke getEdgeStroke(JGraphPane grp, Edge e);

    protected abstract String getEdgeLabel(JGraphPane grp, Edge e);
}
=====================================================================
Found a 98 line (661 tokens) duplication in the following files: 
Starting at line 108 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractCubicCurveReadEdgePainter.java
Starting at line 78 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractCubicCurveEdgePainter.java
	    Point2D pn = cp[cp.length-1];
	    Point2D pe = getPointOfArrowAtEnd(e);
	    grp.graphToScreenPoint(pn, _p1);
	    grp.graphToScreenPoint(pe, _p2);
	    ArrowTools.getArrowShape(_p1, _p2, _al, _aw, _arrow);
	    g.fillPolygon(_arrow);
	}

	// paint the label
	g.setColor(getTextColor(grp, e));
	g.setFont(getFont(grp, e));

	if (hasLabel(e)) {
	    Point2D lp = getLabelPosition(e);
	    grp.graphToScreenPoint(lp, _p1);
	    String en = getEdgeLabel(grp, e);
	    int lw = grp.getFontMetrics(g.getFont()).stringWidth(en);
	    int lh = grp.getFontMetrics(g.getFont()).getHeight();
	    int asc = grp.getFontMetrics(g.getFont()).getAscent();
	    int x = _p1.x - lw/2;
	    int y = _p1.y - lh/2 + asc;
	    g.drawString(en, x, y);    	    
	}
    }

    public void getEdgeScreenBounds(JGraphPane grp, Edge edge, Rectangle scr) {
	Point2D[] cp = getControlPoints(edge);

	boolean first = true;
	for (int i=0; i+3<cp.length; i+=3) {
	    grp.graphToScreenPoint(cp[i], _p1);
	    grp.graphToScreenPoint(cp[i+1], _cp1);
	    grp.graphToScreenPoint(cp[i+2], _cp2);
	    grp.graphToScreenPoint(cp[i+3], _p2);
	    _curve.setCurve(_p1.x, _p1.y, _cp1.x, _cp1.y, _cp2.x, _cp2.y, _p2.x, _p2.y);
	    if (first) {
		first = false;
		scr.setBounds(_curve.getBounds());
	    } else {
		scr.add(_curve.getBounds());
	    }
	}

	if (hasArrowAtStart(edge)) {
	    Point2D p0 = cp[0];
	    Point2D ps = getPointOfArrowAtStart(edge);		
	    grp.graphToScreenPoint(p0, _p1);
	    grp.graphToScreenPoint(ps, _p2);
	    ArrowTools.getArrowShape(_p1, _p2, _al, _aw, _arrow);
	    scr.add(_arrow.getBounds());
	}
	    
	if (hasArrowAtEnd(edge)) {
	    Point2D pn = cp[cp.length-1];
	    Point2D pe = getPointOfArrowAtEnd(edge);
	    grp.graphToScreenPoint(pn, _p1);
	    grp.graphToScreenPoint(pe, _p2);
	    ArrowTools.getArrowShape(_p1, _p2, _al, _aw, _arrow);
	    scr.add(_arrow.getBounds());
	}

	scr.x -= 1;
	scr.y -= 1;
	scr.width += 2;
	scr.height += 2;
    }

    public double screenDistanceFromEdge(JGraphPane grp,Edge edge,Point point) {
	/// FIXME! TODO
	return super.screenDistanceFromEdge(grp, edge, point);
    }

    protected abstract Point2D[] getControlPoints(Edge e);

    protected abstract boolean hasArrowAtStart(Edge e);

    protected abstract boolean hasArrowAtEnd(Edge e);

    protected abstract Point2D getPointOfArrowAtStart(Edge e);

    protected abstract Point2D getPointOfArrowAtEnd(Edge e);
    
    protected abstract boolean hasLabel(Edge e);
    
    protected abstract Point2D getLabelPosition(Edge e);

    protected abstract Color getEdgeColor(JGraphPane grp, Edge e);

    protected abstract Color getPointerColor(JGraphPane grp, Edge e);

    protected abstract Color getTextColor(JGraphPane grp, Edge e);

    protected abstract Font getFont(JGraphPane grp, Edge e);

    protected abstract Stroke getEdgeStroke(JGraphPane grp, Edge e);

    protected abstract String getEdgeLabel(JGraphPane grp, Edge e);
}
=====================================================================
Found a 61 line (391 tokens) duplication in the following files: 
Starting at line 148 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/IGApplet.java
Starting at line 148 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MediGRIDApplet.java
        _gui.addMember(controller, 10, c);

        c.weightx = 1.0;
        c.fill = GridBagConstraints.BOTH;
        _gui.addMember(executor, 10, c);

        c.weightx = 0.0;
        c.fill = GridBagConstraints.NONE;
        _gui.addMember(inspector, 10, c);

        c.gridwidth = GridBagConstraints.REMAINDER;
        _gui.addMember(lensmanager, 10, c);

        _gui.addMember(conditionmanipulator);
        _gui.addMember(tokenmanipulator);
        _gui.addMember(monitor);
        _gui.addMember(statusview);
        _gui.addMember(taskhandler);

        _gui.setProperty(VisibleGroup.VIEWPORT_SIZE_KEY, getContentPane().getSize());

        GWUI.getInstance().addMember(_gui);
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(_gui.getView(), BorderLayout.CENTER);
        getContentPane().validate();

        // GWUI is initiated.
        GWUI.getInstance().setProperty(Group.APPLICATION_STATUS_KEY, Group.INITIATED);
        // Set th workflow ID.
        setWorkflowID(getParameter(GWUI.WORKFLOW_ID_KEY));
    }


    public void start() {
        if (!Group.RUNNING.equals(GWUI.getInstance().getProperty(Group.APPLICATION_STATUS_KEY)))
            GWUI.getInstance().setProperty(Group.APPLICATION_STATUS_KEY, Group.RUNNING);
    }

    public void stop() {
        if (Group.RUNNING.equals(GWUI.getInstance().getProperty(Group.APPLICATION_STATUS_KEY)))
            GWUI.getInstance().setProperty(Group.APPLICATION_STATUS_KEY, Group.PAUSED);
    }

    public void destroy() {
        if (!Group.EXITING.equals(GWUI.getInstance().getProperty(Group.APPLICATION_STATUS_KEY)))
            GWUI.getInstance().setProperty(Group.APPLICATION_STATUS_KEY, Group.EXITING);
    }

    public void showDocument(URL url) {
        getAppletContext().showDocument(url);
    }

    public void showDocument(URL url, String target) {
        getAppletContext().showDocument(url, target);
    }

    public void setWorkflowID(String workflowid) {
        if ("".equals(workflowid)) workflowid = null;
        _gui.setWorkflowID(workflowid);
    }
}
=====================================================================
Found a 60 line (344 tokens) duplication in the following files: 
Starting at line 148 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/PlaceInspector.java
Starting at line 159 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/TransitionInspector.java
	setTransitionNode((TransitionNode)node);
    }

    ///
    /// Implementation of Visible
    /// ....................................................................................................

    private void updateState() {
	logger.debug("updateState()");
	
	if (getGroup()!=null) {
	    Object modalmember = getGroup().getProperty(VisibleGroup.MODAL_MEMBER_KEY);
	    Object status = getGroup().getProperty(WorkflowGroup.WORKFLOW_STATUS_KEY);
	    Object appstatus = getGroup().getProperty(Group.APPLICATION_STATUS_KEY);
	    boolean document = getWorkflow() != null;
	    String activetool = (String)getGroup().getProperty(WorkflowGroup.ACTIVE_TOOL_KEY);

	    if (status==null) status = WorkflowGroup.STATUS_UNDEFINED;

	    if (!IDENTIFIER.equals(activetool) && isActive()) {
		setActive(false);
	    }
	    
	    if (!document || 
		WorkflowGroup.STATUS_RUNNING.equals(status) || 
		WorkflowGroup.STATUS_ACTIVE.equals(status)) {
		if (isActive()) {
		    setActive(false);
		    getGroup().setProperty(WorkflowGroup.ACTIVE_TOOL_KEY, null);
		}
	    } else if (modalmember!=null) {
		getFrame().setEnabled(false);
	    } else {
		boolean editable = 
		    WorkflowGroup.STATUS_INITIATED.equals(status) ||
		    WorkflowGroup.STATUS_SUSPENDED.equals(status);
		getFrame().setEnabled(true);		
		getFrame().setEditable(editable);
	    }
	}

	logger.debug("updateState.exit");
    }

    ///
    /// Implementation of Member
    /// ....................................................................................................
    
    public void groupPropertyChanged(String name, Object oldvalue, Object newvalue) {
	logger.debug("groupPropertyChanged("+name+", "+oldvalue+", "+newvalue+")");

	if (name.equals(Group.APPLICATION_STATUS_KEY)) {
	    updateState();
	} else if (name.equals(VisibleGroup.MODAL_MEMBER_KEY)) {
	    updateState();
	} else if (name.equals(WorkflowGroup.WORKFLOW_STATUS_KEY)) {
	    updateState();
	} else if (name.equals(WorkflowGroup.ACTIVE_TOOL_KEY)) {
	    updateState();
	} else if (name.equals(WorkflowGroup.ACTIVE_WORKFLOW_DOCUMENT_KEY)) {
=====================================================================
Found a 26 line (341 tokens) duplication in the following files: 
Starting at line 106 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphviz/DOTLayout2WorkflowProperties.java
Starting at line 137 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphviz/DOTLayout2WorkflowProperties.java
                        throw new GraphVizException("No control points for edge " + edge.getPlaceID() + " -> " + transition.getID());
                    StringBuffer sb = new StringBuffer();
                    for (int k = 0; k < cp.length; k++) {
                        if (sb.length() > 0)
                            sb.append(",");
                        sb.append("(").append(cp[k].x).append(",").append(bb.height - cp[k].y).append(")");
                    }
                    transition.getProperties().put(edgepropertyprefix + ".cp", sb.toString());
                    if (layoutbuilder.hasEdgeArrowAtStart(edge.getPlaceID(), transition.getID())) {
                        Point ps = layoutbuilder.getEdgePointOfArrowAtStart(edge.getPlaceID(), transition.getID());
                        transition.getProperties().put(edgepropertyprefix + ".ps.x", "" + ps.x);
                        transition.getProperties().put(edgepropertyprefix + ".ps.y", "" + (bb.height - ps.y));
                    }
                    if (layoutbuilder.hasEdgeArrowAtEnd(edge.getPlaceID(), transition.getID())) {
                        Point pe = layoutbuilder.getEdgePointOfArrowAtEnd(edge.getPlaceID(), transition.getID());
                        transition.getProperties().put(edgepropertyprefix + ".pe.x", "" + pe.x);
                        transition.getProperties().put(edgepropertyprefix + ".pe.y", "" + (bb.height - pe.y));
                    }
                    Point lp = layoutbuilder.getEdgeLabelPosition(edge.getPlaceID(), transition.getID());
                    if (lp != null) {
                        transition.getProperties().put(edgepropertyprefix + ".lp.x", "" + lp.x);
                        transition.getProperties().put(edgepropertyprefix + ".lp.y", "" + (bb.height - lp.y));
                    }
                }

                Edge[] outedges = transition.getOutEdges();
=====================================================================
Found a 56 line (340 tokens) duplication in the following files: 
Starting at line 94 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/IGApplet.java
Starting at line 93 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MediGRIDApplet.java
            controller = new WorkflowController(executor);
//            loader = new WorkflowLoader(executor, _gui);
        } catch (Exception e) {
            logger.error("exception during Applet.init(): " + e, e);
        }
        WorkflowDocumentInspector inspector = new WorkflowDocumentInspector(executor);
        UAA uaa = new NullUAA();

        UserTaskHandler taskhandler = new UserTaskHandler();
        InputTaskProducer4Decision decisionproducer = new GraphInputTaskProducer4Decision(graphmanager.getGraphPane(), executor, uaa, this);
        taskhandler.addUserTaskProducer(decisionproducer);

        transitionnodepainter.addButton(new TransitionStatusIcon(graphmanager.getGraphPane()));
        placenodepainter.addButton(new NodeButton4Decision(decisionproducer));

        statusview.setUserTaskHandler(taskhandler);

        PlaceInspector tokenmanipulator = new PlaceInspector(executor, null);
        TransitionInspector conditionmanipulator = new TransitionInspector(executor, null);

        graphmanager.getGraphPane().setNodePainter(TransitionNode.class, transitionnodepainter);
        graphmanager.getGraphPane().setNodePainter(PlaceNode.class, placenodepainter);
        graphmanager.getGraphPane().setEdgePainter(ReadEdge.class, arcedgepainter);
        graphmanager.getGraphPane().setEdgePainter(InEdge.class, arcedgepainter);
        graphmanager.getGraphPane().setEdgePainter(OutEdge.class, arcedgepainter);
        graphmanager.getGraphPane().addManipulator(placenodepainter.getGraphManipulator());
        graphmanager.getGraphPane().addManipulator(tokenmanipulator.getManipulator());
        graphmanager.getGraphPane().addManipulator(conditionmanipulator.getManipulator());
        graphmanager.getGraphPane().addManipulator(new DefaultCursor(Theme.getCursor(DEFAULT_CURSOR_KEY)));

        _gui.addLayer(0, new LayoutLayer(new BorderLayout(),
                "kwfgrid.GWUI.transparent-pane",
                false));

        _gui.addMember(graphmanager, 0);

        LayoutLayer bottompane = new LayoutLayer(new GridBagLayout(),
                "kwfgrid.GWUI.transparent-pane",
                false);
        LayoutLayer d_bottompane = new LayoutLayerDecorator(new BorderLayout(),
                "kwfgrid.GWUI.widget-pane",
                false,
                bottompane,
                BorderLayout.SOUTH);


        _gui.addLayer(10, d_bottompane);

        GridBagConstraints c = new GridBagConstraints();

        c.weightx = 0.0;
        c.fill = GridBagConstraints.NONE;

        //_gui.addMember(loader, 10, c);

        _gui.addMember(controller, 10, c);
=====================================================================
Found a 39 line (332 tokens) duplication in the following files: 
Starting at line 233 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/TransitionNodePainter2.java
Starting at line 132 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/TransitionNodePainter.java
        Stroke oldstroke = g.getStroke();
        Color oldcolor = g.getColor();
        TransitionNode tn = (TransitionNode) node;
        NodePainter state = getState(tn);
        state.paintNode(gpane, g, node);
        g.setStroke(oldstroke);
        g.setColor(oldcolor);
    }

    public boolean isInNode(JGraphPane gpane, Node node, Point point) {
        TransitionNode tn = (TransitionNode) node;
        NodePainter state = getState(tn);
        return state.isInNode(gpane, node, point);
    }

    public void getNodeScreenBounds(JGraphPane gpane, Node node, Rectangle bounds) {
        TransitionNode tn = (TransitionNode) node;
        NodePainter state = getState(tn);
        state.getNodeScreenBounds(gpane, node, bounds);
    }

    public String getToolTipText(JGraphPane gpane, Node node, Point point) {
        TransitionNode tnode = (TransitionNode) node;
        StringBuffer t = new StringBuffer();
        String level = XMLUtilities.getAbstractionLevelDescription(tnode.getTransition());
        t.append("<html>").append(level).append("<br>ID: <b>").append(tnode.getTransition().getID()).append("</b>");
        String description = (String) tnode.getTransition().getDescription();
        if (description != null && description.length() > 0) {
            t.append("<br><i>").append(description).append("</i>");
        }
        String lastResource = tnode.getTransition().getProperties().get("last.resource.name");
        if (lastResource != null && lastResource.length() >0)
            t.append("<br><br>last used resource: <b>").append(lastResource).append("</b>");
        t.append(tnode.getOperationToolTipText());
        t.append("</html>");
        return t.toString();
    }

    protected NodePainter getState(TransitionNode node) {
=====================================================================
Found a 31 line (318 tokens) duplication in the following files: 
Starting at line 94 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/de/fzi/wim/guibase/graphview/view/ArrowEdgePainter.java
Starting at line 20 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/de/fzi/wim/guibase/graphview/view/AbstractEdgePainter.java
    public double screenDistanceFromEdge(JGraphPane graphPane,Edge edge,Point point) {
        double px=point.x;
        double py=point.y;
        Point from=graphPane.getScreenPointForNode(edge.getFrom());
        Point to=graphPane.getScreenPointForNode(edge.getTo());
        double x1=from.x;
        double y1=from.y;
        double x2=to.x;
        double y2=to.y;
        if (px<Math.min(x1,x2)-8 || px>Math.max(x1,x2)+8 || py<Math.min(y1,y2)-8 || py>Math.max(y1,y2)+8)
            return 1000;
        double dist=1000;
        if (x1-x2!=0)
            dist=Math.abs((y2-y1)/(x2-x1)*(px-x1)+(y1-py));
        if (y1-y2!=0)
            dist=Math.min(dist,Math.abs((x2-x1)/(y2-y1)*(py-y1)+(x1-px)));
        return dist;
    }
    /**
     * Returns the outer rectangle of the edge on screen.
     *
     * @param graphPane             the graph pane
     * @param edge                  the edge
     * @param edgeScreenRectangle   the rectangle receiving the edge's coordinates
     */
    public void getEdgeScreenBounds(JGraphPane graphPane,Edge edge,Rectangle edgeScreenRectangle) {
        Point from=graphPane.getScreenPointForNode(edge.getFrom());
        Point to=graphPane.getScreenPointForNode(edge.getTo());
        edgeScreenRectangle.setBounds(Math.min(from.x,to.x),Math.min(from.y,to.y),Math.abs(to.x-from.x)+1,Math.abs(to.y-from.y)+1);
    }
}
=====================================================================
Found a 44 line (291 tokens) duplication in the following files: 
Starting at line 165 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/IGApplet.java
Starting at line 206 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MainApplet.java
        _gui.addMember(statusview);

        _gui.setProperty(VisibleGroup.VIEWPORT_SIZE_KEY, getContentPane().getSize());

        GWUI.getInstance().addMember(_gui);
        getContentPane().setLayout(new BorderLayout());
        getContentPane().add(_gui.getView(), BorderLayout.CENTER);
        getContentPane().validate();

        // GWUI is initiated.
        GWUI.getInstance().setProperty(Group.APPLICATION_STATUS_KEY, Group.INITIATED);
        // Set th workflow ID.
        setWorkflowID(getParameter(GWUI.WORKFLOW_ID_KEY));
    }


    public void start() {
        if (!Group.RUNNING.equals(GWUI.getInstance().getProperty(Group.APPLICATION_STATUS_KEY)))
            GWUI.getInstance().setProperty(Group.APPLICATION_STATUS_KEY, Group.RUNNING);
    }

    public void stop() {
        if (Group.RUNNING.equals(GWUI.getInstance().getProperty(Group.APPLICATION_STATUS_KEY)))
            GWUI.getInstance().setProperty(Group.APPLICATION_STATUS_KEY, Group.PAUSED);
    }

    public void destroy() {
        if (!Group.EXITING.equals(GWUI.getInstance().getProperty(Group.APPLICATION_STATUS_KEY)))
            GWUI.getInstance().setProperty(Group.APPLICATION_STATUS_KEY, Group.EXITING);
    }

    public void showDocument(URL url) {
        getAppletContext().showDocument(url);
    }

    public void showDocument(URL url, String target) {
        getAppletContext().showDocument(url, target);
    }

    public void setWorkflowID(String workflowid) {
        if ("".equals(workflowid)) workflowid = null;
        _gui.setWorkflowID(workflowid);
    }
}
=====================================================================
Found a 57 line (278 tokens) duplication in the following files: 
Starting at line 116 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/ArcEdgePainter.java
Starting at line 174 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/ArcEdgePainter.java
    private ZoomableEdgePainter _readcubiccurvepainter = new AbstractCubicCurveReadEdgePainter(ARROW_SIZE.height, ARROW_SIZE.width) {
        protected Point2D[] getControlPoints(Edge e) {
            return ((ArcEdge) e).getControlPoints();
        }

        protected boolean hasArrowAtStart(Edge e) {
            return ((ArcEdge) e).hasArrowAtStart();
        }

        protected boolean hasArrowAtEnd(Edge e) {
            return ((ArcEdge) e).hasArrowAtEnd();
        }

        protected Point2D getPointOfArrowAtStart(Edge e) {
            return ((ArcEdge) e).getPointOfArrowAtStart();
        }

        protected Point2D getPointOfArrowAtEnd(Edge e) {
            return ((ArcEdge) e).getPointOfArrowAtEnd();
        }

        protected boolean hasLabel(Edge e) {
            return ((ArcEdge) e).hasLabel();
        }

        protected Point2D getLabelPosition(Edge e) {
            return ((ArcEdge) e).getLabelPosition();
        }

        protected Color getEdgeColor(JGraphPane gpane, Edge edge) {
            return COLOR;
        }

        protected Color getPointerColor(JGraphPane gpane, Edge edge) {
            return COLOR;
        }

        protected Color getTextColor(JGraphPane gpane, Edge edge) {
            return TEXT_COLOR;
        }

        protected Font getFont(JGraphPane gpane, Edge edge) {
            return FONT;
        }

        protected Stroke getEdgeStroke(JGraphPane gpane, Edge edge) {
            return STROKE;
        }

        protected String getEdgeLabel(JGraphPane grp, Edge e) {
            String l = _paintlabels ? ((ArcEdge) e).getLabel() : "";
            if (l.length() > _labellength) {
                l = l.substring(0, _labellength) + "...";
            }
            return l;
        }
    };
=====================================================================
Found a 41 line (275 tokens) duplication in the following files: 
Starting at line 119 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/DraggingManipulator.java
Starting at line 116 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/de/fzi/wim/guibase/graphview/controller/DraggingManipulator.java
            autoscroll(e);
            moveDraggedEdge(e.getPoint());
            e.consume();
        }
    }
    protected boolean isStartDraggingEvent(MouseEvent e) {
        return (e.getModifiers() & MouseEvent.SHIFT_MASK)!=0;
    }
    /**
     * Moves the dragged node to given point.
     *
     * @param point                         the screen point where the node should be dragged
     */
    protected void moveDraggedNode(Point point) {
        if (!point.equals(m_lastPosition)) {
            m_lastPosition.setLocation(point.x,point.y);
            point.x-=m_grabPoint1.x;
            point.y-=m_grabPoint1.y;
            Point2D graphPoint=new Point2D.Double();
            m_graphPane.screenToGraphPoint(point,graphPoint);
            m_draggedNode.setLocation(graphPoint.getX(),graphPoint.getY());
            m_graphPane.getGraph().notifyLayoutUpdated();
        }
    }
    /**
     * Moves the dragged edge to given point.
     *
     * @param point                         the screen point where the edge should be dragged
     */
    protected void moveDraggedEdge(Point point) {
        if (!point.equals(m_lastPosition)) {
            m_lastPosition.setLocation(point.x,point.y);
            Point2D graphPoint=new Point2D.Double();
            m_graphPane.screenToGraphPoint(new Point(point.x-m_grabPoint1.x,point.y-m_grabPoint1.y),graphPoint);
            m_draggedEdge.getFrom().setLocation(graphPoint.getX(),graphPoint.getY());
            m_graphPane.screenToGraphPoint(new Point(point.x-m_grabPoint2.x,point.y-m_grabPoint2.y),graphPoint);
            m_draggedEdge.getTo().setLocation(graphPoint.getX(),graphPoint.getY());
            m_graphPane.getGraph().notifyLayoutUpdated();
        }
    }
}
=====================================================================
Found a 37 line (270 tokens) duplication in the following files: 
Starting at line 53 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/GraphBuilder.java
Starting at line 68 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/GraphBuilder2.java
		    transitionnodes.add(node);
            Edge[] readedges = transition.getReadEdges();
            if (readedges!=null) {
            for (int j=0; j<readedges.length; j++) {
                Edge arc = readedges[j];
                PlaceNode from = (PlaceNode)placenodes.get(arc.getPlaceID());
                ReadEdge edge = new ReadEdge(from, node, arc);
                edges.add(edge);
            }
            }
		    Edge[] inedges = transition.getInEdges();
		    if (inedges!=null) {
			for (int j=0; j<inedges.length; j++) {
			    Edge arc = inedges[j];
			    PlaceNode from = (PlaceNode)placenodes.get(arc.getPlaceID());
			    InEdge edge = new InEdge(from, node, arc);
			    edges.add(edge);
			}
		    }
		    Edge[] outedges = transition.getOutEdges();
		    if (outedges!=null) {
			for (int j=0; j<outedges.length; j++) {
			    Edge arc = outedges[j];
			    PlaceNode to = (PlaceNode)placenodes.get(arc.getPlaceID());
			    OutEdge edge = new OutEdge(node, to, arc);
			    edges.add(edge);
			}
		    }
		}
	    }

	    _graph = new WorkflowGraph(_workflow);
	    _graph.addElements(placenodes.values(), null);
	    _graph.addElements(transitionnodes, null);
	    _graph.addElements(null, edges);
	}	
    }
=====================================================================
Found a 37 line (265 tokens) duplication in the following files: 
Starting at line 53 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/IGApplet.java
Starting at line 54 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MediGRIDApplet.java
    public MediGRIDApplet() {
        //
    }

    public void init() {
        // set special logger levels
        GWUI.setLoggerLevel(GWUI.SERVICESTUBS_PACKAGE,getParameter(GWUI.SERVICESTUBS_LOGGER_LEVEL_KEY));
        GWUI.setLoggerLevel(GWUI.GWESCLIENT_PACKAGE,getParameter(GWUI.GWESCLIENT_LOGGER_LEVEL_KEY));

        // set the global properties.
        GWUI.getInstance().setProperty(GWUI.GWES_URI_KEY, getParameter(GWUI.GWES_URI_KEY));
        GWUI.getInstance().setProperty(GWUI.GRAPHVIZ_URI_KEY, getParameter(GWUI.GRAPHVIZ_URI_KEY));
        GWUI.getInstance().setProperty(GWUI.XSD_PATH, getParameter(GWUI.XSD_PATH));
        if (getParameter(GWUI.XSD_PATH) != null) System.setProperty(GWUI.XSD_PATH, getParameter(GWUI.XSD_PATH));
        GWUI.getInstance().setProperty(GWUI.USER_ID_KEY, getParameter(GWUI.USER_ID_KEY));

        // Build the GUI.
        WorkflowStatusMonitor monitor = new WorkflowStatusMonitor();
        WorkflowStatusView statusview = new WorkflowStatusView();
        VisibleExecutor executor = new VisibleExecutor(statusview);
        WorkflowInstanceManager instancemanager = new SingleClientWorkflowInstanceManager();

        _gui = new VisibleWorkflowGroup(instancemanager);

        TransitionNodePainter2 transitionnodepainter = new TransitionNodePainter2();
        PlaceNodePainter placenodepainter = new PlaceNodePainter();
        ArcEdgePainter arcedgepainter = new ArcEdgePainter();

        WorkflowGraphAnalyzer analyzer = new DefaultWorkflowGraphAnalyzer();
        LensManager lensmanager = new LensManager();
        LayoutFactory layoutfactory = new DOTLayoutFactory(executor, lensmanager);
        WorkflowGraphManager graphmanager = new WorkflowGraphManager(analyzer, layoutfactory);
        lensmanager.setGraphPane(graphmanager.getGraphPane());
        lensmanager.addMember(arcedgepainter);
        lensmanager.addMember(transitionnodepainter);
        lensmanager.addMember(placenodepainter);
        WorkflowController controller = null;
=====================================================================
Found a 46 line (209 tokens) duplication in the following files: 
Starting at line 26 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/gui/AbstractJLabelView.java
Starting at line 26 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/gui/AbstractJTextFieldView.java
    protected AbstractJTextFieldView(ProtocolWorkflow target, IStructureObject element) {
	super(target, element);
	_view = null;
	_label = null;
    }

    /**
       Get the label to be displayed by this view.
     */
    protected abstract String getLabel();

    /**
       Get the title for this view.
     */
    protected abstract String getTitle();

    /**
       Check if a "objectsAdded" or "objectsRemoved" modification of the structure affects the label displayed by this view.
     */
    protected abstract boolean affectsLabel(IStructureObject parent, String namespace, String name, List objects);

    /**
       Check if a "propertyChanged" modification of the structure affects the label displayed by this view.
     */
    protected abstract boolean affectsLabel(IStructureObject parent, String namespace, String name, Object object);

    public void objectsAdded(IStructureObject parent, String namespace, String name, List objects) {
	if (affectsLabel(parent, namespace, name, objects)) updateView();
    }
    
    public void objectsRemoved(IStructureObject parent, String namespace, String name, List objects) {
	if (affectsLabel(parent, namespace, name, objects)) updateView();
    }
    
    public void propertyChanged(IStructureObject parent, String namespace, String name, Object newvalue) {
	if (affectsLabel(parent, namespace, name, newvalue)) updateView();
    }    

    protected void updateState() {
	_view.setEnabled(isEnabled());
	_label.setEnabled(isEnabled());
    }

    protected void updateView() {
	updateState();
	_label.setText(getLabel());
=====================================================================
Found a 44 line (205 tokens) duplication in the following files: 
Starting at line 147 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/ParseException.java
Starting at line 40 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/TokenMgrError.java
   protected static final String addEscapes(String str) {
      StringBuffer retval = new StringBuffer();
      char ch;
      for (int i = 0; i < str.length(); i++) {
        switch (str.charAt(i))
        {
           case 0 :
              continue;
           case '\b':
              retval.append("\\b");
              continue;
           case '\t':
              retval.append("\\t");
              continue;
           case '\n':
              retval.append("\\n");
              continue;
           case '\f':
              retval.append("\\f");
              continue;
           case '\r':
              retval.append("\\r");
              continue;
           case '\"':
              retval.append("\\\"");
              continue;
           case '\'':
              retval.append("\\\'");
              continue;
           case '\\':
              retval.append("\\\\");
              continue;
           default:
              if ((ch = str.charAt(i)) < 0x20 || ch > 0x7e) {
                 String s = "0000" + Integer.toString(ch, 16);
                 retval.append("\\u" + s.substring(s.length() - 4, s.length()));
              } else {
                 retval.append(ch);
              }
              continue;
        }
      }
      return retval.toString();
   }
=====================================================================
Found a 36 line (178 tokens) duplication in the following files: 
Starting at line 46 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractCubicCurveReadEdgePainter.java
Starting at line 34 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractCubicCurveEdgePainter.java
	_aw = (int)((double)_arrowwidth * zf);
    }

    public void paintEdge(JGraphPane grp, Graphics2D g, Edge e) {
	Point2D[] cp = getControlPoints(e);

	g.setColor(getEdgeColor(grp, e));
	g.setStroke(getEdgeStroke(grp, e));	

	// paint the spline	
	for (int i=0; i+3<cp.length; i+=3) {
	    grp.graphToScreenPoint(cp[i], _p1);
	    grp.graphToScreenPoint(cp[i+1], _cp1);
	    grp.graphToScreenPoint(cp[i+2], _cp2);
	    grp.graphToScreenPoint(cp[i+3], _p2);
	    _curve.setCurve(_p1.x, _p1.y, _cp1.x, _cp1.y, _cp2.x, _cp2.y, _p2.x, _p2.y);
	    g.draw(_curve);

	    /*
	    /// For Test
	    g.setColor(Color.red);
	    g.fillRect(_cp1.x-5, _cp1.y-5, 11, 11);
	    g.setColor(Color.green);
	    g.fillRect(_cp2.x-2, _cp2.y-2, 5, 5);
	    g.setColor(getEdgeColor(grp, e));
	    g.drawRect(_cp1.x-5, _cp1.y-5, 11, 11);
	    g.drawRect(_cp2.x-2, _cp2.y-2, 5, 5);
	    ///
	    */
	}

	// paint the arrows
	g.setColor(getPointerColor(grp, e));

	if (hasArrowAtStart(e)) {
	    Point2D p0 = cp[0];
=====================================================================
Found a 32 line (177 tokens) duplication in the following files: 
Starting at line 68 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/IGApplet.java
Starting at line 65 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MainApplet.java
        if (getParameter(GWUI.XSD_PATH) != null) System.setProperty(GWUI.XSD_PATH, getParameter(GWUI.XSD_PATH));

        // Build the GUI.
        WorkflowStatusMonitor monitor = new WorkflowStatusMonitor();
        WorkflowStatusView statusview = new WorkflowStatusView();
        VisibleExecutor executor = new VisibleExecutor(statusview);
        WorkflowInstanceManager instancemanager = new SingleClientWorkflowInstanceManager();

        _gui = new VisibleWorkflowGroup(instancemanager);

        TransitionNodePainter2 transitionnodepainter = new TransitionNodePainter2();
        PlaceNodePainter placenodepainter = new PlaceNodePainter();
        ArcEdgePainter arcedgepainter = new ArcEdgePainter();

        WorkflowGraphAnalyzer analyzer = new DefaultWorkflowGraphAnalyzer();
        LensManager lensmanager = new LensManager();
        LayoutFactory layoutfactory = new DOTLayoutFactory(executor, lensmanager);
        WorkflowGraphManager graphmanager = new WorkflowGraphManager(analyzer, layoutfactory);
        lensmanager.setGraphPane(graphmanager.getGraphPane());
        lensmanager.addMember(arcedgepainter);
        lensmanager.addMember(transitionnodepainter);
        lensmanager.addMember(placenodepainter);
        WorkflowController controller = null;
        WorkflowLoader loader = null;
        try {
            controller = new WorkflowController(executor);
            loader = new WorkflowLoader(executor, _gui);
        } catch (Exception e) {
            logger.error("exception during Applet.init(): " + e, e);
        }
        WorkflowDocumentInspector inspector = new WorkflowDocumentInspector(executor);
        UAA uaa = new UAA(this);
=====================================================================
Found a 25 line (176 tokens) duplication in the following files: 
Starting at line 44 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/GWUIApplet.java
Starting at line 43 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/WorkflowControlApplet.java
	GWUI.getInstance().setProperty(GWUI.GWES_URI_KEY, getParameter(GWUI.GWES_URI_KEY));
	GWUI.getInstance().setProperty(GWUI.USER_ID_KEY, getParameter(GWUI.USER_ID_KEY));
	GWUI.getInstance().setProperty(GWUI.UAA_FRAME_KEY, getParameter(GWUI.UAA_FRAME_KEY));
	GWUI.getInstance().setProperty(GWUI.UAA_PORTLET_URL_KEY, getParameter(GWUI.UAA_PORTLET_URL_KEY));
	GWUI.getInstance().setProperty(GWUI.XSD_PATH, getParameter(GWUI.XSD_PATH));
        if (getParameter(GWUI.XSD_PATH) != null) System.setProperty(GWUI.XSD_PATH, getParameter(GWUI.XSD_PATH));
	
	// Build the GUI.
	_gui = WorkflowAppletGroup.getInstance(this);
	//_gui.getExecutor(this).execute(new Runnable() {
	SwingThread.invokeLater(new Runnable() {
		public void run() {
            try {
		        doInit();
            } catch (Exception e) {
                logger.error("Exception during doInit(): "+e, e);
            }
		}
	    });
    }

    private void doInit() throws Exception {
	_group = new JLayeredGroup() {
		public String getIdentifier() {
		    return WorkflowControlApplet.this.IDENTIFIER;
=====================================================================
Found a 24 line (159 tokens) duplication in the following files: 
Starting at line 42 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/DraggingManipulator.java
Starting at line 39 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/de/fzi/wim/guibase/graphview/controller/DraggingManipulator.java
    }
    public String getName() {
        return NAME;
    }
    public boolean isDragging() {
        return m_draggedNode!=null || m_draggedEdge!=null;
    }
    public Node getDraggedNode() {
        return m_draggedNode;
    }
    public Edge getDraggedEdge() {
        return m_draggedEdge;
    }
    public void mousePressed(MouseEvent e) {
        if (m_graphPane.isEnabled() && (e.getModifiers() & MouseEvent.BUTTON1_MASK)!=0 && isStartDraggingEvent(e)) {
            Point point=e.getPoint();
            m_draggedNode=m_graphPane.getNodeAtPoint(point);
            if (m_draggedNode!=null) {
                m_lastPosition=e.getPoint();
                Point nodeScreenPoint=m_graphPane.getScreenPointForNode(m_draggedNode);
                m_grabPoint1=new Point(point.x-nodeScreenPoint.x,point.y-nodeScreenPoint.y);
                m_oldFixedState1=m_draggedNode.isFixed();
                m_draggedNode.setFixed(true);
                m_graphCursor=m_graphPane.getCursor();
=====================================================================
Found a 19 line (156 tokens) duplication in the following files: 
Starting at line 76 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/NodeIconSet.java
Starting at line 139 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/NodeIconSet.java
		width = 0;
	    }
	    iconbounds.setSize(width, height);
	    getIconsOffset(node, nodebounds, iconbounds);
	}
	public void paintNode(JGraphPane graphpane,Graphics2D g,Node node) {
	    if (getIconCount(node)>0) {
		if (isR.x == 0 && isR.y == 0 && isR.width == 0 && isR.height == 0) {
		    _painter.getNodeScreenBounds(graphpane, node, nR);
		    getIconsBounds(node, nR, isR);
		}
		
		int x = isR.x + _insets.left;
		int y = isR.y + _insets.top;
		
		for (int i=0; i<_icons.length; i++) {
		    Icon icon = _icons[i];
		    if (icon.affectsNode(node)) {
			paintIcon(graphpane, g, node, icon, x, y);
=====================================================================
Found a 23 line (154 tokens) duplication in the following files: 
Starting at line 83 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/taskframework/SimpleDataInputForm.java
Starting at line 327 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/gui/PlaceTokenEditor.java
	    _tokenbox = new JComboBox(new TokenBoxModel(((Place)getElement()).getTokens()));
	    _tokenbox.addItemListener(ITEM_LISTENER);
	    _tokenarea = new JTextArea(10, 40);
	    if (_tokenbox.getSelectedItem() instanceof Token) {
            Token token = (Token)_tokenbox.getSelectedItem();
            if (token.getData() != null) {
                //data token
                _tokenarea.setText(token.getData().toXML());
            } else {
                // control token
                Boolean control = token.getControl();
                _tokenarea.setText(control.booleanValue() ? "<control>true</control>" : "<control>false</control>");
            }
	    }
	    _tokenarea.addMouseListener(MOUSE_LISTENER);
	    _tokenarea.getDocument().addDocumentListener(INPUT_LISTENER);
	    _label_token_num = new JLabel("0 Tokens");

	    GridBagLayout gridbag = new GridBagLayout();
	    GridBagConstraints c = new GridBagConstraints();

	    _view = new JPanel();
	    _view.setLayout(gridbag);
=====================================================================
Found a 16 line (150 tokens) duplication in the following files: 
Starting at line 184 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/SwingFactory.java
Starting at line 247 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/SwingFactory.java
    private static final JTextField styleTextField(JTextField area, String themepath) {
	Color bordercolor = Theme.getColor(themepath+".border.color");
	Color bgcolor = Theme.getColor(themepath+".background.color");
	Font font = Theme.getFont(themepath+".font");
	Insets insets = Theme.getInsets(themepath+".insets");	
	Color txcolor = Theme.getColor(themepath+".text.color");
	Dimension size = Theme.getSize(themepath+".size");
	Border border = null;
	if (insets.top>0 && insets.bottom>0 && insets.left>0 && insets.right>0) {
	    border = BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(bordercolor, 1),
							BorderFactory.createEmptyBorder(insets.top-1, 
											insets.left-1, 
											insets.bottom-1, 
											insets.right-1));
	}
	area.setColumns(size.width);
=====================================================================
Found a 35 line (149 tokens) duplication in the following files: 
Starting at line 121 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/IGApplet.java
Starting at line 141 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MainApplet.java
        _gui.addLayer(9, d_toppane);

        _gui.addLayer(0, new LayoutLayer(new BorderLayout(),
                "kwfgrid.GWUI.transparent-pane",
                false));

        _gui.addMember(graphmanager, 0);

        LayoutLayer bottompane = new LayoutLayer(new GridBagLayout(),
                "kwfgrid.GWUI.transparent-pane",
                false);
        LayoutLayer d_bottompane = new LayoutLayerDecorator(new BorderLayout(),
                "kwfgrid.GWUI.widget-pane",
                false,
                bottompane,
                BorderLayout.SOUTH);


        _gui.addLayer(10, d_bottompane);

        GridBagConstraints c = new GridBagConstraints();

        c.weightx = 0.0;
        c.fill = GridBagConstraints.NONE;
        _gui.addMember(loader, 10, c);

        _gui.addMember(controller, 10, c);

        c.weightx = 1.0;
        c.fill = GridBagConstraints.BOTH;
        _gui.addMember(executor, 10, c);

        c.weightx = 0.0;
        c.fill = GridBagConstraints.NONE;
        _gui.addMember(lensmanager, 10, c);
=====================================================================
Found a 16 line (148 tokens) duplication in the following files: 
Starting at line 65 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/DraggingManipulator.java
Starting at line 63 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/de/fzi/wim/guibase/graphview/controller/DraggingManipulator.java
                m_graphPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                e.consume();
            }
            else {
                m_draggedEdge=m_graphPane.getNearestEdge(point);
                if (m_draggedEdge!=null) {
                    m_lastPosition=e.getPoint();
                    Point fromPoint=m_graphPane.getScreenPointForNode(m_draggedEdge.getFrom());
                    m_grabPoint1=new Point(point.x-fromPoint.x,point.y-fromPoint.y);
                    Point toPoint=m_graphPane.getScreenPointForNode(m_draggedEdge.getTo());
                    m_grabPoint2=new Point(point.x-toPoint.x,point.y-toPoint.y);
                    m_oldFixedState1=m_draggedEdge.getFrom().isFixed();
                    m_oldFixedState1=m_draggedEdge.getTo().isFixed();
                    m_draggedEdge.getFrom().setFixed(true);
                    m_draggedEdge.getTo().setFixed(true);
                    m_graphCursor=m_graphPane.getCursor();
=====================================================================
Found a 19 line (146 tokens) duplication in the following files: 
Starting at line 102 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/GWUIApplet.java
Starting at line 111 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MainApplet.java
        statusview.setUserTaskHandler(tasklist);

        graphmanager.getGraphPane().setNodePainter(TransitionNode.class, transitionnodepainter);
        graphmanager.getGraphPane().setNodePainter(PlaceNode.class, placenodepainter);
        graphmanager.getGraphPane().setEdgePainter(ReadEdge.class, arcedgepainter);
        graphmanager.getGraphPane().setEdgePainter(InEdge.class, arcedgepainter);
        graphmanager.getGraphPane().setEdgePainter(OutEdge.class, arcedgepainter);
        graphmanager.getGraphPane().addManipulator(transitionnodepainter.getGraphManipulator());
        graphmanager.getGraphPane().addManipulator(placenodepainter.getGraphManipulator());
        graphmanager.getGraphPane().addManipulator(tokenmanipulator.getManipulator());
        graphmanager.getGraphPane().addManipulator(conditionmanipulator.getManipulator());
        /*
      graphmanager.getGraphPane().addManipulator(new DraggingManipulator(Theme.getCursor(DRAGGING_MANIPULATOR_CURSOR_KEY)) {
          protected boolean isStartDraggingEvent(MouseEvent e) {
              return true;
          }
          });
      */
        graphmanager.getGraphPane().addManipulator(new DefaultCursor(Theme.getCursor(DEFAULT_CURSOR_KEY)));
=====================================================================
Found a 32 line (141 tokens) duplication in the following files: 
Starting at line 80 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/DraggingManipulator.java
Starting at line 79 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/de/fzi/wim/guibase/graphview/controller/DraggingManipulator.java
                    m_graphPane.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
                    e.consume();
                }
            }
        }
    }
    public void mouseReleased(MouseEvent e) {
        if (m_draggedNode!=null) {
            moveDraggedNode(e.getPoint());
            m_draggedNode.setFixed(m_oldFixedState1);
            m_graphPane.setCursor(m_graphCursor);
            m_graphCursor=null;
            m_grabPoint1=null;
            m_draggedNode=null;
            m_lastPosition=null;
            e.consume();
        }
        if (m_draggedEdge!=null) {
            moveDraggedEdge(e.getPoint());
            m_draggedEdge.getFrom().setFixed(m_oldFixedState1);
            m_draggedEdge.getTo().setFixed(m_oldFixedState2);
            m_graphPane.setCursor(m_graphCursor);
            m_graphCursor=null;
            m_grabPoint1=null;
            m_grabPoint2=null;
            m_draggedEdge=null;
            m_lastPosition=null;
            e.consume();
        }
    }
    public void mouseDragged(MouseEvent e) {
        if (m_draggedNode!=null) {
=====================================================================
Found a 19 line (140 tokens) duplication in the following files: 
Starting at line 45 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractArrowReadEdgePainter.java
Starting at line 33 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractArrowEdgePainter.java
	_aw = (int)((double)_arrowwidth * zf);
    }

    public void paintEdge(JGraphPane grp,Graphics2D g,Edge e) {
	// prepare
	Point sp = grp.getScreenPointForNode(e.getFrom());
	Point ep = grp.getScreenPointForNode(e.getTo());

	getNodeScreenBounds(grp, e.getTo(), _bnde);	

	Point _sp = sp;
	Point _ep = getIntersection(_bnde, sp, ep);
	
	if (_sp == null || _ep == null || (_sp.x == _ep.x && _sp.y == _ep.y)) return;

	// draw the line
	g.setColor(getEdgeColor(grp, e));
	g.setStroke(getEdgeStroke(grp, e));
	g.drawLine(_sp.x, _sp.y, _ep.x, _ep.y);
=====================================================================
Found a 32 line (138 tokens) duplication in the following files: 
Starting at line 55 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/ArcEdgePainter.java
Starting at line 85 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/ArcEdgePainter.java
    private ZoomableEdgePainter _readlinepainter = new AbstractArrowReadEdgePainter(ARROW_SIZE.height, ARROW_SIZE.width) {
        protected Color getEdgeColor(JGraphPane gpane, Edge edge) {
            return COLOR;
        }

        protected Color getPointerColor(JGraphPane gpane, Edge edge) {
            return COLOR;
        }

        protected Color getTextColor(JGraphPane gpane, Edge edge) {
            return TEXT_COLOR;
        }

        protected Font getFont(JGraphPane gpane, Edge edge) {
            return FONT;
        }

        protected Stroke getEdgeStroke(JGraphPane gpane, Edge edge) {
            return STROKE;
        }

        protected String getEdgeLabel(JGraphPane grp, Edge e) {
            String l = _paintlabels ? ((ArcEdge) e).getLabel() : "";
            if (l.length() > _labellength) {
                l = l.substring(0, _labellength) + "...";
            }
            return l;
        }
    };

    // Painter for edges which have been layouted by graphviz.
    private ZoomableEdgePainter _cubiccurvepainter = new AbstractCubicCurveEdgePainter(ARROW_SIZE.height, ARROW_SIZE.width) {
=====================================================================
Found a 28 line (132 tokens) duplication in the following files: 
Starting at line 52 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/taskframework/SimpleDataInputForm.java
Starting at line 291 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/gui/PlaceTokenEditor.java
	_label_token_num.setText(token_num+" Token"+(token_num!=1?"s":""));

	// _view.setSize(_view.getLayout().preferredLayoutSize(_view));
	// _view.doLayout();
	// _view.validate();
    }

    public JComponent getView() {
	if (_view==null) {
	    _chooser = SwingFactory2.getFileChooser(GWUI.TOKEN_FILE_CHOOSER);

	    JMenuItem upload = new JMenuItem("new Token from File ...");
	    upload.addActionListener(ACTION_LISTENER);
	    upload.setActionCommand(UPLOAD_COMMAND);
	    _mitem_controltoken_true = new JMenuItem("new control Token 'true'");
	    _mitem_controltoken_true.addActionListener(ACTION_LISTENER);
	    _mitem_controltoken_true.setActionCommand(CONTROL_TOKEN_TRUE_COMMAND);
	    _mitem_controltoken_false = new JMenuItem("new control Token 'false'");
	    _mitem_controltoken_false.addActionListener(ACTION_LISTENER);
	    _mitem_controltoken_false.setActionCommand(CONTROL_TOKEN_FALSE_COMMAND);
	    _mitem_save = new JMenuItem("save current ...");
	    _mitem_save.addActionListener(ACTION_LISTENER);
	    _mitem_save.setActionCommand(SAVE_COMMAND);
	    _popup = new JPopupMenu("Content of Token");
	    _popup.add(upload);
	    _popup.add(_mitem_controltoken_true);
	    _popup.add(_mitem_controltoken_false);
	    _popup.add(new JPopupMenu.Separator());
=====================================================================
Found a 30 line (128 tokens) duplication in the following files: 
Starting at line 56 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/ArcEdgePainter.java
Starting at line 145 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphview/ArcEdgePainter.java
        protected Color getEdgeColor(JGraphPane gpane, Edge edge) {
            return COLOR;
        }

        protected Color getPointerColor(JGraphPane gpane, Edge edge) {
            return COLOR;
        }

        protected Color getTextColor(JGraphPane gpane, Edge edge) {
            return TEXT_COLOR;
        }

        protected Font getFont(JGraphPane gpane, Edge edge) {
            return FONT;
        }

        protected Stroke getEdgeStroke(JGraphPane gpane, Edge edge) {
            return STROKE;
        }

        protected String getEdgeLabel(JGraphPane grp, Edge e) {
            String l = _paintlabels ? ((ArcEdge) e).getLabel() : "";
            if (l.length() > _labellength) {
                l = l.substring(0, _labellength) + "...";
            }
            return l;
        }
    };

    private ZoomableEdgePainter _readcubiccurvepainter = new AbstractCubicCurveReadEdgePainter(ARROW_SIZE.height, ARROW_SIZE.width) {
=====================================================================
Found a 23 line (125 tokens) duplication in the following files: 
Starting at line 65 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MainApplet.java
Starting at line 68 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MediGRIDApplet.java
        GWUI.getInstance().setProperty(GWUI.USER_ID_KEY, getParameter(GWUI.USER_ID_KEY));

        // Build the GUI.
        WorkflowStatusMonitor monitor = new WorkflowStatusMonitor();
        WorkflowStatusView statusview = new WorkflowStatusView();
        VisibleExecutor executor = new VisibleExecutor(statusview);
        WorkflowInstanceManager instancemanager = new SingleClientWorkflowInstanceManager();

        _gui = new VisibleWorkflowGroup(instancemanager);

        TransitionNodePainter2 transitionnodepainter = new TransitionNodePainter2();
        PlaceNodePainter placenodepainter = new PlaceNodePainter();
        ArcEdgePainter arcedgepainter = new ArcEdgePainter();

        WorkflowGraphAnalyzer analyzer = new DefaultWorkflowGraphAnalyzer();
        LensManager lensmanager = new LensManager();
        LayoutFactory layoutfactory = new DOTLayoutFactory(executor, lensmanager);
        WorkflowGraphManager graphmanager = new WorkflowGraphManager(analyzer, layoutfactory);
        lensmanager.setGraphPane(graphmanager.getGraphPane());
        lensmanager.addMember(arcedgepainter);
        lensmanager.addMember(transitionnodepainter);
        lensmanager.addMember(placenodepainter);
        WorkflowController controller = null;
=====================================================================
Found a 7 line (123 tokens) duplication in the following files: 
Starting at line 55 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/TaskListApplet.java
Starting at line 59 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MainApplet.java
        GWUI.getInstance().setProperty(GWUI.GRAPHVIZ_URI_KEY, getParameter(GWUI.GRAPHVIZ_URI_KEY));
        GWUI.getInstance().setProperty(GWUI.USER_ID_KEY, getParameter(GWUI.USER_ID_KEY));
        GWUI.getInstance().setProperty(GWUI.UAA_FRAME_KEY, getParameter(GWUI.UAA_FRAME_KEY));
        GWUI.getInstance().setProperty(GWUI.UAA_PORTLET_URL_KEY, getParameter(GWUI.UAA_PORTLET_URL_KEY));
        GWUI.getInstance().setProperty(GWUI.FORM_SELECTION_SERVLET_URL_KEY, getParameter(GWUI.FORM_SELECTION_SERVLET_URL_KEY));
        GWUI.getInstance().setProperty(GWUI.XSD_PATH, getParameter(GWUI.XSD_PATH));
        if (getParameter(GWUI.XSD_PATH) != null) System.setProperty(GWUI.XSD_PATH, getParameter(GWUI.XSD_PATH));
=====================================================================
Found a 15 line (120 tokens) duplication in the following files: 
Starting at line 43 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/NodeIconSet.java
Starting at line 106 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/NodeIconSet.java
    private abstract class Vertical implements State {
	public Icon getIconAtPoint(JGraphPane graphpane, Node node, Point point) {
	    _painter.getNodeScreenBounds(graphpane, node, nR);
	    getIconsBounds(node, nR, isR);
	    
	    iR.x = isR.x + _insets.left;
	    iR.y = isR.y + _insets.top;
	    
	    for (int i=0; i<_icons.length; i++) {
		Icon icon = _icons[i];
		if (icon.affectsNode(node)) {
		    iR.width = icon.getIconWidth();
		    iR.height = icon.getIconHeight();
		    if (iR.contains(point)) return icon;
		    iR.y += icon.getIconHeight() + _insets.top;
=====================================================================
Found a 21 line (116 tokens) duplication in the following files: 
Starting at line 180 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/GWUIApplet.java
Starting at line 119 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/WorkflowControlApplet.java
Starting at line 120 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/TaskListApplet.java
	_gui.setAppletStatus(TaskListApplet.this, Group.EXITING);
	_group.setProperty(Group.APPLICATION_STATUS_KEY, Group.EXITING);
    }

    public void showDocument(URL url) {
	getAppletContext().showDocument(url);
    }

    public void showDocument(URL url, String target) {
	getAppletContext().showDocument(url, target);
    }

    public void setWorkflowID(final String workflowid) {
	_gui.getExecutor(this).execute(new Runnable() {
		public void run() {
		    logger.debug("Setting workflow ID "+ workflowid);
		    _gui.setWorkflowID("".equals(workflowid) ? null : workflowid);
		}
	    });
    }
}
=====================================================================
Found a 19 line (113 tokens) duplication in the following files: 
Starting at line 82 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractImageNodePainter.java
Starting at line 34 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/NullNodePainter.java
    }

    public boolean isInNode(JGraphPane graphpane,Node node,Point point) {
	getNodeScreenBounds(graphpane, node, _bounds);
	return _bounds.contains(point);
    }

    public void getNodeScreenBounds(JGraphPane graphpane, Node node, Rectangle nodebounds) {
	Point p = graphpane.getScreenPointForNode(node);
	nodebounds.setBounds((int)(p.x - _w / 2d),
			     (int)(p.y - _h / 2d),
			     (int)_w,
			     (int)_h);
    }

    public String getToolTipText(JGraphPane graphpane,Node node,Point point) {
	return null;
    }
}
=====================================================================
Found a 23 line (110 tokens) duplication in the following files: 
Starting at line 302 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 470 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
        jjtn000.setID(id==null?null:DOTParser.stripQuotes(id.image));
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }

  final public void edgeRHS() throws ParseException {
=====================================================================
Found a 18 line (107 tokens) duplication in the following files: 
Starting at line 32 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractCubicCurveReadEdgePainter.java
Starting at line 31 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractArrowReadEdgePainter.java
	_p1 = new Point();
	_p2 = new Point();
	_arrow = new Polygon();
	_arrowwidth = arrowwidth;
	_arrowlength = arrowlength;
	setZoomFactor(1d);
    }

    public void setZoomFactor(double zf) {
	_al = (int)((double)_arrowlength * zf);
	_aw = (int)((double)_arrowwidth * zf);
    }

    private static double calc(double c, double m) {
	return Math.sqrt(c*c/(1+m*m));
    }

    public void paintEdge(JGraphPane grp,Graphics2D g, Edge e) {
=====================================================================
Found a 9 line (106 tokens) duplication in the following files: 
Starting at line 106 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphviz/DOTLayout2WorkflowProperties.java
Starting at line 168 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/graphviz/DOTLayout2WorkflowProperties.java
                        throw new GraphVizException("No control points for edge " + transition.getID() + " -> " + edge.getPlaceID());
                    StringBuffer sb = new StringBuffer();
                    for (int k = 0; k < cp.length; k++) {
                        if (sb.length() > 0)
                            sb.append(",");
                        sb.append("(").append(cp[k].x).append(",").append(bb.height - cp[k].y).append(")");
                    }
                    transition.getProperties().put(edgepropertyprefix + ".cp", sb.toString());
                    if (layoutbuilder.hasEdgeArrowAtStart(transition.getID(), edge.getPlaceID())) {
=====================================================================
Found a 25 line (105 tokens) duplication in the following files: 
Starting at line 117 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 261 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 406 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 518 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
        jj_la1[13] = jj_gen;
        ;
      }
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }

  final public void edgeop() throws ParseException {
=====================================================================
Found a 6 line (105 tokens) duplication in the following files: 
Starting at line 43 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/GWUIApplet.java
Starting at line 58 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/MainApplet.java
        GWUI.getInstance().setProperty(GWUI.GWES_URI_KEY, getParameter(GWUI.GWES_URI_KEY));
        GWUI.getInstance().setProperty(GWUI.GRAPHVIZ_URI_KEY, getParameter(GWUI.GRAPHVIZ_URI_KEY));
        GWUI.getInstance().setProperty(GWUI.USER_ID_KEY, getParameter(GWUI.USER_ID_KEY));
        GWUI.getInstance().setProperty(GWUI.UAA_FRAME_KEY, getParameter(GWUI.UAA_FRAME_KEY));
        GWUI.getInstance().setProperty(GWUI.UAA_PORTLET_URL_KEY, getParameter(GWUI.UAA_PORTLET_URL_KEY));
        GWUI.getInstance().setProperty(GWUI.FORM_SELECTION_SERVLET_URL_KEY, getParameter(GWUI.FORM_SELECTION_SERVLET_URL_KEY));
=====================================================================
Found a 6 line (104 tokens) duplication in the following files: 
Starting at line 56 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractCubicCurveReadEdgePainter.java
Starting at line 137 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/graphview/AbstractCubicCurveReadEdgePainter.java
	for (int i=0; i+3<cp.length; i+=3) {
	    grp.graphToScreenPoint(cp[i], _p1);
	    grp.graphToScreenPoint(cp[i+1], _cp1);
	    grp.graphToScreenPoint(cp[i+2], _cp2);
	    grp.graphToScreenPoint(cp[i+3], _p2);
	    _curve.setCurve(_p1.x, _p1.y, _cp1.x, _cp1.y, _cp2.x, _cp2.y, _p2.x, _p2.y);
=====================================================================
Found a 23 line (103 tokens) duplication in the following files: 
Starting at line 302 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 636 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
        jjtn000.setValue(value==null?null:DOTParser.stripQuotes(value.image));
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }

  final private boolean jj_2_1(int xla) {
=====================================================================
Found a 23 line (102 tokens) duplication in the following files: 
Starting at line 227 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 302 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 342 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 578 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
      jj_consume_token(RBRACKET);
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }

  final public void a_list() throws ParseException {
=====================================================================
Found a 23 line (102 tokens) duplication in the following files: 
Starting at line 119 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 160 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
      }
    } catch (Throwable jjte000) {
    if (jjtc000) {
      jjtree.clearNodeScope(jjtn000);
      jjtc000 = false;
    } else {
      jjtree.popNode();
    }
    if (jjte000 instanceof RuntimeException) {
      {if (true) throw (RuntimeException)jjte000;}
    }
    if (jjte000 instanceof ParseException) {
      {if (true) throw (ParseException)jjte000;}
    }
    {if (true) throw (Error)jjte000;}
    } finally {
    if (jjtc000) {
      jjtree.closeNodeScope(jjtn000, true);
    }
    }
  }

  final public void ideq_stmt() throws ParseException {
=====================================================================
Found a 22 line (101 tokens) duplication in the following files: 
Starting at line 120 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 228 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }

  final public void node_stmt() throws ParseException {
=====================================================================
Found a 23 line (100 tokens) duplication in the following files: 
Starting at line 227 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
Starting at line 636 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/org/glassbox/dotparser/DOTParser.java
        jjtn000.setValue(value==null?null:DOTParser.stripQuotes(value.image));
    } catch (Throwable jjte000) {
      if (jjtc000) {
        jjtree.clearNodeScope(jjtn000);
        jjtc000 = false;
      } else {
        jjtree.popNode();
      }
      if (jjte000 instanceof RuntimeException) {
        {if (true) throw (RuntimeException)jjte000;}
      }
      if (jjte000 instanceof ParseException) {
        {if (true) throw (ParseException)jjte000;}
      }
      {if (true) throw (Error)jjte000;}
    } finally {
      if (jjtc000) {
        jjtree.closeNodeScope(jjtn000, true);
      }
    }
  }

  final private boolean jj_2_1(int xla) {
=====================================================================
Found a 12 line (100 tokens) duplication in the following files: 
Starting at line 36 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/WorkflowControlApplet.java
Starting at line 48 of /mnt/hda6/export/poseidon/hoheisel/Projekte/FIRST-Grid/svn-kwfgrid/gwui/src/main/java/net/kwfgrid/gwui/applet/TaskListApplet.java
	logger.debug("TaskListApplet instantiated.");
 	_gui = null;
	_group = null;
    }

    public void init() {
	// set the global properties.
	GWUI.getInstance().setProperty(GWUI.GWES_URI_KEY, getParameter(GWUI.GWES_URI_KEY));
	GWUI.getInstance().setProperty(GWUI.USER_ID_KEY, getParameter(GWUI.USER_ID_KEY));
	GWUI.getInstance().setProperty(GWUI.UAA_FRAME_KEY, getParameter(GWUI.UAA_FRAME_KEY));
	GWUI.getInstance().setProperty(GWUI.UAA_PORTLET_URL_KEY, getParameter(GWUI.UAA_PORTLET_URL_KEY));
	GWUI.getInstance().setProperty(GWUI.FORM_SELECTION_SERVLET_URL_KEY, getParameter(GWUI.FORM_SELECTION_SERVLET_URL_KEY));