Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## madkit.MadChat.CloseAndMaxTabbedPane
Class CloseAndMaxTabbedPane

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JTabbedPane
                      madkit.MadChat.CloseAndMaxTabbedPane.CloseAndMaxTabbedPane

All Implemented Interfaces:
  java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.SwingConstants

    public class CloseAndMaxTabbedPane

extends javax.swing.JTabbedPane

A JTabbedPane with some added UI functionalities. A close and max/detach icons are added to every tab, typically to let the user close or detach the tab by clicking on these icons.

Version:
  1.1 06/07/04
Author:
  David Bismut, davidou@mageos.com
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class javax.swing.JTabbedPane
`javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener`

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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy`

Field Summary

Fields inherited from class javax.swing.JTabbedPane
`changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT`

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 javax.swing.SwingConstants
`BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST`

Fields inherited from interface java.awt.image.ImageObserver
`ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH`

Constructor Summary
`CloseAndMaxTabbedPane(boolean enhancedUI)` Creates the `CloseAndMaxTabbedPane` with an enhanced UI if `enhancedUI` parameter is set to `true`.

Method Summary
`void` | `addCloseListener(CloseListener l)` Adds a `CloseListener` to the tabbedPane.
`void` | `addDoubleClickListener(DoubleClickListener l)` Adds a `DoubleClickListener` to the tabbedPane.
`void` | `addMaxListener(MaxListener l)` Adds a `MaxListener` to the tabbedPane.
`void` | `addPopupOutsideListener(PopupOutsideListener l)` Adds a `PopupOutsideListener` to the tabbedPane.
`void` | `detachTab(int index)` Detaches the `index` tab in a seperate frame.
`void` | `fireCloseTabEvent(java.awt.event.MouseEvent e, int overTabIndex)` Sends a `MouseEvent`, whose source is this tabbedpane, to every `CloseListener`.
`void` | `fireDoubleClickTabEvent(java.awt.event.MouseEvent e, int overTabIndex)` Sends a `MouseEvent`, whose source is this tabbedpane, to every `DoubleClickListener`.
`void` | `fireMaxTabEvent(java.awt.event.MouseEvent e, int overTabIndex)` Sends a `MouseEvent`, whose source is this tabbedpane, to every `MaxListener`.
`void` | `firePopupOutsideTabEvent(java.awt.event.MouseEvent e)` Sends a `MouseEvent`, whose source is this tabbedpane, to every `PopupOutsideListener`.
`int` | `getOverTabIndex()` Returns the index of the last tab on which the mouse did an action.
`boolean` | `isCloseEnabled()` Returns `true` if the close icon is enabled.
`boolean` | `isMaxEnabled()` Returns `true` if the max/detach icon is enabled.
`void` | `removeCloseListener(CloseListener l)` Removes a `CloseListener` from this tabbedPane.
`void` | `removeDoubleClickListener(DoubleClickListener l)` Removes a `DoubleClickListener` from this tabbedPane.
`void` | `removeMaxListener(MaxListener l)` Removes a `MaxListener` from this tabbedPane.
`void` | `removePopupOutsideListener(PopupOutsideListener l)` Removes a `PopupOutsideListener` from this tabbedPane.
`void` | `setCloseIcon(boolean b)` Sets whether the tabbedPane should have a close icon or not.
`void` | `setMaxIcon(boolean b)` Sets whether the tabbedPane should have a max/detach icon or not.
`void` | `setTabLayoutPolicy(int tabLayoutPolicy)` Override JTabbedPane method.
`void` | `setTabPlacement(int tabPlacement)` Override JTabbedPane method.
`void` | `setUI(javax.swing.plaf.TabbedPaneUI ui)` Override JTabbedPane method.

Methods inherited from class javax.swing.JTabbedPane
`add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, insertTab, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTitleAt, setToolTipTextAt, 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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, 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, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

Methods inherited from class java.awt.Container
`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, 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`

Constructor Detail

