org.gjt.btools.gui.component
Class PaddedPane

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--org.gjt.btools.gui.component.PaddedPane
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class PaddedPane
extends javax.swing.JPanel

Used to produce a new component that consists of some child component with padding around the edge.

This is a container class; the container is designed to hold only one child, which is passed in the constructor. The child will be placed in the container with the requested padding around the edge, and will grow and shrink with the container if desired.

The container is put together when the constructor is called; no components should be explicitly added or removed.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PaddedPane(java.awt.Component contents, java.awt.Insets insets)
          Creates a PaddedPane containing the given component and with the requested padding on each side.
PaddedPane(java.awt.Component contents, java.awt.Insets insets, boolean grow)
          Creates a PaddedPane containing the given component and with the requested padding on each side.
PaddedPane(java.awt.Component contents, int inset)
          Creates a PaddedPane containing the given component and with the same padding on all four sides.
PaddedPane(java.awt.Component contents, int inset, boolean grow)
          Creates a PaddedPane containing the given component and with the same padding on all four sides.
PaddedPane(java.awt.Component contents, int top, int left, int bottom, int right)
          Creates a PaddedPane containing the given component and with the requested padding on each side.
PaddedPane(java.awt.Component contents, int top, int left, int bottom, int right, boolean grow)
          Creates a PaddedPane containing the given component and with the requested padding on each side.
 
Method Summary
 java.awt.Component getContents()
          Returns the child component of this container.
 java.awt.Insets getInsets()
          Returns the padding between the child component and the edges of the container.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PaddedPane

public PaddedPane(java.awt.Component contents,
                  int inset)
Creates a PaddedPane containing the given component and with the same padding on all four sides. The component will grow and shrink with the container.

Parameters:
contents - the component to be placed in the container.
inset - the distance in pixels to place between the given component and the edge of the container; this will be the same for all four sides of the component.

PaddedPane

public PaddedPane(java.awt.Component contents,
                  int inset,
                  boolean grow)
Creates a PaddedPane containing the given component and with the same padding on all four sides.

Parameters:
contents - the component to be placed in the container.
inset - the distance in pixels to place between the given component and the edge of the container; this will be the same for all four sides of the component.
grow - true if the component should grow and shrink with the container, or false if it should remain its preferred size.

PaddedPane

public PaddedPane(java.awt.Component contents,
                  int top,
                  int left,
                  int bottom,
                  int right)
Creates a PaddedPane containing the given component and with the requested padding on each side. The component will grown and shrink with the container.

Parameters:
contents - the component to be placed in the container.
top - the distance in pixels to place between the given component and the top of the container.
left - the distance in pixels to place between the given component and the left of the container.
bottom - the distance in pixels to place between the given component and the bottom of the container.
right - the distance in pixels to place between the given component and the right of the container.

PaddedPane

public PaddedPane(java.awt.Component contents,
                  int top,
                  int left,
                  int bottom,
                  int right,
                  boolean grow)
Creates a PaddedPane containing the given component and with the requested padding on each side.

Parameters:
contents - the component to be placed in the container.
top - the distance in pixels to place between the given component and the top of the container.
left - the distance in pixels to place between the given component and the left of the container.
bottom - the distance in pixels to place between the given component and the bottom of the container.
right - the distance in pixels to place between the given component and the right of the container.
grow - true if the component should grow and shrink with the container, or false if it should remain its preferred size.

PaddedPane

public PaddedPane(java.awt.Component contents,
                  java.awt.Insets insets)
Creates a PaddedPane containing the given component and with the requested padding on each side. The component will grown and shrink with the container.

Parameters:
contents - the component to be placed in the container.
insets - contains the distances in pixels to place between the given component and each edge of the container.

PaddedPane

public PaddedPane(java.awt.Component contents,
                  java.awt.Insets insets,
                  boolean grow)
Creates a PaddedPane containing the given component and with the requested padding on each side.

Parameters:
contents - the component to be placed in the container.
insets - contains the distances in pixels to place between the given component and each edge of the container.
grow - true if the component should grow and shrink with the container, or false if it should remain its preferred size.
Method Detail

getContents

public java.awt.Component getContents()
Returns the child component of this container.

Returns:
the child component.

getInsets

public java.awt.Insets getInsets()
Returns the padding between the child component and the edges of the container.

Overrides:
getInsets in class javax.swing.JComponent
Returns:
the distances in pixels to each edge of the container.


Copyright © 1998-2001, Ben Burton
This software is released under the GNU Public License.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).