From dc79b471f3d6d5cde131e1b4d0171cf72a6fccff Mon Sep 17 00:00:00 2001 From: mdb Date: Mon, 23 May 2005 20:18:56 +0000 Subject: [PATCH] Clear out the _layouts whenever something is changed that would require a relayout to reflect the change (which is basically everything). git-svn-id: https://samskivert.googlecode.com/svn/trunk@1646 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/swing/Label.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/projects/samskivert/src/java/com/samskivert/swing/Label.java b/projects/samskivert/src/java/com/samskivert/swing/Label.java index 636eb203..4b2c8654 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/Label.java +++ b/projects/samskivert/src/java/com/samskivert/swing/Label.java @@ -124,6 +124,7 @@ public class Label implements SwingConstants, LabelStyleConstants } else { return false; } + _layouts = null; return true; } @@ -134,6 +135,7 @@ public class Label implements SwingConstants, LabelStyleConstants public void setFont (Font font) { _font = font; + _layouts = null; } /** @@ -152,6 +154,7 @@ public class Label implements SwingConstants, LabelStyleConstants public void setTextColor (Color color) { _textColor = color; + _layouts = null; } /** @@ -172,6 +175,7 @@ public class Label implements SwingConstants, LabelStyleConstants public void setAlternateColor (Color color) { _alternateColor = color; + _layouts = null; } /** @@ -191,6 +195,7 @@ public class Label implements SwingConstants, LabelStyleConstants public void setAlignment (int align) { _align = align; + _layouts = null; } /** @@ -201,6 +206,7 @@ public class Label implements SwingConstants, LabelStyleConstants public void setStyle (int style) { _style = style; + _layouts = null; } /** @@ -213,6 +219,7 @@ public class Label implements SwingConstants, LabelStyleConstants // use -1 as an indicator that we should be golden _constraints.width = -1; _constraints.height = -1; + _layouts = null; } /** @@ -230,6 +237,7 @@ public class Label implements SwingConstants, LabelStyleConstants } _constraints.width = targetWidth; _constraints.height = 0; + _layouts = null; } /** @@ -249,6 +257,7 @@ public class Label implements SwingConstants, LabelStyleConstants } _constraints.width = 0; _constraints.height = targetHeight; + _layouts = null; } /** @@ -460,8 +469,8 @@ public class Label implements SwingConstants, LabelStyleConstants { // nothing to do if we haven't been laid out if (_layouts == null) { - Log.warning("Label requested to render prior to a call " + - "to layout() [text=" + _text + "]."); + Log.warning("Unlaid-out label asked to render " + + "[text=" + _text + "]."); return; }