private void drawDraggedObject() {

            if (draggedObject == null && draggedElement == null) {
                // Nothing to draw
                return;
            }

            g2d.setColor(draggedColor);
            // Rectangle 
            if (draggedElement instanceof Transition) {
                Transition t = (Transition) draggedElement;
                drawTransition(t.getX(), t.getY(), t.getColor(), t.getColor2(), t.getWidth(), t.getHeight(), t.getName(), t.getFontSize(), 2);
            }

            // Resource
            if (draggedElement instanceof Resource) {
                Resource r = (Resource) draggedElement;
                drawPlace(r.getX(), r.getY(), r.getColor(), r.getColor2(), r.getWidth(), r.getHeight(), r.getName() + " :" + r.getMarking(), r.getFontSize(), 2);
                //drawPlace(x, y, Color.GRAY, Color.gray);

            }

            // Place
            if (draggedElement instanceof Place) {
                Place p = (Place) draggedElement;
                drawPlace(p.getX(), p.getY(), p.getColor(), p.getColor2(), p.getWidth(), p.getHeight(), p.getName() + " :" + p.getMarkings(), p.getFontSize(), 2);
                //drawPlace(x, y, Color.GRAY, Color.gray);

            }
            // Node
            if (draggedElement instanceof Node) {
                Node n = (Node) draggedElement;
                drawPlace(n.getX(), n.getY(), n.getColor(), n.getColor2(), n.getWidth(), n.getHeight(), n.getName() + " :" + n.getCapacity(), n.getFontSize(), 2);
                //drawPlace(x, y, Color.GRAY, Color.gray);
            }

            // Selected is 
            if (draggedObject instanceof Line2D) //if(lineButton.isSelected())
            {
                int x1 = (int) ((Line2D) draggedObject).getX1();
                int y1 = (int) ((Line2D) draggedObject).getY1();
                int x2 = (int) ((Line2D) draggedObject).getX2();
                int y2 = (int) ((Line2D) draggedObject).getY2();
                //Arc a=(Arc) draggedObject;

                // Arc is selected when it is moving
                //Arc _arc=(Arc)selectedElements.get(0); 
                drawArrow(x1, y1, x2, y2, "long", "", 0);//_arc.getName(),_arc.getFontSize());
            }

        }