本文整理匯總了Java中com.cburch.logisim.gui.generic.AttrTableModel類的典型用法代碼示例。如果您正苦於以下問題:Java AttrTableModel類的具體用法?Java AttrTableModel怎麽用?Java AttrTableModel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AttrTableModel類屬於com.cburch.logisim.gui.generic包,在下文中一共展示了AttrTableModel類的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: setAttrTableModel
import com.cburch.logisim.gui.generic.AttrTableModel; //導入依賴的package包/類
void setAttrTableModel(AttrTableModel value) {
attrTable.setAttrTableModel(value);
if (value instanceof AttrTableToolModel) {
Tool tool = ((AttrTableToolModel) value).getTool();
toolbox.setHaloedTool(tool);
layoutToolbarModel.setHaloedTool(tool);
} else {
toolbox.setHaloedTool(null);
layoutToolbarModel.setHaloedTool(null);
}
if (value instanceof AttrTableComponentModel) {
Circuit circ = ((AttrTableComponentModel) value).getCircuit();
Component comp = ((AttrTableComponentModel) value).getComponent();
layoutCanvas.setHaloedComponent(circ, comp);
} else {
layoutCanvas.setHaloedComponent(null, null);
}
}
示例2: selectionChanged
import com.cburch.logisim.gui.generic.AttrTableModel; //導入依賴的package包/類
@Override
public void selectionChanged(ProjectExplorer.Event event) {
Object selected = event.getTarget();
if (selected instanceof Tool) {
if (selected instanceof AddTool) {
AddTool addTool = (AddTool) selected;
ComponentFactory source = addTool.getFactory();
if (source instanceof SubcircuitFactory) {
SubcircuitFactory circFact = (SubcircuitFactory) source;
Circuit circ = circFact.getSubcircuit();
if (proj.getCurrentCircuit() == circ) {
AttrTableModel m = new AttrTableCircuitModel(proj, circ);
proj.getFrame().setAttrTableModel(m);
return;
}
}
}
lastSelected = proj.getTool();
Tool tool = (Tool) selected;
proj.setTool(tool);
proj.getFrame().viewAttributes(tool);
}
}
示例3: selectionChanged
import com.cburch.logisim.gui.generic.AttrTableModel; //導入依賴的package包/類
public void selectionChanged(ProjectExplorerEvent event) {
Object selected = event.getTarget();
if (selected instanceof ProjectExplorerToolNode) {
Tool tool = ((ProjectExplorerToolNode) selected).getValue();
if (selected instanceof AddTool) {
AddTool addTool = (AddTool) tool;
ComponentFactory source = addTool.getFactory();
if (source instanceof SubcircuitFactory) {
SubcircuitFactory circFact = (SubcircuitFactory) source;
Circuit circ = circFact.getSubcircuit();
if (proj.getCurrentCircuit() == circ) {
AttrTableModel m = new AttrTableCircuitModel(proj, circ);
proj.getFrame().setAttrTableModel(m);
return;
}
}
}
// This was causing the selection to lag behind double-clicks,
// commented-out
// lastSelected = proj.getTool();
proj.setTool(tool);
proj.getFrame().viewAttributes(tool);
}
}
示例4: selectionChanged
import com.cburch.logisim.gui.generic.AttrTableModel; //導入依賴的package包/類
public void selectionChanged(ProjectExplorer.Event event) {
Object selected = event.getTarget();
if (selected instanceof Tool) {
if (selected instanceof AddTool) {
AddTool addTool = (AddTool) selected;
ComponentFactory source = addTool.getFactory();
if (source instanceof SubcircuitFactory) {
SubcircuitFactory circFact = (SubcircuitFactory) source;
Circuit circ = circFact.getSubcircuit();
if (proj.getCurrentCircuit() == circ) {
AttrTableModel m = new AttrTableCircuitModel(proj, circ);
proj.getFrame().setAttrTableModel(m);
return;
}
}
}
lastSelected = proj.getTool();
Tool tool = (Tool) selected;
proj.setTool(tool);
proj.getFrame().viewAttributes(tool);
}
}
示例5: viewAttributes
import com.cburch.logisim.gui.generic.AttrTableModel; //導入依賴的package包/類
private void viewAttributes(Tool oldTool, Tool newTool, boolean force) {
AttributeSet newAttrs;
if (newTool == null) {
newAttrs = null;
if (!force)
return;
} else {
newAttrs = newTool.getAttributeSet(layoutCanvas);
}
if (newAttrs == null) {
AttrTableModel oldModel = attrTable.getAttrTableModel();
boolean same = oldModel instanceof AttrTableToolModel
&& ((AttrTableToolModel) oldModel).getTool() == oldTool;
if (!force && !same && !(oldModel instanceof AttrTableCircuitModel)) {
return;
}
}
if (newAttrs == null) {
Circuit circ = proj.getCurrentCircuit();
if (circ != null) {
setAttrTableModel(new AttrTableCircuitModel(proj, circ));
} else if (force) {
setAttrTableModel(null);
}
} else if (newAttrs instanceof SelectionAttributes) {
setAttrTableModel(attrTableSelectionModel);
} else {
setAttrTableModel(new AttrTableToolModel(proj, newTool));
}
}
示例6: viewAttributes
import com.cburch.logisim.gui.generic.AttrTableModel; //導入依賴的package包/類
private void viewAttributes(Tool oldTool, Tool newTool, boolean force) {
AttributeSet newAttrs;
if (newTool == null) {
newAttrs = null;
if (!force) {
return;
}
} else {
newAttrs = newTool.getAttributeSet(layoutCanvas);
}
if (newAttrs == null) {
AttrTableModel oldModel = attrTable.getAttrTableModel();
boolean same = oldModel instanceof AttrTableToolModel
&& ((AttrTableToolModel) oldModel).getTool() == oldTool;
if (!force && !same && !(oldModel instanceof AttrTableCircuitModel)) {
return;
}
}
if (newAttrs == null) {
Circuit circ = proj.getCurrentCircuit();
if (circ != null) {
setAttrTableModel(new AttrTableCircuitModel(proj, circ));
} else if (force) {
setAttrTableModel(null);
}
} else if (newAttrs instanceof SelectionAttributes) {
setAttrTableModel(attrTableSelectionModel);
} else {
setAttrTableModel(new AttrTableToolModel(proj, newTool));
}
}