adavid.awt
Class BorderedPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--adavid.awt.BorderedPanel

public class BorderedPanel
extends java.awt.Panel

Bordered Panel a panel bordered with a text and a line

See Also:
Serialized Form

Field Summary
static int DEFAULT_THICKNESS
          default values
static int INC
          default values
static int MIDDLE
          default values
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
BorderedPanel(java.awt.Graphics g)
          default constructor: all default
BorderedPanel(java.awt.Graphics g, java.lang.String title)
          default constructor: default color and thickness
BorderedPanel(java.awt.Graphics g, java.lang.String title, java.awt.Color color)
          default constructor: default thickness
BorderedPanel(java.awt.Graphics g, java.lang.String title, int thickness)
          default constructor: default color
BorderedPanel(java.awt.Graphics g, java.lang.String title, int thickness, java.awt.Color color)
          the constructor: the Graphics is used for the label, title to display, thickness and color of the border
 
Method Summary
 void addComponent(java.awt.Component compo)
          add a component
 void addComponent(java.awt.Component compo, int width, int height)
          add a component
 NiceCheckbox addNiceCheckbox(java.awt.Graphics g, java.lang.String name)
          create and add a NiceCheckbox
 NiceCheckbox addNiceCheckbox(java.awt.Graphics g, java.lang.String name, java.awt.CheckboxGroup group, java.awt.event.ItemListener listener)
          a method just for convenience: same as before but may initialize a check box group and an item listener..
 void breakColumn()
          break the column
 NiceLabel getLabel()
          returns the used label
 int getOffset()
          offset from border
static BorderedPanel getPanel(java.awt.Graphics g, java.awt.Color color, java.lang.String title, java.awt.Component[] list)
          get a simple panel with the given checkboxes, may have more configuration options in the future
 java.awt.Dimension getPreferredSize()
          preferred size
 void paint(java.awt.Graphics g)
          paint
 int prefHeight()
          preferred Height
 int prefWidth()
          preferred Width
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setCursor, setFont, setLayout, update, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, 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, processComponentEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_THICKNESS

public static final int DEFAULT_THICKNESS
default values

INC

public static final int INC
default values

MIDDLE

public static final int MIDDLE
default values
Constructor Detail

BorderedPanel

public BorderedPanel(java.awt.Graphics g,
                     java.lang.String title)
default constructor: default color and thickness

BorderedPanel

public BorderedPanel(java.awt.Graphics g)
default constructor: all default

BorderedPanel

public BorderedPanel(java.awt.Graphics g,
                     java.lang.String title,
                     java.awt.Color color)
default constructor: default thickness

BorderedPanel

public BorderedPanel(java.awt.Graphics g,
                     java.lang.String title,
                     int thickness)
default constructor: default color

BorderedPanel

public BorderedPanel(java.awt.Graphics g,
                     java.lang.String title,
                     int thickness,
                     java.awt.Color color)
the constructor: the Graphics is used for the label, title to display, thickness and color of the border
Method Detail

getLabel

public NiceLabel getLabel()
returns the used label

paint

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

addComponent

public void addComponent(java.awt.Component compo)
add a component

addComponent

public void addComponent(java.awt.Component compo,
                         int width,
                         int height)
add a component

addNiceCheckbox

public NiceCheckbox addNiceCheckbox(java.awt.Graphics g,
                                    java.lang.String name)
create and add a NiceCheckbox

addNiceCheckbox

public NiceCheckbox addNiceCheckbox(java.awt.Graphics g,
                                    java.lang.String name,
                                    java.awt.CheckboxGroup group,
                                    java.awt.event.ItemListener listener)
a method just for convenience: same as before but may initialize a check box group and an item listener..

breakColumn

public void breakColumn()
break the column

getPreferredSize

public java.awt.Dimension getPreferredSize()
preferred size
Overrides:
getPreferredSize in class java.awt.Container

prefWidth

public int prefWidth()
preferred Width

prefHeight

public int prefHeight()
preferred Height

getOffset

public int getOffset()
offset from border

getPanel

public static BorderedPanel getPanel(java.awt.Graphics g,
                                     java.awt.Color color,
                                     java.lang.String title,
                                     java.awt.Component[] list)
get a simple panel with the given checkboxes, may have more configuration options in the future
Parameters:
g - a valid graphics object
color - the color of the border
title - the title of the panel
list - the list of components to put in the panel