relationtypesframe.java

来自「toocom源代码,主要应用在本体匹配方面!」· Java 代码 · 共 58 行

JAVA
58 行
字号
package toocom.ui;

import javax.swing.*;
import java.awt.*;
import toocom.ocgl.*;
import toocom.graphdrawing.*;
/**
 * This class represents the graphical window used for building the relation types hierarchy.
 * It provides creation and structuration fonctions by using its own toolbar or right
 * mouse click. The buttons of the toolbar allow to create, destroy or link relations with 
 * a is-a link. Right-clicking on a relation open a window with the properties of the relation.
 *
 * @author Fr閐閞ic F黵st
 */
public class RelationTypesFrame extends JPanel{
	
	private MainFrame mf;
	private RelationTypesToolBar rttb;
	private RelationTypesPanel rtp;

	public void setRelationTypeMode(int mode){
		rtp.setRelationTypeMode(mode);
	}
	
	public void clear(){
		rtp.clear();
	}

	/*Lance l'algorithme de dessin d'arbre*/
	public void refreshTree(){
		Ontology o = mf.getOntology();
		if(o != null){
			Graphics g = this.getGraphics();
			TreeDrawing td = new TreeDrawing(g, o.getRelationTypes(), mf.getOntologyLanguage());
			rtp.setPreferredSize(td.getDisplayArea());
			rtp.revalidate();
			repaint();
		}
	}

	public RelationTypesFrame(MainFrame mf){
		super();
		this.mf = mf;
		this.setLayout(new BorderLayout());

		//Create the tool bar panel
		rttb = new RelationTypesToolBar(this);
		rtp = new RelationTypesPanel(mf);

		JScrollPane sp = new JScrollPane(rtp);
		sp.setWheelScrollingEnabled(true);

    	this.add(rttb, BorderLayout.NORTH);
    	this.add(sp, BorderLayout.CENTER);
		rttb.setEnabled(true);
	}
}

⌨️ 快捷键说明

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