当前位置: 首页>>代码示例>>Java>>正文


Java Project.addLibraryListener方法代码示例

本文整理汇总了Java中com.cburch.logisim.proj.Project.addLibraryListener方法的典型用法代码示例。如果您正苦于以下问题:Java Project.addLibraryListener方法的具体用法?Java Project.addLibraryListener怎么用?Java Project.addLibraryListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.cburch.logisim.proj.Project的用法示例。


在下文中一共展示了Project.addLibraryListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: LayoutEditHandler

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
LayoutEditHandler(Frame frame) {
	this.frame = frame;

	Project proj = frame.getProject();
	Clipboard.addPropertyChangeListener(Clipboard.contentsProperty, this);
	proj.addProjectListener(this);
	proj.addLibraryListener(this);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:9,代码来源:LayoutEditHandler.java

示例2: ProjectExplorer

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public ProjectExplorer(Project proj) {
	super();
	this.proj = proj;

	setModel(model);
	setRootVisible(true);
	addMouseListener(myListener);
	ToolTipManager.sharedInstance().registerComponent(this);

	MySelectionModel selector = new MySelectionModel();
	selector.setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
	setSelectionModel(selector);
	setCellRenderer(renderer);
	JTreeUtil.configureDragAndDrop(this, new DragController());
	addTreeSelectionListener(myListener);

	InputMap imap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
	imap.put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0), deleteAction);
	ActionMap amap = getActionMap();
	amap.put(deleteAction, deleteAction);

	proj.addProjectListener(myListener);
	proj.addLibraryListener(myListener);
	AppPreferences.GATE_SHAPE.addPropertyChangeListener(myListener);
	myListener.setFile(proj.getLogisimFile());
	LocaleManager.addLocaleListener(this);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:28,代码来源:ProjectExplorer.java

示例3: register

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
void register() {
	Project proj = frame.getProject();
	if (proj == null) {
		return;
	}

	proj.addProjectListener(this);
	proj.addLibraryListener(this);
	frame.addPropertyChangeListener(Frame.EDITOR_VIEW, this);
	frame.addPropertyChangeListener(Frame.EXPLORER_VIEW, this);
	Circuit circ = proj.getCurrentCircuit();
	if (circ != null) {
		circ.getAppearance().addCanvasModelListener(this);
	}

	menubar.addActionListener(LogisimMenuBar.ADD_CIRCUIT, this);
	menubar.addActionListener(LogisimMenuBar.MOVE_CIRCUIT_UP, this);
	menubar.addActionListener(LogisimMenuBar.MOVE_CIRCUIT_DOWN, this);
	menubar.addActionListener(LogisimMenuBar.SET_MAIN_CIRCUIT, this);
	menubar.addActionListener(LogisimMenuBar.REMOVE_CIRCUIT, this);
	menubar.addActionListener(LogisimMenuBar.EDIT_LAYOUT, this);
	menubar.addActionListener(LogisimMenuBar.EDIT_APPEARANCE, this);
	menubar.addActionListener(LogisimMenuBar.VIEW_TOOLBOX, this);
	menubar.addActionListener(LogisimMenuBar.VIEW_SIMULATION, this);
	menubar.addActionListener(LogisimMenuBar.REVERT_APPEARANCE, this);
	menubar.addActionListener(LogisimMenuBar.ANALYZE_CIRCUIT, this);
	menubar.addActionListener(LogisimMenuBar.CIRCUIT_STATS, this);

	computeEnabled();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:31,代码来源:MenuListener.java

示例4: Canvas

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public Canvas(Project proj) {
	this.proj = proj;
	this.selection = new Selection(proj, this);
	this.painter = new CanvasPainter(this);
	this.oldPreferredSize = null;
	this.paintThread = new CanvasPaintThread(this);
	this.mappings = proj.getOptions().getMouseMappings();
	this.canvasPane = null;
	this.tickCounter = new TickCounter();

	setBackground(Color.white);
	setPreferredSize(new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE));
	addMouseListener(myListener);
	addMouseMotionListener(myListener);
	addMouseWheelListener(myListener);
	addKeyListener(myListener);

	proj.addProjectListener(myProjectListener);
	proj.addLibraryListener(myProjectListener);
	proj.addCircuitListener(myProjectListener);
	proj.getSimulator().addSimulatorListener(tickCounter);
	selection.addListener(myProjectListener);
	LocaleManager.addLocaleListener(this);

	AttributeSet options = proj.getOptions().getAttributeSet();
	options.addAttributeListener(myProjectListener);
	AppPreferences.COMPONENT_TIPS.addPropertyChangeListener(myListener);
	AppPreferences.GATE_SHAPE.addPropertyChangeListener(myListener);
	AppPreferences.ANTI_ALIASING.addPropertyChangeListener(myListener);
	AppPreferences.FILL_COMPONENT_BACKGROUND.addPropertyChangeListener(myListener);
	AppPreferences.SEND_DATA.addPropertyChangeListener(myListener);
	AppPreferences.SHOW_TICK_RATE.addPropertyChangeListener(myListener);
	AppPreferences.LOOK_AND_FEEL.addPropertyChangeListener(myListener);
	AppPreferences.GRAPHICS_ACCELERATION.addPropertyChangeListener(myListener);
	loadOptions(options);
	paintThread.start();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:38,代码来源:Canvas.java

示例5: LogFrame

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
public LogFrame(Project project) {
	this.project = project;
	this.windowManager = new WindowMenuManager();
	project.addProjectListener(myListener);
	project.addLibraryListener(myListener);
	setDefaultCloseOperation(HIDE_ON_CLOSE);
	setJMenuBar(new LogisimMenuBar(this, project));
	setSimulator(project.getSimulator(), project.getCircuitState());

	panels = new LogPanel[] { new SelectionPanel(this), new ScrollPanel(this), new FilePanel(this), };
	tabbedPane = new JTabbedPane();
	for (int index = 0; index < panels.length; index++) {
		LogPanel panel = panels[index];
		tabbedPane.addTab(panel.getTitle(), null, panel, panel.getToolTipText());
	}

	JPanel buttonPanel = new JPanel();
	buttonPanel.add(clearLog);
	clearLog.addActionListener(myListener);

	Container contents = getContentPane();
	tabbedPane.setPreferredSize(new Dimension(450, 300));
	contents.add(tabbedPane, BorderLayout.CENTER);
	contents.add(buttonPanel, BorderLayout.SOUTH);

	LocaleManager.addLocaleListener(myListener);
	myListener.localeChanged();
	pack();
	setLocationRelativeTo(null);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:31,代码来源:LogFrame.java

示例6: ProjectManager

import com.cburch.logisim.proj.Project; //导入方法依赖的package包/类
ProjectManager(Project proj) {
	super(proj.getLogisimFile().getName(), false);
	this.proj = proj;
	proj.addProjectListener(this);
	proj.addLibraryListener(this);
	frameOpened(proj.getFrame());
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:8,代码来源:WindowManagers.java


注:本文中的com.cburch.logisim.proj.Project.addLibraryListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。