sos.reports
Class BasicReportPaneUI

java.lang.Object
  |
  +--javax.swing.plaf.ComponentUI
        |
        +--sos.reports.ReportPaneUI
              |
              +--sos.reports.BasicReportPaneUI

public class BasicReportPaneUI
extends ReportPaneUI

A basic implementation of the report pane look and feel.

Keyboard Assignments

Instances of this UI bind keystrokes to many of the action names given by ReportEditorKit. The actions themselves are provided by the editor kit. If the editor kit does not provide an action with a given name, then the keystroke has no effect.

Key(s)Action Name
ctrl CReportEditorKit.COPY_ACTION_NAME
ctrl VReportEditorKit.PASTE_ACTION_NAME
ctrl XReportEditorKit.CUT_ACTION_NAME
COPYReportEditorKit.COPY_ACTION_NAME
PASTEReportEditorKit.PASTE_ACTION_NAME
CUTReportEditorKit.CUT_ACTION_NAME
RIGHTReportEditorKit.FORWARD_ACTION_NAME
KP_RIGHTReportEditorKit.FORWARD_ACTION_NAME
LEFTReportEditorKit.BACKWARD_ACTION_NAME
KP_LEFTReportEditorKit.BACKWARD_ACTION_NAME
DOWNReportEditorKit.DOWN_ACTION_NAME
KP_DOWNReportEditorKit.DOWN_ACTION_NAME
UPReportEditorKit.UP_ACTION_NAME
KP_UPReportEditorKit.UP_ACTION_NAME
TABReportEditorKit.ADVANCE_FORWARD_ACTION_NAME
shift TABReportEditorKit.ADVANCE_BACKWARD_ACTION_NAME
ESCAPEReportEditorKit.CANCEL_EDIT_ACTION_NAME
alt DOWNReportEditorKit.NARROW_ACTION_NAME
alt KP_DOWNReportEditorKit.NARROW_ACTION_NAME
alt UPReportEditorKit.WIDEN_ACTION_NAME
alt KP_UPReportEditorKit.WIDEN_ACTION_NAME
DELETEReportEditorKit.CLEAR_ACTION_NAME
ctrl DOWNReportEditorKit.JUMP_DOWN_ACTION_NAME
ctrl KP_DOWNReportEditorKit.JUMP_DOWN_ACTION_NAME
ctrl UPReportEditorKit.JUMP_UP_ACTION_NAME
ctrl KP_UPReportEditorKit.JUMP_UP_ACTION_NAME
ctrl RIGHTReportEditorKit.JUMP_FORWARD_ACTION_NAME
ctrl KP_RIGHTReportEditorKit.JUMP_FORWARD_ACTION_NAME
ctrl LEFTReportEditorKit.JUMP_BACKWARD_ACTION_NAME
ctrl KP_LEFTReportEditorKit.JUMP_BACKWARD_ACTION_NAME
shift DOWNReportEditorKit.SELECTION_DOWN_ACTION_NAME
shift KP_DOWNReportEditorKit.SELECTION_DOWN_ACTION_NAME
shift UPReportEditorKit.SELECTION_UP_ACTION_NAME
shift KP_UPReportEditorKit.SELECTION_UP_ACTION_NAME
shift RIGHTReportEditorKit.SELECTION_FORWARD_ACTION_NAME
shift KP_RIGHTReportEditorKit.SELECTION_FORWARD_ACTION_NAME
shift LEFTReportEditorKit.SELECTION_BACKWARD_ACTION_NAME
shift KP_LEFTReportEditorKit.SELECTION_BACKWARD_ACTION_NAME
HOMEReportEditorKit.BEGIN_ACTION_NAME
ctrl HOMEReportEditorKit.BEGIN_REPORT_ACTION_NAME
shift HOMEReportEditorKit.SELECTION_BEGIN_ACTION_NAME
ENDReportEditorKit.END_ACTION_NAME
ctrl ENDReportEditorKit.END_REPORT_ACTION_NAME
shift ENDReportEditorKit.SELECTION_END_ACTION_NAME
ctrl AReportEditorKit.SELECT_ALL_ACTION_NAME
ctrl BACK_SLASHReportEditorKit.UNSELECT_ACTION_NAME
F2ReportEditorKit.BEGIN_EDIT_ACTION_NAME
PAGE_UPReportEditorKit.SCROLL_UP_ACTION_NAME
PAGE_DOWNReportEditorKit.SCROLL_DOWN_ACTION_NAME
shift PAGE_UPReportEditorKit.SELECTION_SCROLL_UP_ACTION_NAME
shift PAGE_DOWNReportEditorKit.SELECTION_SCROLL_DOWN_ACTION_NAME

Since:
1.0
See Also:
JReportPane

Field Summary
static java.lang.Object ANCESTOR_INPUT_MAP_KEY
          The look-and-feel key for the report pane's default input map, which contains the mapping between keystrokes and actions.
static java.lang.Object BACKGROUND_KEY
          The look-and-feel key for the report pane's default background color.
static java.lang.Object FONT_KEY
          The look-and-feel key for the report pane's default font.
