public final class WidgetUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
addAligned(Container container,
JComponent component) |
static void |
addToGridBag(Component comp,
JPanel panel,
int gridx,
int gridy)
Adds a component to a panel with a grid bag layout
|
static void |
addToGridBag(Component comp,
JPanel panel,
int gridx,
int gridy,
double weightx,
double weighty) |
static void |
addToGridBag(Component comp,
JPanel panel,
int gridx,
int gridy,
int anchor)
Adds a component to a panel with a grid bag layout
|
static void |
addToGridBag(Component comp,
JPanel panel,
int x,
int y,
int anchor,
double weightx,
double weighty) |
static void |
addToGridBag(Component comp,
JPanel panel,
int gridx,
int gridy,
int width,
int height)
Adds a component to a panel with a grid bag layout
|
static void |
addToGridBag(Component comp,
JPanel panel,
int gridx,
int gridy,
int width,
int height,
int anchor)
Adds a component to a panel with a grid bag layout
|
static void |
addToGridBag(Component comp,
JPanel panel,
int gridx,
int gridy,
int width,
int height,
int anchor,
int padding) |
static void |
addToGridBag(Component comp,
JPanel panel,
int gridx,
int gridy,
int width,
int height,
int anchor,
int padding,
double weightx,
double weighty)
Adds a component to a panel with a grid bag layout
|
static void |
addToGridBag(Component comp,
JPanel panel,
int gridx,
int gridy,
int width,
int height,
int anchor,
int padding,
double weightx,
double weighty,
int fill) |
static void |
centerOnScreen(Component component) |
static Color |
colorBetween(Color c1,
Color c2)
Creates a color that is in between two colors, in terms of RGB balance.
|
static DCPanel |
decorateWithShadow(JComponent comp) |
static DCPanel |
decorateWithShadow(JComponent comp,
boolean outline,
int margin)
Decorates a JComponent with a nice shadow border.
|
static String |
extractText(Component comp) |
static Font |
findCompatibleFont(String text,
Font fallbackFont)
Finds a font that is capable of displaying the provided text.
|
static void |
invokeSwingAction(Runnable runnable)
Invokes a
Runnable as soon as possible. |
static JScrollPane |
scrollable(JComponent comp,
int maxHeight) |
static JScrollPane |
scrolleable(JComponent comp) |
static void |
setAppropriateFont(JLabel label) |
static void |
setDarkButtonStyle(AbstractButton b) |
static void |
setDefaultButtonStyle(AbstractButton b) |
static void |
setPrimaryButtonStyle(AbstractButton b) |
static void |
showErrorMessage(String shortMessage,
String detailedMessage) |
static void |
showErrorMessage(String shortMessage,
String detailedMessage,
Throwable exception) |
static void |
showErrorMessage(String shortMessage,
Throwable exception) |
static Color |
slightlyBrighter(Color color)
Moderated version of Color.brighter()
|
static Color |
slightlyDarker(Color color)
Moderated version of Color.darker()
|
public static final float FONT_SIZE_SMALL
@Deprecated public static final Font FONT_UBUNTU_PLAIN
@Deprecated public static final Font FONT_UBUNTU_BOLD
@Deprecated public static final Font FONT_UBUNTU_ITALIC
@Deprecated public static final Font FONT_UBUNTU_BOLD_ITALIC
@Deprecated public static final Font FONT_OPENSANS_PLAIN
@Deprecated public static final Font FONT_OPENSANS_BOLD
@Deprecated public static final Font FONT_OPENSANS_ITALIC
@Deprecated public static final Font FONT_OPENSANS_BOLD_ITALIC
public static final Font FONT_FONTAWESOME
public static final Font FONT_BANNER
public static final Font FONT_HEADER1
public static final Font FONT_HEADER2
public static final Font FONT_MONOSPACE
public static final Font FONT_BUTTON
public static final Font FONT_NORMAL
public static final Font FONT_BOLD
public static final Font FONT_SMALL
public static final Font FONT_TABLE_HEADER
public static final int SCROLL_UNIT_INCREMENT
public static final Color BG_COLOR_BLUE_MEDIUM
public static final Color BG_COLOR_BLUE_BRIGHT
public static final Color BG_COLOR_BLUE_DARK
public static final Color BG_COLOR_GREEN_MEDIUM
public static final Color BG_COLOR_GREEN_BRIGHT
public static final Color BG_COLOR_GREEN_DARK
public static final Color BG_COLOR_ORANGE_MEDIUM
public static final Color BG_COLOR_ORANGE_BRIGHT
public static final Color BG_COLOR_ORANGE_DARK
public static final Color BG_SEMI_TRANSPARENT
@Deprecated public static final Color BG_COLOR_PALE_YELLOW
public static final Color BG_COLOR_BRIGHTEST
public static final Color BG_COLOR_BRIGHT
public static final Color BG_COLOR_LESS_BRIGHT
public static final Color BG_COLOR_MEDIUM
public static final Color BG_COLOR_LESS_DARK
public static final Color BG_COLOR_DARK
public static final Color BG_COLOR_DARKEST
public static final Color COLOR_DEFAULT_BACKGROUND
public static final Color COLOR_WELL_BACKGROUND
public static final Color COLOR_ALTERNATIVE_BACKGROUND
@Deprecated public static final Color ADDITIONAL_COLOR_GREEN_BRIGHT
public static final Color ADDITIONAL_COLOR_RED_BRIGHT
public static final Color ADDITIONAL_COLOR_PURPLE_BRIGHT
public static final Color ADDITIONAL_COLOR_CYAN_BRIGHT
public static final int BORDER_WIDE_WIDTH
public static final Border BORDER_SHADOW
public static final Border BORDER_WIDE_ALTERNATIVE
public static final Border BORDER_WIDE_DEFAULT
public static final Border BORDER_WIDE_WELL
@Deprecated public static final Border BORDER_WIDE
@Deprecated public static final Border BORDER_WIDE_BRIGHTEST
public static final Border BORDER_EMPTY
public static Border BORDER_TOP_PADDING
public static final Border BORDER_THIN
public static final Border BORDER_THIN_DARK
public static final Border BORDER_LIST_ITEM
public static final Border BORDER_LIST_ITEM_LEFT_ONLY
public static final Border BORDER_LIST_ITEM_HIGHLIGHTED
public static final Border BORDER_LIST_ITEM_SUBTLE
public static final Border BORDER_EMPHASIZE_FIELD
public static final Border BORDER_INPUT
public static final Border BORDER_TABLE_PANEL
public static final Border BORDER_CHECKBOX_LIST_INDENTATION
public static final Border BORDER_BUTTON_DARK
public static final Border BORDER_BUTTON_DARK_WITH_LINE
public static final Border BORDER_BUTTON_DEFAULT
public static final Border BORDER_BUTTON_PRIMARY
public static final Object BORDER_MENU_ITEM
public static final org.jdesktop.swingx.decorator.Highlighter LIBERELLO_HIGHLIGHTER
public static final int DEFAULT_PADDING
public static final int DEFAULT_ANCHOR
public static final Insets INSETS_EMPTY
public static final String CHAR_CARET_DOWN
FONT_FONTAWESOME font.public static void invokeSwingAction(Runnable runnable)
Runnable as soon as possible. If this is the swing
event dispatch thread, it will be run now, or else later using
SwingUtilities.invokeLater(Runnable)runnable - public static void centerOnScreen(Component component)
public static void addToGridBag(Component comp, JPanel panel, int gridx, int gridy, int width, int height, int anchor)
comp - panel - gridx - gridy - width - height - anchor - public static void addToGridBag(Component comp, JPanel panel, int gridx, int gridy, int width, int height, int anchor, int padding)
public static void addToGridBag(Component comp, JPanel panel, int gridx, int gridy, int width, int height, int anchor, int padding, double weightx, double weighty)
comp - panel - gridx - gridy - width - height - anchor - padding - public static void addToGridBag(Component comp, JPanel panel, int gridx, int gridy, int width, int height, int anchor, int padding, double weightx, double weighty, int fill)
public static void addToGridBag(Component comp, JPanel panel, int gridx, int gridy, int width, int height)
comp - panel - gridx - gridy - width - height - public static void addToGridBag(Component comp, JPanel panel, int x, int y, int anchor, double weightx, double weighty)
public static void addToGridBag(Component comp, JPanel panel, int gridx, int gridy)
comp - panel - gridx - gridy - public static void addToGridBag(Component comp, JPanel panel, int gridx, int gridy, double weightx, double weighty)
public static void addToGridBag(Component comp, JPanel panel, int gridx, int gridy, int anchor)
comp - panel - gridx - gridy - anchor - public static void addAligned(Container container, JComponent component)
public static void showErrorMessage(String shortMessage, String detailedMessage, Throwable exception)
public static JScrollPane scrollable(JComponent comp, int maxHeight)
public static JScrollPane scrolleable(JComponent comp)
public static Color colorBetween(Color c1, Color c2)
c1 - c2 - public static Color slightlyDarker(Color color)
color - public static Color slightlyBrighter(Color color)
color - public static DCPanel decorateWithShadow(JComponent comp)
public static DCPanel decorateWithShadow(JComponent comp, boolean outline, int margin)
comp - outline - margin - public static Font findCompatibleFont(String text, Font fallbackFont)
text - the text to display.fallbackFont - the font to fall back to in case no capable font was foundpublic static void setAppropriateFont(JLabel label)
public static void setPrimaryButtonStyle(AbstractButton b)
public static void setDarkButtonStyle(AbstractButton b)
public static void setDefaultButtonStyle(AbstractButton b)
Copyright © 2016. All Rights Reserved.