Quaqua 8.0 2011-10-02

ch.randelshofer.quaqua.border
Class FocusedBorder

java.lang.Object
  extended by ch.randelshofer.quaqua.border.AbstractFocusedPainter
      extended by ch.randelshofer.quaqua.border.FocusedBorder
All Implemented Interfaces:
PressedCueBorder, VisualMargin, javax.swing.border.Border
Direct Known Subclasses:
FocusedBorder.UIResource

public class FocusedBorder
extends AbstractFocusedPainter
implements PressedCueBorder, VisualMargin

Draws a focus ring around the opaque pixels of a border. The border must provide space for the focus ring.

Version:
1.0 2011-07-26 Created.
Author:
Werner Randelshofer

Nested Class Summary
static class FocusedBorder.UIResource
           
 
Constructor Summary
FocusedBorder(javax.swing.border.Border actualBorder)
           
 
Method Summary
protected  void doPaint(java.awt.Component c, java.awt.Graphics cgx, int x, int y, int width, int height)
           
 java.awt.Insets getBorderInsets(java.awt.Component c)
           
 java.awt.Insets getVisualMargin(java.awt.Component c)
           
 boolean hasPressedCue(javax.swing.JComponent c)
          Returns true, if this border has a visual cue for the pressed state of the button.
 boolean isBorderOpaque()
           
 void paintBorder(java.awt.Component c, java.awt.Graphics cgx, int x, int y, int width, int height)
           
 
Methods inherited from class ch.randelshofer.quaqua.border.AbstractFocusedPainter
paint, paintFocusRing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FocusedBorder

public FocusedBorder(javax.swing.border.Border actualBorder)
Method Detail

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics cgx,
                        int x,
                        int y,
                        int width,
                        int height)
Specified by:
paintBorder in interface javax.swing.border.Border

doPaint

protected void doPaint(java.awt.Component c,
                       java.awt.Graphics cgx,
                       int x,
                       int y,
                       int width,
                       int height)
Specified by:
doPaint in class AbstractFocusedPainter

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Specified by:
getBorderInsets in interface javax.swing.border.Border

isBorderOpaque

public boolean isBorderOpaque()
Specified by:
isBorderOpaque in interface javax.swing.border.Border

getVisualMargin

public java.awt.Insets getVisualMargin(java.awt.Component c)
Specified by:
getVisualMargin in interface VisualMargin

hasPressedCue

public boolean hasPressedCue(javax.swing.JComponent c)
Description copied from interface: PressedCueBorder
Returns true, if this border has a visual cue for the pressed state of the button. If the border has no visual cue, then the ButtonUI has to provide it by some other means.

Specified by:
hasPressedCue in interface PressedCueBorder

Copyright 2003-2007 (c) Werner Randelshofer.
All rights reserved.