Documentation of 'org.jhotdraw.gui.plaf.palette.PaletteUtilities' Java class
PaletteUtilities
org.jhotdraw.gui.plaf.palette

Class PaletteUtilities



  • public class PaletteUtilities
    extends javax.swing.plaf.basic.BasicGraphicsUtils
    PaletteUtilities.
    • Constructor Summary

      Constructors 
      Constructor and Description
      PaletteUtilities() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.Object beginGraphics(java.awt.Graphics2D graphics2d) 
      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 graphics g at location (x, y) just like g.drawString would.
      static void endGraphics(java.awt.Graphics2D graphics2d, java.lang.Object oldHints) 
      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.
      static java.awt.FontMetrics getFontMetrics(javax.swing.JComponent c, java.awt.Graphics g, java.awt.Font font)
      Returns the FontMetrics for the specified Font.
      • Methods inherited from class javax.swing.plaf.basic.BasicGraphicsUtils

        drawBezel, drawDashedRect, drawEtchedRect, drawGroove, drawLoweredBezel, drawString, drawStringUnderlineCharAt, getEtchedInsets, getGrooveInsets, getPreferredButtonSize
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PaletteUtilities

        public PaletteUtilities()
    • 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 graphics g at location (x, y) just like g.drawString would. The character at index underlinedIndex in text will be underlined. If index is beyond the bounds of text (including < 0), nothing will be underlined.
        Parameters:
        g - Graphics to draw with
        text - String to draw
        underlinedIndex - Index of character in text to underline
        x - x coordinate to draw at
        y - 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 null
        g - 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 null
        g - Graphics
        font - Font to get FontMetrics for

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.