org.jhotdraw.gui.plaf.palette
Class PaletteUtilities
- java.lang.Object
-
- javax.swing.plaf.basic.BasicGraphicsUtils
-
- org.jhotdraw.gui.plaf.palette.PaletteUtilities
-
public class PaletteUtilities extends javax.swing.plaf.basic.BasicGraphicsUtilsPaletteUtilities.
-
-
Constructor Summary
Constructors Constructor and Description PaletteUtilities()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static java.lang.ObjectbeginGraphics(java.awt.Graphics2D graphics2d)static voiddrawStringUnderlineCharAt(javax.swing.JComponent c, java.awt.Graphics g, java.lang.String text, int underlinedIndex, int x, int y)Draw a string with the graphicsgat location (x,y) just likeg.drawStringwould.static voidendGraphics(java.awt.Graphics2D graphics2d, java.lang.Object oldHints)static java.awt.FontMetricsgetFontMetrics(javax.swing.JComponent c, java.awt.Graphics g)Returns the FontMetrics for the current Font of the passed in Graphics.static java.awt.FontMetricsgetFontMetrics(javax.swing.JComponent c, java.awt.Graphics g, java.awt.Font font)Returns the FontMetrics for the specified Font.
-
-
-
Method Detail
-
beginGraphics
public static final java.lang.Object beginGraphics(java.awt.Graphics2D graphics2d)
-
endGraphics
public static final void endGraphics(java.awt.Graphics2D graphics2d, java.lang.Object oldHints)
-
drawStringUnderlineCharAt
public static void drawStringUnderlineCharAt(javax.swing.JComponent c, java.awt.Graphics g, java.lang.String text, int underlinedIndex, int x, int y)Draw a string with the graphicsgat location (x,y) just likeg.drawStringwould. The character at indexunderlinedIndexin text will be underlined. Ifindexis beyond the bounds oftext(including < 0), nothing will be underlined.- Parameters:
g- Graphics to draw withtext- String to drawunderlinedIndex- Index of character in text to underlinex- x coordinate to draw aty- y coordinate to draw at- Since:
- 1.4
-
getFontMetrics
public static java.awt.FontMetrics getFontMetrics(javax.swing.JComponent c, java.awt.Graphics g)Returns the FontMetrics for the current Font of the passed in Graphics. This method is used when a Graphics is available, typically when painting. If a Graphics is not available the JComponent method of the same name should be used.Callers should pass in a non-null JComponent, the exception to this is if a JComponent is not readily available at the time of painting.
This does not necessarily return the FontMetrics from the Graphics.
- Parameters:
c- JComponent requesting FontMetrics, may be nullg- Graphics Graphics
-
getFontMetrics
public static java.awt.FontMetrics getFontMetrics(javax.swing.JComponent c, java.awt.Graphics g, java.awt.Font font)Returns the FontMetrics for the specified Font. This method is used when a Graphics is available, typically when painting. If a Graphics is not available the JComponent method of the same name should be used.Callers should pass in a non-null JComonent, the exception to this is if a JComponent is not readily available at the time of painting.
This does not necessarily return the FontMetrics from the Graphics.
- Parameters:
c- JComponent requesting FontMetrics, may be nullg- Graphicsfont- Font to get FontMetrics for
-
-
DataMelt 3.0 © DataMelt by jWork.ORG