⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 maincontrolpanel.java

📁 利用google开发的GWT工具
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
		//Cluster Queue's content		String cellWidth = "80px";		int i;		FlexTable clusterqueue = new FlexTable();		FlexCellFormatter cellFormatter = clusterqueue.getFlexCellFormatter();		clusterqueue.setCellSpacing(0);		String[] clusterconstant = {"Clusterqueue","Cqloa","Used","Avail",				"Total","aoACDS","cdsuE","s","A","S","C","u","a","d","D",				"c","o","E"};		Label tmp;		for(i = 0; i < 18; i ++){			cellFormatter.setWidth(0, i, cellWidth);			cellFormatter.setStyleName(0, i, "gwt-FlexTableFirstRow");			tmp = new Label(clusterconstant[i]);			tmp.setWidth(cellWidth);			clusterqueue.setWidget(0, i, tmp);		}		//call RPC, return value is resulted 		getOutputLinked("ls -l /");				inJobContent.add(jobQueue(20,18,clusterqueue), DockPanel.CENTER);		jobContent.add(inJobContent, clusterQueue);				//Queue Instances's content		FlexTable queueinstance = new FlexTable();		cellFormatter = queueinstance.getFlexCellFormatter();		queueinstance.setCellSpacing(0);		String[] instanceconstant = {"Queue","qtype","qtype","load_avg",				"load_avg","states"};		for(i = 0; i < 6; i ++){			cellFormatter.setWidth(0, i, cellWidth);			cellFormatter.setStyleName(0, i, "gwt-FlexTableFirstRow");			tmp = new Label(instanceconstant[i]);			tmp.setWidth(cellWidth);			queueinstance.setWidget(0, i, tmp);		}		inJobContent = new DockPanel();		inJobContent.add(jobQueue(20,6,queueinstance), DockPanel.CENTER);		jobContent.add(inJobContent, queueInstance);//		jobContent.addTabListener(new TabListener(){//			public void onTabSelected(SourcesTabEvents a, int i){//				//			}//			public boolean onBeforeTabSelected(SourcesTabEvents a, int i){//				return true;//			}//		});				//Hosts' content		FlexTable hosts = new FlexTable();		cellFormatter = hosts.getFlexCellFormatter();		hosts.setCellSpacing(0);		String[] hostconstant = {"Host","Host","#CPU","LoadAvg","LoadAvg",				"MemUsed","MemTotal","SwapUse","SwapTotal"};		for(i = 0; i < 9; i ++){			cellFormatter.setWidth(0, i, cellWidth);			cellFormatter.setStyleName(0, i, "gwt-FlexTableFirstRow");			tmp = new Label(hostconstant[i]);			tmp.setWidth(cellWidth);			hosts.setWidget(0, i, tmp);		}		inJobContent = new DockPanel();		inJobContent.add(jobQueue(20,9,hosts), DockPanel.CENTER);		jobContent.add(inJobContent, host);				jobContent.selectTab(0);		jobContent.getDeckPanel().setAnimationEnabled(true);				jobCon.add(jobContent, DockPanel.WEST);		jobCon.add(eastOfJobCon, DockPanel.EAST);		mainEast.clear();		mainEast.add(jobCon,DockPanel.CENTER);		mainControl.add(mainEast, DockPanel.EAST);	}		/**	 * @author gaojinjun	 */	public void submitJob(){		//main panel of submit job		DockPanel submit = new DockPanel();		DecoratedTabPanel westOfPanel = new DecoratedTabPanel();		HorizontalPanel general = new HorizontalPanel();		HorizontalPanel advance = new HorizontalPanel();		VerticalPanel eastPanel = new VerticalPanel();				//east of submit		//build buttons of east of content panel		String buttonWidth = "100px";		Button Submit = new Button("Submit");		Button edit = new Button("Edit");		Button clear = new Button("Clear");		Button reload = new Button("Reload");		Button saveSetting = new Button("Save Setting");		Button loadSetting = new Button("Load Setting");		Button done = new Button("Done");		Button help = new Button("Help");		Submit.setWidth(buttonWidth);		edit.setWidth(buttonWidth);		clear.setWidth(buttonWidth);		reload.setWidth(buttonWidth);		saveSetting.setWidth(buttonWidth);		loadSetting.setWidth(buttonWidth);		done.setWidth(buttonWidth);		help.setWidth(buttonWidth);				eastPanel.setSpacing(30);		eastPanel.setStylePrimaryName("white");		eastPanel.add(Submit);		eastPanel.add(edit);		eastPanel.add(clear);		eastPanel.add(reload);		eastPanel.add(saveSetting);		eastPanel.add(loadSetting);		eastPanel.add(done);		eastPanel.add(help);				//west of submit, general button's contents		VerticalPanel westOfGeneral = new VerticalPanel();		westOfGeneral.setWidth("210px");				VerticalPanel prefix = new VerticalPanel();		Label Pre = new Label("Prefix");		TextBox Prebx = new TextBox();		Prebx.setText("#$");		prefix.add(Pre);		prefix.add(Prebx);				VerticalPanel jobScript = new VerticalPanel();		Label jobscript = new Label("Job Script");		TextBox jobsc = new TextBox();		jobScript.add(jobscript);		jobScript.add(jobsc);				VerticalPanel jobTask = new VerticalPanel();		Label jobtask = new Label("Job Tasks");		TextBox jobts = new TextBox();		jobTask.add(jobtask);		jobTask.add(jobts);				VerticalPanel jobName = new VerticalPanel();		Label jobname = new Label("Job Name");		TextBox jobnm = new TextBox();		jobName.add(jobname);		jobName.add(jobnm);				VerticalPanel jobArgs = new VerticalPanel();		Label jobargs = new Label("Job Args");		TextBox jobag = new TextBox();		jobArgs.add(jobargs);		jobArgs.add(jobag);				HorizontalPanel Priority = new HorizontalPanel();		VerticalPanel priority = new VerticalPanel();		Label Pri = new Label("Priority");		TextBox Prior = new TextBox();		Prior.setWidth("100px");		Prior.setText("0");		priority.add(Pri);		priority.add(Prior);		VerticalPanel jobShare = new VerticalPanel();		Label jobshare = new Label("Job Share");		TextBox jobsh = new TextBox();		jobsh.setWidth("95px");		jobsh.setText("0");		jobShare.add(jobshare);		jobShare.add(jobsh);		Priority.add(priority);		Priority.add(jobShare);				VerticalPanel startAt = new VerticalPanel();		Label start = new Label("Start At");		TextBox startat = new TextBox();		startAt.add(start);		startAt.add(startat);				VerticalPanel project = new VerticalPanel();		Label Project = new Label("Project");		TextBox Pro = new TextBox();		project.add(Project);		project.add(Pro);				VerticalPanel workingDir = new VerticalPanel();		CheckBox workDir = new CheckBox("Current Working Directory", false);		Label workingdir = new Label("Working Directory");		TextBox Work = new TextBox();		workingDir.add(workDir);		workingDir.add(workingdir);		workingDir.add(Work);				VerticalPanel shell = new VerticalPanel();		Label Shell = new Label("Shell");		TextBox Sh = new TextBox();		shell.add(Shell);		shell.add(Sh);				westOfGeneral.add(prefix);		westOfGeneral.add(jobScript);		westOfGeneral.add(jobTask);		westOfGeneral.add(jobName);		westOfGeneral.add(jobArgs);		westOfGeneral.add(Priority);		westOfGeneral.add(startAt);		westOfGeneral.add(project);		westOfGeneral.add(workingDir);		westOfGeneral.add(shell);				//east of general		VerticalPanel eastOfGeneral = new VerticalPanel();		eastOfGeneral.setWidth("210px");		eastOfGeneral.setSpacing(7);				CheckBox mergeOutput = new CheckBox("Merge Output");		Label stdout = new Label("stdout");		TextBox stdouttxt = new TextBox();		Label stderr = new Label("stderr");		TextBox stderrtxt = new TextBox();		Label stdin = new Label("stdin");		TextBox stdintxt = new TextBox();		PushButton reqResource = new PushButton("Reqest Resources");		ListBox list = new ListBox(false);		list.addItem("Restart depends on Queue");		list.addItem("Restart");		list.addItem("No restart");		CheckBox notify = new CheckBox("Notify Job");		CheckBox hold = new CheckBox("Hold Job");		CheckBox startJob = new CheckBox("Start Job Immediately");		CheckBox reservation = new CheckBox("Job Reservation");				eastOfGeneral.add(mergeOutput);		eastOfGeneral.add(stdout);		eastOfGeneral.add(stdouttxt);		eastOfGeneral.add(stderr);		eastOfGeneral.add(stderrtxt);		eastOfGeneral.add(stdin);		eastOfGeneral.add(stdintxt);		eastOfGeneral.add(reqResource);		eastOfGeneral.add(list);		eastOfGeneral.add(notify);		eastOfGeneral.add(hold);		eastOfGeneral.add(startJob);		eastOfGeneral.add(reservation);				general.add(westOfGeneral);		general.add(eastOfGeneral);				//contents of advance button		VerticalPanel westOfAdvance = new VerticalPanel();		VerticalPanel eastOfAdvance = new VerticalPanel();		westOfAdvance.setWidth("210px");		westOfAdvance.setSpacing(7);		eastOfAdvance.setWidth("210px");		advance.add(westOfAdvance);		advance.add(eastOfAdvance);				//west of advance		Label pEnv = new Label("Parallel Environment");		TextBox paraEnv = new TextBox();		Label env = new Label("Environment");		TextBox envir = new TextBox();		Label context = new Label("Context");		TextBox Context = new TextBox();		Label checkObj = new Label("Checkpoint Object");		TextBox checkpoint = new TextBox();		Label account = new Label("Account");		TextBox acc = new TextBox();		westOfAdvance.add(pEnv);		westOfAdvance.add(paraEnv);		westOfAdvance.add(env);		westOfAdvance.add(envir);		westOfAdvance.add(context);		westOfAdvance.add(Context);		westOfAdvance.add(checkObj);		westOfAdvance.add(checkpoint);		westOfAdvance.add(account);		westOfAdvance.add(acc);				//east of advance		Label verify = new Label("Verify Mode");		ListBox verifyBox = new ListBox(false);		verifyBox.addItem("Skip");		verifyBox.addItem("Warning");		verifyBox.addItem("Error");		verifyBox.addItem("Just verify");		Label mail = new Label("Mail");		CheckBox startOfJob = new CheckBox("Start of Job");		CheckBox endOfJob = new CheckBox("End of Job");		CheckBox abortOfJob = new CheckBox("Abort of Job");		CheckBox suspendOfJob = new CheckBox("Suspend of Job");		Label mailTo = new Label("Mail To");		TextBox mailto = new TextBox();		Label hardQueue = new Label("Hard Queue List");		TextBox hardqueue = new TextBox();		Label softQueue = new Label("Soft Queue List");		TextBox softqueue = new TextBox();		Label masterQueue = new Label("Master Queue List");		TextBox masterqueue = new TextBox();		Label jobDep = new Label("Job Dependencies");		TextBox jobdep = new TextBox();		Label deadLine = new Label("Deadline");		TextBox deadline = new TextBox();		eastOfAdvance.add(verify);		eastOfAdvance.add(verifyBox);		eastOfAdvance.add(mail);		eastOfAdvance.add(startOfJob);		eastOfAdvance.add(endOfJob);		eastOfAdvance.add(abortOfJob);		eastOfAdvance.add(suspendOfJob);		eastOfAdvance.add(mailTo);		eastOfAdvance.add(mailto);		eastOfAdvance.add(hardQueue);		eastOfAdvance.add(hardqueue);		eastOfAdvance.add(softQueue);		eastOfAdvance.add(softqueue);		eastOfAdvance.add(masterQueue);		eastOfAdvance.add(masterqueue);		eastOfAdvance.add(jobDep);		eastOfAdvance.add(jobdep);		eastOfAdvance.add(deadLine);		eastOfAdvance.add(deadline);				westOfPanel.setWidth("660px");		westOfPanel.getDeckPanel().setAnimationEnabled(true);		//westOfPanel.setHeight("500px");		westOfPanel.add(general, new HTML("General"));		westOfPanel.add(advance, new HTML("Advanced"));		westOfPanel.selectTab(0);				submit.add(westOfPanel, DockPanel.WEST);		submit.add(eastPanel, DockPanel.EAST);		//add widget submit to mainEast		mainEast.clear();		mainEast.add(submit, DockPanel.CENTER);		mainControl.add(mainEast, DockPanel.EAST);	}		/**	 * @author gaojinjun	 */	public void complexConfiguration(){		//build main panel of complex config		DockPanel complex = new DockPanel();		VerticalPanel eastOfComplex = new VerticalPanel();		CaptionPanel westOfComplex = new CaptionPanel("Attributes");		DockPanel content = new DockPanel();		DockPanel southOfContent = new DockPanel();		//CSS of CaptionPanel: westOfComplex//		DOM.setStyleAttribute(westOfComplex.getElement(),//			     "border", "3px solid #00c");//		DOM.setStyleAttribute(westOfComplex.getContentWidget().getElement(),//			     "margin", "5px 10px 10px 10px");//		DOM.setStyleAttribute(westOfComplex.getContentWidget().getElement(),//			     "padding", "10px 10px 10px 10px");//		DOM.setStyleAttribute(westOfComplex.getContentWidget().getElement(),//			     "border", "1px solid #ccf");				//build east panel of complex panel		eastOfComplex.setSpacing(30);		String buttonWidth = "100px";		Button commit = new Button("Commit");		Button cancel = new Button("Cancel");		Button help = new Button("Help");		commit.setWidth(buttonWidth);		cancel.setWidth(buttonWidth);		help.setWidth(buttonWidth);				eastOfComplex.add(commit);		eastOfComplex.add(cancel);		eastOfComplex.add(help);		complex.add(eastOfComplex, DockPanel.EAST);				//build west panel of complex panel		String widthOfContent = "80px";		HorizontalPanel northOfContent = new HorizontalPanel();		northOfContent.setSpacing(5);		//build Name box		VerticalPanel name = new VerticalPanel();		Label Name = new Label("Name");		TextBox nameBox = new TextBox();		nameBox.setWidth(widthOfContent);		name.add(Name);		name.add(nameBox);		//build shortcut box		VerticalPanel shortcut = new VerticalPanel();		Label Shortcut = new Label("Shortcut");		TextBox shortcutBox = new TextBox();		shortcutBox.setWidth(widthOfContent);		shortcut.add(Shortcut);		shortcut.add(shortcutBox);		//build type listbox		VerticalPanel type = new VerticalPanel();		Label Type = new Label("Type");		ListBox typeList = new ListBox();		typeList.addItem("INT");		typeList.addItem("STRING");		typeList.addItem("TIME");		typeList.addItem("MEMORY");		typeList.addItem("BOOL");		typeList.addItem("CSTRING");		typeList.addItem("HOST");		typeList.addItem("DOUBLE");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -