org.jhotdraw.gui.plaf.palette
Class PaletteToolBarBorder

java.lang.Object
  extended by javax.swing.border.AbstractBorder
      extended by org.jhotdraw.gui.plaf.palette.PaletteToolBarBorder
All Implemented Interfaces:
java.io.Serializable, javax.swing.border.Border, javax.swing.SwingConstants
Direct Known Subclasses:
PaletteToolBarBorder.UIResource

public class PaletteToolBarBorder
extends javax.swing.border.AbstractBorder
implements javax.swing.SwingConstants

PaletteToolBarBorder.

Version:
$Id: PaletteToolBarBorder.java 591 2009-12-18 22:54:10Z rawcoder $
Author:
Werner Randelshofer
See Also:
Serialized Form

Nested Class Summary
static class PaletteToolBarBorder.UIResource
           
 
Field Summary
private static java.awt.Color bright
           
private static java.awt.Color dark
           
private static java.awt.Color divider
           
private static java.awt.Color[] enabledStopColors
           
private static float[] enabledStops
           
private static java.awt.Color[] selectedStopColors
           
private static float[] selectedStops
           
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
PaletteToolBarBorder()
           
 
Method Summary
private  java.lang.String clippedText(java.lang.String text, java.awt.FontMetrics fm, int availTextWidth)
          Convenience method to clip the passed in text to the specified size.
 java.awt.Insets getBorderInsets(java.awt.Component c)
           
 java.awt.Insets getBorderInsets(java.awt.Component component, java.awt.Insets newInsets)
           
 java.awt.Insets getDragInsets(java.awt.Component c)
          These insets are used by PaletteToolBarUI, to determine if the toolbar should be dragged.
 void paintBorder(java.awt.Component component, java.awt.Graphics gr, int x, int y, int w, int h)
           
 
Methods inherited from class javax.swing.border.AbstractBorder
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle, isBorderOpaque
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enabledStops

private static final float[] enabledStops

enabledStopColors

private static final java.awt.Color[] enabledStopColors

selectedStops

private static final float[] selectedStops

selectedStopColors

private static final java.awt.Color[] selectedStopColors

bright

private static final java.awt.Color bright

dark

private static final java.awt.Color dark

divider

private static final java.awt.Color divider
Constructor Detail

PaletteToolBarBorder

public PaletteToolBarBorder()
Method Detail

paintBorder

public void paintBorder(java.awt.Component component,
                        java.awt.Graphics gr,
                        int x,
                        int y,
                        int w,
                        int h)
Specified by:
paintBorder in interface javax.swing.border.Border
Overrides:
paintBorder in class javax.swing.border.AbstractBorder

getBorderInsets

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

getDragInsets

public java.awt.Insets getDragInsets(java.awt.Component c)
These insets are used by PaletteToolBarUI, to determine if the toolbar should be dragged.

Parameters:
c - JToolBar.
Returns:
Return drag insets.

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component component,
                                       java.awt.Insets newInsets)
Overrides:
getBorderInsets in class javax.swing.border.AbstractBorder

clippedText

private java.lang.String clippedText(java.lang.String text,
                                     java.awt.FontMetrics fm,
                                     int availTextWidth)
Convenience method to clip the passed in text to the specified size.