Remove useless files
This commit is contained in:
parent
6500028632
commit
fb6d10b78b
2 changed files with 0 additions and 118 deletions
|
@ -1,71 +0,0 @@
|
|||
package org.manzerbredes.open_klm.device;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.manzerbredes.open_klm.device.Driver.*;
|
||||
|
||||
public class Keyboard{
|
||||
|
||||
/**
|
||||
* Device driver
|
||||
*/
|
||||
private Driver device;
|
||||
|
||||
/**
|
||||
* Keyboard State
|
||||
*/
|
||||
private KeyboardState state;
|
||||
|
||||
/**
|
||||
* Build a keyboard access
|
||||
*
|
||||
* @throws InstantiationException Throw if failed to instanciate driver
|
||||
*/
|
||||
public Keyboard() throws InstantiationException{
|
||||
this.device=new Driver();
|
||||
this.state=new KeyboardState();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* Change global keyboard color
|
||||
*
|
||||
* @param color Color to apply
|
||||
* @param intensity Intensity wanted
|
||||
*/
|
||||
public void setColor(Color color, Intensity intensity){
|
||||
//Save state
|
||||
this.state.setColor(color, intensity);
|
||||
|
||||
// Set color
|
||||
this.device.setColor(Region.LEFT, color, intensity);
|
||||
this.device.setColor(Region.MIDDLE, color, intensity);
|
||||
this.device.setColor(Region.RIGHT, color, intensity);
|
||||
|
||||
// Apply color
|
||||
this.device.commit(this.state.getMode());
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Change region keyboard color
|
||||
*
|
||||
* @param region Region to apply the color
|
||||
* @param color Color to apply
|
||||
* @param intensity Intensity wanted
|
||||
*/
|
||||
public void setRegionColor(Region region, Color color, Intensity intensity){
|
||||
// Save state
|
||||
this.state.setRegionColor(region, color, intensity);
|
||||
|
||||
// Set color
|
||||
this.device.setColor(region, color, intensity);
|
||||
|
||||
// Apply color
|
||||
this.device.commit(this.state.getMode());
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -1,47 +0,0 @@
|
|||
package org.manzerbredes.open_klm.device;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import org.javatuples.Pair;
|
||||
import org.manzerbredes.open_klm.device.Driver.Color;
|
||||
import org.manzerbredes.open_klm.device.Driver.Intensity;
|
||||
import org.manzerbredes.open_klm.device.Driver.Mode;
|
||||
import org.manzerbredes.open_klm.device.Driver.Region;
|
||||
|
||||
public class KeyboardState {
|
||||
|
||||
|
||||
|
||||
|
||||
public KeyboardState() {
|
||||
this.mode=Mode.NORMAL;
|
||||
}
|
||||
|
||||
public void setColor(Color color, Intensity intensity){
|
||||
this.KeyboardColor.put(Region.LEFT, new Pair<Driver.Color, Driver.Intensity>(color, intensity));
|
||||
this.KeyboardColor.put(Region.MIDDLE, new Pair<Driver.Color, Driver.Intensity>(color, intensity));
|
||||
this.KeyboardColor.put(Region.RIGHT, new Pair<Driver.Color, Driver.Intensity>(color, intensity));
|
||||
}
|
||||
|
||||
public void setRegionColor(Region region, Color color, Intensity intensity){
|
||||
this.KeyboardColor.put(region, new Pair<Driver.Color, Driver.Intensity>(color, intensity));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return the mode
|
||||
*/
|
||||
public Mode getMode() {
|
||||
return mode;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mode the mode to set
|
||||
*/
|
||||
public void setMode(Mode mode) {
|
||||
this.mode = mode;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue