Oracle Forms 9i Samples and Demos


oracle.forms.demos.beans
Class Hyperlink

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--oracle.ewt.lwAWT.LWComponent
                    |
                    +--oracle.ewt.lwAWT.AbstractPainterComponent
                          |
                          +--oracle.ewt.lwAWT.LWLabel
                                |
                                +--oracle.forms.demos.beans.Hyperlink
All Implemented Interfaces:
javax.accessibility.Accessible, oracle.ewt.lwAWT.DoubleBufferer, java.util.EventListener, oracle.ewt.help.HelpCapable, java.awt.image.ImageObserver, oracle.ewt.lwAWT.ImmediatePainter, oracle.ewt.lwAWT.KeyProcessor, java.awt.MenuContainer, java.awt.event.MouseListener, java.io.Serializable, oracle.ewt.lwAWT.VirtualComponent

public class Hyperlink
extends oracle.ewt.lwAWT.LWLabel
implements java.awt.event.MouseListener

Oracle Forms Server 9i JavaBean Example

A Hyperlink is a JavaBean that mimics the look and actions of a standard web browser hyperlink. It can be used in Java applications to provide a similar working experience to that obtained from HTML based applications. The hyperlink supports the following states:
normal The default state of the hyperlink when the user has/had no interaction[s] with it.
active The state of the hyperlink when the user has moved the mouse over it.
visited The state of the hyperlink when the user clicked on the hyperlink component during this particular application session. Will expire when the user ends the application.

The hyperlink will not perform any default actions when the user clicks on it. Any component that is interested in the actions of the hyperlink must register itself as an ActionListener with the hyperlink. The hyperlink will notify the interested parties when it has been clicked through an ActionEvent

Version:
9.0 29/Oct/2001
Author:
Steve Button, Duncan Mills
See Also:
Serialized Form

Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Fields inherited from class oracle.ewt.lwAWT.LWLabel
CENTER, DEFAULT, LEFT, RIGHT
 
Fields inherited from class oracle.ewt.lwAWT.LWComponent
DEFAULT_BORDERPAINTER, DEFAULT_COLOR, DEFAULT_FONT, DEFAULT_PAINTER, MNEMONIC_CHAR_NONE, MNEMONIC_INDEX_NONE
 
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
Hyperlink()
           
Hyperlink(java.lang.String label)
          Create a hyperlink with no specific URL target
Hyperlink(java.lang.String label, java.lang.String URL)
          Create a hyperlink using the given URL.
Hyperlink(java.lang.String label, java.lang.String URL, java.awt.Color normalcolor)
          Creates a hyperlink using the given URL with the specified color.
Hyperlink(java.lang.String label, java.lang.String URL, java.awt.Color normalcolor, java.awt.Color visitedcolor)
          Creates a hyperlink using the given URL with the specified color.
 
Method Summary
 void addActionListener(java.awt.event.ActionListener listener)
          Adds the specified action listener object to receive action events from this hyperlink.
 void addMouseListener(java.awt.event.MouseListener listener)
          Adds the specified action listener object to receive action events from this hyperlink.
 java.awt.Color getActiveColor()
          Gets the active color for this hyperlink.
 boolean getDebug()
          Gets debug mode
 java.lang.String getLabel()
          Get the label for the HyperLink.
 java.awt.Color getNormalColor()
          Gets the normal color for this hyperlink.
 java.lang.String getURL()
          Returns the URL associated with this hyperlink.
 java.awt.Color getVisitedColor()
          Gets the visited color for this hyperlink.
 void log(java.lang.String msg)
          Convenience method to display an message out to the console.
 void mouseClicked(java.awt.event.MouseEvent e)
          Event handler for when the mouse clicks the hyperlink
 void mouseEntered(java.awt.event.MouseEvent e)
          Event handler for when the mouse enters the hyperlink
 void mouseExited(java.awt.event.MouseEvent e)
          Event handler for when the mouse leaves the hyperlink
 void mousePressed(java.awt.event.MouseEvent e)
          Not implemented
 void mouseReleased(java.awt.event.MouseEvent e)
          Not implemented
 void paint(java.awt.Graphics g)
          Paints the hyperlink.
 void removeActionListener(java.awt.event.ActionListener listener)
          Removes the specified action listener object from the list of action listeners associated with this hyperlink.
 void removeActionListener(java.awt.event.MouseListener listener)
          Removes the specified action listener object from the list of action listeners associated with this hyperlink.
 void setActiveColor(java.awt.Color newActiveColor)
          Sets the active color for this hyperlink.
 void setDebug(boolean debugMode)
          Sets debug mode
 void setDebug(boolean debugMode, boolean forAll)
          Sets debug mode - allows switch on for all instances
 void setLabel(java.lang.String label)
          Set the label for the HyperLink.
 void setNormalColor(java.awt.Color newNormalColor)
          Sets the normal color for this hyperlink.
 void setURL(java.lang.String URL)
          Sets the URL to associate with this hyperlink.
 void setVisitedColor(java.awt.Color newVisitedColor)
          Sets the visited color for this hyperlink.
 
