本文整理汇总了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();
}
示例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();
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
}
示例11: AddSeparator
import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
AddSeparator(ToolbarData toolbar, int pos) {
this.toolbar = toolbar;
this.pos = pos;
}
示例12: AddTool
import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
AddTool(ToolbarData toolbar, Tool tool) {
this.toolbar = toolbar;
this.tool = tool;
}
示例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;
}
示例14: RemoveSeparator
import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
RemoveSeparator(ToolbarData toolbar, int pos) {
this.toolbar = toolbar;
this.pos = pos;
}
示例15: RemoveTool
import com.cburch.logisim.file.ToolbarData; //导入依赖的package包/类
RemoveTool(ToolbarData toolbar, int which) {
this.toolbar = toolbar;
this.which = which;
}