public GraphLine[] getSelectedLines() {
        ArrayList<GraphElement> buffer = new ArrayList();
        Iterator<Map.Entry<Integer, GraphLine>> it = lines.entrySet().iterator();
        GraphLine bgp;
        while (it.hasNext()) {
             bgp = it.next().getValue();
            if (bgp.getComponent().getSelect()) {
                buffer.add(bgp);
            }
        }
        
        GraphLine[] gls = buffer.toArray(new GraphLine[0]);
        
        return gls;
    }