com.tecnick.junitconv
Class GroupBox

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by com.tecnick.junitconv.GroupBox
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class GroupBox
extends java.awt.Panel

Title: GroupBox Class
Description: Is a Bordered Panel with optional title

Copyright (c) 2002-2006 Tecnick.com S.r.l (www.tecnick.com) Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
Project homepage: http://junitconv.sourceforge.net
License: http://www.gnu.org/copyleft/gpl.html GPL 2

Version:
1.0.004
Author:
Nicola Asuni [www.tecnick.com].
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Panel
java.awt.Panel.AccessibleAWTPanel
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
private  java.awt.Color backgroundColor
          Background color.
private  int border_padding
          Minimum distance between border and component edge.
private  int border_width
          Border width.
private  java.awt.Font default_font
          Default font.
private static long serialVersionUID
          serialVersionUID
private  int text_padding
          Minimum distance between border title text.
private  java.awt.Color textColor
          Text color (foreground color).
protected  java.lang.String title
          Applet title.
private  java.awt.Font title_font
          Font for title.
 
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
GroupBox()
          void constructor.
GroupBox(java.lang.String ti, int bw, int bp, int tp, java.awt.Font tf)
          constructor.
 
Method Summary
private  void DrawBorder(java.awt.Graphics g, int bw, int x1, int y1, int x2, int y2)
          Draw a 3D carved border
 java.awt.Dimension getMinimumSize()
          Redefines the inherited getMinimumSize() method for better sizing
 java.awt.Insets insets()
          Redefines the inherited method to allow space for drawing the border
 void paint(java.awt.Graphics g)
          Redefines the inherited method to draw the border and title in addition to inherited functionality.
 void setBorderPadding(int bp)
          Set the border padding (minimum distance between border and component)
 void setBorderWidth(int bw)
          Set the border width
 void setTextPadding(int tp)
          Set the padding around text title
 void setTitle(java.lang.String title)
          Changes the GroupBox's title.
 void setTitleFont(java.awt.Font tf)
          Changes the GroupBox's title.
 
Methods inherited from class java.awt.Panel
addNotify, getAccessibleContext
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMousePosition, getPreferredSize, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getMousePosition, 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, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, 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, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
serialVersionUID

See Also:
Constant Field Values

title

protected java.lang.String title
Applet title.


border_padding

private int border_padding
Minimum distance between border and component edge.


text_padding

private int text_padding
Minimum distance between border title text.


border_width

private int border_width
Border width.


textColor

private java.awt.Color textColor
Text color (foreground color).


backgroundColor

private java.awt.Color backgroundColor
Background color.


title_font

private java.awt.Font title_font
Font for title.


default_font

private java.awt.Font default_font
Default font.

Constructor Detail

GroupBox

public GroupBox(java.lang.String ti,
                int bw,
                int bp,
                int tp,
                java.awt.Font tf)
constructor.

Parameters:
ti - the title of the GroupBox. To be used if you want a title
bw - border width
bp - border padding
tp - text padding
tf - title font

GroupBox

public GroupBox()
void constructor. To be used if you don't want a title.

Method Detail

setTitle

public void setTitle(java.lang.String title)
Changes the GroupBox's title.

Parameters:
title - the new title

setTitleFont

public void setTitleFont(java.awt.Font tf)
Changes the GroupBox's title.

Parameters:
tf - the new title

setBorderWidth

public void setBorderWidth(int bw)
Set the border width

Parameters:
bw - border width

setBorderPadding

public void setBorderPadding(int bp)
Set the border padding (minimum distance between border and component)

Parameters:
bp - border padding

setTextPadding

public void setTextPadding(int tp)
Set the padding around text title

Parameters:
tp - border padding

insets

public java.awt.Insets insets()
Redefines the inherited method to allow space for drawing the border

Overrides:
insets in class java.awt.Container
Returns:
Inset

getMinimumSize

public java.awt.Dimension getMinimumSize()
Redefines the inherited getMinimumSize() method for better sizing

Overrides:
getMinimumSize in class java.awt.Container
Returns:
dimension

paint

public void paint(java.awt.Graphics g)
Redefines the inherited method to draw the border and title in addition to inherited functionality.

Overrides:
paint in class java.awt.Container
Parameters:
g - the Graphics object

DrawBorder

private void DrawBorder(java.awt.Graphics g,
                        int bw,
                        int x1,
                        int y1,
                        int x2,
                        int y2)
Draw a 3D carved border

Parameters:
g - current graphics
bw - 1/2 border
x1 - x origin coordinate
y1 - y origin coordinate
x2 - x final coordinate
y2 - y final coordinate