Subversion Repositories svn.mios

Rev

Rev 709 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
709 adamjking 1
package org.midibox.midi.xml;
2
 
721 adamjking 3
import org.midibox.midi.MidiFilterDevice;
4
import org.w3c.dom.Element;
5
import org.w3c.dom.Node;
709 adamjking 6
 
721 adamjking 7
public class MidiFilterDeviceXML extends VirtualMidiDeviceXML {
8
 
9
    MidiFilterDevice midiFilterDevice;
10
 
11
    protected String midiFilterDeviceAttrName = "name";
12
 
13
    protected String midiFilterDeviceAttrHashCode = "hashCode";
14
 
15
    protected String midiFilterTag = "midiFilter";
16
 
17
    public MidiFilterDeviceXML(MidiFilterDevice midiFilterDevice, String rootElementTag) {
18
 
19
        super(midiFilterDevice, rootElementTag);
20
 
21
        this.midiFilterDevice = midiFilterDevice;
22
 
23
        tags.add(midiFilterTag);
24
    }
25
 
26
    protected void parseElement(Element element) {
27
 
28
        super.parseElement(element);
29
 
30
        String name = element.getNodeName();
31
 
32
        if (name == midiFilterTag) {
33
 
34
            MidiFilterXML midiFilterXML = new MidiFilterXML(midiFilterDevice.getMidiFilter(), midiFilterTag);
35
 
36
            midiFilterXML.loadXML(element);
37
        }
38
    }
39
 
40
    public void saveXML(Node node) {
41
 
42
        super.saveXML(node);
43
 
44
        MidiFilterXML midiFilterXML = new MidiFilterXML(midiFilterDevice.getMidiFilter(), midiFilterTag);
45
 
46
        midiFilterXML.saveXML(rootElement);
47
    }
709 adamjking 48
}