### CloseAndMaxTabbedPane

    public CloseAndMaxTabbedPane(boolean enhancedUI)

  Creates the `CloseAndMaxTabbedPane` with an enhanced UI if `enhancedUI` parameter is set to `true`.

  Parameters:
    `enhancedUI` - whether the tabbedPane should use an enhanced UI

Method Detail

### getOverTabIndex

    public int getOverTabIndex()

  Returns the index of the last tab on which the mouse did an action.

### isCloseEnabled

    public boolean isCloseEnabled()

  Returns `true` if the close icon is enabled.

### isMaxEnabled

    public boolean isMaxEnabled()

  Returns `true` if the max/detach icon is enabled.

### setTabLayoutPolicy

    public void setTabLayoutPolicy(int tabLayoutPolicy)

  Override JTabbedPane method. Does nothing.

  Overrides:
    `setTabLayoutPolicy` in class `javax.swing.JTabbedPane`

### setTabPlacement

    public void setTabPlacement(int tabPlacement)

  Override JTabbedPane method. Does nothing.

  Overrides:
    `setTabPlacement` in class `javax.swing.JTabbedPane`

### setUI

    public void setUI(javax.swing.plaf.TabbedPaneUI ui)

  Override JTabbedPane method. Does nothing.

  Overrides:
    `setUI` in class `javax.swing.JTabbedPane`

### setCloseIcon

    public void setCloseIcon(boolean b)

  Sets whether the tabbedPane should have a close icon or not.

  Parameters:
    `b` - whether the tabbedPane should have a close icon or not

### setMaxIcon

    public void setMaxIcon(boolean b)

  Sets whether the tabbedPane should have a max/detach icon or not.

  Parameters:
    `b` - whether the tabbedPane should have a max/detach icon or not

### detachTab

    public void detachTab(int index)

  Detaches the `index` tab in a seperate frame. When the frame is closed, the tab is automatically reinserted into the tabbedPane.

  Parameters:
    `index` - index of the tabbedPane to be detached

### addCloseListener

    public void addCloseListener(CloseListener l)

  Adds a `CloseListener` to the tabbedPane.

  Parameters:
    `l` - the `CloseListener` to add
  See Also:
    `fireCloseTabEvent(java.awt.event.MouseEvent, int)`, `removeCloseListener(madkit.MadChat.CloseAndMaxTabbedPane.CloseListener)`

### addMaxListener

    public void addMaxListener(MaxListener l)

  Adds a `MaxListener` to the tabbedPane.

  Parameters:
    `l` - the `MaxListener` to add
  See Also:
    `fireMaxTabEvent(java.awt.event.MouseEvent, int)`, `removeMaxListener(madkit.MadChat.CloseAndMaxTabbedPane.MaxListener)`

### addDoubleClickListener

    public void addDoubleClickListener(DoubleClickListener l)

  Adds a `DoubleClickListener` to the tabbedPane.

  Parameters:
    `l` - the `DoubleClickListener` to add
  See Also:
    `fireDoubleClickTabEvent(java.awt.event.MouseEvent, int)`, `removeDoubleClickListener(madkit.MadChat.CloseAndMaxTabbedPane.DoubleClickListener)`

### addPopupOutsideListener

    public void addPopupOutsideListener(PopupOutsideListener l)

  Adds a `PopupOutsideListener` to the tabbedPane.

  Parameters:
    `l` - the `PopupOutsideListener` to add
  See Also:
    `firePopupOutsideTabEvent(java.awt.event.MouseEvent)`, `removePopupOutsideListener(madkit.MadChat.CloseAndMaxTabbedPane.PopupOutsideListener)`

### removeCloseListener

    public void removeCloseListener(CloseListener l)

  Removes a `CloseListener` from this tabbedPane.

  Parameters:
    `l` - the `CloseListener` to remove
  See Also:
    `fireCloseTabEvent(java.awt.event.MouseEvent, int)`, `addCloseListener(madkit.MadChat.CloseAndMaxTabbedPane.CloseListener)`

