public static Ident getNeighborIdent(Item neighborItem, String fieldName) { Ident neighborItemIdent = neighborItem.getIdent(); return getNeighborIdent(neighborItemIdent, fieldName); } public static String getString(Item parent, String fieldName, String defaultVal) {
public LightConfig(Item configItem) { lightName = configItem.getIdent().getLocalName(); lightType = LightType.AMBIENT; // For now, we assume light is ambient (no direction required) if type is not specified String typeString = ItemFuncs.getString(configItem, LightsCameraAN.P_lightType, null); if (typeString.equals("DIRECTIONAL")) { lightType = LightType.DIRECTIONAL; } for (int index = 0; index < lightDirection.length; index++) { lightDirection[index] = ItemFuncs.getDouble(configItem, LightsCameraAN.P_direction[index], 0.0).floatValue(); } for (int index = 0; index < lightColor.length; index++) { lightColor[index] = ItemFuncs.getDouble(configItem, LightsCameraAN.P_color[index], null).floatValue(); } }
@Override protected void initExtendedFieldsAndLinks(Nugget nug, Item configItem, Assembler assmblr, Mode mode) { ItemAssemblyReader reader = getReader(); getLogger().debug("NuggetBuilder.initExtendedFieldsAndLinks"); nug.myDetails = reader.readConfigValString(configItem.getIdent(), AssemblyTestNames.P_details, configItem, null); if (nug instanceof MegaNugget) { MegaNugget mn = (MegaNugget) nug; mn.myGaucho = reader.readConfigValString(configItem.getIdent(), AssemblyTestNames.P_gaucho, configItem, null); mn.myCount = reader.readConfigValLong(configItem.getIdent(), AssemblyTestNames.P_count, configItem, null); mn.myAngle = reader.readConfigValDouble(configItem.getIdent(), AssemblyTestNames.P_angle, configItem, null); mn.myOtherNugs = reader.findOrMakeLinkedObjSeq(configItem, AssemblyTestNames.P_otherNugs, assmblr, mode); mn.myTriggers = reader.findOrMakeLinkedObjects(configItem, AssemblyTestNames.P_trigger, assmblr, mode, null); List<Object> friendlyNugs = reader.findOrMakeLinkedObjects(configItem, AssemblyTestNames.P_friendlyNug, assmblr, mode, null); if (friendlyNugs.size() == 1) { Object fn = friendlyNugs.get(0); mn.myFriendlyNug = (Nugget) fn; } // List<Item> otherNugs } } // List<Object> linkedTriggers = findOrMakeLinkedObjects(configItem, AssemblyNames.P_trigger, asmblr, mode, null);
public BoneJointConfig(Item configItem) { myURI_Fragment = configItem.getIdent().getLocalName(); myJointNum = ItemFuncs.getInteger(configItem, BoneAN.P_jointNum, null); myJointName = ItemFuncs.getString(configItem, BoneAN.P_jointName, null); myNormalDefaultPos = ItemFuncs.getDouble(configItem, BoneAN.P_defaultPosNorm, null); Set<Item> bprItems = ItemFuncs.getLinkedItemSet(configItem, BoneAN.P_projectionRange); for (Item bpri : bprItems) { BoneProjectionRange bpr = BoneProjectionRange.makeOne(this, bpri); myProjectionRanges.add(bpr); } }
LinkDirection.FORWARD); if(targetThingItem != null){ spec.setMyTargetThingID(targetThingItem.getIdent()); LinkDirection.FORWARD); if(actionVerbItem != null){ spec.setMyActionVerbID(actionVerbItem.getIdent()); LinkDirection.FORWARD); if(sourceAgentItem != null){ spec.setMySourceAgentID(sourceAgentItem.getIdent()); logger.warn( "ThingActionParam \"{}\" did not provide a \"paramIdent\" and was discarded", i.getIdent()); continue; else { name = nameItem_RawSet.iterator().next().getIdent(); } logger.warn( "ThingActionParam \"{}\" provided multiple values illegally and was discarded", i.getIdent()); i.getIdent()); value = identTypeItems.iterator().next().getIdent();
@Override protected void initExtendedFieldsAndLinks( SerialNumberSpec mkc, Item item, Assembler asmblr, Mode mode) { ItemAssemblyReader reader = getReader(); mkc.setSerialNumber(reader.readConfigValString( item.getIdent(), theSerialNumberNumber, item, "000001")); // read in and build the linked properties, and storing each in the Spec List linkedProperties = reader.findOrMakeLinkedObjects( item, theHasProperty, asmblr, mode, null); for(Object lp: linkedProperties) { if(!(lp instanceof PropertySpec)) { continue; } PropertySpec propertySpec = (PropertySpec)lp; mkc.addProperty(propertySpec.getName(), propertySpec.getValue()); } } }