LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJToolBarComponent

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JToolBar
                  extended by leon.view.win.swing.component.LyJToolBarComponent
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.SwingConstants

public class LyJToolBarComponent
extends javax.swing.JToolBar
implements java.awt.event.MouseListener

This class implements a floatable toolbar.

See Also:
JToolBar, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JToolBar
javax.swing.JToolBar.Separator
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
static java.lang.String __VERSION
           
static int DEFAULT_GAP
          Default gap, in pixels, between the button and the border.
static boolean TOOLBAR_FLOATABILITY
          Enables the floatability of toolbars.
 
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 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
LyJToolBarComponent()
          Creates a default toolbar component.
LyJToolBarComponent(java.lang.String name, javax.swing.border.Border border, int maxWidth, boolean wrap)
          Creates a new toolbar component with the specified attributes.
LyJToolBarComponent(java.lang.String name, javax.swing.border.Border border, int maxWidth, boolean wrap, int align)
          Creates a new toolbar component with the specified attributes.
 
Method Summary
 void addNotify()
          Sets the toolbar unfloatable when its parent is already a ToolBar.
 java.awt.Component addSeparator(LyJSeparator sep)
          Adds a default separator.
 java.awt.Component addSeparator(LyJSeparator sep, int beforeGap, int afterGap)
          Adds a separator with the specified before and after gaps.
 java.awt.Dimension getMaximumSize()
          (non-Javadoc).
 java.awt.Dimension getMinimumSize()
          (non-Javadoc).
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent e)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void setImageBackground(java.awt.Image image)
          Set the image used as a background for the toolbar component.
 void setOrientation(int o)
          (non-Javadoc).
 void setOrientationLock(boolean status, LyViewManager viewManager)
          Locks the orientation to avoid change when floating.
 
Methods inherited from class javax.swing.JToolBar
add, addSeparator, addSeparator, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, getUIClassID, isBorderPainted, isFloatable, isRollover, setBorderPainted, setFloatable, setLayout, setMargin, setRollover, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getPreferredSize, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

__VERSION

public static final java.lang.String __VERSION
See Also:
Constant Field Values

TOOLBAR_FLOATABILITY

public static boolean TOOLBAR_FLOATABILITY
Enables the floatability of toolbars.


DEFAULT_GAP

public static final int DEFAULT_GAP
Default gap, in pixels, between the button and the border.

See Also:
Constant Field Values
Constructor Detail

LyJToolBarComponent

public LyJToolBarComponent()
Creates a default toolbar component.


LyJToolBarComponent

public LyJToolBarComponent(java.lang.String name,
                           javax.swing.border.Border border,
                           int maxWidth,
                           boolean wrap)
Creates a new toolbar component with the specified attributes.

Parameters:
name - the name of the toolbar
border - the border of the toolbar
maxWidth - the maximum width for wrap mode
wrap - the wrap mode property

LyJToolBarComponent

public LyJToolBarComponent(java.lang.String name,
                           javax.swing.border.Border border,
                           int maxWidth,
                           boolean wrap,
                           int align)
Creates a new toolbar component with the specified attributes.

Parameters:
name - the name of the toolbar
border - the border of the toolbar
maxWidth - the maximum width for wrap mode
wrap - the wrap mode property
align - the align mode property
Method Detail

setOrientationLock

public void setOrientationLock(boolean status,
                               LyViewManager viewManager)
Locks the orientation to avoid change when floating.

Parameters:
status - Indicates that the orientation can change or not.
See Also:
JToolBar.setOrientation(int)

setOrientation

public void setOrientation(int o)
(non-Javadoc).

Overrides:
setOrientation in class javax.swing.JToolBar
See Also:
JToolBar.setOrientation(int)

addSeparator

public java.awt.Component addSeparator(LyJSeparator sep)
Adds a default separator. The default gap is used before and after this separator.

Parameters:
sep - the separator to add
Returns:
the separator

addSeparator

public java.awt.Component addSeparator(LyJSeparator sep,
                                       int beforeGap,
                                       int afterGap)
Adds a separator with the specified before and after gaps.

Parameters:
sep - the new separator to add
beforeGap - the size, in pixels, of the gap before the specified separator
afterGap - the size, in pixels, of the gap after the specified separator
Returns:
the separator with its before and after gaps set

setImageBackground

public void setImageBackground(java.awt.Image image)
Set the image used as a background for the toolbar component.

Parameters:
image - the reference of the image used as a background

addNotify

public void addNotify()
Sets the toolbar unfloatable when its parent is already a ToolBar.

Overrides:
addNotify in class javax.swing.JComponent
See Also:
Component.addNotify()

getMaximumSize

public java.awt.Dimension getMaximumSize()
(non-Javadoc).

Overrides:
getMaximumSize in class javax.swing.JComponent
See Also:
Component.getMaximumSize()

getMinimumSize

public java.awt.Dimension getMinimumSize()
(non-Javadoc).

Overrides:
getMinimumSize in class javax.swing.JComponent
See Also:
Component.getMinimumSize()

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

(c) January 2013 - W4 S.A.

Website: W4 S.A., contact us: support@w4global.com