### removeMaxListener

    public void removeMaxListener(MaxListener l)

  Removes a `MaxListener` from this tabbedPane.

  Parameters:
    `l` - the `MaxListener` to remove
  See Also:
    `fireMaxTabEvent(java.awt.event.MouseEvent, int)`, `addMaxListener(madkit.MadChat.CloseAndMaxTabbedPane.MaxListener)`

### removeDoubleClickListener

    public void removeDoubleClickListener(DoubleClickListener l)

  Removes a `DoubleClickListener` from this tabbedPane.

  Parameters:
    `l` - the `DoubleClickListener` to remove
  See Also:
    `fireDoubleClickTabEvent(java.awt.event.MouseEvent, int)`, `addDoubleClickListener(madkit.MadChat.CloseAndMaxTabbedPane.DoubleClickListener)`

### removePopupOutsideListener

    public void removePopupOutsideListener(PopupOutsideListener l)

  Removes a `PopupOutsideListener` from this tabbedPane.

  Parameters:
    `l` - the `PopupOutsideListener` to remove
  See Also:
    `firePopupOutsideTabEvent(java.awt.event.MouseEvent)`, `addPopupOutsideListener(madkit.MadChat.CloseAndMaxTabbedPane.PopupOutsideListener)`

### fireCloseTabEvent

    public void fireCloseTabEvent(java.awt.event.MouseEvent e,
                                  int overTabIndex)

  Sends a `MouseEvent`, whose source is this tabbedpane, to every `CloseListener`. The method also updates the `overTabIndex` of the tabbedPane with a value coming from the UI. This method method is called each time a `MouseEvent` is received from the UI when the user clicks on the close icon of the tab which index is `overTabIndex`.

  Parameters:
    `e` - the `MouseEvent` to be sent
    `overTabIndex` - the index of a tab, usually the tab over which the mouse is
  See Also:
    `addCloseListener(madkit.MadChat.CloseAndMaxTabbedPane.CloseListener)`, `EventListenerList`

### fireMaxTabEvent

    public void fireMaxTabEvent(java.awt.event.MouseEvent e,
                                int overTabIndex)

  Sends a `MouseEvent`, whose source is this tabbedpane, to every `MaxListener`. The method also updates the `overTabIndex` of the tabbedPane with a value coming from the UI. This method method is called each time a `MouseEvent` is received from the UI when the user clicks on the max icon of the tab which index is `overTabIndex`.

  Parameters:
    `e` - the `MouseEvent` to be sent
    `overTabIndex` - the index of a tab, usually the tab over which the mouse is
  See Also:
    `addMaxListener(madkit.MadChat.CloseAndMaxTabbedPane.MaxListener)`, `EventListenerList`

### fireDoubleClickTabEvent

    public void fireDoubleClickTabEvent(java.awt.event.MouseEvent e,
                                        int overTabIndex)

  Sends a `MouseEvent`, whose source is this tabbedpane, to every `DoubleClickListener`. The method also updates the `overTabIndex` of the tabbedPane with a value coming from the UI. This method method is called each time a `MouseEvent` is received from the UI when the user double-clicks on the tab which index is `overTabIndex`.

  Parameters:
    `e` - the `MouseEvent` to be sent
    `overTabIndex` - the index of a tab, usually the tab over which the mouse is
  See Also:
    `addDoubleClickListener(madkit.MadChat.CloseAndMaxTabbedPane.DoubleClickListener)`, `EventListenerList`

### firePopupOutsideTabEvent

    public void firePopupOutsideTabEvent(java.awt.event.MouseEvent e)

  Sends a `MouseEvent`, whose source is this tabbedpane, to every `PopupOutsideListener`. The method also sets the `overTabIndex` to -1. This method method is called each time a `MouseEvent` is received from the UI when the user right-clicks on the inactive part of a tabbedPane.

  Parameters:
    `e` - the `MouseEvent` to be sent
  See Also:
    `addPopupOutsideListener(madkit.MadChat.CloseAndMaxTabbedPane.PopupOutsideListener)`, `EventListenerList`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.