LEONARDI Application Composer - 8.9.0.40 by W4 S.A.

leon.view.win.swing.component
Class LyJHRefComponent

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.LyJHRefComponent
All Implemented Interfaces:
java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.SwingConstants, LyEventTransmitter, LySetLabelInterface

public class LyJHRefComponent
extends javax.swing.JLabel
implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener, LyEventTransmitter, LySetLabelInterface, java.awt.event.FocusListener, java.awt.event.KeyListener

This class implements a simple label with an image.

See Also:
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 LY_OVER_CURSOR
          Mouse cursor when over HRef links.
 int MIN_HEIGHT
          Minimum height, in pixels.
static boolean SEPARATE_HIGHLIGHT
          Separates highlighting of image and label.
static boolean USE_GRAYED_IMAGE
          Image is grayed and may be highlighted when mouse is over.
 
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
LyJHRefComponent()
          Sole constructor.
LyJHRefComponent(java.lang.String label, java.awt.Image image, java.awt.Font font, boolean visited, boolean sensitive, java.lang.Object userData)
          Creates a href component with the specified attributes.
 
Method Summary
 void activateLink()
          Does this action when link has been activate.
 void addNotify()
          (non-Javadoc).
 void focusGained(java.awt.event.FocusEvent e)
          Refreshes the component when focus is gained.
 void focusLost(java.awt.event.FocusEvent e)
          Refreshes the component when focus is lost.
 LyActionTransmitter getActionTransmitter()
          (non-Javadoc).
 java.awt.Dimension getPreferredSize()
          (non-Javadoc).
 LySelectionTransmitter getSelectionTransmitter()
          (non-Javadoc).
 java.lang.Object getUserData()
          Returns user data.
 void highlightImage(boolean status)
          Uses the highlighted or grayed images on the component depending on the status.
 void highlightLabel(boolean status)
          Highligts the text label depending on the status and the mouse position, and sets the corresponding cursor.
 boolean isFocusTraversable()
          This component can always gain focus.
 void keyPressed(java.awt.event.KeyEvent e)
          Does nothing when a key is pressed.
 void keyReleased(java.awt.event.KeyEvent e)
          Does nothing when a key is released.
 void keyTyped(java.awt.event.KeyEvent e)
          (non-Javadoc).
 void mouseClicked(java.awt.event.MouseEvent e)
          Does nothing.
 void mouseDragged(java.awt.event.MouseEvent e)
          Does nothing.
 void mouseEntered(java.awt.event.MouseEvent e)
          Does nothing.
 void mouseExited(java.awt.event.MouseEvent e)
          (non-Javadoc).
 void mouseMoved(java.awt.event.MouseEvent e)
          (non-Javadoc).
 void mousePressed(java.awt.event.MouseEvent e)
          (non-Javadoc).
 void mouseReleased(java.awt.event.MouseEvent e)
          Does nothing.
 void paintComponent(java.awt.Graphics g)
          Highlights the text.
 void setDefaultColor(java.awt.Color color)
          Sets the default color.
 void setDisableColor(java.awt.Color color)
          Sets the disabled color.
 void setFont(java.awt.Font f)
          Sets the font and gets its associated font metrics.
 void setHighlightColor(java.awt.Color color)
          Sets the highlight color.
 void setIdle(boolean status)
          Sets the idle mode.
 void setImage(java.awt.Image img)
          Sets the new image and initializes the icon image with the same value.
 void setLabel(java.lang.String label)
          (non-Javadoc).
 void setMinimumWidth(int minimumWidth)
          Set the minimum width of this component.
 void setSensitive(boolean sensitive)
          Sets the sensitivity.
 void setUserData(java.lang.Object userData)
          Sets the user data.
 void setVisited(boolean visited)
          Sets the visited status.
 void setVisitedColor(java.awt.Color color)
          Sets the visited color.
 
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, 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, 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, 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, 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

USE_GRAYED_IMAGE

public static boolean USE_GRAYED_IMAGE
Image is grayed and may be highlighted when mouse is over.


SEPARATE_HIGHLIGHT

public static boolean SEPARATE_HIGHLIGHT
Separates highlighting of image and label.


LY_OVER_CURSOR

public static java.awt.Cursor LY_OVER_CURSOR
Mouse cursor when over HRef links.


MIN_HEIGHT

public int MIN_HEIGHT
Minimum height, in pixels.

Constructor Detail

LyJHRefComponent

public LyJHRefComponent()
Sole constructor. Creates a default working href component.


LyJHRefComponent

public LyJHRefComponent(java.lang.String label,
                        java.awt.Image image,
                        java.awt.Font font,
                        boolean visited,
                        boolean sensitive,
                        java.lang.Object userData)
Creates a href component with the specified attributes.

Parameters:
label - the text label
image - the icon image
font - the font of this href component
visited - Indicates if this href component is visited.
sensitive - Indicates if this href component is sensitive.
userData - the user datas
Method Detail

