本文整理匯總了Java中com.cburch.logisim.analyze.model.VariableListEvent類的典型用法代碼示例。如果您正苦於以下問題:Java VariableListEvent類的具體用法?Java VariableListEvent怎麽用?Java VariableListEvent使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
VariableListEvent類屬於com.cburch.logisim.analyze.model包,在下文中一共展示了VariableListEvent類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: listChanged
import com.cburch.logisim.analyze.model.VariableListEvent; //導入依賴的package包/類
@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;
}
}
示例2: listChanged
import com.cburch.logisim.analyze.model.VariableListEvent; //導入依賴的package包/類
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;
}
}
示例3: listChanged
import com.cburch.logisim.analyze.model.VariableListEvent; //導入依賴的package包/類
@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;
}
}
示例4: listChanged
import com.cburch.logisim.analyze.model.VariableListEvent; //導入依賴的package包/類
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;
}
}
示例5: listChanged
import com.cburch.logisim.analyze.model.VariableListEvent; //導入依賴的package包/類
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;
}
}