JIDE 3.5.15

com.jidesoft.plaf.basic
Class BasicSidePaneUI

java.lang.Object
  extended by javax.swing.plaf.ComponentUI
      extended by javax.swing.plaf.PanelUI
          extended by com.jidesoft.plaf.SidePaneUI
              extended by com.jidesoft.plaf.basic.BasicSidePaneUI
Direct Known Subclasses:
AquaSidePaneUI, EclipseSidePaneUI, Office2003SidePaneUI, Office2007SidePaneUI, VsnetSidePaneUI, XertoSidePaneUI

public class BasicSidePaneUI
extends SidePaneUI

A basic L&f implementation of SidePaneUI


Field Summary
protected  boolean _alwaysShowText
           
protected  Color _background
           
protected  Color _buttonBackground
           
protected  int _displayOrientation
           
 DropTarget _dt
           
protected  Font _font
           
protected  int _groupGap
           
protected  boolean _highlightSelectedTab
           
protected  int _iconTextGap
           
protected  int _itemGap
           
protected  Color _lineColor
           
protected  Insets _margin
           
protected  Rectangle[] _rects
          Rectangles that hold location of each icon/text
protected  Color _selectedButtonBackground
           
protected  Color _selectedButtonForeground
           
protected  boolean _showText
           
protected  SidePane _sidePane
           
protected  int _size
           
protected  int _textBorderGap
           
 
Constructor Summary
BasicSidePaneUI()
           
 
Method Summary
protected  com.jidesoft.plaf.basic.BasicSidePaneUI.DropListener createDropListener()
           
protected  LayoutManager createLayoutManager()
          Invoked by installUI to create a layout manager object to manage the JideSidePane.
protected  MouseInputListener createMouseInputListener()
           
static ComponentUI createUI(JComponent c)
           
protected  void drawEastPane(Graphics g, JComponent c, FontMetrics metrics)
           
protected  void drawNorthPane(Graphics g, JComponent c, FontMetrics metrics)
           
protected  void drawSouthPane(Graphics g, JComponent c, FontMetrics metrics)
           
protected  void drawWestPane(Graphics g, JComponent c, FontMetrics metrics)
           
protected  FontMetrics getFontMetrics()
           
protected  Color[] getGradientColors(SidePaneItem item)
           
 SidePaneGroup getGroupForIndex(int index)
           
 Rectangle getGroupRect(int index)
          Gets the rectangle of the SidePaneGroup.
 SidePaneItem getItemForIndex(int index)
           
 ThemePainter getPainter()
           
protected  int getPreferredHeightVertical()
           
 Dimension getPreferredSize(JComponent c)
          Returns the specified component's preferred size appropriate for the look and feel.
protected  int getPreferredWidthHorizontal()
           
 int getSelectedItemIndex(Point p)
           
protected  void initButtonRects()
           
protected  void installComponents()
          Creates and installs any required subcomponents for the SidePane.
protected  void installDefaults()
           
protected  void installKeyboardActions()
           
protected  void installListeners()
           
 void installUI(JComponent c)
           
protected  boolean isItemHighlighted(SidePaneItem item)
           
protected  boolean isRoundedCorner()
           
 void paint(Graphics g, JComponent c)
          Paints the specified component appropriate for the look and feel.
protected  void paintBackground(Graphics g, JComponent c)
           
protected  void paintItemBackground(SidePaneItem item, Graphics g, Rectangle rect, int side)
           
protected  void uninstallComponents()
          Removes any installed subcomponents from the JTabbedPane.
protected  void uninstallDefaults()
           
protected  void uninstallKeyboardActions()
           
protected  void uninstallListeners()
           
 void uninstallUI(JComponent c)
           
 
Methods inherited from class javax.swing.plaf.ComponentUI
contains, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_dt

public DropTarget _dt

_sidePane

protected SidePane _sidePane

_size

protected int _size

_margin

protected Insets _margin

_iconTextGap

protected int _iconTextGap

_textBorderGap

protected int _textBorderGap

_itemGap

protected int _itemGap

_groupGap

protected int _groupGap

_lineColor

protected Color _lineColor

_background

protected Color _background

_buttonBackground

protected Color _buttonBackground

_selectedButtonBackground

protected Color _selectedButtonBackground

_selectedButtonForeground

protected Color _selectedButtonForeground

_font

protected Font _font

_showText

protected boolean _showText

