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


Java ToolbarData类代码示例

本文整理汇总了Java中com.cburch.logisim.file.ToolbarData的典型用法代码示例。如果您正苦于以下问题:Java ToolbarData类的具体用法?Java ToolbarData怎么用?Java ToolbarData使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: buildContents

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
private void buildContents() {
	List<ToolbarItem> oldItems = items;
	List<ToolbarItem> newItems = new ArrayList<ToolbarItem>();
	ToolbarData data = proj.getLogisimFile().getOptions().getToolbarData();
	for (Tool tool : data.getContents()) {
		if (tool == null) {
			newItems.add(new ToolbarSeparator(4));
		} else {
			ToolbarItem i = findItem(oldItems, tool);
			if (i == null) {
				newItems.add(new ToolItem(tool));
			} else {
				newItems.add(i);
			}
		}
	}
	items = Collections.unmodifiableList(newItems);
	fireToolbarContentsChanged();
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:20,代码来源:LayoutToolbarModel.java

示例2: buildContents

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
private void buildContents() {
	List<ToolbarItem> oldItems = items;
	List<ToolbarItem> newItems = new ArrayList<ToolbarItem>();
	int pos = -1;
	ToolbarData data = proj.getLogisimFile().getOptions().getToolbarData();
	for (Tool tool : data.getContents()) {
		++pos;
		if (tool == null) {
			newItems.add(new ToolbarSeparator(4));
		} else {
			ToolbarItem i = findItem(oldItems, tool);
			if (i == null) {
				newItems.add(new ToolItem(tool));
			} else {
				newItems.add(i);
			}
		}
	}
	items = Collections.unmodifiableList(newItems);
	fireToolbarContentsChanged();
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:22,代码来源:LayoutToolbarModel.java

示例3: LayoutToolbarModel

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
public LayoutToolbarModel(Frame frame, Project proj) {
	// this.frame = frame;
	this.proj = proj;
	myListener = new MyListener();
	items = Collections.emptyList();
	haloedTool = null;
	buildContents();

	// set up listeners
	ToolbarData data = proj.getOptions().getToolbarData();
	data.addToolbarListener(myListener);
	data.addToolAttributeListener(myListener);
	AppPreferences.GATE_SHAPE.addPropertyChangeListener(myListener);
	proj.addProjectListener(myListener);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:16,代码来源:LayoutToolbarModel.java

示例4: ToolbarList

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
public ToolbarList(ToolbarData base) {
	this.base = base;
	this.model = new Model();

	setModel(model);
	setCellRenderer(new ListRenderer());
	setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

	AppPreferences.GATE_SHAPE.addPropertyChangeListener(model);
	base.addToolbarListener(model);
	base.addToolAttributeListener(model);
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:13,代码来源:ToolbarList.java

示例5: doMove

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
private void doMove(int delta) {
	int oldIndex = list.getSelectedIndex();
	int newIndex = oldIndex + delta;
	ToolbarData data = getOptions().getToolbarData();
	if (oldIndex >= 0 && newIndex >= 0 && newIndex < data.size()) {
		getProject().doAction(ToolbarActions.moveTool(data, oldIndex, newIndex));
		list.setSelectedIndex(newIndex);
	}
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:10,代码来源:ToolbarOptions.java

示例6: LayoutToolbarModel

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
public LayoutToolbarModel(Frame frame, Project proj) {
	this.frame = frame;
	this.proj = proj;
	myListener = new MyListener();
	items = Collections.emptyList();
	haloedTool = null;
	buildContents();

	// set up listeners
	ToolbarData data = proj.getOptions().getToolbarData();
	data.addToolbarListener(myListener);
	data.addToolAttributeListener(myListener);
	AppPreferences.GATE_SHAPE.addPropertyChangeListener(myListener);
	proj.addProjectListener(myListener);
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:16,代码来源:LayoutToolbarModel.java

示例7: ToolbarList

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public ToolbarList(ToolbarData base) {
	this.base = base;
	this.model = new Model();

	setModel(model);
	setCellRenderer(new ListRenderer());
	setSelectionMode(ListSelectionModel.SINGLE_SELECTION);

	AppPreferences.GATE_SHAPE.addPropertyChangeListener(model);
	base.addToolbarListener(model);
	base.addToolAttributeListener(model);
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:14,代码来源:ToolbarList.java

示例8: doMove

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
private void doMove(int delta) {
	int oldIndex = list.getSelectedIndex();
	int newIndex = oldIndex + delta;
	ToolbarData data = getOptions().getToolbarData();
	if (oldIndex >= 0 && newIndex >= 0 && newIndex < data.size()) {
		getProject().doAction(
				ToolbarActions.moveTool(data, oldIndex, newIndex));
		list.setSelectedIndex(newIndex);
	}
}
 
开发者ID:reds-heig,项目名称:logisim-evolution,代码行数:11,代码来源:ToolbarOptions.java

示例9: ToolbarList

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
public ToolbarList(ToolbarData base) {
	this.base = base;
	this.model = new Model();

	setModel(model);
	setCellRenderer(new ListRenderer());
	setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
	
	AppPreferences.GATE_SHAPE.addPropertyChangeListener(model);
	base.addToolbarListener(model);
	base.addToolAttributeListener(model);
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:13,代码来源:ToolbarList.java

示例10: doMove

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
private void doMove(int delta) {
	int oldIndex = list.getSelectedIndex();
	int newIndex = oldIndex + delta;
	ToolbarData data = getOptions().getToolbarData();
	if (oldIndex >= 0 && newIndex >= 0 && newIndex < data.size()) {
		getProject().doAction(ToolbarActions.moveTool(data,
				oldIndex, newIndex));
		list.setSelectedIndex(newIndex);
	}
}
 
开发者ID:franciscaconcha,项目名称:ProyectoLogisim,代码行数:11,代码来源:ToolbarOptions.java

示例11: AddSeparator

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
AddSeparator(ToolbarData toolbar, int pos) {
	this.toolbar = toolbar;
	this.pos = pos;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:5,代码来源:ToolbarActions.java

示例12: AddTool

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
AddTool(ToolbarData toolbar, Tool tool) {
	this.toolbar = toolbar;
	this.tool = tool;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:5,代码来源:ToolbarActions.java

示例13: MoveTool

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
MoveTool(ToolbarData toolbar, int oldpos, int dest) {
	this.toolbar = toolbar;
	this.oldpos = oldpos;
	this.dest = dest;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:6,代码来源:ToolbarActions.java

示例14: RemoveSeparator

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
RemoveSeparator(ToolbarData toolbar, int pos) {
	this.toolbar = toolbar;
	this.pos = pos;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:5,代码来源:ToolbarActions.java

示例15: RemoveTool

import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
RemoveTool(ToolbarData toolbar, int which) {
	this.toolbar = toolbar;
	this.which = which;
}
 
开发者ID:LogisimIt,项目名称:Logisim,代码行数:5,代码来源:ToolbarActions.java


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