Methods inherited from class oracle.ewt.lwAWT.LWLabel
createAccessibleContext, getDefaultName, getImageSet, getLabelFor, getPaintData, getPainter, getText, getUIClassID, isFocusable, paramString, postProcessKey, setFocusable, setImage, setImageSet, setLabelFor, setText
 
Methods inherited from class oracle.ewt.lwAWT.AbstractPainterComponent
getInvalidateFlags, getMaximumSize, getMinimumSize, getPreferredSize, getRepaintFlags, interiorContains, isInteriorTransparent, paintInterior
 
Methods inherited from class oracle.ewt.lwAWT.LWComponent
accessAccessibleContext, addAnyEventListener, addImpl, addNotify, addPostKeyListener, addPreKeyListener, clipToParents, contains, convertInnerToOuterSize, convertInteriorToOuter, convertOuterToInterior, disable, doLayout, enable, eventMatchesMnemonic, eventMatchesMnemonic, freezeRepaints, getAccessibleContext, getActualAlignment, getActualReadingDirection, getAlignment, getBackground, getBaseClassName, getBorderContext, getBorderInsets, getBorderPainter, getClientProperty, getColorScheme, getDefaultHelpProvider, getDocumentSize, getDoubleBuffer, getEWTDropTarget, getFill, getFocusedComponent, getFont, getForeground, getGraphics, getHelpBook, getHelpProvider, getHelpTopic, getInnerBounds, getInnerHeight, getInnerOrigin, getInnerSize, getInnerWidth, getInsets, getInteriorAlignmentX, getInteriorAlignmentY, getLookAndFeel, getMnemonicChar, getMnemonicIndex, getMnemonicString, getName, getPageBounds, getPaintContext, getPaintState, getPrintPaintContext, getReadingDirection, getToolTipValue, getUI, getUIDefaults, hasFocus, hasGlobalFocus, hasMnemonicModifier, hasWindowFocus, hide, imageUpdate, insets, invalidate, invalidateAndRepaintIfNecessary, isActive, isBorderTransparent, isChildClipped, isClippedBySibling, isFocusTraversable, isLocaleDefaulted, isPaintPropagationRequired, isReadingDirectionDefaulted, isTransparent, paintAll, paintImmediate, paintImmediate, paintImmediateInterior, paintImmediateInterior, paintImmediateUnclipped, paintOverChildren, pointInInterior, pointIsInChild, print, printAll, printPage, processEvent, processEventImpl, processFocusEvent, processMouseEvent, putClientProperty, redispatchEvent, remove, removeAll, removeAnyEventListener, removeClientProperty, removeNotify, removePostKeyListener, removePreKeyListener, repaint, repaintInterior, repaintInterior, reshape, setAlignment, setBackground, setColorScheme, setDefaultHelpProvider, setEnabled, setEWTDropTarget, setFill, setFont, setForeground, setHelpBook, setHelpProvider, setHelpTopic, setLocale, setLookAndFeel, setMnemonicChar, setMnemonicIndex, setReadingDirection, setToolTipValue, setToolTipValue, setUI, setVisible, shiftFrozenDamage, showHelp, unfreezeRepaints, update, updateAlignment, updateLocale, updateReadingDirection, updateUI, updateUI, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, getListeners, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, remove, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFontMetrics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, inside, isDisplayable, isDoubleBuffered, isEnabled, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface oracle.ewt.lwAWT.VirtualComponent
getBounds, getSize
 

Constructor Detail

Hyperlink

public Hyperlink()

Hyperlink

public Hyperlink(java.lang.String label)
Create a hyperlink with no specific URL target
Parameters:
label - Text of label

Hyperlink