getUserData

public java.lang.Object getUserData()
Returns user data.

Returns:
the user data
See Also:
setUserData(Object)

isFocusTraversable

public boolean isFocusTraversable()
This component can always gain focus.

Overrides:
isFocusTraversable in class java.awt.Component
Returns:
true
See Also:
Component.isFocusTraversable()

paintComponent

public void paintComponent(java.awt.Graphics g)
Highlights the text.

Overrides:
paintComponent in class javax.swing.JComponent
See Also:
JComponent.paintComponent(java.awt.Graphics)

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Does nothing.

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
See Also:
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
(non-Javadoc).

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
See Also:
MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
(non-Javadoc).

Specified by:
mousePressed in interface java.awt.event.MouseListener
See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Does nothing.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
(non-Javadoc).

Specified by:
mouseExited in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseExited(java.awt.event.MouseEvent)

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Does nothing.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseReleased(java.awt.event.MouseEvent)

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Does nothing.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
See Also:
MouseListener.mouseEntered(java.awt.event.MouseEvent)

activateLink

public void activateLink()
Does this action when link has been activate.


highlightLabel

public void highlightLabel(boolean status)
Highligts the text label depending on the status and the mouse position, and sets the corresponding cursor.

Parameters:
status - the new status

highlightImage

public void highlightImage(boolean status)
Uses the highlighted or grayed images on the component depending on the status.

Parameters:
status - the new status

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Refreshes the component when focus is gained.

Specified by:
focusGained in interface java.awt.event.FocusListener
See Also:
FocusListener.focusGained(java.awt.event.FocusEvent)

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Refreshes the component when focus is lost.

Specified by:
focusLost in interface java.awt.event.FocusListener
See Also:
FocusListener.focusLost(java.awt.event.FocusEvent)

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Does nothing when a key is pressed.

Specified by:
keyPressed in interface java.awt.event.KeyListener
See Also:
KeyListener.keyPressed(java.awt.event.KeyEvent)

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Does nothing when a key is released.

Specified by:
keyReleased in interface java.awt.event.KeyListener
See Also:
KeyListener.keyReleased(java.awt.event.KeyEvent)

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
(non-Javadoc).

Specified by:
keyTyped in interface java.awt.event.KeyListener
See Also:
KeyListener.keyTyped(java.awt.event.KeyEvent)

getActionTransmitter

public LyActionTransmitter getActionTransmitter()
(non-Javadoc).

Specified by:
getActionTransmitter in interface LyEventTransmitter
Returns:
the action transmitter of this component
See Also:
LyEventTransmitter.getActionTransmitter()

getSelectionTransmitter

public LySelectionTransmitter getSelectionTransmitter()
(non-Javadoc).

Specified by:
getSelectionTransmitter in interface LyEventTransmitter
Returns:
the selection transmitter of this component
See Also:
LyEventTransmitter.getSelectionTransmitter()

setLabel

public void setLabel(java.lang.String label)
(non-Javadoc).

Specified by:
setLabel in interface LySetLabelInterface
Parameters:
label - new label
See Also:
LySetLabelInterface.setLabel(java.lang.String)

setUserData

public void setUserData(java.lang.Object userData)
Sets the user data.

Parameters:
userData - the new user data
See Also:
getUserData()

setMinimumWidth

public void setMinimumWidth(int minimumWidth)
Set the minimum width of this component.

Parameters:
minimumWidth - the new minimum width of the component (a negative value means that there is no minimum width).

getPreferredSize

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

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

addNotify

public void addNotify()
(non-Javadoc).

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

setDisableColor

public void setDisableColor(java.awt.Color color)
Sets the disabled color.

Parameters:
color - the new disabled color

setDefaultColor

public void setDefaultColor(java.awt.Color color)
Sets the default color.

Parameters:
color - the new default color

setHighlightColor

public void setHighlightColor(java.awt.Color color)
Sets the highlight color.

Parameters:
color - the new highlight color

setVisitedColor

public void setVisitedColor(java.awt.Color color)
Sets the visited color.

Parameters:
color - the new visited color

setFont

public void setFont(java.awt.Font f)
Sets the font and gets its associated font metrics.

Overrides:
setFont in class javax.swing.JComponent
See Also:
Component.setFont(java.awt.Font)

setImage

public void setImage(java.awt.Image img)
Sets the new image and initializes the icon image with the same value.

Parameters:
img - the new image

setSensitive

public void setSensitive(boolean sensitive)
Sets the sensitivity.

Parameters:
sensitive - Indicates if the component is sensitive or not.

setVisited

public void setVisited(boolean visited)
Sets the visited status.

Parameters:
visited - Indicates if the component is visited or not.

setIdle

public void setIdle(boolean status)
Sets the idle mode.

Parameters:
status - the new idle status

(c) January 2013 - W4 S.A.

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