Subversion Repositories svn.mios

Rev

Rev 722 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
721 adamjking 1
package org.midibox.midi.xml;
2
 
3
import org.midibox.midi.MidiMonitorFilteredDevice;
4
import org.w3c.dom.Element;
5
import org.w3c.dom.Node;
6
 
7
public class MidiMonitorFilteredDeviceXML extends VirtualMidiDeviceXML {
8
 
9
    protected MidiMonitorFilteredDevice midiMonitorFilteredDevice;
10
 
722 adamjking 11
    public final static String TAG_ROOT_ELEMENT = "midiMonitorFilteredDevice";
721 adamjking 12
 
13
    public MidiMonitorFilteredDeviceXML(
14
            MidiMonitorFilteredDevice midiMonitorFilteredDevice,
15
            String rootElementTag) {
16
 
17
        super(midiMonitorFilteredDevice, rootElementTag);
18
 
19
        this.midiMonitorFilteredDevice = midiMonitorFilteredDevice;
20
 
753 adamjking 21
        addTag(MidiMonitorFilteredXML.TAG_ROOT_ELEMENT);
721 adamjking 22
    }
23
 
24
    protected void parseElement(Element element) {
25
 
26
        super.parseElement(element);
27
 
28
        String name = element.getNodeName();
29
 
722 adamjking 30
        if (name == MidiMonitorFilteredXML.TAG_ROOT_ELEMENT) {
721 adamjking 31
 
32
            MidiMonitorFilteredXML midiMonitorFilteredXML = new MidiMonitorFilteredXML(
33
                    midiMonitorFilteredDevice.getMidiMonitorFiltered(),
722 adamjking 34
                    MidiMonitorFilteredXML.TAG_ROOT_ELEMENT);
721 adamjking 35
 
36
            midiMonitorFilteredXML.loadXML(element);
37
        }
38
    }
39
 
40
    public void saveXML(Node node) {
41
 
42
        super.saveXML(node);
43
 
44
        MidiMonitorFilteredXML midiMonitorFilteredXML = new MidiMonitorFilteredXML(
45
                midiMonitorFilteredDevice.getMidiMonitorFiltered(),
722 adamjking 46
                MidiMonitorFilteredXML.TAG_ROOT_ELEMENT);
721 adamjking 47
 
48
        midiMonitorFilteredXML.saveXML(rootElement);
49
    }
50
}