public void schemeEditorDelElement() {
        if(ce_element.getSelectionIndex() == -1) return;
        String elementName = ce_element.getText();
        String elementType = scheme.getElements().get(elementName);
        Element element = library.getLibrary().get(elementType);
        
        ce_element.remove(elementName);
        scheme.getElements().remove(elementName);
        List<String> sourceFor = new LinkedList<String>();
  circ: for(String circuitName : scheme.getCircuits().keySet()) {
            Circuit circuit = scheme.getCircuits().get(circuitName);
            for(int n = element.getIcnt(); n < element.getIcnt() + element.getOcnt(); n++) {
                if(circuit.getContacts().contains(new Contact(elementName, n))) {
                    sourceFor.add(circuitName);
                    continue circ;
                }
            }
            for(int n = 0; n < element.getIcnt(); n++) {
                circuit.getContacts().remove(new Contact(elementName, n));
            }
        }
        for(String circuitName : sourceFor) {
            scheme.getCircuits().remove(circuitName);
            ce_circuit.remove(circuitName);
            ce_circuit2.remove(circuitName);
        }
        
        for(int n = 0; n < element.getIcnt() + element.getOcnt() + element.getEcnt(); n++)
        {
            se_signal.remove(new Contact(elementName, n).toString());
        }
        for(int n = 0; n < element.getIcnt(); n++)
        {
            ce_drain.remove(new Contact(elementName, n).toString());
        }
        for(int n = element.getIcnt(); n < element.getIcnt() + element.getOcnt(); n++)
        {
            ce_source.remove(new Contact(elementName, n).toString());
        }
        schemeEditorSchemeChanged();
        signalEditorSignalsChanged();
    }