Revision: 598
Author: [email protected]
Date: Tue Jul 28 12:16:49 2009
Log: issue#99 undo r563 to repeat later in the agreed on style.
http://code.google.com/p/piccolo2d/source/detail?r=598
Modified:
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PImage.java
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTImage.java
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java
=======================================
--- /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
Tue Jul 28 12:13:57 2009
+++ /piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/PNode.java
Tue Jul 28 12:16:49 2009
@@ -3158,6 +3158,18 @@
in.defaultReadObject();
parent = (PNode) in.readObject();
}
+
+ // ****************************************************************
+ // Debugging - methods for debugging
+ // ****************************************************************
+
+ /**
+ * Returns a string representation of this object for debugging
purposes.
+ */
+ public String toString() {
+ String result = super.toString().replaceAll(".*\\.", "");
+ return result + "[" + paramString() + "]";
+ }
/**
* Returns a string representing the state of this node. This method is
@@ -3166,10 +3178,34 @@
* returned string may be empty but may not be <code>null</code>.
*
* @return a string representation of this node's state
- * @deprecated
*/
- protected final String paramString() {
- return "this Method (paramString) is deprecated and will go away
in the next release.";
+ protected String paramString() {
+ StringBuffer result = new StringBuffer();
+
+ result.append("bounds=" + (bounds == null ? "null" :
bounds.toString()));
+ result.append(",fullBounds=" + (fullBoundsCache == null ? "null" :
fullBoundsCache.toString()));
+ result.append(",transform=" + (transform == null ? "null" :
transform.toString()));
+ result.append(",paint=" + (paint == null ? "null" :
paint.toString()));
+ result.append(",transparency=" + transparency);
+ result.append(",childrenCount=" + getChildrenCount());
+
+ if (fullBoundsInvalid) {
+ result.append(",fullBoundsInvalid");
+ }
+
+ if (pickable) {
+ result.append(",pickable");
+ }
+
+ if (childrenPickable) {
+ result.append(",childrenPickable");
+ }
+
+ if (visible) {
+ result.append(",visible");
+ }
+
+ return result.toString();
}
public PInputEventListener[] getInputEventListeners() {
=======================================
---
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PImage.java
Mon Jul 27 13:14:54 2009
+++
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PImage.java
Tue Jul 28 12:16:49 2009
@@ -240,4 +240,22 @@
g2.dispose();
return result;
}
-}
+
+ /**
+ * Returns a string representing the state of this node. This method is
+ * intended to be used only for debugging purposes, and the content and
+ * format of the returned string may vary between implementations. The
+ * returned string may be empty but may not be <code>null</code>.
+ *
+ * @return a string representation of this node's state
+ */
+ protected String paramString() {
+ StringBuffer result = new StringBuffer();
+
+ result.append("image=" + (image == null ? "null" :
image.toString()));
+ result.append(',');
+ result.append(super.paramString());
+
+ return result.toString();
+ }
+}
=======================================
---
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java
Mon Jul 27 13:14:54 2009
+++
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PPath.java
Tue Jul 28 12:16:49 2009
@@ -426,4 +426,28 @@
stroke = PUtil.readStroke(in);
path = PUtil.readPath(in);
}
-}
+
+ // ****************************************************************
+ // Debugging - methods for debugging
+ // ****************************************************************
+
+ /**
+ * Returns a string representing the state of this node. This method is
+ * intended to be used only for debugging purposes, and the content and
+ * format of the returned string may vary between implementations. The
+ * returned string may be empty but may not be <code>null</code>.
+ *
+ * @return a string representation of this node's state
+ */
+ protected String paramString() {
+ StringBuffer result = new StringBuffer();
+
+ result.append("path=" + (path == null ? "null" : path.toString()));
+ result.append(",stroke=" + (stroke == null ? "null" :
stroke.toString()));
+ result.append(",strokePaint=" + (strokePaint == null ? "null" :
strokePaint.toString()));
+ result.append(',');
+ result.append(super.paramString());
+
+ return result.toString();
+ }
+}
=======================================
---
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java
Mon Jul 27 13:14:54 2009
+++
/piccolo2d.java/trunk/core/src/main/java/edu/umd/cs/piccolo/nodes/PText.java
Tue Jul 28 12:16:49 2009
@@ -344,4 +344,27 @@
double height) {
recomputeLayout();
}
-}
+
+ // ****************************************************************
+ // Debugging - methods for debugging
+ // ****************************************************************
+
+ /**
+ * Returns a string representing the state of this node. This method is
+ * intended to be used only for debugging purposes, and the content and
+ * format of the returned string may vary between implementations. The
+ * returned string may be empty but may not be <code>null</code>.
+ *
+ * @return a string representation of this node's state
+ */
+ protected String paramString() {
+ StringBuffer result = new StringBuffer();
+
+ result.append("text=" + (text == null ? "null" : text));
+ result.append(",font=" + (font == null ? "null" :
font.toString()));
+ result.append(',');
+ result.append(super.paramString());
+
+ return result.toString();
+ }
+}
=======================================
---
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTImage.java
Sat Jul 25 06:39:02 2009
+++
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTImage.java
Tue Jul 28 12:16:49 2009
@@ -141,4 +141,27 @@
}
}
}
-}
+
+ // ****************************************************************
+ // Debugging - methods for debugging
+ // ****************************************************************
+
+ /**
+ * Returns a string representing the state of this node. This method is
+ * intended to be used only for debugging purposes, and the content and
+ * format of the returned string may vary between implementations. The
+ * returned string may be empty but may not be <code>null</code>.
+ *
+ * @return a string representation of this node's state
+ */
+ protected String paramString() {
+ StringBuffer result = new StringBuffer();
+
+ result.append("image=" + (image == null ? "null" :
image.toString()));
+
+ result.append(',');
+ result.append(super.paramString());
+
+ return result.toString();
+ }
+}
=======================================
---
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java
Tue Jul 28 12:07:42 2009
+++
/piccolo2d.java/trunk/swt/src/main/java/edu/umd/cs/piccolox/swt/PSWTPath.java
Tue Jul 28 12:16:49 2009
@@ -424,4 +424,27 @@
}
setShape(path);
}
-}
+
+ // ****************************************************************
+ // Debugging - methods for debugging
+ // ****************************************************************
+
+ /**
+ * Returns a string representing the state of this node. This method is
+ * intended to be used only for debugging purposes, and the content and
+ * format of the returned string may vary between implementations. The
+ * returned string may be empty but may not be <code>null</code>.
+ *
+ * @return a string representation of this node's state
+ */
+ protected String paramString() {
+ StringBuffer result = new StringBuffer();
+
+ result.append("path=" + (shape == null ? "null" :
shape.toString()));
+ result.append(",strokePaint=" + (strokePaint == null ? "null" :
strokePaint.toString()));
+ result.append(',');
+ result.append(super.paramString());
+
+ return result.toString();
+ }
+}
--~--~---------~--~----~------------~-------~--~----~
Piccolo2D Developers Group: http://groups.google.com/group/piccolo2d-dev?hl=en
-~----------~----~----~----~------~----~------~--~---