diff options
author | Joshua Slack <[email protected]> | 2017-04-20 21:12:42 -0500 |
---|---|---|
committer | Joshua Slack <[email protected]> | 2017-04-20 21:12:42 -0500 |
commit | 9e9c406384a5ef51fd777d936932382f8dde0dc4 (patch) | |
tree | 8b925b31021dc24c95bdc4cd0d36660dd4d7d607 /ardor3d-collada/src | |
parent | 2d335b378ab5a4ab98741117230e82d3c7cb8a69 (diff) |
Cleaned up various warnings
Diffstat (limited to 'ardor3d-collada/src')
5 files changed, 52 insertions, 66 deletions
diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaAnimUtils.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaAnimUtils.java index d20278c..55dadff 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaAnimUtils.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaAnimUtils.java @@ -90,7 +90,7 @@ public class ColladaAnimUtils { /** * Retrieve a name to use for the skin node based on the element names. - * + * * @param ic * instance_controller element. * @param controller @@ -101,17 +101,17 @@ public class ColladaAnimUtils { private String getSkinStoreName(final Element ic, final Element controller) { final String controllerName = controller.getAttributeValue("name", (String) null) != null ? controller .getAttributeValue("name", (String) null) : controller.getAttributeValue("id", (String) null); - final String instanceControllerName = ic.getAttributeValue("name", (String) null) != null ? ic - .getAttributeValue("name", (String) null) : ic.getAttributeValue("sid", (String) null); - final String storeName = (controllerName != null ? controllerName : "") - + (controllerName != null && instanceControllerName != null ? " : " : "") - + (instanceControllerName != null ? instanceControllerName : ""); - return storeName; + final String instanceControllerName = ic.getAttributeValue("name", (String) null) != null ? ic + .getAttributeValue("name", (String) null) : ic.getAttributeValue("sid", (String) null); + final String storeName = (controllerName != null ? controllerName : "") + + (controllerName != null && instanceControllerName != null ? " : " : "") + + (instanceControllerName != null ? instanceControllerName : ""); + return storeName; } /** * Copy the render states from our source Spatial to the destination Spatial. Does not recurse. - * + * * @param source * @param target */ @@ -124,7 +124,7 @@ public class ColladaAnimUtils { /** * Clone the given MeshData object via deep copy using the Ardor3D BinaryExporter and BinaryImporter. - * + * * @param meshData * the source to clone. * @return the clone. @@ -144,7 +144,7 @@ public class ColladaAnimUtils { /** * Builds data based on an instance controller element. - * + * * @param node * Ardor3D parent Node * @param instanceController @@ -171,7 +171,7 @@ public class ColladaAnimUtils { /** * Construct skin mesh(es) from the skin element and attach them (under a single new Node) to the given parent Node. - * + * * @param ardorParentNode * Ardor3D Node to attach our skin node to. * @param instanceController @@ -181,7 +181,6 @@ public class ColladaAnimUtils { * @param skin * our <skin> element. */ - @SuppressWarnings("unchecked") private void buildSkinMeshes(final Node ardorParentNode, final Element instanceController, final Element controller, final Element skin) { final String skinSource = skin.getAttributeValue("source"); @@ -579,10 +578,10 @@ public class ColladaAnimUtils { /** * Construct morph mesh(es) from the <morph> element and attach them (under a single new Node) to the given parent * Node. - * + * * Note: This method current does not do anything but attach the referenced mesh since Ardor3D does not yet support * morph target animation. - * + * * @param ardorParentNode * Ardor3D Node to attach our morph mesh to. * @param controller @@ -616,7 +615,7 @@ public class ColladaAnimUtils { /** * Parse all animations in library_animations - * + * * @param colladaRoot */ public void parseLibraryAnimations(final Element colladaRoot) { @@ -643,10 +642,9 @@ public class ColladaAnimUtils { /** * Merge all animation channels into Ardor jointchannels - * + * * @param entry */ - @SuppressWarnings("unchecked") private void buildAnimations(final Element parentElement, final Collection<TargetChannel> targetList) { final List<Element> elementTransforms = new ArrayList<Element>(); @@ -831,12 +829,11 @@ public class ColladaAnimUtils { /** * Gather up all animation channels based on what nodes they affect. - * + * * @param channelMap * @param animationRoot * @param animationItemRoot */ - @SuppressWarnings("unchecked") private void parseAnimations(final Multimap<Element, TargetChannel> channelMap, final Element animationRoot, final AnimationItem animationItemRoot) { if (animationRoot.getChild("animation") != null) { @@ -889,7 +886,7 @@ public class ColladaAnimUtils { /** * Find a target node based on collada target format. - * + * * @param target * @return */ @@ -954,7 +951,7 @@ public class ColladaAnimUtils { /** * Break up a target uri string into id, sids and accessors - * + * * @param targetString * @return */ @@ -1019,7 +1016,7 @@ public class ColladaAnimUtils { /** * Convert a list of collada elements into a list of TransformElements - * + * * @param transforms * @return */ @@ -1051,7 +1048,7 @@ public class ColladaAnimUtils { /** * Bake a list of TransformElements into an Ardor3D Transform object. - * + * * @param transforms * @return */ @@ -1101,7 +1098,7 @@ public class ColladaAnimUtils { /** * Util for making a readable string out of a xml element hierarchy - * + * * @param e * @param maxDepth * @return @@ -1116,7 +1113,6 @@ public class ColladaAnimUtils { return str.toString(); } - @SuppressWarnings("unchecked") private static void getElementString(final Element e, final StringBuilder str, final int depth, final int maxDepth, final boolean showDots) { addSpacing(str, depth); @@ -1138,7 +1134,7 @@ public class ColladaAnimUtils { str.append('>'); if (depth < maxDepth) { str.append('\n'); - for (final Element child : (List<Element>) e.getChildren()) { + for (final Element child : e.getChildren()) { getElementString(child, str, depth + 1, maxDepth, showDots); } if (!"".equals(e.getText())) { @@ -1184,7 +1180,7 @@ public class ColladaAnimUtils { return "Target [accessorType=" + accessorType + ", id=" + id + ", sids=" + sids + "]"; } return "Target [accessorType=" + accessorType + ", accessorIndexX=" + accessorIndexX + ", accessorIndexY=" - + accessorIndexY + ", id=" + id + ", sids=" + sids + "]"; + + accessorIndexY + ", id=" + id + ", sids=" + sids + "]"; } } } diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaDOMUtil.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaDOMUtil.java index 2bff121..42360dc 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaDOMUtil.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaDOMUtil.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -46,7 +46,7 @@ public class ColladaDOMUtil { /** * Find element with specific id - * + * * @param baseUrl * url specifying target id * @return element with specific id or null if not found @@ -57,7 +57,7 @@ public class ColladaDOMUtil { /** * Find element with specific sid - * + * * @param baseUrl * url specifying target sid * @return element with specific id or null if not found @@ -68,7 +68,7 @@ public class ColladaDOMUtil { /** * Select nodes through an XPath query and return all hits as a List - * + * * @param element * root element to start search on * @param query @@ -89,7 +89,7 @@ public class ColladaDOMUtil { /** * Select nodes through an XPath query and returns the first hit - * + * * @param element * root element to start search on * @param query @@ -121,7 +121,7 @@ public class ColladaDOMUtil { /** * Compiles and return an XPath expression. Expressions are cached. - * + * * @param query * XPath query to compile * @return new XPath expression object @@ -146,7 +146,7 @@ public class ColladaDOMUtil { /** * Parses the text under a node and returns it as a float array. - * + * * @param node * node to parse content from * @return parsed float array @@ -176,7 +176,7 @@ public class ColladaDOMUtil { /** * Parses the text under a node and returns it as a double array. - * + * * @param node * node to parse content from * @return parsed double array @@ -206,7 +206,7 @@ public class ColladaDOMUtil { /** * Parses the text under a node and returns it as an int array. - * + * * @param node * node to parse content from * @return parsed int array @@ -236,7 +236,7 @@ public class ColladaDOMUtil { /** * Parses the text under a node and returns it as a boolean array. - * + * * @param node * node to parse content from * @return parsed boolean array @@ -266,7 +266,7 @@ public class ColladaDOMUtil { /** * Parses the text under a node and returns it as a string array. - * + * * @param node * node to parse content from * @return parsed string array @@ -292,14 +292,13 @@ public class ColladaDOMUtil { /** * Strips the namespace from all nodes in a tree. - * + * * @param rootElement * Root of strip operation */ public void stripNamespace(final Element rootElement) { rootElement.setNamespace(null); - @SuppressWarnings("unchecked") final List<Element> children = rootElement.getChildren(); final Iterator<Element> i = children.iterator(); while (i.hasNext()) { @@ -310,7 +309,7 @@ public class ColladaDOMUtil { /** * Parse an int value in an attribute. - * + * * @param input * Element containing the attribute * @param attributeName @@ -331,7 +330,7 @@ public class ColladaDOMUtil { /** * Convert a Collada color description into an Ardor3D ColorRGBA - * + * * @param colorDescription * Collada color description * @return Ardor3d ColorRGBA @@ -358,11 +357,10 @@ public class ColladaDOMUtil { /** * Find Element with semantic POSITION under an element with inputs - * + * * @param v * @return */ - @SuppressWarnings("unchecked") public Element getPositionSource(final Element v) { for (final Element input : v.getChildren("input")) { if ("POSITION".equals(input.getAttributeValue("semantic"))) { diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaInputPipe.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaInputPipe.java index d883756..0505c10 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaInputPipe.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaInputPipe.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -77,7 +77,6 @@ public class ColladaInputPipe { float_param, bool_param, int_param, name_param, idref_param } - @SuppressWarnings("unchecked") public ColladaInputPipe(final ColladaDOMUtil colladaDOMUtil, final Element input) { // Setup our type try { @@ -201,10 +200,10 @@ public class ColladaInputPipe { _buffer = BufferUtils.createFloatBuffer(size); meshData.setTangentCoords(new FloatBufferData(_buffer, _paramCount)); break; - // case TEXBINORMAL: - // _buffer = BufferUtils.createFloatBuffer(size); - // meshData.setTangentBuffer(_buffer); - // break; + // case TEXBINORMAL: + // _buffer = BufferUtils.createFloatBuffer(size); + // meshData.setTangentBuffer(_buffer); + // break; default: } } diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaMaterialUtils.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaMaterialUtils.java index e4572ff..9c2ccc6 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaMaterialUtils.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaMaterialUtils.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -60,7 +60,7 @@ public class ColladaMaterialUtils { /** * Find and apply the given material to the given Mesh. - * + * * @param materialName * our material name * @param mesh @@ -345,7 +345,7 @@ public class ColladaMaterialUtils { /** * Function to searches an xml node for <texture> elements and adds them to the texture state of the mesh. - * + * * @param mesh * the Ardor3D Mesh to add the Texture to. * @param element @@ -359,7 +359,6 @@ public class ColladaMaterialUtils { if ("texture".equals(element.getName()) && _loadTextures) { populateTextureState(mesh, element, effect, loadedTextures, info, null); } - @SuppressWarnings("unchecked") final List<Element> children = element.getChildren(); if (children != null) { for (final Element child : children) { @@ -371,7 +370,7 @@ public class ColladaMaterialUtils { /** * Convert a <texture> element to an Ardor3D representation and store in the given state. - * + * * @param mesh * the Ardor3D Mesh to add the Texture to. * @param daeTexture @@ -535,7 +534,6 @@ public class ColladaMaterialUtils { } } - @SuppressWarnings("unchecked") public void bindMaterials(final Element bindMaterial) { if (bindMaterial == null || bindMaterial.getChildren().isEmpty()) { return; @@ -553,7 +551,6 @@ public class ColladaMaterialUtils { } } - @SuppressWarnings("unchecked") public void unbindMaterials(final Element bindMaterial) { if (bindMaterial == null || bindMaterial.getChildren().isEmpty()) { return; diff --git a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaNodeUtils.java b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaNodeUtils.java index 165ad89..6db31ec 100644 --- a/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaNodeUtils.java +++ b/ardor3d-collada/src/main/java/com/ardor3d/extension/model/collada/jdom/ColladaNodeUtils.java @@ -3,7 +3,7 @@ * * This file is part of Ardor3D. * - * Ardor3D is free software: you can redistribute it and/or modify it + * Ardor3D is free software: you can redistribute it and/or modify it * under the terms of its license which may be found in the accompanying * LICENSE file or at <http://www.ardor3d.com/LICENSE>. */ @@ -59,12 +59,11 @@ public class ColladaNodeUtils { /** * Retrieves the scene and returns it as an Ardor3D Node. - * + * * @param colladaRoot * The collada root element * @return Scene as an Node or null if not found */ - @SuppressWarnings("unchecked") public Node getVisualScene(final Element colladaRoot) { if (colladaRoot.getChild("scene") == null) { logger.warning("No scene found in collada file!"); @@ -155,11 +154,10 @@ public class ColladaNodeUtils { /** * Parse an asset element into an AssetData object. - * + * * @param asset * @return */ - @SuppressWarnings("unchecked") public AssetData parseAsset(final Element asset) { final AssetData assetData = new AssetData(); @@ -202,7 +200,6 @@ public class ColladaNodeUtils { return assetData; } - @SuppressWarnings("unchecked") private void parseContributor(final AssetData assetData, final Element contributor) { for (final Element child : contributor.getChildren()) { if ("author".equals(child.getName())) { @@ -236,11 +233,10 @@ public class ColladaNodeUtils { /** * Recursively parse the node hierarcy. - * + * * @param dNode * @return a new Ardor3D node, created from the given <node> element */ - @SuppressWarnings("unchecked") private Node buildNode(final Element dNode, JointNode jointNode) { final NodeType nodeType = getNodeType(dNode); final JointNode jointChildNode; @@ -352,7 +348,7 @@ public class ColladaNodeUtils { /** * Combines a list of transform elements into an Ardor3D Transform object. - * + * * @param transforms * List of transform elements * @return an Ardor3D Transform object |