_alwaysShowText

protected boolean _alwaysShowText

_highlightSelectedTab

protected boolean _highlightSelectedTab

_rects

protected Rectangle[] _rects
Rectangles that hold location of each icon/text


_displayOrientation

protected int _displayOrientation
Constructor Detail

BasicSidePaneUI

public BasicSidePaneUI()
Method Detail

createUI

public static ComponentUI createUI(JComponent c)

installUI

public void installUI(JComponent c)
Overrides:
installUI in class ComponentUI

uninstallUI

public void uninstallUI(JComponent c)
Overrides:
uninstallUI in class ComponentUI

createLayoutManager

protected LayoutManager createLayoutManager()
Invoked by installUI to create a layout manager object to manage the JideSidePane.

Returns:
a layout manager object

installComponents

protected void installComponents()
Creates and installs any required subcomponents for the SidePane. Invoked by installUI.

Since:
1.4

uninstallComponents

protected void uninstallComponents()
Removes any installed subcomponents from the JTabbedPane. Invoked by uninstallUI.

Since:
1.4

installDefaults

protected void installDefaults()

uninstallDefaults

protected void uninstallDefaults()

installListeners

protected void installListeners()

createMouseInputListener

protected MouseInputListener createMouseInputListener()

createDropListener

protected com.jidesoft.plaf.basic.BasicSidePaneUI.DropListener createDropListener()

uninstallListeners

protected void uninstallListeners()

installKeyboardActions

protected void installKeyboardActions()

uninstallKeyboardActions

protected void uninstallKeyboardActions()

getSelectedItemIndex

public int getSelectedItemIndex(Point p)
Specified by:
getSelectedItemIndex in class SidePaneUI

getGroupRect

public Rectangle getGroupRect(int index)
Gets the rectangle of the SidePaneGroup.

Parameters:
index - the index of the SidePaneGroup
Returns:
the rectangle of the SidePaneGroup. null if the index is invalid.

getGroupForIndex

public SidePaneGroup getGroupForIndex(int index)
Specified by:
getGroupForIndex in class SidePaneUI

getItemForIndex

public SidePaneItem getItemForIndex(int index)
Specified by:
getItemForIndex in class SidePaneUI

getFontMetrics

protected FontMetrics getFontMetrics()

initButtonRects

protected void initButtonRects()

paint

public void paint(Graphics g,
                  JComponent c)
Paints the specified component appropriate for the look and feel. This method is invoked from the ComponentUI.update method when the specified component is being painted. Subclasses should override this method and use the specified Graphics object to render the content of the component.

Overrides:
paint in class ComponentUI
Parameters:
g - the Graphics context in which to paint
c - the component being painted; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)

paintItemBackground

protected void paintItemBackground(SidePaneItem item,
                                   Graphics g,
                                   Rectangle rect,
                                   int side)

getGradientColors

protected Color[] getGradientColors(SidePaneItem item)

isItemHighlighted

protected boolean isItemHighlighted(SidePaneItem item)

drawWestPane

protected void drawWestPane(Graphics g,
                            JComponent c,
                            FontMetrics metrics)

drawEastPane

protected void drawEastPane(Graphics g,
                            JComponent c,
                            FontMetrics metrics)

drawNorthPane

protected void drawNorthPane(Graphics g,
                             JComponent c,
                             FontMetrics metrics)

drawSouthPane

protected void drawSouthPane(Graphics g,
                             JComponent c,
                             FontMetrics metrics)

paintBackground

protected void paintBackground(Graphics g,
                               JComponent c)

getPreferredSize

public Dimension getPreferredSize(JComponent c)
Returns the specified component's preferred size appropriate for the look and feel. If null is returned, the preferred size will be calculated by the component's layout manager instead (this is the preferred approach for any component with a specific layout manager installed). The default implementation of this method returns null.

Overrides:
getPreferredSize in class ComponentUI
Parameters:
c - the component whose preferred size is being queried; this argument is often ignored, but might be used if the UI object is stateless and shared by multiple components
See Also:
JComponent.getPreferredSize(), LayoutManager.preferredLayoutSize(java.awt.Container)

getPreferredWidthHorizontal

protected int getPreferredWidthHorizontal()

getPreferredHeightVertical

protected int getPreferredHeightVertical()

getPainter

public ThemePainter getPainter()

isRoundedCorner

protected boolean isRoundedCorner()

JIDE 3.5.15