swooppreferences.java

来自「Semantic Web Ontology Editor」· Java 代码 · 共 506 行 · 第 1/2 页

JAVA
506
字号
		codeSelChk = new JCheckBox("Highlight code fragment in Source Pane corresponding to entity");		codeSelChk.setFont(tahoma);		useLabelChk = new JCheckBox("Display entities using rdfs:label instead of their URI if possible (defaults to URI)");		useLabelChk.setFont(tahoma);		langBox = new JComboBox();		langBox.setEditable(true);		langBox.setFont(tahoma);		langBox.addItem("   (plain literals)");		langBox.addItem("ar (Arabic)");		langBox.addItem("zh (Chinese - Mandarin)");		langBox.addItem("nl (Dutch)");		langBox.addItem("en (English)");		langBox.addItem("fr (French)");		langBox.addItem("de (German)");		langBox.addItem("he (Hebrew)");		langBox.addItem("hi (Hindi)");		langBox.addItem("it (Italian)");		langBox.addItem("ja (Japanese)");		langBox.addItem("ko (Korean)");		langBox.addItem("fa (Persian - Farsi)");		langBox.addItem("po (Portuguese)");		langBox.addItem("ru (Russian)");		langBox.addItem("es (Spanish)");		langBox.addItem("sw (Swahili)");		langBox.addItem("tr (Turkish)");		langBox.setSelectedIndex(0);		JPanel langPanel = new JPanel();		langPanel.setLayout(new GridLayout(1,2));		langLbl = new JLabel("          Select language to display labels:");		langLbl.setFont(tahoma);		langPanel.add(langLbl);		langPanel.add(langBox);		langLbl.setEnabled(false);		langBox.setEnabled(false);				JPanel uigrpPanel = new JPanel();		uigrpPanel.setLayout(new GridLayout(8,1));				uigrpPanel.add(iconChk);		uigrpPanel.add(divChk);		uigrpPanel.add(fontPanel);		uigrpPanel.add(countPanel);		uigrpPanel.add(codeSelChk);		uigrpPanel.add(useLabelChk);		uigrpPanel.add(langPanel);		uiPanel.add(uigrpPanel, "Center");		uiPanel.setBorder(new EtchedBorder());				// setup general panel		JPanel genPanel = new JPanel();		genPanel.setLayout(new BorderLayout());				JLabel verPrefLbl = new JLabel(" Feature Options");				verPrefLbl.setFont(tahomaB);		genPanel.add(verPrefLbl, "North");		userNameFld = new JTextField("");		userNameFld.setFont(tahoma);		JLabel nameLbl = new JLabel(" Current Username: ");		nameLbl.setFont(tahoma);		JLabel nameLbl2 = new JLabel(" (for tracking authorship of changes etc.)");		nameLbl2.setFont(tahoma);		JPanel namePanel = new JPanel();		namePanel.setLayout(new BorderLayout());		namePanel.add(nameLbl, "West");		namePanel.add(userNameFld, "Center");		namePanel.add(nameLbl2, "East");		openLastChk = new JCheckBox("Start SWOOP with the last opened Workspace");		openLastChk.setFont(tahoma);		JPanel saveWkspcPanel = new JPanel();		saveWkspcPanel.setLayout(new BorderLayout());		JPanel saveWkspcPanelL = new JPanel();		saveWkspcPanelL.setLayout(new BorderLayout());		JPanel saveWkspcPanelR = new JPanel();		saveWkspcPanelR.setLayout(new BorderLayout());		saveWkspcChk = new JCheckBox("Auto Save Workspace");		saveWkspcChk.setFont(tahoma);		saveWkspcPanelL.add(saveWkspcChk, "West");		saveWkspcFileFld = new JTextField();		saveWkspcPanelL.add(saveWkspcFileFld, "Center");				JLabel everyLbl = new JLabel("every");		everyLbl.setFont(tahoma);		saveWkspcPanelL.add(everyLbl, "East");		saveWkspcPanel.add(saveWkspcPanelL, "Center");		saveWkspcTimeFld = new JTextField();		JLabel minsLbl = new JLabel("mins");		minsLbl.setFont(tahoma);		saveWkspcPanelR.add(saveWkspcTimeFld, "Center");		saveWkspcPanelR.add(minsLbl, "East");		saveWkspcPanel.add(saveWkspcPanelR, "East");				JLabel reasLbl = new JLabel(" Default SWOOP Reasoner: ");		reasLbl.setFont(tahoma);		reasonerBox = new JComboBox();		reasonerBox.setFont(tahoma);		JPanel reasPanel = new JPanel();		reasPanel.setLayout(new GridLayout(1,3));		reasPanel.add(reasLbl);		reasPanel.add(reasonerBox);		reasPanel.add(new JLabel(""));		logChangesChk = new JCheckBox("Log (Committed) Ontology Changes");		logChangesChk.setFont(tahoma);		pointChk = new JCheckBox("Auto-save Ontology Checkpoints");		pointChk.setFont(tahoma);		savePtDiskChk = new JCheckBox("Save checkpoints to disk (in /SWOOP/checkpoints/)");		savePtDiskChk.setFont(tahoma);//		savePtDiskChk.setEnabled(false);		Box verPanel = Box.createHorizontalBox();		verPanel.add(logChangesChk);		verPanel.add(pointChk);		autoRetChk = new JCheckBox("Auto-retrieve (Annotea) Annotations upon SWOOP selection change (Ctrl-U)");		autoRetChk.setFont(tahoma);		JLabel shareChanges = new JLabel("  Share Annotea Change Sets by serializing.. ");		rdfxmlRadio = new JRadioButton("RDF/XML");		javaRadio = new JRadioButton("Java Objects");				ButtonGroup group = new ButtonGroup();		group.add(rdfxmlRadio);		group.add(javaRadio);		shareChanges.setFont(tahoma);		rdfxmlRadio.setFont(tahoma);		javaRadio.setFont(tahoma);		JPanel changePanel = new JPanel();		changePanel.setLayout(new BorderLayout());		changePanel.add(shareChanges, "Center");		JPanel radioPane = new JPanel();		radioPane.setLayout(new GridLayout(1,2));		radioPane.add(rdfxmlRadio);		radioPane.add(javaRadio);		changePanel.add(radioPane, "East");		useProxyChk = new JCheckBox("Use HTTP Proxy");		useProxyChk.setFont(tahoma);		proxyHostFld = new JTextField();		proxyHostFld.setFont(tahoma);		proxyPortFld = new JTextField();		proxyPortFld.setFont(tahoma);		JLabel proxyHostLbl = new JLabel("Host:");		proxyHostLbl.setFont(tahoma);		JLabel proxyPortLbl = new JLabel("Port:");		proxyPortLbl.setFont(tahoma);		JPanel proxyPanel1 = new JPanel();		proxyPanel1.setLayout(new BorderLayout());		proxyPanel1.add(proxyHostLbl, "West");		proxyPanel1.add(proxyHostFld, "Center");		JPanel proxyPanel2 = new JPanel();		proxyPanel2.setLayout(new BorderLayout());		proxyPanel2.add(proxyPortLbl, "West");		proxyPanel2.add(proxyPortFld, "Center");		JPanel proxyPanel = new JPanel();		proxyPanel.setLayout(new GridLayout(1,3));		proxyPanel.add(useProxyChk);		proxyPanel.add(proxyPanel1);		proxyPanel.add(proxyPanel2);				JPanel generalPanel = new JPanel();		generalPanel.setLayout(new GridLayout(9,1));		generalPanel.add(namePanel);		generalPanel.add(openLastChk);		generalPanel.add(saveWkspcPanel);		generalPanel.add(proxyPanel);		generalPanel.add(reasPanel);		generalPanel.add(verPanel);		generalPanel.add(savePtDiskChk);		generalPanel.add(autoRetChk);//		generalPanel.add(changePanel); not needed anymore				genPanel.add(generalPanel, "Center");		genPanel.setBorder(new EtchedBorder());				// setup standard vocabulary view panel		JLabel vocabPrefLbl = new JLabel(" Standard Vocabulary View Options");		vocabPrefLbl.setFont(tahomaB);		viewOWLVocabularyAsRDFChk  = new JCheckBox("View OWL vocabulary as RDF");		viewOWLVocabularyAsRDFChk.setFont(tahoma);		viewRDFVocabularyAsRDFChk = new JCheckBox("View RDF/RDFS vocabulary as RDF");		viewRDFVocabularyAsRDFChk.setFont(tahoma);				JPanel vocabViewPanel = new JPanel();				vocabViewPanel.setLayout( new BorderLayout() );		JPanel checkboxesPanel = new JPanel();		checkboxesPanel.setLayout( new GridLayout(2, 1));		checkboxesPanel.add( viewOWLVocabularyAsRDFChk );		checkboxesPanel.add( viewRDFVocabularyAsRDFChk );		vocabViewPanel.setBorder(new EtchedBorder());		vocabViewPanel.add( vocabPrefLbl, BorderLayout.NORTH);		vocabViewPanel.add( checkboxesPanel, BorderLayout.CENTER);				// setup final top panel		JPanel topPanel = new JPanel();		//topPanel.setLayout(new GridLayout(3,1));		topPanel.setLayout( new BorderLayout() );		JPanel orgPanel1 = new JPanel();		JPanel orgPanel2 = new JPanel();		JPanel orgPanel3 = new JPanel();		orgPanel1.setLayout( new BorderLayout());		orgPanel2.setLayout( new BorderLayout());		orgPanel3.setLayout( new BorderLayout());				orgPanel1.add( uiPanel, BorderLayout.NORTH);		orgPanel2.add( genPanel, BorderLayout.NORTH);		orgPanel3.add( vocabViewPanel, BorderLayout.NORTH);				orgPanel1.add(orgPanel2, BorderLayout.CENTER);		orgPanel2.add(orgPanel3, BorderLayout.CENTER);				topPanel.add(orgPanel1);				// setup button panel		JPanel btnPanel = new JPanel();		saveBtn = new JButton("Save");		saveBtn.setFont(tahoma);		cancelBtn = new JButton("Cancel");		cancelBtn.setFont(tahoma);		btnPanel.add(saveBtn);		btnPanel.add(cancelBtn);				content.add(topPanel, "Center");		content.add(btnPanel, "South");				setTitle("SWOOP Preferences");				setSize(500, 550);		setLocation(150, 100);				// add action listeners		logChangesChk.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent arg0) {				pointChk.setEnabled(logChangesChk.isSelected());			}					});		saveBtn.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent arg0) {				savePreferences();				dispose();			}					});		cancelBtn.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent arg0) {				dispose();			}			});		useLabelChk.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent arg0) {				langLbl.setEnabled(useLabelChk.isSelected());				langBox.setEnabled(useLabelChk.isSelected());			}					});		useProxyChk.addActionListener(new ActionListener() {			public void actionPerformed(ActionEvent arg0) {				proxyHostFld.setEnabled(useProxyChk.isSelected());				proxyPortFld.setEnabled(useProxyChk.isSelected());			}					});	}}

⌨️ 快捷键说明

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