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