Created
January 13, 2011 03:06
-
-
Save kimukou/777323 to your computer and use it in GitHub Desktop.
steelseries-maventest.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// steelseries-maventest.groovy | |
// see http://harmoniccode.blogspot.com/ | |
// javadoc http://idisk.mac.com/han.solo-Public/SteelSeries3/javadoc/index.html | |
// | |
// test using: 1)Groovy Console Java Web Start | |
// http://dl.getdropbox.com/u/653108/groovy/console.jnlp | |
// | |
// 2)IntelliJ 10.0.1 CE | |
// Grape Plugin : http://plugins.intellij.net/plugin/?idea&id=4702 | |
// | |
// reference site: bluepapa32’s site | |
// http://d.hatena.ne.jp/bluepapa32/20101228/1293466511 | |
@GrabResolver (name='sonatype-release', root='https://oss.sonatype.org/content/repositories/releases/') | |
//@Grab(group = 'eu.hansolo', module='SteelSeries', version='3.5.3') | |
@Grab(group = 'eu.hansolo', module='SteelSeries', version='3.9') | |
@Grab(group='com.miglayout', module='miglayout', version='3.7.3') | |
import groovy.swing.SwingBuilder | |
//import javax.swing.* | |
import java.awt.* | |
//import javax.swing.WindowConstants as WC | |
import groovy.swing.factory.LayoutFactory | |
import net.miginfocom.swing.MigLayout | |
//import eu.hansolo.steelseries.extras.* //since 2.1 | |
import eu.hansolo.steelseries.tools.* | |
import eu.hansolo.steelseries.gauges.* | |
def swingBuilder = new SwingBuilder() | |
swingBuilder.edt { | |
frame(title:'steeltestFull', | |
//size: [900,900], | |
pack: true, | |
location: [50,50], | |
resizable: true, | |
locationByPlatform:true, | |
show: true | |
//,defaultCloseOperation:WC.EXIT_ON_CLOSE | |
) | |
{ | |
registerFactory("migLayout", new LayoutFactory(MigLayout)) | |
registerBeanFactory("radialGauge", Radial) | |
registerBeanFactory("radialBargraphGauge", RadialBargraph) | |
registerBeanFactory("linearGauge", Linear) | |
registerBeanFactory("linearBargraphGauge", LinearBargraph) | |
tabbedPane(){ | |
panel(title:"page1"){ | |
migLayout(layoutConstraints: "gap 0,insets 0,fill") | |
panel(constraints: "span,wrap, gapbottom 0,gaptop 0",border: emptyBorder(0)){ | |
boxLayout() | |
radialGauge(id:'radial',preferredSize: [300,300] | |
,value:10 | |
,lcdValue:15 | |
,titleAndUnitFont:new Font("MS ゴシック",Font.PLAIN,20) //Font Change(to Verdana) | |
,titleAndUnitFontEnabled:true //Font Change(to Verdana) | |
,title:'はひふへほ~' | |
,unitString:'パーセント' | |
,tickmarkSectionsVisible:true | |
,tickmarkSections:[[10,20,Color.BLUE],[50,60,Color.GREEN]] as Section[] | |
,customTickmarkLabelsEnabled:true | |
,customTickmarkLabels:[0, 10, 50, 100] as Double[] | |
) | |
radialBargraphGauge(id:'radialBargraph',preferredSize: [300,300] | |
,value:30 | |
,lcdValue:35 | |
,barGraphColor:ColorDef.BLUE | |
,lcdColor:LcdColor.YELLOW_LCD | |
) | |
} | |
panel(constraints: "span,wrap, gapbottom 0,gaptop 0",border: emptyBorder(0)){ | |
boxLayout() | |
linearGauge(id:'linear',preferredSize: [100,300] | |
,value:50 | |
,lcdValue:55 | |
,title:'hogehoge' | |
,valueColor:ColorDef.ORANGE | |
) | |
linearBargraphGauge(id:'linearBargraph',preferredSize: [300,100] | |
,value:70 | |
,lcdValue:75 | |
,valueColor:ColorDef.CYAN | |
,titleVisible:false | |
//,tickmarksVisible:false | |
) | |
} | |
} | |
} | |
} | |
} | |
println '秒' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment