org.japura.gui
Class Decorator

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLayeredPane
                  extended by org.japura.gui.Decorator
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class Decorator
extends javax.swing.JLayeredPane

Copyright (C) 2008-2011 Carlos Eduardo Leite de Andrade

This library is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see www.gnu.org/licenses/

For more information, contact: www.japura.org

Author:
Carlos Eduardo Leite de Andrade
See Also:
Serialized Form

Nested Class Summary
static class Decorator.Direction
           
 
Nested classes/interfaces inherited from class javax.swing.JLayeredPane
javax.swing.JLayeredPane.AccessibleJLayeredPane
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static Decorator.Direction HORIZONTAL
           
static Decorator.Direction VERTICAL
           
 
Fields inherited from class javax.swing.JLayeredPane
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER
 
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
Decorator(java.awt.Component component)
           
Decorator(java.awt.Component component, Anchor anchor)
           
Decorator(java.awt.Component component, Anchor anchor, Decorator.Direction direction)
           
 
Method Summary
 java.awt.Component add(java.awt.Component comp)
           
 java.awt.Component add(java.awt.Component comp, int index)
           
 void add(java.awt.Component comp, java.lang.Object constraints)
           
 void add(java.awt.Component comp, java.lang.Object constraints, int index)
           
 java.awt.Component add(java.lang.String name, java.awt.Component comp)
           
 java.lang.String addDecoration(java.awt.Component component)
           
 java.lang.String addDecoration(javax.swing.ImageIcon image)
           
 void addDecoration(java.lang.String id, java.awt.Component component)
           
 void addDecoration(java.lang.String id, javax.swing.ImageIcon image)
           
 void doLayout()
           
 Anchor getAnchor()
           
 java.awt.Component getComponent()
           
 Decorator.Direction getDirection()
           
 java.awt.Insets getMargin()
           
 java.awt.Dimension getMinimumSize()
           
 java.awt.Dimension getPreferredSize()
           
 void remove(java.awt.Component comp)
           
 void removeAll()
           
 void removeDecoration(java.lang.String id)
           
 void removeDecorations()
           
 void setDecorationsVisible(boolean visibled)
           
 void setDecorationVisible(java.lang.String id, boolean visibled)
           
 void setMargin(java.awt.Insets margin)
           
 
Methods inherited from class javax.swing.JLayeredPane
addImpl, getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, paramString, putLayer, remove, setLayer, setLayer, setPosition
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, 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

VERTICAL

public static final Decorator.Direction VERTICAL

HORIZONTAL

public static final Decorator.Direction HORIZONTAL
Constructor Detail

Decorator

public Decorator(java.awt.Component component)

Decorator

public Decorator(java.awt.Component component,
                 Anchor anchor)

Decorator

public Decorator(java.awt.Component component,
                 Anchor anchor,
                 Decorator.Direction direction)
Method Detail

getDirection

public final Decorator.Direction getDirection()

setDecorationVisible

public final void setDecorationVisible(java.lang.String id,
                                       boolean visibled)

setDecorationsVisible

public final void setDecorationsVisible(boolean visibled)

addDecoration

public final void addDecoration(java.lang.String id,
                                javax.swing.ImageIcon image)

addDecoration

public final java.lang.String addDecoration(javax.swing.ImageIcon image)

addDecoration

public final void addDecoration(java.lang.String id,
                                java.awt.Component component)

addDecoration

public final java.lang.String addDecoration(java.awt.Component component)

removeDecoration

public final void removeDecoration(java.lang.String id)

removeDecorations

public final void removeDecorations()

getComponent

public java.awt.Component getComponent()

getMargin

public java.awt.Insets getMargin()

getAnchor

public Anchor getAnchor()

setMargin

public final void setMargin(java.awt.Insets margin)

getMinimumSize

public java.awt.Dimension getMinimumSize()
Overrides:
getMinimumSize in class javax.swing.JComponent

getPreferredSize

public final java.awt.Dimension getPreferredSize()
Overrides:
getPreferredSize in class javax.swing.JComponent

add

public final java.awt.Component add(java.awt.Component comp,
                                    int index)
Overrides:
add in class java.awt.Container

add

public final void add(java.awt.Component comp,
                      java.lang.Object constraints,
                      int index)
Overrides:
add in class java.awt.Container

add

public final void add(java.awt.Component comp,
                      java.lang.Object constraints)
Overrides:
add in class java.awt.Container

add

public final java.awt.Component add(java.awt.Component comp)
Overrides:
add in class java.awt.Container

add

public final java.awt.Component add(java.lang.String name,
                                    java.awt.Component comp)
Overrides:
add in class java.awt.Container

remove

public final void remove(java.awt.Component comp)
Overrides:
remove in class java.awt.Container

removeAll

public final void removeAll()
Overrides:
removeAll in class javax.swing.JLayeredPane

doLayout

public final void doLayout()
Overrides:
doLayout in class java.awt.Container