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

📄 matchingresultform.java

📁 toocom源代码,主要应用在本体匹配方面!
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
package toocom.matching;

import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import java.awt.event.*;
import java.awt.*;
import java.lang.*; 
import toocom.ocgl.*;
import toocom.iotools.*;
import toocom.ui.*;
import java.io.*;
import javax.swing.filechooser.*;

/** 
 * This class represents the graphical window into which the result of ontology 
 *  matching is displayed.
 *
 * @author Fr閐閞ic F黵st
 */
public class MatchingResultForm extends JDialog{
	
	private Language l;
	private MatchingList list;
	private TextArea matchC;
	private TextArea matchR;
	
	public MatchingResultForm(MatchingList list,Language l,Frame f){
		super(f,Constants.MATCHING_RESULT_FORM_FRAME_TITLE + " - " + list.getFirstOnto().getTerm(l) + "-" + list.getSecondOnto().getTerm(l));
		this.list = list;
		this.l = l;
		this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
		this.setBackground(Constants.MATCHING_RESULT_FORM_FRAME_COLOR);
		this.setSize(f.getSize().width*2/3,f.getSize().height*2/3);
		this.setLocation(f.getSize().width/6,f.getSize().height/6);
		this.setLayout(new BorderLayout());
		Box paramBox = new Box(BoxLayout.X_AXIS);
		Box firstBox = new Box(BoxLayout.Y_AXIS);
		// Symmetry
		firstBox.add(new JLabel(Constants.SYMMETRY_LABEL));
		JSlider symSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		symSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				symChange(e);
			}
		});
		firstBox.add(symSlider);
		// Transitivity
		firstBox.add(new JLabel(Constants.TRANSITIVITY_LABEL));
		JSlider transSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		transSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				transChange(e);
			}
		});
		firstBox.add(transSlider);
		// Reflexivity
		firstBox.add(new JLabel(Constants.REFLEXIVITY_LABEL));
		JSlider reflSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		reflSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				reflChange(e);
			}
		});
		firstBox.add(reflSlider);
		// Irreflexivity
		firstBox.add(new JLabel(Constants.IRREFLEXIVITY_LABEL));
		JSlider irrSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		irrSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				irrChange(e);
			}
		});
		firstBox.add(irrSlider);
		// Antisymmetry
		firstBox.add(new JLabel(Constants.ANTISYMMETRY_LABEL));
		JSlider antiSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		antiSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				antiChange(e);
			}
		});
		firstBox.add(antiSlider);
		paramBox.add(firstBox);
		Box secondBox = new Box(BoxLayout.Y_AXIS);
		// Cardinality Min
		secondBox.add(new JLabel(Constants.MIN_CARDINALITY_LABEL));
		JSlider cminSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		cminSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				cminChange(e);
			}
		});
		secondBox.add(cminSlider);
		// Cardinality Max
		secondBox.add(new JLabel(Constants.MAX_CARDINALITY_LABEL));
		JSlider cmaxSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		cmaxSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				cmaxChange(e);
			}
		});
		secondBox.add(cmaxSlider);
		// Topo
		secondBox.add(new JLabel(Constants.AXIOMS_LABEL));
		JSlider topoSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		topoSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				topoChange(e);
			}
		});
		secondBox.add(topoSlider);
		// Topo+
		secondBox.add(new JLabel(Constants.AXIOMS_PLUS_LABEL));
		JSlider topoPlusSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		topoPlusSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				topoPlusChange(e);
			}
		});
		secondBox.add(topoPlusSlider);
		// Signature
		secondBox.add(new JLabel(Constants.SIGNATURE_LABEL));
		JSlider signSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		signSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				signChange(e);
			}
		});
		secondBox.add(signSlider);
		paramBox.add(secondBox);
		Box thirdBox = new Box(BoxLayout.Y_AXIS);
		// Incompatibility
		thirdBox.add(new JLabel(Constants.INCOMPATIBILITY_LABEL));
		JSlider incompSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		incompSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				incompChange(e);
			}
		});
		thirdBox.add(incompSlider);
		// Exclusivity
		thirdBox.add(new JLabel(Constants.EXCLUSIVITY_LABEL));
		JSlider excluSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		excluSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				excluChange(e);
			}
		});
		thirdBox.add(excluSlider);
		// Disjonction
		thirdBox.add(new JLabel(Constants.DISJONCTION_LABEL));
		JSlider disjSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		disjSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				disjChange(e);
			}
		});
		thirdBox.add(disjSlider);
		// Abstraction
		thirdBox.add(new JLabel(Constants.ABSTRACTION_LABEL));
		JSlider absSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		absSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				absChange(e);
			}
		});
		thirdBox.add(absSlider);
		// ISA
		thirdBox.add(new JLabel(Constants.ISA_LABEL));
		JSlider isaSlider = new JSlider(SwingConstants.HORIZONTAL,0,100,50);
		isaSlider.addChangeListener(new ChangeListener(){
			public void stateChanged(ChangeEvent e){
				isaChange(e);
			}
		});
		thirdBox.add(isaSlider);
		paramBox.add(thirdBox);
		// Matchings 
		matchC = new TextArea("",8,50,TextArea.SCROLLBARS_BOTH);
		matchC.setEditable(false);
		this.refreshConceptsMatchings();
		matchR = new TextArea("",8,50,TextArea.SCROLLBARS_BOTH);
		matchR.setEditable(false);
		this.refreshRelationsMatchings();
		this.getContentPane().add(paramBox,BorderLayout.NORTH);
		Box global = new Box(BoxLayout.Y_AXIS);
		global.add(matchC);
		global.add(matchR);
    	this.getContentPane().add(global,BorderLayout.CENTER);
    	Container buttonBox = new Container();
    	buttonBox.setLayout(new FlowLayout(FlowLayout.CENTER));
    	JButton printButton = new JButton(Constants.PRINT_BUTTON_LABEL);
		printButton.setMaximumSize(new Dimension(Constants.INTERNAL_FRAME_BUTTON_DIM,Constants.INTERNAL_FRAME_BUTTON_DIM));
		printButton.setMinimumSize(new Dimension(Constants.INTERNAL_FRAME_BUTTON_DIM,Constants.INTERNAL_FRAME_BUTTON_DIM));
		printButton.setBorder(BorderFactory.createRaisedBevelBorder());
		printButton.addActionListener(new ActionListener(){
    		public void actionPerformed(ActionEvent e){
    			print();
    		}
    	});
    	printButton.setToolTipText(Constants.PRINT_BUTTON_TIPTEXT);
    	printButton.setVisible(true);
    	buttonBox.add(printButton);
    	/*JButton fixConButton = new JButton(Constants.FIX_CONCEPTS_BUTTON_LABEL);
		fixConButton.setMaximumSize(new Dimension(Constants.INTERNAL_FRAME_BUTTON_DIM,Constants.INTERNAL_FRAME_BUTTON_DIM));
		fixConButton.setMinimumSize(new Dimension(Constants.INTERNAL_FRAME_BUTTON_DIM,Constants.INTERNAL_FRAME_BUTTON_DIM));
		fixConButton.setBorder(BorderFactory.createRaisedBevelBorder());
		fixConButton.addActionListener(new ActionListener(){
    		public void actionPerformed(ActionEvent e){
    			fixCon();
    		}
    	});
    	fixConButton.setToolTipText(Constants.FIX_CONCEPTS_BUTTON_TIPTEXT);
    	fixConButton.setVisible(true);
    	buttonBox.add(fixConButton);
    	JButton fixRelButton = new JButton(Constants.FIX_RELATIONS_BUTTON_LABEL);
		fixRelButton.setMaximumSize(new Dimension(Constants.INTERNAL_FRAME_BUTTON_DIM,Constants.INTERNAL_FRAME_BUTTON_DIM));
		fixRelButton.setMinimumSize(new Dimension(Constants.INTERNAL_FRAME_BUTTON_DIM,Constants.INTERNAL_FRAME_BUTTON_DIM));
		fixRelButton.setBorder(BorderFactory.createRaisedBevelBorder());
		fixRelButton.addActionListener(new ActionListener(){
    		public void actionPerformed(ActionEvent e){
    			fixRel();
    		}
    	});
    	fixRelButton.setToolTipText(Constants.FIX_RELATIONS_BUTTON_TIPTEXT);
    	fixRelButton.setVisible(true);

⌨️ 快捷键说明

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