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


Java VariableListEvent.MOVE屬性代碼示例

本文整理匯總了Java中com.cburch.logisim.analyze.model.VariableListEvent.MOVE屬性的典型用法代碼示例。如果您正苦於以下問題:Java VariableListEvent.MOVE屬性的具體用法?Java VariableListEvent.MOVE怎麽用?Java VariableListEvent.MOVE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在com.cburch.logisim.analyze.model.VariableListEvent的用法示例。


在下文中一共展示了VariableListEvent.MOVE屬性的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: listChanged

@Override
public void listChanged(VariableListEvent event) {
	String[] oldCopy = listCopy;
	updateCopy();
	int index;
	switch (event.getType()) {
	case VariableListEvent.ALL_REPLACED:
		fireContentsChanged(this, 0, oldCopy.length);
		return;
	case VariableListEvent.ADD:
		index = list.indexOf(event.getVariable());
		fireIntervalAdded(this, index, index);
		return;
	case VariableListEvent.REMOVE:
		index = ((Integer) event.getData()).intValue();
		fireIntervalRemoved(this, index, index);
		return;
	case VariableListEvent.MOVE:
		fireContentsChanged(this, 0, getSize());
		return;
	case VariableListEvent.REPLACE:
		index = ((Integer) event.getData()).intValue();
		fireContentsChanged(this, index, index);
		return;
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:26,代碼來源:VariableTab.java

示例2: listChanged

public void listChanged(VariableListEvent event) {
	String[] oldCopy = listCopy;
	updateCopy();
	int index;
	switch (event.getType()) {
	case VariableListEvent.ALL_REPLACED:
		fireContentsChanged(this, 0, oldCopy.length);
		return;
	case VariableListEvent.ADD:
		index = list.indexOf(event.getVariable());
		fireIntervalAdded(this, index, index);
		return;
	case VariableListEvent.REMOVE:
		index = ((Integer) event.getData()).intValue();
		fireIntervalRemoved(this, index, index);
		return;
	case VariableListEvent.MOVE:
		fireContentsChanged(this, 0, getSize());
		return;
	case VariableListEvent.REPLACE:
		index = ((Integer) event.getData()).intValue();
		fireContentsChanged(this, index, index);
		return;
	}
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:25,代碼來源:VariableTab.java

示例3: listChanged

@Override
public void listChanged(VariableListEvent event) {
	int index;
	String variable;
	Object selection;
	switch (event.getType()) {
	case VariableListEvent.ALL_REPLACED:
		computePrototypeValue();
		fireContentsChanged(this, 0, getSize());
		if (source.isEmpty()) {
			select.setSelectedItem(null);
		} else {
			select.setSelectedItem(source.get(0));
		}
		break;
	case VariableListEvent.ADD:
		variable = event.getVariable();
		if (prototypeValue == null || variable.length() > prototypeValue.length()) {
			computePrototypeValue();
		}

		index = source.indexOf(variable);
		fireIntervalAdded(this, index, index);
		if (select.getSelectedItem() == null) {
			select.setSelectedItem(variable);
		}
		break;
	case VariableListEvent.REMOVE:
		variable = event.getVariable();
		if (variable.equals(prototypeValue))
			computePrototypeValue();
		index = ((Integer) event.getData()).intValue();
		fireIntervalRemoved(this, index, index);
		selection = select.getSelectedItem();
		if (selection != null && selection.equals(variable)) {
			selection = source.isEmpty() ? null : source.get(0);
			select.setSelectedItem(selection);
		}
		break;
	case VariableListEvent.MOVE:
		fireContentsChanged(this, 0, getSize());
		break;
	case VariableListEvent.REPLACE:
		variable = event.getVariable();
		if (variable.equals(prototypeValue))
			computePrototypeValue();
		index = ((Integer) event.getData()).intValue();
		fireContentsChanged(this, index, index);
		selection = select.getSelectedItem();
		if (selection != null && selection.equals(variable)) {
			select.setSelectedItem(event.getSource().get(index));
		}
		break;
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:55,代碼來源:OutputSelector.java

示例4: listChanged

public void listChanged(VariableListEvent event) {
	int index;
	String variable;
	Object selection;
	switch (event.getType()) {
	case VariableListEvent.ALL_REPLACED:
		computePrototypeValue();
		fireContentsChanged(this, 0, getSize());
		if (source.isEmpty()) {
			select.setSelectedItem(null);
		} else {
			select.setSelectedItem(source.get(0));
		}
		break;
	case VariableListEvent.ADD:
		variable = event.getVariable();
		if (prototypeValue == null
				|| variable.length() > prototypeValue.length()) {
			computePrototypeValue();
		}

		index = source.indexOf(variable);
		fireIntervalAdded(this, index, index);
		if (select.getSelectedItem() == null) {
			select.setSelectedItem(variable);
		}
		break;
	case VariableListEvent.REMOVE:
		variable = event.getVariable();
		if (variable.equals(prototypeValue))
			computePrototypeValue();
		index = ((Integer) event.getData()).intValue();
		fireIntervalRemoved(this, index, index);
		selection = select.getSelectedItem();
		if (selection != null && selection.equals(variable)) {
			selection = source.isEmpty() ? null : source.get(0);
			select.setSelectedItem(selection);
		}
		break;
	case VariableListEvent.MOVE:
		fireContentsChanged(this, 0, getSize());
		break;
	case VariableListEvent.REPLACE:
		variable = event.getVariable();
		if (variable.equals(prototypeValue))
			computePrototypeValue();
		index = ((Integer) event.getData()).intValue();
		fireContentsChanged(this, index, index);
		selection = select.getSelectedItem();
		if (selection != null && selection.equals(variable)) {
			select.setSelectedItem(event.getSource().get(index));
		}
		break;
	}
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:55,代碼來源:OutputSelector.java

示例5: listChanged

public void listChanged(VariableListEvent event) {
	int index;
	String variable;
	Object selection;
	switch (event.getType()) {
	case VariableListEvent.ALL_REPLACED:
		computePrototypeValue();
		fireContentsChanged(this, 0, getSize());
		if (source.isEmpty()) {
			select.setSelectedItem(null);
		} else {
			select.setSelectedItem(source.get(0));
		}
		break;
	case VariableListEvent.ADD:
		variable = event.getVariable();
		if (prototypeValue == null || variable.length() > prototypeValue.length()) {
			computePrototypeValue();
		}
		
		index = source.indexOf(variable);
		fireIntervalAdded(this, index, index);
		if (select.getSelectedItem() == null) {
			select.setSelectedItem(variable);
		}
		break;
	case VariableListEvent.REMOVE:
		variable = event.getVariable();
		if (variable.equals(prototypeValue)) computePrototypeValue();
		index = ((Integer) event.getData()).intValue();
		fireIntervalRemoved(this, index, index);
		selection = select.getSelectedItem();
		if (selection != null && selection.equals(variable)) {
			selection = source.isEmpty() ? null : source.get(0);
			select.setSelectedItem(selection);
		}
		break;
	case VariableListEvent.MOVE:
		fireContentsChanged(this, 0, getSize());
		break;
	case VariableListEvent.REPLACE:
		variable = event.getVariable();
		if (variable.equals(prototypeValue)) computePrototypeValue();
		index = ((Integer) event.getData()).intValue();
		fireContentsChanged(this, index, index);
		selection = select.getSelectedItem();
		if (selection != null && selection.equals(variable)) {
			select.setSelectedItem(event.getSource().get(index));
		}
		break;
	}
}
 
開發者ID:franciscaconcha,項目名稱:ProyectoLogisim,代碼行數:52,代碼來源:OutputSelector.java


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