concepttypesframe.java

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

JAVA
56 行
字号
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 axioms.
 * It provides creation and structuration fonctions by using its own toolbar or right
 * mouse click.
 *
 * @author Fr閐閞ic F黵st
 */
public class ConceptTypesFrame extends JPanel {	

	private MainFrame mf;
	private ConceptTypesToolBar cttb;
	private ConceptTypesPanel ctp;

	public void setConceptTypeMode(int mode){
		ctp.setConceptTypeMode(mode);
	}

	public void clear() {
		ctp.clear();
	}

	/** Run the tree drawing algorithm */
	public void refreshTree(){
		Ontology o = mf.getOntology();
		if(o != null){
			Graphics g = this.getGraphics();
			TreeDrawing td = new TreeDrawing(g, o.getConceptTypes(), mf.getOntologyLanguage());
			ctp.setPreferredSize(td.getDisplayArea());
			ctp.revalidate();
			repaint();
		}
	}

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

		//Create the tool bar panel
		cttb = new ConceptTypesToolBar(this);
		ctp = new ConceptTypesPanel(mf);

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

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

⌨️ 快捷键说明

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