mdh.hephaestus2.gamelib
Class BorderPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--mdh.hephaestus2.gamelib.BorderPanel
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable

public class BorderPanel
extends Panel

A panel with a rectangular solid-colored border of varying width.

The default is black, 1-pixel, and it can be changed with setBorder().

Author:
Copyright © 2002 by Mark Hughes <kamikaze@kuoi.asui.uidaho.edu>
See Also:
Serialized Form

Field Summary
 
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
BorderPanel()
          Creates a new BorderPanel.
BorderPanel(LayoutManager layout)
          Creates a new BorderPanel with the given layout manager.
 
Method Summary
 Color getBorderColor()
          Returns the color of the border, or the start-color of a gradient.
 Color getBorderColor1()
          Returns the border gradient mid-color.
 Color getBorderColor2()
          Returns the border gradient end-color.
 int getBorderWidth()
          Returns the width of the border.
 Insets insets()
          Deprecated. As of JDK version 1.1, replaced by getInsets().
 void paint(Graphics g)
           
 void setBorder(Color c, int width)
          Sets the color and width of the border.
 void setBorderColor(Color c)
          Sets the color of the border.
 void setBorderGradient(Color c0, Color c1, Color c2)
          Sets the border to be a gradient scaling from c0 to c1, then from c1 to c2.
 void setBorderWidth(int w)
          Sets the width of the border.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BorderPanel

public BorderPanel()
Creates a new BorderPanel.


BorderPanel

public BorderPanel(LayoutManager layout)
Creates a new BorderPanel with the given layout manager.

Method Detail

getBorderColor

public Color getBorderColor()
Returns the color of the border, or the start-color of a gradient.


getBorderColor1

public Color getBorderColor1()
Returns the border gradient mid-color.


getBorderColor2

public Color getBorderColor2()
Returns the border gradient end-color.


getBorderWidth

public int getBorderWidth()
Returns the width of the border.


insets

public Insets insets()
Deprecated. As of JDK version 1.1, replaced by getInsets().

Determines the insets of this panel, which are based on the border width.

Overrides:
insets in class Container

paint

public void paint(Graphics g)
Overrides:
paint in class Container

setBorder

public void setBorder(Color c,
                      int width)
Sets the color and width of the border.


setBorderColor

public void setBorderColor(Color c)
Sets the color of the border.


setBorderGradient

public void setBorderGradient(Color c0,
                              Color c1,
                              Color c2)
Sets the border to be a gradient scaling from c0 to c1, then from c1 to c2.

Parameters:
c0 - start-color of the gradient, must not be null.
c1 - mid-color of the gradient, may be null, in which case it will be automatically computed for you.
c2 - end-color of the gradient, must not be null.

setBorderWidth

public void setBorderWidth(int w)
Sets the width of the border.