[.home.]
[.hacks.]
[.java.]

Class BorderPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--Awt
                          |
                          +--Caption
                                |
                                +--BorderPanel
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.AdjustmentListener, java.util.EventListener, java.awt.event.FocusListener, java.awt.image.ImageObserver, java.awt.ItemSelectable, java.awt.event.KeyListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable
Direct Known Subclasses:
Base

public class BorderPanel
extends Caption

(#)Cal.java

Version:
3.2 19-Mar-2004

A Panel with an optional border, titlestring and helptext that can be minimized if desired
Author:
Holger Pfaff
See Also:
Serialized Form

Field Summary
protected  java.lang.String helpText
          helptext for this panel null for none
protected  boolean miniMizable
          can this panel be minimized ?
protected  NullLayout nullLayout
          nulllayout is used when minimized
 
Fields inherited from class Caption
active, activeRect, caption, entered, hrefs, iconDist, iconPos, invalid, mode
 
Fields inherited from class Awt
actionListener, Background, bg, big, bim, Black, BlueMask, Bold, Bolditalic, borderDepth, borderType, BOTTOM, Brighter, Bulk, BULK, C, Center, CENTER, ColorMask, componentStates, Darker, E, East, EFFECT_MASK, Esc, FILL, Flat, FontMask, fonts, FontSize0, FontSizeMask, Foreground, GreenMask, Href, HREF, Hrefend, innerInsets, insets, Italic, itemListener, jvendor, jversion, Larger, LEFT, minimumDimension, MISC_MASK, Monospaced, N, NE, None, NONE, North, NorthEast, NorthWest, Null, NW, Plain, POSITION_MASK, Raised, RAISED, RedMask, RIGHT, S, SansSerif, SE, Serif, Smaller, South, SouthEast, SouthWest, Sunken, SUNKEN, SW, Tab0, TabMask, TabSizeMask, TOP, Uline, ULINE, W, West, White
 
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()
          The default contructor creates a regualr panel w/o decoration.
BorderPanel(int borderType)
          Create a panel with the specified border type.
BorderPanel(int borderType, java.lang.String title)
          Create a panel with the specified border type and title string.
BorderPanel(java.lang.String title)
          Create a panel with the specified title string.
 
Method Summary
 java.lang.String getHelptext()
          Get this panels help text
protected  java.awt.Rectangle getIconRectangle()
          calculate icon position & size
 java.awt.Insets getInsets()
          get Insets for this panel. insets + innerInsets + titlehight
protected  java.awt.Rectangle getTitleRectangle()
          calculate title position & size
 boolean iconVisible()
          is icon currently visible ?
 java.awt.Dimension measure()
          calculate required sizes for this panel
 java.awt.Dimension measureCaption()
          calculate Caption (Title) size including a fix one pixel border left/right two pixel top/bottom
 java.awt.Dimension measureIcon()
          calculate Icon size including a fix one pixel border left/right two pixel top/bottom
 int measureTitleHeight()
          calculate titlehight, if any
 boolean mini()
          Get this panels state
 boolean minimizable()
          Get this panels miniMizable property
 void mouseClicked(java.awt.event.MouseEvent e)
          implement java.awt.event.MouseListener
 void mouseExited(java.awt.event.MouseEvent e)
          implement java.awt.event.MouseListener
 void mouseMoved(java.awt.event.MouseEvent e)
          implement java.awt.event.MouseListener
 void paint(java.awt.Graphics g)
          Overwirte paint to do the actual artwork ;-)
 void paintCaption(java.awt.Graphics g, int x, int y, int w, int h)
          Paint the Caption (Title)
 void paintIcon(java.awt.Graphics g, int x, int y, int w, int h)
          Paint the Icon
 void setHelptext(java.lang.String helpText)
          Set the help text for this panel
 void setLayout(java.awt.LayoutManager l)
          Overwite setLayout() to be able to save old layout
 void setMini(boolean m)
          Force this panel to a specific state
 void setMinimizable(boolean miniMizable)
          Set the miniMizable property for this panel
 boolean titleVisible()
          is title currently visible ?
 
Methods inherited from class Caption
doHref, getCaption, getHref, getLabel, getMode, getText, getTitle, invalidate, isActive, isEntered, mousePressed, setActive, setCaption, setEntered, setLabel, setMode, setText, setTitle
 