public Hyperlink(java.lang.String label,
                 java.lang.String URL)
Create a hyperlink using the given URL. Set the normal color to the default.
Parameters:
label - Text of linklabel
URL - The URL to associate with this linklabel

Hyperlink

public Hyperlink(java.lang.String label,
                 java.lang.String URL,
                 java.awt.Color normalcolor)
Creates a hyperlink using the given URL with the specified color. Sets the visited color to the default.
Parameters:
label - Text of label
URL - Universal Resource Locator (URL)
color - Color of the normal hyperlink

Hyperlink

public Hyperlink(java.lang.String label,
                 java.lang.String URL,
                 java.awt.Color normalcolor,
                 java.awt.Color visitedcolor)
Creates a hyperlink using the given URL with the specified color.
Parameters:
label - Text of label
URL - Universal Resource Locator (URL)
color - Color of normal hyperlink
color - Color of visited
Method Detail

setLabel

public void setLabel(java.lang.String label)
Set the label for the HyperLink.
Parameters:
Label - the label to display

getLabel

public java.lang.String getLabel()
Get the label for the HyperLink.
Returns:
The label for this HyperLink

setURL

public void setURL(java.lang.String URL)
Sets the URL to associate with this hyperlink.
Parameters:
URL - The associated URL.

getURL

public java.lang.String getURL()
Returns the URL associated with this hyperlink.
Returns:
The URL assosicated with this hyperlink as a String

setVisitedColor

public void setVisitedColor(java.awt.Color newVisitedColor)
Sets the visited color for this hyperlink. The visited color will appear when the link has been clicked as determined by the isClicked attribute.
Parameters:
color - Color of visited link

getVisitedColor

public java.awt.Color getVisitedColor()
Gets the visited color for this hyperlink.
Returns:
color Color of visited link

setNormalColor

public void setNormalColor(java.awt.Color newNormalColor)
Sets the normal color for this hyperlink. The normal color appears is used when the link is first and subsequently drawn, up until the point where it is actively clicked.
Returns:
color Color of normal hyperlink

getNormalColor

public java.awt.Color getNormalColor()
Gets the normal color for this hyperlink.
Returns:
color Color of normal hyperlink

setActiveColor

public void setActiveColor(java.awt.Color newActiveColor)
Sets the active color for this hyperlink. The active color appears when the mouse is moved over the hyperlink to signify that it is a usable component with an associated action.
Returns:
color Color of active hyperlink

getActiveColor

public java.awt.Color getActiveColor()
Gets the active color for this hyperlink.
Returns:
color Color of active hyperlink

setDebug

public void setDebug(boolean debugMode,
                     boolean forAll)
Sets debug mode - allows switch on for all instances

setDebug

public void setDebug(boolean debugMode)
Sets debug mode

getDebug

public boolean getDebug()
Gets debug mode

paint

public void paint(java.awt.Graphics g)
Paints the hyperlink.
Overrides:
paint in class oracle.ewt.lwAWT.LWComponent
Parameters:
g - The Graphics object to paint on

addActionListener

public void addActionListener(java.awt.event.ActionListener listener)
Adds the specified action listener object to receive action events from this hyperlink.
Parameters:
listener - ActionListener to add to event queue

removeActionListener

public void removeActionListener(java.awt.event.ActionListener listener)
Removes the specified action listener object from the list of action listeners associated with this hyperlink.
Parameters:
listener - ActionListener to add to event queue

addMouseListener

public void addMouseListener(java.awt.event.MouseListener listener)
Adds the specified action listener object to receive action events from this hyperlink.
Overrides:
addMouseListener in class java.awt.Component
Parameters:
listener - ActionListener to add to event queue

removeActionListener

public void removeActionListener(java.awt.event.MouseListener listener)
Removes the specified action listener object from the list of action listeners associated with this hyperlink.
Parameters:
listener - ActionListener to add to event queue

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Event handler for when the mouse clicks the hyperlink
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
MouseEvent - Event

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Event handler for when the mouse enters the hyperlink
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
MouseEvent - Event

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Event handler for when the mouse leaves the hyperlink
Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
MouseEvent - Event

mousePressed

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

mouseReleased

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

log

public void log(java.lang.String msg)
Convenience method to display an message out to the console. Examines the m_Debug and m_DebugALL settings to see if it should output the message. Outputs message in format
Parameters:
the - message to be output

Oracle Forms 9i Samples and Demos