use of com.cburch.draw.toolbar.ToolbarItem in project logisim-evolution by reds-heig.
the class LayoutToolbarModel method buildContents.
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();
}
use of com.cburch.draw.toolbar.ToolbarItem in project logisim-evolution by reds-heig.
the class KeyboardToolSelection method actionPerformed.
public void actionPerformed(ActionEvent event) {
ToolbarModel model = toolbar.getToolbarModel();
int i = -1;
for (ToolbarItem item : model.getItems()) {
if (item.isSelectable()) {
i++;
if (i == index) {
model.itemSelected(item);
}
}
}
}
Aggregations