LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJIconJLabel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLabel
                  extended by leon.view.win.swing.component.LyJIconJLabel
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 LyJIconJLabel
extends javax.swing.JLabel
implements java.awt.event.MouseListener

This class implements the icon component for swing viewer.

See Also:
LyIcon, Serialized Form

Nested Class Summary
 
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 java.awt.Cursor DEFAULT_CURSOR
          Default cursor.
static int DEFAULT_GAP
          Default gap, in pixels.
static int DEFAULT_HEIGHT
          Default display height, in pixels.
static int DEFAULT_WIDTH
          Default display width, in pixels.
static java.awt.Cursor OVER_CURSOR
          Mouse cursor when over sensitive icons.
static int TIP_MAX_CHARS
          Maximum number of characters for the tooltips.
 
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
LyJIconJLabel(java.awt.Image image)
          Creates a default icon label component for the specified image.
LyJIconJLabel(java.awt.Image image, int width, int height, LyIcon.Border border)
          Creates an icon label component with the specified attributes and no tooltip.
LyJIconJLabel(java.awt.Image image, java.lang.String tip, int width, int height)
          Creates an icon label component with the specified attributes.
LyJIconJLabel(java.awt.Image image, java.lang.String tip, int width, int height, LyIcon.Border border)
          Creates an icon label component with the specified attributes.
 
Method Summary
 void computeGap()
          Computes the vertical and horizontal gaps depending on this component's preferred size.
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 LyIcon.Border getBorderType()
          Gets the type of the border.
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been clicked (pressed and released) on a component.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits a component.
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a component.
 void setBorderType(LyIcon.Border borderType)
          Sets the type of the border.
 void setDimension(int width, int height)
          Sets the width and height of the icon.
 void setImage(java.awt.Image image)
          Sets the displayed image.
 void setSensitive(boolean sensitive)
          Sets or unsets the sensitive mode on this icon.
 
Methods inherited from class javax.swing.JLabel
getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, getMaximumSize, getMinimumSize, 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, 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, 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, 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

TIP_MAX_CHARS

public static int TIP_MAX_CHARS
Maximum number of characters for the tooltips.


DEFAULT_WIDTH

public static int DEFAULT_WIDTH
Default display width, in pixels.


DEFAULT_HEIGHT

public static int DEFAULT_HEIGHT
Default display height, in pixels.


DEFAULT_GAP

public static int DEFAULT_GAP
Default gap, in pixels.


DEFAULT_CURSOR

public static java.awt.Cursor DEFAULT_CURSOR
Default cursor.


OVER_CURSOR

public static java.awt.Cursor OVER_CURSOR
Mouse cursor when over sensitive icons.

Constructor Detail

LyJIconJLabel

public LyJIconJLabel(java.awt.Image image)
Creates a default icon label component for the specified image. Initializes the class attributes to the default values.

Parameters:
image - the associated icon image

LyJIconJLabel

public LyJIconJLabel(java.awt.Image image,
                     java.lang.String tip,
                     int width,
                     int height)
Creates an icon label component with the specified attributes. This component has no border.

Parameters:
image - the icon image
tip - the tooltip text
width - the width of the displayed image
height - the height of the displayed image

LyJIconJLabel

public LyJIconJLabel(java.awt.Image image,
                     java.lang.String tip,
                     int width,
                     int height,
                     LyIcon.Border border)
Creates an icon label component with the specified attributes.

Parameters:
image - the icon image
tip - the tooltip text
width - the width of the displayed image
height - the height of the displayed image
border - the border type. Same as _borderType.

LyJIconJLabel

public LyJIconJLabel(java.awt.Image image,
                     int width,
                     int height,
                     LyIcon.Border border)
Creates an icon label component with the specified attributes and no tooltip.

Parameters:
image - the icon image
width - the width of the displayed image
height - the height of the displayed image
border - the border type. Same as _borderType.
Method Detail

computeGap

public void computeGap()
Computes the vertical and horizontal gaps depending on this component's preferred size.


setBorderType

public void setBorderType(LyIcon.Border borderType)
Sets the type of the border.

Parameters:
borderType - the type of the border. One of the following:
  • LyIcon.Border.NONE
  • LyIcon.Border.SINGLE
  • LyIcon.Border.DOUBLE
  • LyIcon.Border.RAISED
  • LyIcon.Border.LOWERED
See Also:
getBorderType()

getBorderType

public LyIcon.Border getBorderType()
Gets the type of the border.

Returns:
the type of the border
See Also:
#setBorderType(int)

setImage

public void setImage(java.awt.Image image)
Sets the displayed image.

Parameters:
image - the icon image

setSensitive

public void setSensitive(boolean sensitive)
Sets or unsets the sensitive mode on this icon.

Parameters:
sensitive - true if icon is sensitive (may be changed by clicking on it), false otherwise.

setDimension

public void setDimension(int width,
                         int height)
Sets the width and height of the icon.

Parameters:
width - new width value.
height - new height value.

getActionTransmitter

public LyActionTransmitter getActionTransmitter()
(non-Javadoc).

See Also:
LyEventTransmitter.getActionTransmitter()

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse button has been clicked (pressed and released) on a component.

Specified by:
mouseClicked in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.

Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener

(c) January 2013 - W4 S.A.

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