com.sygem.swing.jslidemenu
Class SlideMenuPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycom.sygem.swing.jslidemenu.SlideMenuPanel
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class SlideMenuPanel
extends javax.swing.JComponent

This class represents a single panel, containing one or more components.

Within each panel, you can customize the rendering of the background, the font used by the header, and the foreground and background colours as well.

ActionListeners can be registered against the header button - use these to be informed of when a panel is selected. NOTE: events will be generated every time the header is clicked on, even if the panel is already open. To determine if a panel is open, use the isOpen() method.

If the size of the items in the panel is larger than the space available, a scroll-bar will be displayed to let users get at all items.

Title: JSlideMenu
Description: A Swing component allowing animated panels containing any components
Copyright: Copyright (c) 2004
Company: SyGem Software

Version:
1.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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
SlideMenuPanel(java.lang.String title)
          Standard constructor.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Registers an ActionListener against the panel.
 BackgroundRenderer getBackgroundRenderer()
          Returns the renderer currently being used for this panel.
 javax.swing.JComponent getContentPane()
          Returns the ContentPane of this panel.
 boolean isOpen()
          Returns true if this category is currently open.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes an ActionListener from this panel.
 void setBackgroundColor(java.awt.Color c)
          Sets the background color of the panel header button.
 void setBackgroundRenderer(BackgroundRenderer backgroundRenderer)
          Registers a new renderer for this panel.
 void setFont(java.awt.Font font)
          Sets the font used on the panel header button.
 void setTextColor(java.awt.Color c)
          Sets the foreground (text) color of the panel header button.
 
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, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SlideMenuPanel

public SlideMenuPanel(java.lang.String title)
Standard constructor. The title string will be displayed on the header button.

Parameters:
title - String
Method Detail

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)

Registers an ActionListener against the panel.

ActionEvents are generated whenever the panel header is clicked on - even if the panel is currently on show.

The getSource() method of the ActionEvent will return the SlideMenuPanel.

Parameters:
listener - The ActionListener to add

getBackgroundRenderer

public BackgroundRenderer getBackgroundRenderer()
Returns the renderer currently being used for this panel. If no renderer has been assigned, this method will return null.

Returns:
The current BackgroundRenderer

getContentPane

public javax.swing.JComponent getContentPane()
Returns the ContentPane of this panel. You should only add components to this content pane.

Returns:
The pane to which components should be added

isOpen

public boolean isOpen()
Returns true if this category is currently open.

Returns:
True if this category is currently open

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes an ActionListener from this panel.

Parameters:
listener - The ActionListener to remove

setBackgroundColor

public void setBackgroundColor(java.awt.Color c)
Sets the background color of the panel header button.

Parameters:
c - The background color of the header button

setBackgroundRenderer

public void setBackgroundRenderer(BackgroundRenderer backgroundRenderer)
Registers a new renderer for this panel.

Parameters:
backgroundRenderer - The backgroundRenderer to use as the renderer for this panel.

setFont

public void setFont(java.awt.Font font)
Sets the font used on the panel header button.

Parameters:
font - The Font that will be used on the header button

setTextColor

public void setTextColor(java.awt.Color c)
Sets the foreground (text) color of the panel header button.

Parameters:
c - The text color on the header button


Copyright © 2004 SyGem Software. All Rights Reserved.