Revision 406:bd6463426a76

View differences:

src/main/java/cz/agents/alite/vis/layer/toggle/KeyToggleLayer.java
6 6
import javax.swing.KeyStroke;
7 7

  
8 8
import cz.agents.alite.vis.Vis;
9
import cz.agents.alite.vis.layer.VisLayer;
9 10

  
10 11

  
11 12
/**
......
19 20
    private final Integer toggleKeyCode;
20 21
    private KeyListener keyListener;
21 22

  
23
    
22 24
    protected KeyToggleLayer(String toggleKey) {
23 25
        this.toggleKey = toggleKey;
24 26
        this.toggleKeyCode = null;
25 27
    }
26 28

  
29
    protected KeyToggleLayer(String toggleKey, VisLayer layer) {
30
    	this.toggleKey = toggleKey;
31
    	this.toggleKeyCode = null;
32
    	addSubLayer(layer);
33
    }
34
    
27 35
    protected KeyToggleLayer(int toggleKeyCode) {
28 36
        this.toggleKey = null;
29 37
        this.toggleKeyCode = toggleKeyCode;
......
91 99
    public static KeyToggleLayer create(String toggleKeyCode) {
92 100
        return new KeyToggleLayer(toggleKeyCode);
93 101
    }
102
    
103
    public static KeyToggleLayer create(String toggleKeyCode, VisLayer visLayer) {
104
        return new KeyToggleLayer(toggleKeyCode, visLayer);
105
    }
94 106

  
95 107
}

Also available in: Unified diff