|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JPanel
|
+--edu.mssm.crover.beans.LooseTabbedPane
A LooseTabbedPane is a TabbedPane whose elements can be detached to be contained in independant windows, or in internal frames of a desktopPane inside the tabbedpane. A detached element can be re-integrated in the tabbedPane, back and forth, at the user convenience. This GUI provides for the comfort of a TabbedPane, that is the elements share the same space on the desktop, and so the useful space is best used compared to independant windows. But the LooseTabbedPane also allows each tab to be extracted to that the user can work with two, or more, of the tabs at the same time. LooseTabbedPane also supports for desk tabs. These tabs contain a desktop that can contain internalFrames. Each tab of the LooseTabbedPane (but desk tabs) can be moved to an internal frame of a given desk. LooseTabbedPane now provides a way to determine which tab element has the focus. The events are fired only when the focus is actually transferred from a tab element to another. This works without regard of the appearance of the tab. For instance, when a tab is detached, the creation of the independant window is not considered a transfer of tab-focus because it is still the same tab that has the tab-focus. The tab-focus events are also fired when the JInternalFrame that contains a tab is activated (and this tab did not previously have the tab-focus).
For an example and test of this GUI element, run main().,
Serialized Form| Nested Class Summary | |
protected class |
LooseTabbedPane.AttachedFrame
AttachedFrame class contain the content of the tab in the detached state. |
protected class |
LooseTabbedPane.DesktopElement
|
protected class |
LooseTabbedPane.FlyingElement
FlyingElements are added to the TabbedPane in place of a component. |
| Field Summary | |
boolean |
buttonsInTabs
Toggle the display of interaction buttons immediately following the tab content. |
static int |
EMBED_STATE
attached state: the content is rendered in the tab. |
java.util.Vector |
focus_listeners
|
static int |
INDEPENDANT_STATE
detached state: the content is rendered in an independant window. |
| 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 | |
LooseTabbedPane()
|
|
| Method Summary | |
void |
addFocusListener(TabFocusListener fl)
|
void |
attach()
Attach the content associated to this tab inside the tabbedPane. |
void |
attachedFrameFocusChange(java.lang.String new_tab_title)
|
void |
cleanDesk(java.lang.String title)
Clean a desk-tab. |
void |
detach()
Detach the content associated to this tab from the tabbedPane. |
void |
fireFocusEvent(int type,
java.lang.String tab_title)
Dispacth this event to all the registered listeners. |
LooseTabbedPane.DesktopElement |
getDesk(java.lang.String title)
Returns the DesktopElement contained in this tab. |
protected LooseTabbedPane.FlyingElement |
getSelectedNoDesk(java.lang.String action_description)
Returns a the selected FlyingElement. |
javax.swing.JTabbedPane |
getTabbedPane()
Returns the JTabbedPane. |
void |
insertDesk(java.lang.String title,
javax.swing.Icon icon,
java.lang.String tip,
int position)
Inserts a new virtual desk in this LooseTabbedPane. |
void |
insertTab(java.lang.String title,
javax.swing.Icon icon,
java.awt.Component comp,
java.lang.String tip,
int position,
int state)
Inserts comp in the LooseTabbedPane. |
static void |
main(java.lang.String[] args)
Builds a full example of use. |
protected static java.awt.Component |
makeTextPanel(java.lang.String text)
|
void |
move(java.lang.String desk_title)
Moves the content associated to this tab from the tabbedPane. |
void |
removeDesk(java.lang.String title)
Remove a desk-tab. |
void |
removeFocusListener(TabFocusListener fl)
|
void |
selectNext()
Selects the next tab of this tabbedPane. |
void |
selectPrevious()
Selects the previous tab of this tabbedPane. |
void |
stateChanged(javax.swing.event.ChangeEvent event)
Examine the JTabbedPane events and fire the TabFocusEvent when needed. |
| Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, 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, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, 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, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, 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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int EMBED_STATE
public static final int INDEPENDANT_STATE
public java.util.Vector focus_listeners
public boolean buttonsInTabs
| Constructor Detail |
public LooseTabbedPane()
| Method Detail |
public javax.swing.JTabbedPane getTabbedPane()
public void selectNext()
public void selectPrevious()
public void attach()
public void detach()
protected LooseTabbedPane.FlyingElement getSelectedNoDesk(java.lang.String action_description)
public void move(java.lang.String desk_title)
public void insertTab(java.lang.String title,
javax.swing.Icon icon,
java.awt.Component comp,
java.lang.String tip,
int position,
int state)
title - of this new Tab.comp - The component to add for the new Tab.position - of insertion. 0 is first.tip - The tip text for this tab.state - The state of this tab: EMBED_STATE (attached) or
INDEPENDANT_STATE (detached, own window).icon - graphical representation of the type of this tab
public void insertDesk(java.lang.String title,
javax.swing.Icon icon,
java.lang.String tip,
int position)
title - of this new desk-tab.position - of insertion. 0 is first.tip - The tip text for this tab.public void cleanDesk(java.lang.String title)
public void removeDesk(java.lang.String title)
public void stateChanged(javax.swing.event.ChangeEvent event)
stateChanged in interface javax.swing.event.ChangeListenerpublic void attachedFrameFocusChange(java.lang.String new_tab_title)
public void fireFocusEvent(int type,
java.lang.String tab_title)
public LooseTabbedPane.DesktopElement getDesk(java.lang.String title)
public void addFocusListener(TabFocusListener fl)
public void removeFocusListener(TabFocusListener fl)
public static void main(java.lang.String[] args)
protected static java.awt.Component makeTextPanel(java.lang.String text)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||