@Override
    public String getCode() {
        double size = getSize()/50;
        
        double x = getCentreX()/50;
        double y = getCentreY()/50;
        
        double maxY = 0;
        double minX = 0;
        double minY = 0;
        double[] graphSize = getGraphSize();
        if(graphSize != null){
            maxY = graphSize[1]/50;
            minX = graphSize[2]/50;
            minY = graphSize[3]/50;
        }
        
        x -= minX;
        
        
        
        //double middleY = (maxY + minY)/2;
        
        //if(y == middleY) y = 0;
        //else y = middleY - y;
        
        if(y == maxY) y = 0;
        else y = maxY - y;
        
        String comments = getComments();
        String newLine = System.getProperty("line.separator");
        
        
        String labelStr = "";
        if(!getLabel().isEmpty()){
            labelStr = newLine + "\\uput["+getLabelPosition()+"]("+x+","+y+
        "){"+getLabel()+"}";
        }
        
        if(dotStyle.equals(DEFAULT_DOT)){
            if(!comments.isEmpty())
                return comments + newLine + "\\dotnode[dotsize="+size+", linecolor="+
                    getNodeColourString()+"]("+x+","+y+"){"+getNodeID()+"}" + labelStr;
            return "\\dotnode[dotsize="+size+", linecolor="+
                    getNodeColourString()+"]("+x+","+y+"){"+getNodeID()+"}" + labelStr;
        }else{
            if(!comments.isEmpty())
                return comments + newLine + "\\dotnode[dotsize="+size+", linecolor="+
                    getNodeColourString()+",dotstyle="+dotStyle+"]("+x+","+y+
                    "){"+getNodeID()+"}" + labelStr;
            return "\\dotnode[dotsize="+size+", linecolor="+
                    getNodeColourString()+",dotstyle="+dotStyle+"]("+x+","+y+
                    "){"+getNodeID()+"}" + labelStr;
        }
    }