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
-
HyperLink()
- Create a default HyplerLink
-
HyperLink(String)
- Create a hyperlink with no specific URL target
-
HyperLink(String, String)
- Create a hyperlink using the given URL.
-
HyperLink(String, String, Color)
- Creates a hyperlink using the given URL with the
specified color.
-
HyperLink(String, String, Color, Color)
- Creates a hyperlink using the given URL with the
specified color.
-
addActionListener(ActionListener)
- Adds the specified action listener object to receive action events from
this hyperlink.
-
addMouseListener(MouseListener)
- Adds the specified action listener object to receive action events from
this hyperlink.
-
getActiveColor()
- Gets the active color for this hyperlink.
-
getLabel()
- Get the label for the HyperLink.
-
getNormalColor()
- Gets the normal color for this hyperlink.
-
getURL()
- Returns the URL associated with this hyperlink.
-
getVisitedColor()
- Gets the visited color for this hyperlink.
-
log(String)
- Convenience method to display an message out to the console.
-
main(String[])
- The main entry point to run this from the command line for testing purposes
-
mouseClicked(MouseEvent)
- Event handler for when the mouse clicks the hyperlink
-
mouseEntered(MouseEvent)
- Event handler for when the mouse enters the hyperlink
-
mouseExited(MouseEvent)
- Event handler for when the mouse leaves the hyperlink
-
mousePressed(MouseEvent)
- Not implemented
-
mouseReleased(MouseEvent)
- Not implemented
-
paint(Graphics)
- Paints the hyperlink.
-
removeActionListener(ActionListener)
- Removes the specified action listener object from the list of action listeners
associated with this hyperlink.
-
removeActionListener(MouseListener)
- Removes the specified action listener object from the list of action listeners
associated with this hyperlink.
-
setActiveColor(Color)
- Sets the active color for this hyperlink.
-
setLabel(String)
- Set the label for the HyperLink.
-
setNormalColor(Color)
- Sets the normal color for this hyperlink.
-
setURL(String)
- Sets the URL to associate with this hyperlink.
-
setVisitedColor(Color)
- Sets the visited color for this hyperlink.
HyperLink
public HyperLink()
- Create a default HyplerLink
HyperLink
public HyperLink(String label)
- Create a hyperlink with no specific URL target
- Parameters:
- label - Text of label
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
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
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
setLabel
public void setLabel(String label)
- Set the label for the HyperLink.
- Parameters:
- Label - the label to display
getLabel
public String getLabel()
- Get the label for the HyperLink.
- Returns:
- The label for this HyperLink
setURL
public void setURL(String URL)
- Sets the URL to associate with this hyperlink.
- Parameters:
- URL - The associated URL.
getURL
public String getURL()
- Returns the URL associated with this hyperlink.
- Returns:
- The URL assosicated with this hyperlink as a String
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
getVisitedColor
public Color getVisitedColor()
- Gets the visited color for this hyperlink.
- Returns:
- color Color of visited link
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
getNormalColor
public Color getNormalColor()
- Gets the normal color for this hyperlink.
- Returns:
- color Color of normal hyperlink
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
getActiveColor
public Color getActiveColor()
- Gets the active color for this hyperlink.
- Returns:
- color Color of active hyperlink
paint
public void paint(Graphics g)
- Paints the hyperlink.
- Parameters:
- g - The Graphics object to paint on
- Overrides:
- paint in class LWComponent
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
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
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
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
mouseClicked
public void mouseClicked(MouseEvent e)
- Event handler for when the mouse clicks the hyperlink
- Parameters:
- MouseEvent - Event
mouseEntered
public void mouseEntered(MouseEvent e)
- Event handler for when the mouse enters the hyperlink
- Parameters:
- MouseEvent - Event
mouseExited
public void mouseExited(MouseEvent e)
- Event handler for when the mouse leaves the hyperlink
- Parameters:
- MouseEvent - Event
mousePressed
public void mousePressed(MouseEvent e)
- Not implemented
mouseReleased
public void mouseReleased(MouseEvent e)
- Not implemented
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
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