static java.lang.Object MARGIN_KEY
          The look-and-feel key for the report pane's default margins.
protected  JReportPane reportPane
          The report pane that this look and feel is overseeing.
static java.lang.Object SELECTION_BACKGROUND_KEY
          The look-and-feel key for the report pane's default selection background color.
static java.lang.Object SELECTION_FOREGROUND_KEY
          The look-and-feel key for the report pane's default selection foreground color.
static java.lang.Object TRAVERSAL_POLICY_KEY
          The look-and-feel key for the report pane's default traversal policy.
 
Constructor Summary
BasicReportPaneUI()
          Creates an instance of BasicReportPaneUI.
 
Method Summary
protected  java.awt.event.FocusListener createFocusListener()
          Returns a FocusListener that responds to focus changes in the report pane.
protected  javax.swing.event.MouseInputListener createMouseInputListener()
          Returns a MouseInputListener that responds to mouse events pertaining to the report pane.
protected  java.beans.PropertyChangeListener createPropertyChangeListener()
          Returns a PropertyChangeListener that responds to changes in the report pane.
static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
          Returns an instance of the UI delegate for the specified component.
 View elementToView(JReportPane reportPane, Element element)
          Returns the view that represents the specified element.
 java.awt.Dimension getMinimumSize(javax.swing.JComponent component)
          Returns the specified component's minimum size appropriate for this look and feel.
 java.awt.Dimension getPreferredSize(javax.swing.JComponent component)
          Returns the specified component's preferred size appropriate for this look and feel.
 View getRootView(JReportPane reportPane)
          Returns the top-level view rendering the report of the specified report pane.
 java.lang.String getToolTipText(JReportPane reportPane, java.awt.event.MouseEvent event)
          Returns the string to be used as the tooltip for event.
protected  void installDefaults()
          Installs the default colors of the report pane.
protected  void installKeyboardActions()
          Installs the keyboards actions into the report pane.
protected  void installListeners()
          Installs the look and feel's listeners into the print preview pane and possibly any of its child pages.
 void installUI(javax.swing.JComponent component)
          Configures the specified component appropriate for the look and feel.
 void paint(java.awt.Graphics g, javax.swing.JComponent c)
          Paints the specified component appropriate for the look and feel.
 java.util.Set pointToElements(JReportPane reportPane, java.awt.Point point)
          Returns the set of elements occupying the specified point.
protected  void uninstallDefaults()
          Uninstalls the defaults installed by installDefaults.
protected  void uninstallKeyboardActions()
          Uninstalls the keyboard actions installed by this look and feel object.
protected  void uninstallListeners()
          Uninstalls the listeners installed by this look and feel object.
 void uninstallUI(javax.swing.JComponent component)
          Reverses configuration which was done on the specified component during installUI.
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ANCESTOR_INPUT_MAP_KEY

public static final java.lang.Object ANCESTOR_INPUT_MAP_KEY
The look-and-feel key for the report pane's default input map, which contains the mapping between keystrokes and actions. The value associated with this key must be of type javax.swing.InputMap. Clients may change the default value by invoking at application start-up
  UIManager.put( BasicReportPaneUI.ANCESTOR_INPUT_MAP_KEY, customInputMap );
 


BACKGROUND_KEY

public static final java.lang.Object BACKGROUND_KEY
The look-and-feel key for the report pane's default background color. The value associated with this key must be of type java.awt.Color. Clients may change the default value by invoking at application start-up
  UIManager.put( BasicReportPaneUI.BACKGROUND_KEY, Color.blue );
 


FONT_KEY

