Class TextCrossingPainter<T extends javax.swing.JComponent>

  • All Implemented Interfaces:
    Painter<T>

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

      • paintIconR

        java.awt.Rectangle paintIconR
      • paintViewR

        java.awt.Rectangle paintViewR
      • paintTextR

        java.awt.Rectangle paintTextR
      • insetss

        java.awt.Insets insetss
      • crossColor

        java.awt.Color crossColor
    • Constructor Detail

      • TextCrossingPainter

        TextCrossingPainter()
    • Method Detail

      • doPaint

        protected void doPaint​(java.awt.Graphics2D g,
                               javax.swing.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 javax.swing.JComponent>
        Parameters:
        g - The Graphics2D object in which to paint
      • doPaint

        private void doPaint​(java.awt.Graphics2D g,
                             java.awt.Rectangle r)
      • setForeground

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

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