Methods inherited from class Awt
addActionListener, addItemListener, addNotify, adjustmentValueChanged, Array2Insets, bold, bolditalic, brighter, centerWindow, Color2Esc, darker, dim, doMeasure, drawCaption, drawCaption, drawLine, drawRectangle, drawString, drawString, drawTriangle, error, exHref, exString, focusGained, focusLost, getAppletContext, getBG, getBGImage, getBGParent, getBGParentImage, getBorderDepth, getBorderRectangle, getBorderType, getColor, getColor, getFont, getFont, getFont, getInnerInsets, getInnerRectangle, getMetrics, getMinimumSize, getMode, getPosition, getPreferredSize, getRectangle, getSelectedObjects, getTab, getTopComponent, isBulk, isEffect, isFill, isHref, isMSJVM, isNS4JVM, isRaised, isSunken, isUline, italic, keyPressed, keyReleased, keyTyped, larger, loadImage, loadImageFromArchive, loadImageFromStream, loadImageFromURL, makeBim, measureCaption, measureString, monospaced, mouseDragged, mouseEntered, mouseReleased, notifyActionListeners, notifyItemListeners, paintBackground, paintBackground, paintBim, paintBorder, plain, refresh, refresh, refreshAll, removeActionListener, removeItemListener, sansserif, serif, setBackground, setBG, setBGIfNull, setBorderDepth, setBorderType, setBorderType, setBounds, setEnabled, setFont, setFont, setForeground, setInnerInsets, setInsets, setVisible, smaller, tile, tile, update, waitForImage
 
Methods inherited from class java.awt.Panel
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, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, 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, 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, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, 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
 

Field Detail

helpText

protected java.lang.String helpText
helptext for this panel null for none


nullLayout

protected NullLayout nullLayout
nulllayout is used when minimized


miniMizable

protected boolean miniMizable
can this panel be minimized ?

Constructor Detail

BorderPanel

public BorderPanel()
The default contructor creates a regualr panel w/o decoration.


BorderPanel

public BorderPanel(int borderType)
Create a panel with the specified border type.

Parameters:
borderType - border type.

BorderPanel

public BorderPanel(java.lang.String title)
Create a panel with the specified title string. Bordertype BULK is used per default

Parameters:
title - Title.

BorderPanel

public BorderPanel(int borderType,
                   java.lang.String title)
Create a panel with the specified border type and title string.

Parameters:
borderType - border type.
title - Title.
Method Detail

setHelptext

public void setHelptext(java.lang.String helpText)
Set the help text for this panel

Parameters:
helpText - help text.

getHelptext

public java.lang.String getHelptext()
Get this panels help text


setMinimizable

public void setMinimizable(boolean miniMizable)
Set the miniMizable property for this panel

Parameters:
miniMizable - can this panel be minimized?

minimizable

public boolean minimizable()
Get this panels miniMizable property


setMini

public void setMini(boolean m)
Force this panel to a specific state

Parameters:
m - minimized=true maximized=false

mini

public boolean mini()
Get this panels state


setLayout

public void setLayout(java.awt.LayoutManager l)
Overwite setLayout() to be able to save old layout

Overrides:
setLayout in class java.awt.Container

measure

public java.awt.Dimension measure()
calculate required sizes for this panel

Overrides:
measure in class Caption

measureCaption

public java.awt.Dimension measureCaption()
calculate Caption (Title) size including a fix one pixel border left/right two pixel top/bottom

Overrides:
measureCaption in class Caption

measureIcon

public java.awt.Dimension measureIcon()
calculate Icon size including a fix one pixel border left/right two pixel top/bottom

Overrides:
measureIcon in class Caption

measureTitleHeight

public int measureTitleHeight()
calculate titlehight, if any


getInsets

public java.awt.Insets getInsets()
get Insets for this panel. insets + innerInsets + titlehight

Overrides:
getInsets in class Awt

titleVisible

public boolean titleVisible()
is title currently visible ?


iconVisible

public boolean iconVisible()
is icon currently visible ?


getTitleRectangle

protected java.awt.Rectangle getTitleRectangle()
calculate title position & size


getIconRectangle

protected java.awt.Rectangle getIconRectangle()
calculate icon position & size


paint

public void paint(java.awt.Graphics g)
Overwirte paint to do the actual artwork ;-)

Overrides:
paint in class Caption
Parameters:
g - Graphics object to use

paintCaption

public void paintCaption(java.awt.Graphics g,
                         int x,
                         int y,
                         int w,
                         int h)
Paint the Caption (Title)

Overrides:
paintCaption in class Caption
Parameters:
g - Graphics object to use
x - x-position of describing rect
y - y-position of describing rect
w - width of describing rect
h - height of describing rect

paintIcon

public void paintIcon(java.awt.Graphics g,
                      int x,
                      int y,
                      int w,
                      int h)
Paint the Icon

Overrides:
paintIcon in class Caption
Parameters:
g - Graphics object to use
x - x-position of describing rect
y - y-position of describing rect
w - width of describing rect
h - height of describing rect

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener

Specified by:
mouseExited in interface java.awt.event.MouseListener
Overrides:
mouseExited in class Caption

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Overrides:
mouseMoved in class Caption

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
implement java.awt.event.MouseListener

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Overrides:
mouseClicked in class Awt

[.home.]
[.hacks.]
[.java.]