public static final java.lang.Object FONT_KEY
The look-and-feel key for the report pane's default font. The value associated with this key must be of type java.awt.Font. Clients may change the default value by invoking at application start-up
  UIManager.put( BasicReportPaneUI.FONT_KEY, new Font( "Serif', Font.PLAIN, 12 ));
 


MARGIN_KEY

public static final java.lang.Object MARGIN_KEY
The look-and-feel key for the report pane's default margins. The value associated with this key must be of type java.awt.Insets. Clients may change the default value by invoking at application start-up
  UIManager.put( BasicReportPaneUI.MARGIN_KEY, customInsets );
 


SELECTION_BACKGROUND_KEY

public static final java.lang.Object SELECTION_BACKGROUND_KEY
The look-and-feel key for the report pane's default selection background color. The value associated with this key must be of type java.awt.Color. Clients may change the default value by invoking at application start-up
  UIManager.put( BasicReportPaneUI.SELECTION_BACKGROUND_KEY, Color.blue );
 


SELECTION_FOREGROUND_KEY

public static final java.lang.Object SELECTION_FOREGROUND_KEY
The look-and-feel key for the report pane's default selection foreground color. The value associated with this key must be of type java.awt.Color. Clients may change the default value by invoking at application start-up
  UIManager.put( BasicReportPaneUI.SELECTION_FOREGROUND_KEY, Color.white );
 


TRAVERSAL_POLICY_KEY

public static final java.lang.Object TRAVERSAL_POLICY_KEY
The look-and-feel key for the report pane's default traversal policy. The value associated with this key must be of type TraversalPolicy. Clients may change the default value by invoking at application start-up
  UIManager.put( BasicReportPaneUI.TRAVERSAL_POLICY_KEY, customTraversalPolicy );
 


reportPane

protected JReportPane reportPane
The report pane that this look and feel is overseeing.

Constructor Detail

BasicReportPaneUI

public BasicReportPaneUI()
Creates an instance of BasicReportPaneUI.

Method Detail

createFocusListener

protected java.awt.event.FocusListener createFocusListener()
Returns a FocusListener that responds to focus changes in the report pane.

Returns:
a FocusListener that responds to focus changes in the report pane.

createMouseInputListener

protected javax.swing.event.MouseInputListener createMouseInputListener()
Returns a MouseInputListener that responds to mouse events pertaining to the report pane.

Returns:
a MouseInputListener that responds to mouse events pertaining to the report pane.

createPropertyChangeListener

protected java.beans.PropertyChangeListener createPropertyChangeListener()
Returns a PropertyChangeListener that responds to changes in the report pane.

Returns:
a PropertyChangeListener that responds to changes in the report pane.

createUI

public static javax.swing.plaf.ComponentUI createUI(javax.swing.JComponent c)
Returns an instance of the UI delegate for the specified component.


getMinimumSize

public java.awt.Dimension getMinimumSize(javax.swing.JComponent component)
Returns the specified component's minimum size appropriate for this look and feel.

Overrides:
getMinimumSize in class javax.swing.plaf.ComponentUI
Parameters:
component - the component whose minimum size is being queried
Returns:
a Dimension representing component's minimum size, or null if the minimum size should be calculated by the component's layout manager

getPreferredSize

public java.awt.Dimension getPreferredSize(javax.swing.JComponent component)
Returns the specified component's preferred size appropriate for this look and feel.

Overrides:
getPreferredSize in class javax.swing.plaf.ComponentUI
Parameters:
component - the component whose preferred size is being queried
Returns:
a Dimension representing component's preferred size, or null if the preferred size should be calculated by the component's layout manager

getRootView

public View getRootView(JReportPane reportPane)
Description copied from class: ReportPaneUI
Returns the top-level view rendering the report of the specified report pane.

Specified by:
getRootView in class ReportPaneUI
Parameters:
reportPane - the report pane whose root view is requested
Returns:
the root view of the specified report pane

getToolTipText

public java.lang.String getToolTipText(JReportPane reportPane,
                                       java.awt.event.MouseEvent event)
Description copied from class: ReportPaneUI
Returns the string to be used as the tooltip for event. By default this returns null.

Overrides:
getToolTipText in class ReportPaneUI
Parameters:
reportPane - the report pane for which the tool tip is requested
event - the mouse event triggering the request
Returns:
the tooltip for reportPane as a result of event

installDefaults

protected void installDefaults()
Installs the default colors of the report pane.

See Also:
uninstallDefaults()

installKeyboardActions

protected void installKeyboardActions()
Installs the keyboards actions into the report pane.

See Also:
uninstallKeyboardActions()

installListeners

protected void installListeners()
Installs the look and feel's listeners into the print preview pane and possibly any of its child pages.

See Also:
uninstallListeners()

installUI

public void installUI(javax.swing.JComponent component)
Configures the specified component appropriate for the look and feel.

Overrides:
installUI in class javax.swing.plaf.ComponentUI
See Also:
uninstallUI(javax.swing.JComponent)

paint

public void paint(java.awt.Graphics g,
                  javax.swing.JComponent c)
Paints the specified component appropriate for the look and feel.

Overrides:
paint in class javax.swing.plaf.ComponentUI
Parameters:
g - the Graphics context in which to paint
c - the component being painted

uninstallDefaults

protected void uninstallDefaults()
Uninstalls the defaults installed by installDefaults.

See Also:
installDefaults()

uninstallKeyboardActions

protected void uninstallKeyboardActions()
Uninstalls the keyboard actions installed by this look and feel object.

See Also:
installKeyboardActions()

uninstallListeners

protected void uninstallListeners()
Uninstalls the listeners installed by this look and feel object.

See Also:
installListeners()

uninstallUI

public void uninstallUI(javax.swing.JComponent component)
Reverses configuration which was done on the specified component during installUI.

Overrides:
uninstallUI in class javax.swing.plaf.ComponentUI
See Also:
installUI(javax.swing.JComponent)

elementToView

public View elementToView(JReportPane reportPane,
                          Element element)
Description copied from class: ReportPaneUI
Returns the view that represents the specified element.

Specified by:
elementToView in class ReportPaneUI
Parameters:
reportPane - the report pane for which the tool tip is requested
element - the report element for which the corresponding view is requested
Returns:
the view of element

pointToElements

public java.util.Set pointToElements(JReportPane reportPane,
                                     java.awt.Point point)
Description copied from class: ReportPaneUI
Returns the set of elements occupying the specified point.

Specified by:
pointToElements in class ReportPaneUI
Parameters:
reportPane - the report pane for which the elements are requested
point - the point at which the elements are requested
Returns:
the set of elements at point


Copyright 2003, 2004 Side of Software (SOS). All rights reserved.