|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.formaria.swing.Panel
org.formaria.swing.RollupBar
public class RollupBar
An outlook style roll-up bar. The methods are modelled on the JTabbedPane
Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from formaria.
$Revision: 1.15 $
| Nested Class Summary | |
|---|---|
class |
RollupBar.AccordianLayout
|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| 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 | |
|---|---|
protected boolean |
allExpandable
|
protected boolean |
antiAlias
|
protected java.lang.String |
buttonClassName
|
protected javax.swing.ButtonGroup |
buttonGroup
|
protected int |
buttonHeight
|
protected Project |
currentProject
|
protected int |
lastSelIdx
|
protected int |
maxPanelSize
|
protected int |
minPanelSize
|
protected int |
selIdx
|
protected javax.swing.JToggleButton |
topBtn
|
| Fields inherited from class org.formaria.swing.Panel |
|---|
arc, BORDER_BEVEL, BORDER_FLAT, BORDER_NONE, drawBorder, padding, translucent, usesLaf |
| 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 | |
|---|---|
RollupBar()
Create a new button panel |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Invoked when a mouse button has been pressed on a component. |
java.awt.Component |
add(java.awt.Component comp)
Add a new button. |
void |
add(java.awt.Component comp,
java.lang.Object constraints)
Add a new button. |
java.awt.Color |
getBackgroundAt(int index)
Get a button's background color |
javax.swing.JToggleButton |
getButton(int index)
Get the button component at the specified index, skips over the expanded panel |
int |
getButtonCount()
Get the number of buttons |
java.awt.Component |
getContentComponent(int idx)
Get a nested component |
int |
getContentComponentCount()
Get the count of the nested components |
java.awt.Color |
getForegroundAt(int index)
Get a button's foreground color |
java.awt.Dimension |
getMaximumSize()
Get the minimum layout size of this component |
int |
getMaxSharedPanels()
Get the maximum number of shared panels |
java.awt.Dimension |
getMinimumSize()
Get the minimum layout size of this component |
java.awt.Dimension |
getPreferredSize()
Get the preferred layout size of this component |
int |
getSelectedIndex()
Get the index of the selected button |
java.lang.String |
getTitleAt(int index)
Get the title of the button at the specified index |
protected boolean |
isAllExpandable()
Does this component allow all of its panel to be visible at once? |
boolean |
isOverlapButtons()
Do the buttons overlap for the adjacent panels when the content is hidden? |
void |
setAlignment(int align)
Set one or more attributes of the component. |
protected void |
setAllExpandable(boolean state)
Set this component to allow all of its panel to be visible at once. |
void |
setAntiAlias(boolean value)
Set the anti-alias property |
void |
setAntiAlias(java.lang.String state)
Set the AntiAliasing state. |
void |
setBackgroundAt(int index,
java.awt.Color clr)
Set the button background color |
void |
setButtonHeight(int value)
Set teh height of the rollup buttons |
void |
setDisabledImageName(java.lang.String imgName)
Sets the disabled image to display based on the image name. |
void |
setDragEnabled(boolean state)
Enabled drag and drop operations |
void |
setForegroundAt(int index,
java.awt.Color clr)
Set the foreground color |
void |
setIconName(java.lang.String value)
|
void |
setImageName(java.lang.String imgName)
Sets the image to display based on the image name. |
void |
setMaxSharedPanels(int maxPanels)
Set the maximum number of shared panels (the number of panels that can occupy a single divider) |
void |
setOverlapButtons(boolean state)
Set the buttons to overlap for the adjacent panels when the content is hidden |
void |
setPainter(java.lang.String value)
Set the painter for the buttons |
void |
setPressedImageName(java.lang.String imgName)
Sets the pressed image to display based on the image name. |
void |
setRolloverImageName(java.lang.String imgName)
Sets the rollover image to display based on the image name. |
void |
setSelectedIndex(int index)
Select a button |
void |
setSlideImages(boolean value)
Slide images of the content or just collapse |
void |
setState(java.lang.String[] panelStates)
|
void |
setStyle(java.lang.String value)
Set the style for the buttons |
void |
setTitleAt(int index,
java.lang.String str)
Set a button's title |
void |
setVertical(boolean vertical)
Set the layout as vertical (one button above another) |
| Methods inherited from class org.formaria.swing.Panel |
|---|
addNotify, getArc, getDrawBorder, getInsets, getPainter, getUsesLaf, paintComponent, restoreState, saveState, setArc, setBlend, setBorder, setBounds, setDrawBorder, setPad, setSwingBorder, setTitle, setTitlePos, setTitlePosition, setTitleStyle, setToolTip, setTranslucent, setUsesLaf, update |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, 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, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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 |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, remove, remove, removeAll, 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, 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 |
|---|
protected int selIdx
protected int lastSelIdx
protected javax.swing.JToggleButton topBtn
protected javax.swing.ButtonGroup buttonGroup
protected Project currentProject
protected int buttonHeight
protected int minPanelSize
protected int maxPanelSize
protected boolean antiAlias
protected java.lang.String buttonClassName
protected boolean allExpandable
| Constructor Detail |
|---|
public RollupBar()
| Method Detail |
|---|
public java.awt.Component add(java.awt.Component comp)
add in class java.awt.Containercomp - the new button component
public void add(java.awt.Component comp,
java.lang.Object constraints)
add in class java.awt.Containercomp - the new button componentpublic javax.swing.JToggleButton getButton(int index)
index - the button index
public java.awt.Color getBackgroundAt(int index)
index - the button index
public java.awt.Color getForegroundAt(int index)
index - the button index
public int getButtonCount()
public int getSelectedIndex()
public java.lang.String getTitleAt(int index)
index - the button index
public void setBackgroundAt(int index,
java.awt.Color clr)
index - the button indexclr - the new colr
public void setForegroundAt(int index,
java.awt.Color clr)
index - the button indexclr - the new colorpublic void setSelectedIndex(int index)
index - the button index
public void setTitleAt(int index,
java.lang.String str)
index - the button indexstr - the text for the buttonpublic void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenere - the eventpublic void setSlideImages(boolean value)
value - true to slide an image of teh contentpublic void setDragEnabled(boolean state)
state - true to enablepublic void setButtonHeight(int value)
value - the height in pixelspublic void setAntiAlias(boolean value)
value - thew new valuepublic void setStyle(java.lang.String value)
value - the new stylepublic void setPainter(java.lang.String value)
setPainter in class Panelvalue - the new painter classpublic void setIconName(java.lang.String value)
value - public void setAlignment(int align)
align - 1 to right align the text, 0 for left alignment and 2 for
centered textpublic void setImageName(java.lang.String imgName)
setImageName in class PanelimgName - the imagepublic void setPressedImageName(java.lang.String imgName)
imgName - the imagepublic void setRolloverImageName(java.lang.String imgName)
imgName - the imagepublic void setDisabledImageName(java.lang.String imgName)
imgName - the imagepublic void setAntiAlias(java.lang.String state)
"true" - to anti alias the textprotected boolean isAllExpandable()
protected void setAllExpandable(boolean state)
allExpandable - public int getContentComponentCount()
getContentComponentCount in interface CompositeComponentpublic java.awt.Component getContentComponent(int idx)
getContentComponent in interface CompositeComponentthe - index of the nested component
public void setVertical(boolean vertical)
isVertical - public boolean isOverlapButtons()
public void setOverlapButtons(boolean state)
state - the new flag valuepublic int getMaxSharedPanels()
public void setMaxSharedPanels(int maxPanels)
maxPanels - the new max panel countpublic void setState(java.lang.String[] panelStates)
public java.awt.Dimension getPreferredSize()
getPreferredSize in class Panelpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentpublic java.awt.Dimension getMaximumSize()
getMaximumSize in class javax.swing.JComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||