Skip to content
Snippets Groups Projects
Commit 4e963038 authored by Raphael GIRARDOT's avatar Raphael GIRARDOT
Browse files

FSLabel computes its preferred size according to SizeUtils

parent 57e5516a
Branches
Tags
No related merge requests found
Showing
with 6 additions and 14 deletions
......@@ -4,18 +4,17 @@ import java.awt.Dimension;
import javax.swing.Icon;
import fr.soleil.lib.project.swing.text.JSmoothLabel;
import fr.soleil.lib.project.awt.SizeUtils;
import fr.soleil.lib.project.swing.text.DynamicForegroundLabel;
/**
* A {@link JSmoothLabel} that exaggerates its preferred size
* A {@link DynamicForegroundLabel} that exaggerates its preferred size
*
* @author GIRARDOT
*/
public class FSLabel extends JSmoothLabel {
public class FSLabel extends DynamicForegroundLabel {
private static final long serialVersionUID = 7378644125535811939L;
public static final int MARGIN = 20;
private static final long serialVersionUID = -3159753855132292433L;
public FSLabel() {
super();
......@@ -43,13 +42,6 @@ public class FSLabel extends JSmoothLabel {
@Override
public Dimension getPreferredSize() {
Dimension prefSize;
Dimension refSize = super.getPreferredSize();
if (isPreferredSizeSet()) {
prefSize = refSize;
} else {
prefSize = new Dimension(refSize.width + MARGIN, refSize.height);
}
return prefSize;
return SizeUtils.getAdaptedPreferredSize(this, super.getPreferredSize());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment