All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class oracle.forms.demos.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.HyperLink

public class HyperLink
extends LWLabel
implements MouseListener

Oracle Forms Server 6i JavaBean Example

A HyperLink is a JavaBean that mimics the look and actions of a standard web browser hyperlink. It can be usedf 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:
1.00 11-FEB-00
Author:
Steve Button

Constructor Index

 o HyperLink()
Create a default HyplerLink
 o HyperLink(String)
Create a hyperlink with no specific URL target
 o HyperLink(String, String)
Create a hyperlink using the given URL.
 o HyperLink(String, String, Color)
Creates a hyperlink using the given URL with the specified color.
 o HyperLink(String, String, Color, Color)
Creates a hyperlink using the given URL with the specified color.

Method Index

 o addActionListener(ActionListener)
Adds the specified action listener object to receive action events from this hyperlink.
 o addMouseListener(MouseListener)
Adds the specified action listener object to receive action events from this hyperlink.
 o getActiveColor()
Gets the active color for this hyperlink.
 o getLabel()
Get the label for the HyperLink.
 o getNormalColor()
Gets the normal color for this hyperlink.
 o getURL()
Returns the URL associated with this hyperlink.
 o getVisitedColor()
Gets the visited color for this hyperlink.
 o log(String)
Convenience method to display an message out to the console.
 o main(String[])
The main entry point to run this from the command line for testing purposes
 o mouseClicked(MouseEvent)
Event handler for when the mouse clicks the hyperlink
 o mouseEntered(MouseEvent)
Event handler for when the mouse enters the hyperlink
 o mouseExited(MouseEvent)
Event handler for when the mouse leaves the hyperlink
 o mousePressed(MouseEvent)
Not implemented
 o mouseReleased(MouseEvent)
Not implemented
 o paint(Graphics)
Paints the hyperlink.
 o removeActionListener(ActionListener)
Removes the specified action listener object from the list of action listeners associated with this hyperlink.
 o removeActionListener(MouseListener)
Removes the specified action listener object from the list of action listeners associated with this hyperlink.
 o setActiveColor(Color)
Sets the active color for this hyperlink.
 o setLabel(String)
Set the label for the HyperLink.
 o setNormalColor(Color)
Sets the normal color for this hyperlink.
 o setURL(String)
Sets the URL to associate with this hyperlink.
 o setVisitedColor(Color)
Sets the visited color for this hyperlink.

Constructors

 o HyperLink
 public HyperLink()
Create a default HyplerLink

 o HyperLink
 public HyperLink(String label)
Create a hyperlink with no specific URL target

Parameters:
label - Text of label
 o HyperLink
 public HyperLink(String label,
                  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
 o HyperLink
 public HyperLink(String label,
                  String URL,
                  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
 o HyperLink
 public HyperLink(String label,
                  String URL,
                  Color normalcolor,
                  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

Methods

 o setLabel
 public void setLabel(String label)
Set the label for the HyperLink.

Parameters:
Label - the label to display
 o getLabel
 public String getLabel()
Get the label for the HyperLink.

Returns:
The label for this HyperLink
 o setURL
 public void setURL(String URL)
Sets the URL to associate with this hyperlink.

Parameters:
URL - The associated URL.
 o getURL
 public String getURL()
Returns the URL associated with this hyperlink.

Returns:
The URL assosicated with this hyperlink as a String
 o setVisitedColor
 public void setVisitedColor(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
 o getVisitedColor
 public Color getVisitedColor()
Gets the visited color for this hyperlink.

Returns:
color Color of visited link
 o setNormalColor
 public void setNormalColor(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
 o getNormalColor
 public Color getNormalColor()
Gets the normal color for this hyperlink.

Returns:
color Color of normal hyperlink
 o setActiveColor
 public void setActiveColor(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
 o getActiveColor
 public Color getActiveColor()
Gets the active color for this hyperlink.

Returns:
color Color of active hyperlink
 o paint
 public void paint(Graphics g)
Paints the hyperlink.

Parameters:
g - The Graphics object to paint on
Overrides:
paint in class LWComponent
 o addActionListener
 public synchronized void addActionListener(ActionListener listener)
Adds the specified action listener object to receive action events from this hyperlink.

Parameters:
listener - ActionListener to add to event queue
 o removeActionListener
 public synchronized void removeActionListener(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
 o addMouseListener
 public synchronized void addMouseListener(MouseListener listener)
Adds the specified action listener object to receive action events from this hyperlink.

Parameters:
listener - ActionListener to add to event queue
Overrides:
addMouseListener in class Component
 o removeActionListener
 public synchronized void removeActionListener(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
 o mouseClicked
 public void mouseClicked(MouseEvent e)
Event handler for when the mouse clicks the hyperlink

Parameters:
MouseEvent - Event
 o mouseEntered
 public void mouseEntered(MouseEvent e)
Event handler for when the mouse enters the hyperlink

Parameters:
MouseEvent - Event
 o mouseExited
 public void mouseExited(MouseEvent e)
Event handler for when the mouse leaves the hyperlink

Parameters:
MouseEvent - Event
 o mousePressed
 public void mousePressed(MouseEvent e)
Not implemented

 o mouseReleased
 public void mouseReleased(MouseEvent e)
Not implemented

 o log
 public void log(String msg)
Convenience method to display an message out to the console. Examines the DEBUG setting to see if it should output the message. Outputs message in format

Parameters:
the - message to be output
 o main
 public static void main(String args[])
The main entry point to run this from the command line for testing purposes

Parameters:
String[] - the command line parameters for the application to use

All Packages  Class Hierarchy  This Package  Previous  Next  Index