當前位置: 首頁>>代碼示例>>Java>>正文


Java AttrTableModel類代碼示例

本文整理匯總了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);
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:19,代碼來源:Frame.java

示例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);
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:25,代碼來源:ToolboxManip.java

示例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);
	}
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:26,代碼來源:ToolboxManip.java

示例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);
	}
}
 
開發者ID:franciscaconcha,項目名稱:ProyectoLogisim,代碼行數:24,代碼來源:ToolboxManip.java

示例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));
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:31,代碼來源:Frame.java

示例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));
	}
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:32,代碼來源:Frame.java


注:本文中的com.cburch.logisim.gui.generic.AttrTableModel類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。