org.zaval.awt.gdp
Class JDgnContainer


java.lang.Object

  |

  +--java.awt.Component

        |

        +--java.awt.Container

              |

              +--javax.swing.JComponent

                    |

                    +--javax.swing.JPanel

                          |

                          +--org.zaval.awt.gdp.JDgnContainer

All Implemented Interfaces:
javax.accessibility.Accessible, DgnComponent, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class JDgnContainer
extends javax.swing.JPanel
implements DgnComponent

This is Java Swing panel that can be used as a designer container for a Swing component. The panel paints special border and implements CursorInfo interface to define resize cursor, move cursor types for different part of the border area. The class implements the layout manager interface that layouts the specified child component in the centre of the container with the specified gap (the gap defines left, right, top and bottom indents).

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
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.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
JDgnContainer()
           Constructs a new designer container.
JDgnContainer(java.awt.Component c)
           Constructs a new designer container with the specified child component.
 
Method Summary
 int getGap()
           Gets the gap that actually is used as insets.
 java.awt.Insets getInsets()
           Determines the insets of this container, which indicate the size of the container's border.
 java.awt.Color getRectangleColor()
           Gets the designer border color.
 void paint(java.awt.Graphics g)
           Paints this component.
 void setGap(int g)
           Sets the specified gap that actually defines the container insets
 void setRectangleColor(java.awt.Color c)
           Sets the specified color for the designer border.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, 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, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JDgnContainer


public JDgnContainer()
Constructs a new designer container.

JDgnContainer


public JDgnContainer(java.awt.Component c)
Constructs a new designer container with the specified child component.
Parameters:
c - the specified child component.
Method Detail

getGap


public int getGap()
Gets the gap that actually is used as insets. The gap defines left, top, bottom and right indents.
Returns:
a gap.

setGap


public void setGap(int g)
Sets the specified gap that actually defines the container insets
Parameters:
g - the specified gap.

getInsets


public java.awt.Insets getInsets()
Determines the insets of this container, which indicate the size of the container's border. The implementation returns the gap as the insets top, left, bottom and right fields value.
Overrides:
getInsets in class javax.swing.JComponent
Returns:
the insets of this container.

paint


public void paint(java.awt.Graphics g)
Paints this component. This method is called when the contents of the component should be painted in response to the component first being shown or damage needing repair. The method is overrided to paint the design border.
Overrides:
paint in class javax.swing.JComponent
Parameters:
g - the graphics context to use for painting.

setRectangleColor


public void setRectangleColor(java.awt.Color c)
Sets the specified color for the designer border.
Parameters:
c - the specified color.

getRectangleColor


public java.awt.Color getRectangleColor()
Gets the designer border color.
Returns:
a designer border color.


Copyright © Zaval Creative Engineering Group, 2000-2005
http://www.zaval.org