MCPcopy Create free account
hub / github.com/boazy/TWEditorEnhanced / setFields

Method setFields

src/main/java/AttributesPanel.java:193–228  ·  view source on GitHub ↗
(DBList list)

Source from the content-addressed store, hash-verified

191 }
192
193 public void setFields(DBList list)
194 throws DBException
195 {
196 for (int tab = 0; tab < this.fields.length; tab++) {
197 for (int row = 0; row < this.fields[0].length; row++) {
198 for (int col = 0; col < this.fields[0][0].length; col++) {
199 if (this.fields[tab][row][col] != null) {
200 this.fields[tab][row][col].setSelected(false);
201 }
202 }
203 }
204
205 this.levels[tab] = -1;
206 }
207
208 DBElement element = list.getElement("CharAbilities");
209 if (element == null) {
210 throw new DBException("CharAbilities field not found");
211 }
212 DBList abilityList = (DBList)element.getValue();
213 int count = abilityList.getElementCount();
214 for (int index = 0; index < count; index++) {
215 DBList fieldList = (DBList)abilityList.getElement(index).getValue();
216 String abilityName = fieldList.getString("RnAbName");
217 JCheckBox field = (JCheckBox)this.labelMap.get(abilityName);
218 if (field != null) {
219 field.setSelected(true);
220 int value = Integer.parseInt(field.getActionCommand());
221 int tab = value / 100;
222 int row = value % 100 / 10;
223 int col = value % 10;
224 if ((row == 0) && (col > this.levels[tab]))
225 this.levels[tab] = col;
226 }
227 }
228 }
229
230 public void getFields(DBList list)
231 throws DBException

Callers

nothing calls this directly

Calls 4

getElementMethod · 0.95
getValueMethod · 0.95
getElementCountMethod · 0.95
getStringMethod · 0.95

Tested by

no test coverage detected