| Modifier and Type | Class and Description |
|---|---|
| private static class | SynthGraphicsUtils.
Wraps a SynthIcon around the Icon interface, forwarding calls to the SynthIcon with a given SynthContext. |
| Modifier and Type | Field and Description |
|---|---|
| private Rectangle | |
| private Rectangle | |
| private Insets | |
| private Rectangle | |
| private Rectangle | |
| private Rectangle | |
| private Rectangle | |
| private Insets |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | Returns: the size of the passed in string.SynthContext ss, Font Font to use font, FontMetrics FontMetrics, may be ignored metrics, String Text to get size of. text)Returns the size of the passed in string. |
| public void | drawLine(SynthContext
Identifies hosting region. context, Object Identifies the portion of the component being asked
to paint, may be null. paintKey, Graphics Graphics object to paint to g, int x origin x1, int y origin y1, int x destination x2, int y destination y2)Draws a line between the two end points. |
| public void | drawLine(SynthContext
identifies hosting region context, Object identifies the portion of the component being asked
to paint, may be null paintKey, Graphics Graphics object to paint to g, int x origin x1, int y origin y1, int x destination x2, int y destination y2, Object identifies the requested style of the line (e.g. "dashed") styleKey)Draws a line between the two end points. |
| public static int | Returns: an int specifying the height of the icon.the icon icon, SynthContext SynthContext requesting the icon, may be null.Returns the icon's height. |
| public static int | Returns: an int specifying the width of the icon.the icon icon, SynthContext SynthContext requesting the icon, may be null.Returns the icon's width. |
| public int | Returns: maximum height of the characters for the font from the passed in context.SynthContext used to determine font. context)Returns the maximum height of the Font from the passed in SynthContext. |
| public Dimension | Returns: the maximum size needed to properly render an icon and text.SynthContext ss, Font Font to use font, String Text to layout text, Icon Icon to layout icon, int horizontal alignment hAlign, int vertical alignment vAlign, int horizontal text position hTextPosition, int vertical text position vTextPosition, int gap between icon and text iconTextGap, int Index into text to render the mnemonic at, -1
indicates no mnemonic. mnemonicIndex)Returns the maximum size needed to properly render an icon and text. |
| public Dimension | Returns: the minimum size needed to properly render an icon and text.SynthContext ss, Font Font to use font, String Text to layout text, Icon Icon to layout icon, int horizontal alignment hAlign, int vertical alignment vAlign, int horizontal text position hTextPosition, int vertical text position vTextPosition, int gap between icon and text iconTextGap, int Index into text to render the mnemonic at, -1
indicates no mnemonic. mnemonicIndex)Returns the minimum size needed to properly render an icon and text. |
| pack-priv static Dimension | getPreferredMenuItemSize(SynthContext context, SynthContext accContext, JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap, String acceleratorDelimiter, boolean useCheckAndArrow, String propertyPrefix)
A quick note about how preferred sizes are calculated... |
| public Dimension | Returns: the preferred size needed to properly render an icon and text.SynthContext ss, Font Font to use font, String Text to layout text, Icon Icon to layout icon, int horizontal alignment hAlign, int vertical alignment vAlign, int horizontal text position hTextPosition, int vertical text position vTextPosition, int gap between icon and text iconTextGap, int Index into text to render the mnemonic at, -1
indicates no mnemonic. mnemonicIndex)Returns the preferred size needed to properly render an icon and text. |
| public String | Returns: by reference, the location to place the icon and text.SynthContext ss, FontMetrics FontMetrics for the Font to use, this may be ignored fm, String Text to layout text, Icon Icon to layout icon, int horizontal alignment hAlign, int vertical alignment vAlign, int horizontal text position hTextPosition, int vertical text position vTextPosition, Rectangle Rectangle to layout text and icon in. viewR, Rectangle Rectangle to place icon bounds in iconR, Rectangle Rectangle to place text in textR, int gap between icon and text iconTextGap)Lays out text and an icon returning, by reference, the location to place the icon and text. |
| pack-priv static void | paint(SynthContext context, SynthContext accContext, Graphics g, Icon checkIcon, Icon arrowIcon, String acceleratorDelimiter, int defaultTextIconGap, String propertyPrefix)
|
| pack-priv static void | |
| pack-priv static void | |
| pack-priv static void | |
| pack-priv static void | |
| pack-priv static void | |
| public static void | paintIcon(Icon
the icon icon, SynthContext identifies hosting region, may be null. context, Graphics the graphics context g, int the x location to paint to x, int the y location to paint to y, int the width of the region to paint to, may be 0 width, int the height of the region to paint to, may be 0 height)Paints the icon. |
| pack-priv static void | |
| pack-priv static void | |
| public void | paintText(SynthContext
SynthContext ss, Graphics Graphics used to render string in. g, String Text to render text, Rectangle Bounds of the text to be drawn. bounds, int Index to draw string at. mnemonicIndex)Paints text at the specified location. |
| public void | paintText(SynthContext
SynthContext ss, Graphics Graphics used to render string in. g, String Text to render text, int X location to draw text at. x, int Upper left corner to draw text at. y, int Index to draw string at. mnemonicIndex)Paints text at the specified location. |
| public void | paintText(SynthContext
SynthContext ss, Graphics Graphics to render string and icon into g, String Text to layout text, Icon Icon to layout icon, int horizontal alignment hAlign, int vertical alignment vAlign, int horizontal text position hTextPosition, int vertical text position vTextPosition, int gap between icon and text iconTextGap, int Index into text to render the mnemonic at, -1
indicates no mnemonic. mnemonicIndex, int Amount to offset the text when painting textOffset)Paints an icon and text. |
| pack-priv static void |
| iconR | back to summary |
|---|---|
| private Rectangle iconR | |
| paintIconR | back to summary |
|---|---|
| private Rectangle paintIconR | |
| paintInsets | back to summary |
|---|---|
| private Insets paintInsets | |
| paintTextR | back to summary |
|---|---|
| private Rectangle paintTextR | |
| paintViewR | back to summary |
|---|---|
| private Rectangle paintViewR | |
| textR | back to summary |
|---|---|
| private Rectangle textR | |
| viewR | back to summary |
|---|---|
| private Rectangle viewR | |
| viewSizingInsets | back to summary |
|---|---|
| private Insets viewSizingInsets | |
| SynthGraphicsUtils | back to summary |
|---|---|
| public SynthGraphicsUtils() Creates a | |
| computeStringWidth | back to summary |
|---|---|
| public int computeStringWidth(SynthContext ss, Font font, FontMetrics metrics, String text) Returns the size of the passed in string.
| |
| drawLine | back to summary |
|---|---|
| public void drawLine(SynthContext context, Object paintKey, Graphics g, int x1, int y1, int x2, int y2) Draws a line between the two end points.
| |
| drawLine | back to summary |
|---|---|
| public void drawLine(SynthContext context, Object paintKey, Graphics g, int x1, int y1, int x2, int y2, Object styleKey) Draws a line between the two end points. This implementation supports only one line style key,
Specifying
| |
| getIconHeight | back to summary |
|---|---|
| public static int getIconHeight(Icon icon, SynthContext context) Returns the icon's height.
The
| |
| getIconWidth | back to summary |
|---|---|
| public static int getIconWidth(Icon icon, SynthContext context) Returns the icon's width.
The
| |
| getMaximumCharHeight | back to summary |
|---|---|
| public int getMaximumCharHeight(SynthContext context) Returns the maximum height of the Font from the passed in SynthContext.
| |
| getMaximumSize | back to summary |
|---|---|
| public Dimension getMaximumSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex) Returns the maximum size needed to properly render an icon and text.
| |
| getMinimumSize | back to summary |
|---|---|
| public Dimension getMinimumSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex) Returns the minimum size needed to properly render an icon and text.
| |
| getPreferredMenuItemSize | back to summary |
|---|---|
| pack-priv static Dimension getPreferredMenuItemSize(SynthContext context, SynthContext accContext, JComponent c, Icon checkIcon, Icon arrowIcon, int defaultTextIconGap, String acceleratorDelimiter, boolean useCheckAndArrow, String propertyPrefix) A quick note about how preferred sizes are calculated... Generally speaking, SynthPopupMenuUI will run through the list of its children (from top to bottom) and ask each for its preferred size. Each menu item will add up the max width of each element (icons, text, accelerator spacing, accelerator text or arrow icon) encountered thus far, so by the time all menu items have been calculated, we will know the maximum (preferred) menu item size for that popup menu. Later when it comes time to paint each menu item, we can use those same accumulated max element sizes in order to layout the item. | |
| getPreferredSize | back to summary |
|---|---|
| public Dimension getPreferredSize(SynthContext ss, Font font, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex) Returns the preferred size needed to properly render an icon and text.
| |
| layoutText | back to summary |
|---|---|
| public String layoutText(SynthContext ss, FontMetrics fm, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, Rectangle viewR, Rectangle iconR, Rectangle textR, int iconTextGap) Lays out text and an icon returning, by reference, the location to place the icon and text.
| |
| paint | back to summary |
|---|---|
| pack-priv static void paint(SynthContext context, SynthContext accContext, Graphics g, Icon checkIcon, Icon arrowIcon, String acceleratorDelimiter, int defaultTextIconGap, String propertyPrefix) | |
| paintAccText | back to summary |
|---|---|
| pack-priv static void paintAccText(Graphics g, SynthMenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintArrowIcon | back to summary |
|---|---|
| pack-priv static void paintArrowIcon(Graphics g, SynthMenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintBackground | back to summary |
|---|---|
| pack-priv static void paintBackground(Graphics g, SynthMenuItemLayoutHelper lh) | |
| paintBackground | back to summary |
|---|---|
| pack-priv static void paintBackground(SynthContext context, Graphics g, JComponent c) | |
| paintCheckIcon | back to summary |
|---|---|
| pack-priv static void paintCheckIcon(Graphics g, SynthMenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintIcon | back to summary |
|---|---|
| public static void paintIcon(Icon icon, SynthContext context, Graphics g, int x, int y, int width, int height) Paints the icon. The
| |
| paintIcon | back to summary |
|---|---|
| pack-priv static void paintIcon(Graphics g, SynthMenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintMenuItem | back to summary |
|---|---|
| pack-priv static void paintMenuItem(Graphics g, SynthMenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| paintText | back to summary |
|---|---|
| public void paintText(SynthContext ss, Graphics g, String text, Rectangle bounds, int mnemonicIndex) Paints text at the specified location. This will not attempt to render the text as html nor will it offset by the insets of the component.
| |
| paintText | back to summary |
|---|---|
| public void paintText(SynthContext ss, Graphics g, String text, int x, int y, int mnemonicIndex) Paints text at the specified location. This will not attempt to render the text as html nor will it offset by the insets of the component.
| |
| paintText | back to summary |
|---|---|
| public void paintText(SynthContext ss, Graphics g, String text, Icon icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex, int textOffset) Paints an icon and text. This will render the text as html, if necessary, and offset the location by the insets of the component.
| |
| paintText | back to summary |
|---|---|
| pack-priv static void paintText(Graphics g, SynthMenuItemLayoutHelper lh, MenuItemLayoutHelper. | |
| Modifier and Type | Field and Description |
|---|---|
| private static final List | |
| private SynthContext | |
| private SynthIcon |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static SynthGraphicsUtils. | |
| public int | |
| public int | |
| public void | paintIcon(Component c, Graphics g, int x, int y)
Implements javax. Draw the icon at the specified location. |
| pack-priv static void | |
| pack-priv void |
| CACHE | back to summary |
|---|---|
| private static final List<SynthGraphicsUtils. | |
| context | back to summary |
|---|---|
| private SynthContext context | |
| synthIcon | back to summary |
|---|---|
| private SynthIcon synthIcon | |
| SynthIconWrapper | back to summary |
|---|---|
| pack-priv SynthIconWrapper(SynthIcon icon, SynthContext context) | |
| get | back to summary |
|---|---|
| pack-priv static SynthGraphicsUtils. | |
| getIconHeight | back to summary |
|---|---|
| public int getIconHeight() Implements javax. Doc from javax. Returns the icon's height. | |
| getIconWidth | back to summary |
|---|---|
| public int getIconWidth() Implements javax. Doc from javax. Returns the icon's width. | |
| paintIcon | back to summary |
|---|---|
| public void paintIcon(Component c, Graphics g, int x, int y) Implements javax. Doc from javax. Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color. | |
| release | back to summary |
|---|---|
| pack-priv static void release(SynthGraphicsUtils. | |
| reset | back to summary |
|---|---|
| pack-priv void reset(SynthIcon icon, SynthContext context) | |