RADi Runtime Library v1.2.1

de.muntjak.radiloader
Class FolderPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by de.muntjak.radiloader.FolderPanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class FolderPanel
extends JPanel

A FolderPanel is a RADi-special component: a panel with a title where one can hide or show the content by clicking in the title.

A FolderPanel consists of a title button and a content panel, whose layout manager is NewLayout.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
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
FolderPanel()
          Constructs a new FolderPanel whose closed title is "Show content" and whose opened title is "Hide content".
 
Method Summary
 void add(Component comp, Object constraints)
          Adds a component to the content panel.
 String getClosedTitle()
          Returns the title displayed if the panel is closed.
 Border getContentBorder()
          Returns the border of the content panel.
 Font getFont()
          Returns the title button's font.
 LayoutManager getLayout()
          Returns the content panel's layout manager, NewLayout by default.
 Dimension getMinimumSize()
          Returns the value from getPreferredSize().
 String getOpenTitle()
          Returns the title displayed if the panel is opened.
 Dimension getPreferredSize()
          Calculates and returns the preferred size dependent on the settings for retainWidth and retainHeight.
 boolean isClosed()
          Returns the panel's closed state.
 boolean isRetainHeight()
          Returns the retainHeight property value.
 boolean isRetainWidth()
          Returns the retainWidth property value.
 void remove(Component comp)
          Removes the specified component from the content panel.
 void removeAll()
          Removes all components from the content panel.
 void setClosed(boolean closed)
          Programmatically show or hide the content.
 void setClosedTitle(String s)
          Sets the title string to be displayed if the panel is closed.
 void setContentBorder(Border border)
          Sets the content panel's border.
 void setFont(Font f)
          Sets the font of both the title button and the content panel.
 void setForeground(Color fg)
          Sets the foregound color of both the title button and the content panel.
 void setLayout(LayoutManager layout)
          Sets the content panel's layout manager.
 void setOpenTitle(String s)
          Sets the title string to be displayed if the panel is opened.
 void setRetainHeight(boolean b)
          Sets the retainHeight property.
 void setRetainWidth(boolean b)
          Sets the retainWidth property.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, 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, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, 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
 

Constructor Detail

FolderPanel

public FolderPanel()
Constructs a new FolderPanel whose closed title is "Show content" and whose opened title is "Hide content". The panel is initially opened.

Method Detail

add

public void add(Component comp,
                Object constraints)
Adds a component to the content panel.

Overrides:
add in class Container
Parameters:
constraints - an NLConstraint object you get from one of the static NLConstraint factory methods.
See Also:
NLConstraint

getClosedTitle

public String getClosedTitle()
Returns the title displayed if the panel is closed. The default is "Show content".

Returns:
the title displayed if the panel is closed

getContentBorder

public Border getContentBorder()
Returns the border of the content panel.

Returns:
the content panel's border

getFont

public Font getFont()
Returns the title button's font.

Specified by:
getFont in interface MenuContainer
Overrides:
getFont in class Component

getLayout

public LayoutManager getLayout()
Returns the content panel's layout manager, NewLayout by default.

Overrides:
getLayout in class Container

getMinimumSize

public Dimension getMinimumSize()
Returns the value from getPreferredSize().

Overrides:
getMinimumSize in class JComponent

getOpenTitle

public String getOpenTitle()
Returns the title displayed if the panel is opened. The default is "Hide content".

Returns:
the title displayed if the panel is opened

getPreferredSize

public Dimension getPreferredSize()
Calculates and returns the preferred size dependent on the settings for retainWidth and retainHeight.

Overrides:
getPreferredSize in class JComponent
See Also:
setRetainWidth(boolean), setRetainHeight(boolean)

isClosed

public boolean isClosed()
Returns the panel's closed state.

Returns:
the panel's closed state

isRetainHeight

public boolean isRetainHeight()
Returns the retainHeight property value. If true, the preferred size of the folder panel will not change as the closed state changes, if false, the preferred size of the folder panel will be calculated differently dependent on its closed state.

Returns:
the retainHeight property value

isRetainWidth

public boolean isRetainWidth()
Returns the retainWidth property value. If true, the preferred size of the folder panel will not change as the closed state changes, if false, the preferred size of the folder panel will be calculated differently dependent on its closed state.

Returns:
the retainWidth property value

remove

public void remove(Component comp)
Removes the specified component from the content panel.

Overrides:
remove in class Container

removeAll

public void removeAll()
Removes all components from the content panel.

Overrides:
removeAll in class Container

setClosed

public void setClosed(boolean closed)
Programmatically show or hide the content. This is a bound property.

Parameters:
closed - the new closed state

setClosedTitle

public void setClosedTitle(String s)
Sets the title string to be displayed if the panel is closed.

Parameters:
s - the string to be displayed if the panel is closed.

setContentBorder

public void setContentBorder(Border border)
Sets the content panel's border. By default the content panel has no border.

Parameters:
border - some border or null

setFont

public void setFont(Font f)
Sets the font of both the title button and the content panel.

Overrides:
setFont in class JComponent

setForeground

public void setForeground(Color fg)
Sets the foregound color of both the title button and the content panel.

Overrides:
setForeground in class JComponent

setLayout

public void setLayout(LayoutManager layout)
Sets the content panel's layout manager.

Overrides:
setLayout in class Container

setOpenTitle

public void setOpenTitle(String s)
Sets the title string to be displayed if the panel is opened.

Parameters:
s - the string to be displayed if the panel is opened.

setRetainHeight

public void setRetainHeight(boolean b)
Sets the retainHeight property. The default is true.

Parameters:
b - if true, the preferred size of the folder panel will not change as the closed state changes, if false, the preferred size of the folder panel will change as its closed state changes.

setRetainWidth

public void setRetainWidth(boolean b)
Sets the retainWidth property. The default is true.

Parameters:
b - if true, the preferred size of the folder panel will not change as the closed state changes, if false, the preferred size of the folder panel will change as its closed state changes.

RADi Runtime Library v1.2.1