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
This commit is contained in:
@@ -124,6 +124,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
_layouts = null;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -134,6 +135,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
|||||||
public void setFont (Font font)
|
public void setFont (Font font)
|
||||||
{
|
{
|
||||||
_font = font;
|
_font = font;
|
||||||
|
_layouts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -152,6 +154,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
|||||||
public void setTextColor (Color color)
|
public void setTextColor (Color color)
|
||||||
{
|
{
|
||||||
_textColor = color;
|
_textColor = color;
|
||||||
|
_layouts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,6 +175,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
|||||||
public void setAlternateColor (Color color)
|
public void setAlternateColor (Color color)
|
||||||
{
|
{
|
||||||
_alternateColor = color;
|
_alternateColor = color;
|
||||||
|
_layouts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -191,6 +195,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
|||||||
public void setAlignment (int align)
|
public void setAlignment (int align)
|
||||||
{
|
{
|
||||||
_align = align;
|
_align = align;
|
||||||
|
_layouts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -201,6 +206,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
|||||||
public void setStyle (int style)
|
public void setStyle (int style)
|
||||||
{
|
{
|
||||||
_style = 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
|
// use -1 as an indicator that we should be golden
|
||||||
_constraints.width = -1;
|
_constraints.width = -1;
|
||||||
_constraints.height = -1;
|
_constraints.height = -1;
|
||||||
|
_layouts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -230,6 +237,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
|||||||
}
|
}
|
||||||
_constraints.width = targetWidth;
|
_constraints.width = targetWidth;
|
||||||
_constraints.height = 0;
|
_constraints.height = 0;
|
||||||
|
_layouts = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -249,6 +257,7 @@ public class Label implements SwingConstants, LabelStyleConstants
|
|||||||
}
|
}
|
||||||
_constraints.width = 0;
|
_constraints.width = 0;
|
||||||
_constraints.height = targetHeight;
|
_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
|
// nothing to do if we haven't been laid out
|
||||||
if (_layouts == null) {
|
if (_layouts == null) {
|
||||||
Log.warning("Label requested to render prior to a call " +
|
Log.warning("Unlaid-out label asked to render " +
|
||||||
"to layout() [text=" + _text + "].");
|
"[text=" + _text + "].");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user