From 142905654f6d7bb579297fff673b3444f5dfba82 Mon Sep 17 00:00:00 2001 From: "Kae..pl" Date: Sat, 9 Feb 2013 19:08:11 +0000 Subject: [PATCH] Added a function that creates the full name of the field (with its pointer and table indicators). Just for debugging purposes. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10381 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../scene/plugins/blender/file/Field.java | 19 +++++++++++++++---- .../scene/plugins/blender/file/Structure.java | 10 ++++++++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/file/Field.java b/engine/src/blender/com/jme3/scene/plugins/blender/file/Field.java index ef7802d9b..06197bef7 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/file/Field.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/file/Field.java @@ -276,10 +276,13 @@ class Field implements Cloneable { } } } - - @Override - public String toString() { - StringBuilder result = new StringBuilder(); + + /** + * This method builds the full name of the field (with function, pointer and table indications). + * @return the full name of the field + */ + public String getFullName() { + StringBuilder result = new StringBuilder(); if (function) { result.append('('); } @@ -295,6 +298,14 @@ class Field implements Cloneable { if (function) { result.append(")()"); } + return result.toString(); + } + + @Override + public String toString() { + StringBuilder result = new StringBuilder(); + result.append(this.getFullName()); + //insert appropriate amount of spaces to format the output corrently int nameLength = result.length(); result.append(' ');//at least one space is a must diff --git a/engine/src/blender/com/jme3/scene/plugins/blender/file/Structure.java b/engine/src/blender/com/jme3/scene/plugins/blender/file/Structure.java index cba7dde7f..005cf6072 100644 --- a/engine/src/blender/com/jme3/scene/plugins/blender/file/Structure.java +++ b/engine/src/blender/com/jme3/scene/plugins/blender/file/Structure.java @@ -215,6 +215,16 @@ public class Structure implements Cloneable { public String getFieldName(int fieldIndex) { return fields[fieldIndex].name; } + + /** + * This method returns the full field name of the given index. + * @param fieldIndex + * the index of the field + * @return the full field name of the given index + */ + public String getFieldFullName(int fieldIndex) { + return fields[fieldIndex].getFullName(); + } /** * This method returns the field type of the given index.