diff --git a/resources/lib/args4j-2.33.jar b/resources/lib/args4j-2.33.jar new file mode 100644 index 0000000..61be8f3 Binary files /dev/null and b/resources/lib/args4j-2.33.jar differ diff --git a/src/app/App.java b/src/app/App.java new file mode 100644 index 0000000..c509962 --- /dev/null +++ b/src/app/App.java @@ -0,0 +1,56 @@ +package org.manzerbredes.open_klm.app; + +import org.kohsuke.args4j.CmdLineException; +import org.kohsuke.args4j.CmdLineParser; +import org.kohsuke.args4j.Option; +import org.manzerbredes.open_klm.client.MainWindow; +import org.manzerbredes.open_klm.drivers.*; +import org.manzerbredes.open_klm.drivers.DriverTypeA; +import org.manzerbredes.open_klm.drivers.DriverTypeA.*; + +/** + * Hello world! + * + */ +public class App +{ + @Option(name="-leftColor",usage="Set the left color") + public String leftColor=null; + @Option(name="-middleColor",usage="Set the middle color") + public String middleColor=null; + @Option(name="-rightColor",usage="Set the right color") + public String rightColor=null; + + public void parseArguments(){ + if(this.leftColor!=null || this.rightColor!=null || this.middleColor!=null){ + try { + DriverTypeA device=new Device_1770_ff00(); + if(this.leftColor==null) + this.leftColor="OFF"; + if(this.middleColor==null) + this.middleColor="OFF"; + if(this.rightColor==null) + this.rightColor="OFF"; + device.setRegionColor(Region.LEFT, Color.valueOf(leftColor), Intensity.HIGH); + device.setRegionColor(Region.MIDDLE, Color.valueOf(middleColor), Intensity.HIGH); + device.setRegionColor(Region.RIGHT, Color.valueOf(rightColor), Intensity.HIGH); + + } catch (InstantiationException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + System.exit(0); + } + + } + + public static void main( String[] args ) throws InstantiationException, CmdLineException + { + App app =new App(); + CmdLineParser parser = new CmdLineParser(app); + parser.parseArgument(args); + app.parseArguments(); + new MainWindow(); + + } +}