|
|
@ -52,6 +52,15 @@ public final class SwingUtil { |
|
|
|
SwingUtilities2.setSkipClickCount(comp, count); |
|
|
|
SwingUtilities2.setSkipClickCount(comp, count); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static int stringWidth(final JComponent c, final FontMetrics fm, final String string) { |
|
|
|
|
|
|
|
return SwingUtilities2.stringWidth(c, fm, string); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static String clipStringIfNecessary(final JComponent c, final FontMetrics fm, |
|
|
|
|
|
|
|
final String string, int availTextWidth) { |
|
|
|
|
|
|
|
return SwingUtilities2.clipStringIfNecessary(c, fm, string, availTextWidth); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static FontMetrics getFontMetrics(final JComponent c, final Graphics g) { |
|
|
|
public static FontMetrics getFontMetrics(final JComponent c, final Graphics g) { |
|
|
|
if (g == null) throw new IllegalArgumentException("Graphics must not be null"); |
|
|
|
if (g == null) throw new IllegalArgumentException("Graphics must not be null"); |
|
|
|
return getFontMetrics(c, g.getFont()); |
|
|
|
return getFontMetrics(c, g.getFont()); |
|
|
@ -66,10 +75,6 @@ public final class SwingUtil { |
|
|
|
return c.getFontMetrics(font); |
|
|
|
return c.getFontMetrics(font); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static int stringWidth(final JComponent c, final FontMetrics fm, final String string) { |
|
|
|
|
|
|
|
return SwingUtilities2.stringWidth(c, fm, string); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static boolean shouldIgnore(final MouseEvent me, final JComponent c) { |
|
|
|
public static boolean shouldIgnore(final MouseEvent me, final JComponent c) { |
|
|
|
return c == null || !c.isEnabled() |
|
|
|
return c == null || !c.isEnabled() |
|
|
|
|| !SwingUtilities.isLeftMouseButton(me) |
|
|
|
|| !SwingUtilities.isLeftMouseButton(me) |
|
|
|