📄 maincontrolpanel.java
字号:
typeList.addItem("RESTRING"); typeList.setWidth(widthOfContent); type.add(Type); type.add(typeList); //build relation listbox VerticalPanel relation = new VerticalPanel(); Label Relation = new Label("Relation"); ListBox relationList = new ListBox(); relationList.addItem("=="); relationList.addItem(">="); relationList.addItem(">"); relationList.addItem("<="); relationList.addItem("<"); relationList.addItem("!="); relationList.setWidth(widthOfContent); relation.add(Relation); relation.add(relationList); //build requestable listbox VerticalPanel requestable = new VerticalPanel(); Label Requestable = new Label("Requestable"); ListBox requestableList = new ListBox(); requestableList.addItem("NO"); requestableList.addItem("YES"); requestableList.addItem("FORCE"); requestableList.setWidth(widthOfContent); requestable.add(Requestable); requestable.add(requestableList); //build consumable listbox VerticalPanel consumable = new VerticalPanel(); Label Consumable = new Label("Consumable"); ListBox consumableList = new ListBox(); consumableList.addItem("NO"); consumableList.addItem("YES"); consumableList.setWidth(widthOfContent); consumable.add(Consumable); consumable.add(consumableList); //build default box VerticalPanel defaults = new VerticalPanel(); Label Defaults = new Label("Default"); TextBox defaultsBox = new TextBox(); defaultsBox.setText("NONE"); defaultsBox.setWidth(widthOfContent); defaults.add(Defaults); defaults.add(defaultsBox); //build urgency box VerticalPanel urgency = new VerticalPanel(); Label Urgency = new Label("Urgency"); TextBox urgencyBox = new TextBox(); urgencyBox.setWidth(widthOfContent); urgency.add(Urgency); urgency.add(urgencyBox); //add up verticalpanel to content dockpanel'north northOfContent.add(name); northOfContent.add(shortcut); northOfContent.add(type); northOfContent.add(relation); northOfContent.add(requestable); northOfContent.add(consumable); northOfContent.add(defaults); northOfContent.add(urgency); content.add(northOfContent, DockPanel.NORTH); //build west of content'south String[] centerOfContent = {"Name","Shortcut","Type","Relation","Requestable", "Consumable","Default","Urgency"}; FlexTable centerofcontent = new FlexTable(); FlexCellFormatter cellFormatter = centerofcontent.getFlexCellFormatter(); int i; for(i = 0; i < 8; i++){ cellFormatter.setWidth(0, i, widthOfContent); cellFormatter.setStyleName(0, i, "gwt-FlexTableFirstRow"); Label tmp = new Label(centerOfContent[i]); tmp.setWidth(widthOfContent); centerofcontent.setWidget(0, i, tmp); } southOfContent.add(jobQueue(20, 8, centerofcontent), DockPanel.WEST); //build east of content'south VerticalPanel eastOfContent = new VerticalPanel(); eastOfContent.setSpacing(50); eastOfContent.setWidth(buttonWidth); Button add = new Button("Add"); Button modify = new Button("Modify"); Button delete = new Button("Delete"); Button load = new Button("Load"); Button save = new Button("Save"); add.setWidth(buttonWidth); modify.setWidth(buttonWidth); delete.setWidth(buttonWidth); load.setWidth(buttonWidth); save.setWidth(buttonWidth); //add buttons to eastOfContent eastOfContent.add(add); eastOfContent.add(modify); eastOfContent.add(delete); eastOfContent.add(load); eastOfContent.add(save); southOfContent.add(eastOfContent, DockPanel.EAST); content.add(southOfContent, DockPanel.SOUTH); westOfComplex.add(content); complex.add(westOfComplex, DockPanel.WEST); mainEast.clear(); mainEast.add(complex, DockPanel.CENTER); mainControl.add(mainEast, DockPanel.EAST); } /** * @author gaojinjun */ public void hostConfiguration(){ //main panel of host config DockPanel hostconfig = new DockPanel(); VerticalPanel eastOfHost = new VerticalPanel(); TabPanel westOfHost = new TabPanel(); //build east of host config eastOfHost.setSpacing(30); String buttonWidth = "100px"; Button add = new Button("Add"); Button modify = new Button("Modify"); Button delete = new Button("Delete"); Button shutdown = new Button("Shutdown"); Button done = new Button("Done"); Button help = new Button("Help"); add.setWidth(buttonWidth); modify.setWidth(buttonWidth); delete.setWidth(buttonWidth); shutdown.setWidth(buttonWidth); done.setWidth(buttonWidth); help.setWidth(buttonWidth); eastOfHost.add(add); eastOfHost.add(modify); eastOfHost.add(delete); eastOfHost.add(shutdown); eastOfHost.add(done); eastOfHost.add(help); //build west of host config String htmlWidth = "140px"; HTML adminHost = new HTML("Administration Host"); HTML submitHost = new HTML("Submit Host"); HTML hostGroup = new HTML("Host Groups"); HTML executionHost = new HTML("Execution Host"); adminHost.setWidth("180px"); submitHost.setWidth(htmlWidth); hostGroup.setWidth(htmlWidth); executionHost.setWidth(htmlWidth); //fill in content of every tab //fill in adminHost String contentWidth = "600px"; VerticalPanel contentOfAdmin = new VerticalPanel(); Label host = new Label("Host"); TextBox hostBox = new TextBox(); hostBox.setWidth(contentWidth); TextArea mainContent = new TextArea(); mainContent.setSize(contentWidth, "500px"); mainContent.setReadOnly(true); contentOfAdmin.add(host); contentOfAdmin.add(hostBox); contentOfAdmin.add(mainContent); //fill in submitHost VerticalPanel contentOfSubmit = new VerticalPanel(); Label submit = new Label("Host"); TextBox submitBox = new TextBox(); submitBox.setWidth(contentWidth); TextArea subMainContent = new TextArea(); subMainContent.setSize(contentWidth, "500px"); subMainContent.setReadOnly(true); contentOfSubmit.add(submit); contentOfSubmit.add(submitBox); contentOfSubmit.add(subMainContent); //fill in hostGroup HorizontalPanel hostMainContent = new HorizontalPanel(); hostMainContent.setSpacing(5); VerticalPanel leftOfMain = new VerticalPanel(); VerticalPanel rightOfMain = new VerticalPanel(); Label hostgroup = new Label("Hostgroup"); Label member = new Label("Members"); TextArea hostgroups = new TextArea(); TextArea members = new TextArea(); hostgroups.setSize("300px", "500px"); hostgroups.setReadOnly(true); members.setSize("300px", "500px"); members.setReadOnly(true); leftOfMain.add(hostgroup); leftOfMain.add(hostgroups); rightOfMain.add(member); rightOfMain.add(members); hostMainContent.add(leftOfMain); hostMainContent.add(rightOfMain); //fill in executionhost HorizontalPanel executionMainContent = new HorizontalPanel(); executionMainContent.setSpacing(5); VerticalPanel leftOfExecution = new VerticalPanel(); VerticalPanel rightOfExecution = new VerticalPanel(); Label hosts = new Label("Hosts"); TextArea hostsArea = new TextArea(); hostsArea.setSize("300px", "500px"); leftOfExecution.add(hosts); leftOfExecution.add(hostsArea); String eastwidth = "80px"; Label loadScaling = new Label("Load Scaling"); TextArea loadScalingArea = new TextArea(); loadScalingArea.setSize("300px", eastwidth); Label accessAttri = new Label("Access Attributes"); TextArea accessAttriArea = new TextArea(); accessAttriArea.setSize("300px", eastwidth); Label consumFixAttri = new Label("Consumable/Fixed Attributes"); TextArea consumFixAttriArea = new TextArea(); consumFixAttriArea.setSize("300px", eastwidth); Label reportVariab = new Label("Reporting Variables"); TextArea reportVariabArea = new TextArea(); reportVariabArea.setSize("300px", eastwidth); Label usage = new Label("Usage Scaling"); TextArea usageArea = new TextArea(); usageArea.setSize("300px", eastwidth); rightOfExecution.add(loadScaling); rightOfExecution.add(loadScalingArea); rightOfExecution.add(accessAttri); rightOfExecution.add(accessAttriArea); rightOfExecution.add(consumFixAttri); rightOfExecution.add(consumFixAttriArea); rightOfExecution.add(reportVariab); rightOfExecution.add(reportVariabArea); rightOfExecution.add(usage); rightOfExecution.add(usageArea); executionMainContent.add(leftOfExecution); executionMainContent.add(rightOfExecution); //build west of host westOfHost.add(contentOfAdmin, adminHost); westOfHost.add(contentOfSubmit, submitHost); westOfHost.add(hostMainContent, hostGroup); westOfHost.add(executionMainContent, executionHost); westOfHost.getDeckPanel().setAnimationEnabled(true); westOfHost.selectTab(0); hostconfig.add(westOfHost, DockPanel.WEST); hostconfig.add(eastOfHost, DockPanel.EAST); mainEast.clear(); mainEast.add(hostconfig, DockPanel.CENTER); mainControl.add(mainEast, DockPanel.CENTER); } /** * @author gaojinjun */ public void clusterConfiguration(){ int i; DecoratorPanel deck = new DecoratorPanel(); DockPanel mainPanel = new DockPanel(); HorizontalPanel maincluster = new HorizontalPanel(); VerticalPanel host = new VerticalPanel(); VerticalPanel configuration = new VerticalPanel(); VerticalPanel buttonIn = new VerticalPanel(); Label hostLabel = new Label("Host"); ListBox hostPanel = new ListBox(); hostPanel.setSize("200px", "500ox"); hostPanel.addItem("global"); hostPanel.addItem("cluster0.cluster.hla"); for(i = 0; i < 20; i++){ hostPanel.addItem(""); } hostPanel.setVisibleItemCount(18); host.add(hostLabel); host.add(hostPanel); Label config = new Label("Configuration"); ListBox configPanel = new ListBox(); configPanel.setSize("400px", "500ox"); configPanel.addItem("global"); configPanel.addItem("cluster0.cluster.hla"); for(i = 0; i < 20; i++){ configPanel.addItem(""); } configPanel.setVisibleItemCount(18); configuration.add(config); configuration.add(configPanel); String buttonWidth = "100px"; Button add = new Button("Add"); Button modify = new Button("Modify"); Button delete = new Button("Delete"); Button done = new Button("Done"); Button help = new Button("Help"); add.setWidth(buttonWidth); modify.setWidth(buttonWidth); delete.setWidth(buttonWidth); done.setWidth(buttonWidth); help.setWidth(buttonWidth); buttonIn.setSpacing(30); buttonIn.add(add); buttonIn.add(modify); buttonIn.add(delete); buttonIn.add(done); buttonIn.add(help); maincluster.add(host); maincluster.add(configuration); deck.add(maincluster); mainPanel.add(deck, DockPanel.WEST); mainPanel.add(buttonIn, DockPanel.EAST); mainEast.clear(); mainEast.add(mainPanel, DockPanel.CENTER); mainControl.add(mainEast, DockPanel.CENTER); } /** * @author gaojinjun */ public void schedulerConfiguration(){ DockPanel schedulerconfig = new DockPanel(); TabPanel westOfSched = new TabPanel(); VerticalPanel eastOfSched = new VerticalPanel(); //build east of panel String buttonWidth = "100px"; Button ok = new Button("OK"); Button cancel = new Button("Cancel"); Button help = new Button("Help"); ok.setWidth(buttonWidth); cancel.setWidth(buttonWidth); help.setWidth(buttonWidth); eastOfSched.setSpacing(30); eastOfSched.add(ok); eastOfSched.add(cancel); eastOfSched.add(help); //build west of panel //build general parameters's content HTML generalPara = new HTML("General Parameters"); HTML loadAdjust = new HTML("Load Adjustment"); generalPara.setWidth("180px"); loadAdjust.setWidth("140px"); VerticalPanel generalP = new VerticalPanel(); String textWidth = "300px"; Label algorithm = new Label("Algorithm"); TextBox algo = new TextBox(); algo.setText("default"); algo.setWidth(textWidth); Label schedInterval = new Label("Schedule Interval"); TextBox schedInt = new TextBox(); schedInt.setText("0:0:15"); schedInt.setWidth(textWidth); Label repriInterval = new Label("Reprioritize Interval"); TextBox repriInt = new TextBox(); repriInt.setText("0:0:0"); repriInt.setWidth(textWidth); Label defaultDuration = new Label("Default Duration"); TextBox defDuration = new TextBox(); defDuration.setText("0:10:0"); defDuration.setWidth(textWidth); Label maxJob = new Label("Max Jobs/User"); TextBox maxUser = new TextBox(); maxUser.setText("0"); maxUser.setWidth(textWidth); ListBox sortList = new ListBox(); sortList.addItem("Sort by load"); sortList.addItem("Sort by sequence number"); Label jobSchedInfo = new Label("Job Scheduling Information"); HorizontalPanel jobschedinfo = new HorizontalPanel(); jobschedinfo.setSpacing(5); ListBox jobInfo = new ListBox(); jobInfo.addItem("False"); jobInfo.addItem("True"); jobInfo.addItem("Job Range"); jobInfo.setWidth("100px"); TextBox jobInfoBox = new TextBox(); jobInfoBox.setWidth("190px"); jobschedinfo.add(jobInfo); jobschedinfo.add(jobInfoBox); Label loadFormula = new Label("Load Formula"); TextBox loadBox = new TextBox(); loadBox.setText("np_load_avg"); loadBox.setWidth(textWidth); Label flushSubmit = new Label("Flush Submit Seconds"); TextBox flushSubBox = new TextBox(); flushSubBox.setText("0"); flushSubBox.setWidth(textWidth); Label flushFinish = new Label("Flush Finish Seconds"); TextBox flushFinishBox = new TextBox(); flushFinishBox.setText("0"); flushFinishBox.setWidth(textWidth); Label maxReserv = new Label("Maximum Reservation"); TextBox maxReservBox = new TextBox(); maxReservBox.setText("0"); maxReservBox.setWidth(textWidth);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -