Package sc.fiji.snt.gui
Class IconFactory
java.lang.Object
sc.fiji.snt.gui.IconFactory
A factory for
FADerivedIcons presets.- Author:
- Tiago Ferreira
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic IconaccentIcon(Color color, boolean squarify) static voidassignIcon(AbstractButton button, IconFactory.GLYPH glyph, Color color, float scalingFactor) static voidassignIcon(AbstractButton button, IconFactory.GLYPH glyph, Color defaultColor, Color disabledColor, float scalingFactor) static voidassignIcon(AbstractButton button, IconFactory.GLYPH defaultGlyph, IconFactory.GLYPH selectedGlyph) static voidassignIcon(AbstractButton button, IconFactory.GLYPH defaultGlyph, IconFactory.GLYPH selectedGlyph, float scalingFactor) static voidassignIcon(AbstractButton button, IconFactory.GLYPH defaultGlyph, IconFactory.GLYPH selectedGlyph, Color color, float scalingFactor) static voidassignIcon(AbstractButton button, IconFactory.GLYPH defaultGlyph, IconFactory.GLYPH selectedGlyph, Color defaultColor, Color selectedColor, float scalingFactor) static voidassignIcon(JMenuItem item, char symbol, boolean solid, Color color) static voidassignIcon(JMenuItem item, IconFactory.GLYPH defaultGlyph) static voidassignNotification(AbstractButton button, Color dotColor) Decorates a button's icon(s) with a notification dot in the upper right corner, wrapping whichever icons are already assigned (including selected/disabled states for aJToggleButton)static voidassignTabIcon(JTabbedPane tabbedPane, int tabIndex, IconFactory.GLYPH entry) static TitledBorderbottomBorder(char symbol, boolean solid) static IconbuttonIcon(char symbol, boolean solid) static IconbuttonIcon(char symbol, boolean solid, Color color) static IconbuttonIcon(IconFactory.GLYPH entry, float scalingFactor) static IconbuttonIcon(IconFactory.GLYPH entry, Color color, float scalingFactor) static Colorstatic intstatic Colorstatic Colorstatic IcondoubleIcon(IconFactory.GLYPH entry1, IconFactory.GLYPH entry2, float scalingFactor, Color color) static IcondropdownMenuIcon(IconFactory.GLYPH entry, float scalingFactor, Color color) static IconfixedWidthIcon(Icon icon, int refWidth) Wraps an icon in a fixed-width icon, centering it within a common reference.static IconfixedWidthIcon(Icon icon, Icon refIcon) Wraps an icon in a fixed-width icon, centering it within a common reference.static Iconget(IconFactory.GLYPH entry, float size, Color color) Creates a new icon from a Font Awesome glyph.static ImageIcongetAsImage(IconFactory.GLYPH entry, float size, Color color) Creates a new image icon from a Font Awesome glyph.static IconlistIcon(JList<?> list, IconFactory.GLYPH entry) static IconlistIcon(JList<?> list, IconFactory.GLYPH entry, Color color) static IconmenuIcon(char symbol, boolean solid) static Iconstatic IconmenuIcon(IconFactory.GLYPH entry) static IconmenuIcon(IconFactory.GLYPH entry, Color color) static Iconstatic Iconstatic IconnodeIconMulticolor(boolean isLeaf, boolean isExpanded) static IconnotificationIcon(Icon icon, Color dotColor, Color ringColor) Overlays a small notification dot on an icon's upper right corner within the icon's own bounds (the icon's reported size is unchanged).static Colorstatic Color
-
Constructor Details
-
IconFactory
public IconFactory()
-
-
Method Details
-
disabledColor
-
get
Creates a new icon from a Font Awesome glyph.- Parameters:
entry- the glyph defining the icon's Unicode IDsize- the icon's sizecolor- the icon's color- Returns:
- the icon
-
getAsImage
Creates a new image icon from a Font Awesome glyph.- Parameters:
entry- the glyph defining the icon's Unicode IDsize- the icon's sizecolor- the icon's color- Returns:
- the icon
-
buttonIcon
-
buttonIcon
-
buttonIcon
-
buttonIcon
-
listIcon
-
listIcon
-
assignTabIcon
-
bottomBorder
-
doubleIcon
public static Icon doubleIcon(IconFactory.GLYPH entry1, IconFactory.GLYPH entry2, float scalingFactor, Color color) -
notificationIcon
Overlays a small notification dot on an icon's upper right corner within the icon's own bounds (the icon's reported size is unchanged).- Parameters:
icon- the source icondotColor- the dot's fill colorringColor- contrast ring color around the dot, or null for no ring- See Also:
-
dropdownMenuIcon
-
assignIcon
public static void assignIcon(AbstractButton button, IconFactory.GLYPH glyph, Color color, float scalingFactor) -
assignIcon
public static void assignIcon(AbstractButton button, IconFactory.GLYPH glyph, Color defaultColor, Color disabledColor, float scalingFactor) -
assignIcon
public static void assignIcon(AbstractButton button, IconFactory.GLYPH defaultGlyph, IconFactory.GLYPH selectedGlyph, float scalingFactor) -
assignIcon
public static void assignIcon(AbstractButton button, IconFactory.GLYPH defaultGlyph, IconFactory.GLYPH selectedGlyph, Color color, float scalingFactor) -
assignIcon
public static void assignIcon(AbstractButton button, IconFactory.GLYPH defaultGlyph, IconFactory.GLYPH selectedGlyph, Color defaultColor, Color selectedColor, float scalingFactor) -
assignIcon
public static void assignIcon(AbstractButton button, IconFactory.GLYPH defaultGlyph, IconFactory.GLYPH selectedGlyph) -
assignIcon
-
assignIcon
-
assignNotification
Decorates a button's icon(s) with a notification dot in the upper right corner, wrapping whichever icons are already assigned (including selected/disabled states for aJToggleButton)- Parameters:
button- the button to decoratedotColor- the dot's fill color (e.g., Color.RED)- See Also:
-
defaultColor
-
secondaryColor
-
selectedColor
-
disabledSelectedColor
- Returns:
- a faded version of
selectedColor(), for a disabled icon/button that should still read as "selected"/"active".
-
nodeIcon
-
nodeIcon
-
nodeIconMulticolor
-
accentIcon
-
fixedWidthIcon
Wraps an icon in a fixed-width icon, centering it within a common reference.- Parameters:
icon- the icon to be matched to referencerefIcon- reference icon, setting the target width- Returns:
- the centered fixed-width icon
-
fixedWidthIcon
Wraps an icon in a fixed-width icon, centering it within a common reference.- Parameters:
icon- the icon to be matched to referencerefWidth- the target width- Returns:
- the centered fixed-width icon
-
defaultSize
public static int defaultSize()
-