Class TextCrossingPainter<T extends JComponent>

java.lang.Object
org.jdesktop.beans.AbstractBean
org.jdesktop.swingx.painter.AbstractPainter<T>
org.jdesktop.swingx.plaf.basic.TextCrossingPainter<T>
All Implemented Interfaces:
Painter<T>

class TextCrossingPainter<T extends JComponent> extends AbstractPainter<T>
Painter used to cross-out unselectable dates. PENDING JW: subclass (or maybe even use?) one of the painter subclasses.
  • Field Details

  • Constructor Details

    • TextCrossingPainter

      TextCrossingPainter()
  • Method Details

    • doPaint

      protected void doPaint(Graphics2D g, JComponent comp, int width, int height)
      Subclasses must implement this method and perform custom painting operations here.

      Paints a diagonal cross over the text if the comp is of type JLabel, does nothing otherwise.

      Specified by:
      doPaint in class AbstractPainter<T extends JComponent>
      Parameters:
      g - The Graphics2D object in which to paint
      comp -
      width -
      height -
    • doPaint

      private void doPaint(Graphics2D g, Rectangle r)
    • setForeground

      public void setForeground(Color crossColor)
      Parameters:
      crossColor - the color to paint the cross with
    • getForeground

      public Color getForeground()
      Returns the color to use for painting the cross.
      Returns:
      the color used for painting.