Class symantec.itools.awt.InfoTipPanel
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class symantec.itools.awt.InfoTipPanel

Object
   |
   +----Component
           |
           +----Container
                   |
                   +----Panel
                           |
                           +----ImagePanel
                                   |
                                   +----symantec.itools.awt.InfoTipPanel

public class InfoTipPanel
extends ImagePanel
implements Runnable, Serializable
The InfoTipPanel is a panel which may contain only one component. Whenever this component receives a mouse entered event, the InfoTipPanel either scrolls a text message towards the button or pops the text up immediately next to the button. Whenever this component receives a mouse exit event, the text scrolls away from the component or disappears.

Version:
1.0, September 4, 1997
Author:
Symantec

Variable Index

 o ABOVE_COMPONENT
Defines the "from top" scroll direction.
 o BELOW_COMPONENT
Defines the "from bottom" scroll direction.
 o DONE_SCROLLING_IN
Defines the "done scrolling in" scroll state.
 o DONE_SCROLLING_OUT
Defines the "done scrolling out" scroll state.
 o LEFT_OF_COMPONENT
Defines the "from left" scroll direction.
 o RIGHT_OF_COMPONENT
Defines the "from right" scroll direction.
 o SCROLLING_IN
Defines the "scrolling in" scroll state.
 o SCROLLING_OUT
Defines the "scrolling out" scroll state.
 o WAITING_TO_SCROLL_IN
Defines the "waiting to scroll in" scroll state.
 o bufferedBgndImage
Off screen buffer used for animation.
 o callingAddInternally
Internal flag that indicates a call to add() is being made from within InfoTipPanel.
 o delayTimer
Timer object which is used to time the delay before popping up the text.
 o dontDrawText
Internal flag that indicates that the component is NOT to draw the text from within paint().
 o errors
Error strings.
 o extraHighlightHeight
Extra height which is added on if highlighText == true
 o extraHighlightWidth
Extra width which is added on if highlighText == true
 o highlightText
boolean property representing whether the text will be drawn transparently rather than using the specified textHighlightColor.
 o myComponent
Reference to the component which will be added to the InfoTipPanel and whose mouse entered and mouse exited events will control the scrolling of the text.
 o myMouseListener
Reference to the Mouse object which is listening to myComponent for mouse events.
 o offScreenImage
Off screen buffer used for animation.
 o text
The text which will be scrolled on mouse entered and mouse exited events from myComponent.
 o textAnimationThread
The thread which will animate the scrolling text.
 o textAscent
Ascent of current message text.
 o textColor
The color used for text when this component is enabled.
 o textDelay
int property which represents how long (in milliseconds) to pause before starting to scroll/pop-up text on a mouse entered event.
 o textDescent
Descent of current message text.
 o textHeight
Height of current message text.
 o textHighlightColor
Color which will be used to highlight the text if highlightText flag is set.
 o textScrollsIn
boolean property representing whether the text will be scrolled in from the edge of the panel on a mouse over, or popped up beside the component.
 o textWidth
Width of current message text.

Constructor Index

 o symantec.itools.awt.InfoTipPanel()
Constructs a default InfoTipPanel.
 o symantec.itools.awt.InfoTipPanel(Component, String, int, boolean, int, boolean)
Constructs a new InfoTipPanel initialized with the specified component, text, minimum height and minimum width.

Method Index

 o addImpl(Component, Object, int)
Adds the specified component to this container at the specified index.
 o addNotify()
Tells this component that it has been added to a container.
 o addPropertyChangeListener(PropertyChangeListener)
Adds a listener for all event changes.
 o addTextLocationListener(PropertyChangeListener)
Adds a listener for the TextLocation property changes.
 o addTextLocationListener(VetoableChangeListener)
Adds a vetoable listener for the TextLocation property changes.
 o addVetoableChangeListener(VetoableChangeListener)
Adds a vetoable listener for all event changes.
 o atOrBeyondPoint(Point, Point, int)
Utility method for updateDirection, calculateDX, and calculateDY.
 o calculateDX(Point)
Utility method for drawNextFrame.
 o calculateDY(Point)
Utility method for drawNextFrame.
 o calculateTextAttributes()
Utility method.
 o createOffScreenBuffers()
This method re-creates the off screen images necessary for the text animation.
 o drawNextFrame(Point)
Does all necessary calculations and graphics work to advance the text one frame (starting from the point specified in the paramter startingPoint).
 o drawText(Graphics, int, int)
Draws the current text into the graphics context and location specified in the parameters.
 o getAreaAffectedByPopup()
Utility method for getBufferedBackgroundBounds.
 o getAreaAffectedByScroll()
Utility method for getBufferedBackgroundBounds.
 o getBufferedBackgroundBottomMostY()
Utility method for getBufferedBackgroundBounds.
 o getBufferedBackgroundBounds()
Calculates the rectangle which bounds the portion of this component's background which the text will animate over.
 o getBufferedBackgroundLeftMostX()
Utility method for getBufferedBackgroundBounds.
 o getBufferedBackgroundRightMostX()
Utility method for getBufferedBackgroundBounds.
 o getBufferedBackgroundTopMostY()
Utility method for getBufferedBackgroundBounds.
 o getComponent()
Gets the current component in the InfoTipPanel.
 o getHighlightBounds(int, int)
Determines the rectangle which bounds the area that should be highlighted.
 o getHighlightText()
Gets the current value of the "Highlight Text" property which determines whether the text will be highlighted with the current textHighlightColor or not.
 o getMinimumSize()
Returns the minimum dimensions to properly display this component.
 o getPreferredSize()
Returns the recommended dimensions to properly display this component.
 o getText()
Gets the current text in this InfoTipPanel.
 o getTextColor()
Gets the current text color.
 o getTextConstantXPos()
Utility method for getTextStartingPoint and getTextFinishingPoint.
 o getTextConstantYPos()
Utility method for getTextStartingPoint and getTextFinishingPoint.
 o getTextDelay()
Get the amount of time (in milliseconds) to wait after a mouse entered event before the text is scrolled in or popped up.
 o getTextFinishingPoint()
Calculates the point at which the text should be located when the scrolling animation has scrolled the text all the way in.
 o getTextHighlightColor()
Gets the current highlight color which will be used if highlightText is true.
 o getTextLocation()
Gets the current value of the "Text Location" property for this InfoTipPanel.
 o getTextScrollsIn()
Gets the value of the "Text Scrolls In" property which tells the InfoTipPanel whether the text should be scrolled in on a mouse over rather than just appearing next to the component (without scrolling in).
 o getTextStartingPoint()
Calculates the point at which the text should be located when the scrolling animation is initiated.
 o isValidTextLocation(int)
Is the given text location valid.
 o paint(Graphics)
Paints this component using the given graphics context.
 o popDownText()
Basically just erases the text next to the component (in the location specified by textLocation).
 o popUpText()
Draws the text next to the component (in the location specified by textLocation).
 o remove(Component)
Removes the specified component from this container.
 o removeAll()
Removes all the components from this container.
 o removeNotify()
Tells this component that it is being removed from a container.
 o removePropertyChangeListener(PropertyChangeListener)
Removes a listener for all event changes.
 o removeTextLocationListener(PropertyChangeListener)
Removes a listener for the TextLocation property changes.
 o removeTextLocationListener(VetoableChangeListener)
Removes a vetoable listener for the TextLocation property changes.
 o removeVetoableChangeListener(VetoableChangeListener)
Removes a vetoable listener for all event changes.
 o run()
Standard method in the java.lang.Runnable interface.
 o scrollOneDirection(Point)
Starts the text scrolling in the current direction, starting from the point specified by the parameter startingPoint.
 o scrollText()
Start the text scrolling in or out from the appropriate location.
 o setBounds(int, int, int, int)
Reshapes the Component to the specified bounding box.
 o setComponent(Component)
Sets the component in this InfoTipPanel.
 o setFont(Font)
Sets the font of the component.
 o setHighlightText(boolean)
Sets the "Highlight Text" property which determines whether the text will be highlighted with the current textHighlightColor or not.
 o setImageURL(URL)
Sets the URL of the image to display in this panel.
 o setLayout(LayoutManager)
Takes no action.
 o setStyle(int)
Sets the new panel image style.
 o setText(String)
Sets the text in this InfoTipPanel.
 o setTextColor(Color)
Sets the text color.
 o setTextDelay(int)
Set the amount of time (in milliseconds) to wait after a mouse entered event before the text is scrolled in or popped up.
 o setTextHighlightColor(Color)
Sets the current highlight color which will be used if highlightText is true.
 o setTextLocation(int)
Sets where the text will be located in this InfoTipPanel.
 o setTextScrollsIn(boolean)
Sets the "Text Scrolls In" property which tells the InfoTipPanel whether the text should be scrolled in on a mouse over rather than just appearing next to the component (without scrolling in).
 o startScrolling(int, boolean)
Starts the text scrolling in the direction indicated by the parameter newScrollState.
 o stopScrolling()
Stops the scrolling text animation (if any).
 o storeBackground()
Utility method for run.
 o updateDirection(Point)
Utility method for drawNextFrame.
 o validateOffScreenBuffers()
Utility method of run This method checks to see whether the off screen images necessary for the animation already exist, and if so that they are of the correct size.

Variables

 o ABOVE_COMPONENT
public static final int ABOVE_COMPONENT
Defines the "from top" scroll direction. One of four possible values for textLocation.

 o BELOW_COMPONENT
public static final int BELOW_COMPONENT
Defines the "from bottom" scroll direction. One of four possible values for textLocation.

 o DONE_SCROLLING_IN
protected static final int DONE_SCROLLING_IN
Defines the "done scrolling in" scroll state. One of four possible values for scrollState.

 o DONE_SCROLLING_OUT
protected static final int DONE_SCROLLING_OUT
Defines the "done scrolling out" scroll state. One of four possible values for scrollState.

 o LEFT_OF_COMPONENT
public static final int LEFT_OF_COMPONENT
Defines the "from left" scroll direction. One of four possible values for textLocation.

 o RIGHT_OF_COMPONENT
public static final int RIGHT_OF_COMPONENT
Defines the "from right" scroll direction. One of four possible values for textLocation.

 o SCROLLING_IN
protected static final int SCROLLING_IN
Defines the "scrolling in" scroll state. One of four possible values for scrollState.

 o SCROLLING_OUT
protected static final int SCROLLING_OUT
Defines the "scrolling out" scroll state. One of four possible values for scrollState.

 o WAITING_TO_SCROLL_IN
protected static final int WAITING_TO_SCROLL_IN
Defines the "waiting to scroll in" scroll state. One of four possible values for scrollState.

 o bufferedBgndImage
protected transient java.awt.Image bufferedBgndImage
Off screen buffer used for animation.

 o callingAddInternally
protected transient boolean callingAddInternally
Internal flag that indicates a call to add() is being made from within InfoTipPanel.

 o delayTimer
protected symantec.itools.util.Timer delayTimer
Timer object which is used to time the delay before popping up the text.

 o dontDrawText
protected transient boolean dontDrawText
Internal flag that indicates that the component is NOT to draw the text from within paint().

 o errors
protected transient java.util.ResourceBundle errors
Error strings.

 o extraHighlightHeight
protected int extraHighlightHeight
Extra height which is added on if highlighText == true

 o extraHighlightWidth
protected int extraHighlightWidth
Extra width which is added on if highlighText == true

 o highlightText
protected boolean highlightText
boolean property representing whether the text will be drawn transparently rather than using the specified textHighlightColor.

See Also:
setHighlightText, getHighlightText
 o myComponent
protected java.awt.Component myComponent
Reference to the component which will be added to the InfoTipPanel and whose mouse entered and mouse exited events will control the scrolling of the text.

See Also:
setComponent, getComponent
 o myMouseListener
protected symantec.itools.awt.InfoTipPanel. Mouse myMouseListener
Reference to the Mouse object which is listening to myComponent for mouse events.

 o offScreenImage
protected transient java.awt.Image offScreenImage
Off screen buffer used for animation.

 o text
protected java.lang.String text
The text which will be scrolled on mouse entered and mouse exited events from myComponent.

See Also:
setText, getText
 o textAnimationThread
protected transient java.lang.Thread textAnimationThread
The thread which will animate the scrolling text.

 o textAscent
protected transient int textAscent
Ascent of current message text.

 o textColor
protected java.awt.Color textColor
The color used for text when this component is enabled.

See Also:
getTextColor, setTextColor
 o textDelay
protected int textDelay
int property which represents how long (in milliseconds) to pause before starting to scroll/pop-up text on a mouse entered event.

See Also:
setTextDelay, getTextDelay
 o textDescent
protected transient int textDescent
Descent of current message text.

 o textHeight
protected transient int textHeight
Height of current message text.

 o textHighlightColor
protected java.awt.Color textHighlightColor
Color which will be used to highlight the text if highlightText flag is set.

See Also:
setTextHighlightColor, getTextHighlightColor
 o textScrollsIn
protected boolean textScrollsIn
boolean property representing whether the text will be scrolled in from the edge of the panel on a mouse over, or popped up beside the component.

See Also:
setTextScrollsIn, getTextScrollsIn
 o textWidth
protected transient int textWidth
Width of current message text.

Constructors

 o InfoTipPanel
public InfoTipPanel()
Constructs a default InfoTipPanel. The panel is initialized with a null component, RIGHT_OF_COMPONENT as the scrolldirection, and the Auto-Position property set to true.

 o InfoTipPanel
public InfoTipPanel(Component component,
                    String text,
                    int textLocation,
                    boolean textScrollsIn,
                    int textDelay,
                    boolean highlightText)
Constructs a new InfoTipPanel initialized with the specified component, text, minimum height and minimum width.

Parameters:
component - the component which will be added to the InfoTipPanel and whose mouse entered and mouse exited events will control the scrolling of the text.
text - the text which will be scrolled.
textLocation - the direction from which the text is scrolled. resize itself and position the component placed inside of it.

Methods

 o addImpl
protected void addImpl(Component comp,
                       Object constraints,
                       int index)
Adds the specified component to this container at the specified index. Also notifies the layout manager to add the component to the this container's layout using the specified constraints object.

This is the method to override if you want to track every add request to a container. An overriding method should usually include a call to super.addImpl(comp, constraints, index). It is overridden here to set the only component in this InfoTipPanel. This is the component that triggers text scrolling on a mouse entered event. The InfoTipPanel can only contain one component. Any previous component will be removed before the new one is added.

Parameters:
comp - the component to be added
constraints - an object expressing layout contraints for this component
index - the position in the container's list at which to insert the component. -1 means insert at the end.
Overrides:
addImpl in class Container
See Also:
remove
 o addNotify
public synchronized void addNotify()
Tells this component that it has been added to a container. This is a standard Java AWT method which gets called by the AWT when this component is added to a container. Typically, it is used to create this component's peer. It has been OVERRIDDEN here to calculate text sizes and to create any off screen buffers that will be needed for the animation.

Overrides:
addNotify in class Panel
See Also:
removeNotify
 o addPropertyChangeListener
public synchronized void addPropertyChangeListener(PropertyChangeListener listener)
Adds a listener for all event changes.

Parameters:
listener - the listener to add.
Overrides:
addPropertyChangeListener in class ImagePanel
See Also:
removePropertyChangeListener
 o addTextLocationListener
public synchronized void addTextLocationListener(PropertyChangeListener listener)
Adds a listener for the TextLocation property changes.

Parameters:
listener - the listener to add.
See Also:
removeTextLocationListener(java.beans.PropertyChangeListener)
 o addTextLocationListener
public synchronized void addTextLocationListener(VetoableChangeListener listener)
Adds a vetoable listener for the TextLocation property changes.

Parameters:
listener - the listener to add.
See Also:
removeTextLocationListener(java.beans.VetoableChangeListener)
 o addVetoableChangeListener
public synchronized void addVetoableChangeListener(VetoableChangeListener listener)
Adds a vetoable listener for all event changes.

Parameters:
listener - the listener to add.
Overrides:
addVetoableChangeListener in class ImagePanel
See Also:
removeVetoableChangeListener
 o atOrBeyondPoint
protected boolean atOrBeyondPoint(Point currentLocation,
                                  Point point,
                                  int allowance)
Utility method for updateDirection, calculateDX, and calculateDY. If paramter 'allowance' equals zero, this method determines whether or not the text has scrolled to a position which is at or beyond the point specified in the parameter 'point' (based on textLocation and scrollState). For a non-zero 'allowance', this method determines whether or not the text has scrolled to a position which is either beyond 'point' or within 'allowance' pixels of 'point' (based on the current textLocation and scrollState).

Returns:
whether or not 'currentLocation' is at or beyond 'point' (given 'allowance' pixels of leeway).
 o calculateDX
protected int calculateDX(Point startingPoint)
Utility method for drawNextFrame. Given the current location of the text, this method calculates how far in the x-direction the text should move when it advances to the next frame of the animation.

Parameters:
startingPoint - the current location of the text.
Returns:
the distance in the x-direction the text should move when it advances to the next frame of the animation.
See Also:
calculateDY
 o calculateDY
protected int calculateDY(Point startingPoint)
Utility method for drawNextFrame. Given the current location of the text, this method calculates how far in the y-direction the text should move when it advances to the next frame of the animation.

Parameters:
startingPoint - the current location of the text.
Returns:
the distance in the y-direction the text should move when it advances to the next frame of the animation.
See Also:
calculateDX
 o calculateTextAttributes
protected void calculateTextAttributes()
Utility method. This method calculates the ascent, descent, height, and width of the current text, based on the current graphics context.

 o createOffScreenBuffers
protected void createOffScreenBuffers()
This method re-creates the off screen images necessary for the text animation. This method must be called any time that the sizes of these images must be re-calculated -- it will flush() the old images (if any) and create new images of the correct size.

 o drawNextFrame
protected void drawNextFrame(Point startingPoint)
Does all necessary calculations and graphics work to advance the text one frame (starting from the point specified in the paramter startingPoint). statingPoint is modified by this method to be the NEW position of the text (scrolled one frame further than when the method was called)

Parameters:
startingPoint - the current position of the text (before this method advances it by one animation frame).
 o drawText
protected void drawText(Graphics g,
                        int x,
                        int y)
Draws the current text into the graphics context and location specified in the parameters. Highlights the text, if necessary.

Parameters:
g - the graphics context into which the text should be drawn
x - the x-coordinate at which the text should be drawn
y - the y-coordinate at which the text should be drawn
 o getAreaAffectedByPopup
protected java.awt.Rectangle getAreaAffectedByPopup()
Utility method for getBufferedBackgroundBounds. Calculates the rectangle which bounds the portion of this component's background which the text will pop-up over.

Returns:
this bounding rectangle (or null if there is insufficient space to do the animation.
 o getAreaAffectedByScroll
protected java.awt.Rectangle getAreaAffectedByScroll()
Utility method for getBufferedBackgroundBounds. Calculates the rectangle which bounds the portion of this component's background which the text will scroll over.

Returns:
this bounding rectangle (or null if there is insufficient space to do the animation.
 o getBufferedBackgroundBottomMostY
protected int getBufferedBackgroundBottomMostY()
Utility method for getBufferedBackgroundBounds. This method calculates the y-coordinate of the bottom edge of the rectangle which bounds the portion of this component's background which the text will animate over.

Returns:
this y-coordinate.
See Also:
getBufferedBackgroundBounds, getBufferedBackgroundTopMostY, getBufferedBackgroundLeftMostX, getBufferedBackgroundRightMostX
 o getBufferedBackgroundBounds
protected java.awt.Rectangle getBufferedBackgroundBounds()
Calculates the rectangle which bounds the portion of this component's background which the text will animate over.

Returns:
this bounding rectangle.
 o getBufferedBackgroundLeftMostX
protected int getBufferedBackgroundLeftMostX()
Utility method for getBufferedBackgroundBounds. This method calculates the x-coordinate of the rectangle which bounds the portion of this component's background which the text will animate over.

Returns:
this x-coordinate.
See Also:
getBufferedBackgroundBounds, getBufferedBackgroundTopMostY, getBufferedBackgroundBottomMostY, getBufferedBackgroundRightMostX
 o getBufferedBackgroundRightMostX
protected int getBufferedBackgroundRightMostX()
Utility method for getBufferedBackgroundBounds. This method calculates the x-coordinate of the right edge of the rectangle which bounds the portion of this component's background which the text will animate over.

Returns:
this x-coordinate.
See Also:
getBufferedBackgroundBounds, getBufferedBackgroundTopMostY, getBufferedBackgroundBottomMostY, getBufferedBackgroundLeftMostX
 o getBufferedBackgroundTopMostY
protected int getBufferedBackgroundTopMostY()
Utility method for getBufferedBackgroundBounds. This method calculates the y-coordinate of the rectangle which bounds the portion of this component's background which the text will animate over.

Returns:
this y-coordinate.
See Also:
getBufferedBackgroundBounds, getBufferedBackgroundBottomMostY, getBufferedBackgroundLeftMostX, getBufferedBackgroundRightMostX
 o getComponent
public java.awt.Component getComponent()
Gets the current component in the InfoTipPanel. This is the component that triggers text scrolling on a mouse entered event.

Returns:
the current component in the InfoTipPanel
See Also:
setComponent
 o getHighlightBounds
protected java.awt.Rectangle getHighlightBounds(int textX,
                                                int textY)
Determines the rectangle which bounds the area that should be highlighted.

Returns:
this bounding Rectangle, or null if textWidth or textHeight is zero.
 o getHighlightText
public boolean getHighlightText()
Gets the current value of the "Highlight Text" property which determines whether the text will be highlighted with the current textHighlightColor or not.

Returns:
the current value of this property
See Also:
setHighlightText, getTextHighlightColor, setTextHighlightColor
 o getMinimumSize
public java.awt.Dimension getMinimumSize()
Returns the minimum dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the minimum size of this component. It is OVERRIDDEN here to just return the preferred size as determined by a call to getPreferredSize()

Returns:
A Dimension representing the minimum size of this component
Overrides:
getMinimumSize in class Container
See Also:
getPreferredSize
 o getPreferredSize
public java.awt.Dimension getPreferredSize()
Returns the recommended dimensions to properly display this component. This is a standard Java AWT method which gets called to determine the recommended size of this component. It has been OVERRIDEEN here to, for each axis, return the larger of the current size and the size of myComponent.

Returns:
A Dimension representing the preferred size of this component
Overrides:
getPreferredSize in class Container
See Also:
getMinimumSize
 o getText
public java.lang.String getText()
Gets the current text in this InfoTipPanel. This is the text which scrolls out on a mouse entered event.

Returns:
the text
See Also:
setText
 o getTextColor
public java.awt.Color getTextColor()
Gets the current text color.

Returns:
the current color of the text
See Also:
setTextColor
 o getTextConstantXPos
protected int getTextConstantXPos()
Utility method for getTextStartingPoint and getTextFinishingPoint. This method calculates the x-position at which the text should be drawn if the textLocation is either ABOVE_COMPONENT or BELOW_COMPONENT. Requires a graphics context to be available.

Returns:
the x-position at which the text should be drawn if the textLocation is either ABOVE_COMPONENT or BELOW_COMPONENT.
See Also:
getTextStartingPoint, getTextFinishingPoint
 o getTextConstantYPos
protected int getTextConstantYPos()
Utility method for getTextStartingPoint and getTextFinishingPoint. This method calculates the y-position at which the text should be drawn if the textLocation is either LEFT_OF_COMPONENT or RIGHT_OF_COMPONENT. Requires a graphics context to be available.

Returns:
the y-position at which the text should be drawn if the textLocation is either LEFT_OF_COMPONENT or RIGHT_OF_COMPONENT.
See Also:
getTextStartingPoint, getTextFinishingPoint
 o getTextDelay
public int getTextDelay()
Get the amount of time (in milliseconds) to wait after a mouse entered event before the text is scrolled in or popped up.

Returns:
the amount of time (in milliseconds) that this InfoTipPanel will wait after a mouse entered event before the text is scrolled in or popped up.
See Also:
setTextDelay
 o getTextFinishingPoint
protected java.awt.Point getTextFinishingPoint()
Calculates the point at which the text should be located when the scrolling animation has scrolled the text all the way in.

Returns:
this Point
See Also:
getTextStartingPoint
 o getTextHighlightColor
public java.awt.Color getTextHighlightColor()
Gets the current highlight color which will be used if highlightText is true.

Returns:
the current highlight color
See Also:
setTextHighlightColor, getHighlightText, setHighlightText
 o getTextLocation
public int getTextLocation()
Gets the current value of the "Text Location" property for this InfoTipPanel. The text location controls where the text will appear on a mouse entered event.

Returns:
the text location: RIGHT_OF_COMPONENT, LEFT_OF_COMPONENT, ABOVE_COMPONENT, or BELOW_COMPONENT
See Also:
setTextLocation
 o getTextScrollsIn
public boolean getTextScrollsIn()
Gets the value of the "Text Scrolls In" property which tells the InfoTipPanel whether the text should be scrolled in on a mouse over rather than just appearing next to the component (without scrolling in).

Returns:
the current value of this property
See Also:
setTextScrollsIn
 o getTextStartingPoint
protected java.awt.Point getTextStartingPoint()
Calculates the point at which the text should be located when the scrolling animation is initiated.

Returns:
this Point
See Also:
getTextFinishingPoint
 o isValidTextLocation
protected boolean isValidTextLocation(int i)
Is the given text location valid.

Parameters:
i - the given text location
Returns:
true if the given text location is acceptable, false if not.
 o paint
public void paint(Graphics g)
Paints this component using the given graphics context. This is a standard Java AWT method which typically gets called by the AWT to handle painting this component. It paints this component using the given graphics context. The graphics context clipping region is set to the bounding rectangle of this component and its [0,0] coordinate is this component's top-left corner. It has been OVERRIDDEN for this container to call super.paint(g), and then draw it's text, if necessary.

Parameters:
g - the graphics context used for painting
Overrides:
paint in class ImagePanel
See Also:
repaint
 o popDownText
protected void popDownText()
Basically just erases the text next to the component (in the location specified by textLocation).

See Also:
popUpText
 o popUpText
protected void popUpText()
Draws the text next to the component (in the location specified by textLocation).

See Also:
popDownText
 o remove
public synchronized void remove(Component comp)
Removes the specified component from this container. This is a standard Java AWT method which gets called to remove a component from a container. When this happens the component's removeNotify() will also get called to indicate component removal. It has been OVERRIDDEN here to add remove the listeners which we added to the component.

Parameters:
comp - the component to remove
Overrides:
remove in class Container
See Also:
removeAll, add
 o removeAll
public synchronized void removeAll()
Removes all the components from this container. This is a standard Java AWT method which gets called to remove all the components from a container. When this happens each component's removeNotify() will also get called to indicate component removal. It has been OVERRIDDEN here to remove the InfoTipPanel's reference to its component.

Overrides:
removeAll in class Container
See Also:
remove, add
 o removeNotify
public synchronized void removeNotify()
Tells this component that it is being removed from a container. This is a standard Java AWT method which gets called by the AWT when this component is removed from a container. Typically, it is used to destroy the peers of this component and all its subcomponents. It has been OVERRIDDEN here to dispose of any buffers or any animation thread in use by this InfoTipPanel, and then call super.removeNotify().

Overrides:
removeNotify in class Container
See Also:
addNotify
 o removePropertyChangeListener
public synchronized void removePropertyChangeListener(PropertyChangeListener listener)
Removes a listener for all event changes.

Parameters:
listener - the listener to remove.
Overrides:
removePropertyChangeListener in class ImagePanel
See Also:
addPropertyChangeListener
 o removeTextLocationListener
public synchronized void removeTextLocationListener(PropertyChangeListener listener)
Removes a listener for the TextLocation property changes.

Parameters:
listener - the listener to remove.
See Also:
addTextLocationListener(java.beans.PropertyChangeListener)
 o removeTextLocationListener
public synchronized void removeTextLocationListener(VetoableChangeListener listener)
Removes a vetoable listener for the TextLocation property changes.

Parameters:
listener - the listener to remove.
See Also:
addTextLocationListener(java.beans.VetoableChangeListener)
 o removeVetoableChangeListener
public synchronized void removeVetoableChangeListener(VetoableChangeListener listener)
Removes a vetoable listener for all event changes.

Parameters:
listener - the listener to remove.
Overrides:
removeVetoableChangeListener in class ImagePanel
See Also:
addVetoableChangeListener
 o run
public void run()
Standard method in the java.lang.Runnable interface. When an object implementing interface Runnable is used to create a thread, starting the thread causes the object's run method to be called in that separately executing thread. Here, run has been implemented to do animate the text scrolling in and out. The thread calling this method will continue to animate the text until it scrolls either completely out, or completely in.

Since:
JDK1.0
See Also:
run
 o scrollOneDirection
protected java.awt.Point scrollOneDirection(Point startingPoint)
Starts the text scrolling in the current direction, starting from the point specified by the parameter startingPoint. The text will continue to be scrolled until the current direction changes (due to a mouse event, or due to the text scrolling all the way in or out).

Parameters:
startingPoint - the point from which the text starts scrolling
Returns:
the point at which the text stopped scrolling
 o scrollText
protected void scrollText()
Start the text scrolling in or out from the appropriate location. The text will continue to be scrolled back and forth until the text scrolls all the way in, or all the way out.

 o setBounds
public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Reshapes the Component to the specified bounding box. It has been OVERRIDDEN here to adjust all the animation buffers to the correct size (based on the new size of the InfoTipPanel)

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the component
height - the height of the component
Overrides:
setBounds in class Component
See Also:
getBounds, setLocation, setSize
 o setComponent
public void setComponent(Component comp)
Sets the component in this InfoTipPanel. This is the component that triggers text scrolling on a mouse entered event. The InfoTipPanel can only contain one component. Any previous component will be removed before the new one is added.

Parameters:
comp - the component to add
See Also:
getComponent
 o setFont
public synchronized void setFont(Font f)
Sets the font of the component. This is a standard method of java.awt.component. It has been OVERRIDDEN here to recalculate the sizes/locations of everything based on the new font.

Parameters:
f - the font
Overrides:
setFont in class Component
 o setHighlightText
public void setHighlightText(boolean newValue) throws PropertyVetoException
Sets the "Highlight Text" property which determines whether the text will be highlighted with the current textHighlightColor or not.

Parameters:
newValue - the new value of this property
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getHighlightText, getTextHighlightColor, setTextHighlightColor
 o setImageURL
public void setImageURL(URL url) throws PropertyVetoException
Sets the URL of the image to display in this panel. It has been OVERRIDDEN here to suspend the animation thread while the image is set, and to re-buffer the new background.

Parameters:
url - the URL of the image to display
Throws: PropertyVetoException
if the specified property value is unacceptable
Overrides:
setImageURL in class ImagePanel
See Also:
setImageURL, getImageURL
 o setLayout
public void setLayout(LayoutManager mgr)
Takes no action. This is a standard Java AWT method which gets called to specify which layout manager should be used to layout the components in standard containers. Since layout managers CANNOT BE USED with this container the standard setLayout has been OVERRIDDEN for this container and does nothing.

Parameters:
l - the layout manager to use to layout this container's components (IGNORED)
Overrides:
setLayout in class Container
See Also:
getLayout
 o setStyle
public void setStyle(int newStyle) throws PropertyVetoException
Sets the new panel image style. It has been OVERRIDDEN here to suspend the animation thread while the style is set, and to re-buffer the new background.

Parameters:
newStyle - the new panel image style, one of IMAGE_TILED, IMAGE_CENTERED, or IMAGE_SCALED_TO_FIT
Throws: PropertyVetoException
if the specified property value is unacceptable
Overrides:
setStyle in class ImagePanel
See Also:
setStyle, getStyle, IMAGE_TILED, IMAGE_CENTERED, IMAGE_SCALED_TO_FIT
 o setText
public void setText(String newText) throws PropertyVetoException
Sets the text in this InfoTipPanel. This is the text which scrolls out on a mouse entered event. Causes the component to redraw.

Parameters:
newText - the text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getText
 o setTextColor
public void setTextColor(Color color) throws PropertyVetoException
Sets the text color. Causes the InfoTipPanel to redraw.

Parameters:
color - the new color for the text
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getTextColor
 o setTextDelay
public void setTextDelay(int newDelay) throws PropertyVetoException
Set the amount of time (in milliseconds) to wait after a mouse entered event before the text is scrolled in or popped up.

Parameters:
newDelay - the amount of time (in milliseconds) to wait after a mouse entered event before the text is scrolled in or popped up.
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getTextDelay
 o setTextHighlightColor
public void setTextHighlightColor(Color color) throws PropertyVetoException
Sets the current highlight color which will be used if highlightText is true.

Parameters:
color - the new highlight color
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getTextHighlightColor, getHighlightText, setHighlightText
 o setTextLocation
public void setTextLocation(int newLocation) throws PropertyVetoException
Sets where the text will be located in this InfoTipPanel. This controls where the text will appear on a mouse entered event. Causes the component to redraw.

Parameters:
newLocation - the new text location: RIGHT_OF_COMPONENT, LEFT_OF_COMPONENT, ABOVE_COMPONENT, or BELOW_COMPONENT
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getTextLocation
 o setTextScrollsIn
public void setTextScrollsIn(boolean newScroll) throws PropertyVetoException
Sets the "Text Scrolls In" property which tells the InfoTipPanel whether the text should be scrolled in on a mouse over rather than just appearing next to the component (without scrolling in).

Parameters:
newScroll - the new value for this property
Throws: PropertyVetoException
if the specified property value is unacceptable
See Also:
getTextScrollsIn
 o startScrolling
protected void startScrolling(int newScrollState,
                              boolean ignoreDelay)
Starts the text scrolling in the direction indicated by the parameter newScrollState. The text will continue to be scrolled back and forth until the text scrolls all the way in, or all the way out. Causes a thread to be started to animate the text. This method is also responsible for starting the timer if the textDelay is set to some number of milliseconds. This method will be called a second time if and when that timer goes off.

Parameters:
newScrollState - the direction of the scroll: SCROLLING_IN, or SCROLLING_OUT
ignoreDelay - whether or not to ignore a delay even if it would normally be necessary (i.e. even though the text is starting to scroll in)
See Also:
stopScrolling
 o stopScrolling
protected void stopScrolling()
Stops the scrolling text animation (if any). Any subsequent mouse over events will cause the text to scroll again, as usual.

See Also:
startScrolling
 o storeBackground
protected void storeBackground()
Utility method for run. This method stores the background (in this case only the panel's image since this is a heavyweight component) into bufferedBgndImage. Only the portion of the background inside of the bounds specified by getBufferedBackgroundBounds() is saved.

See Also:
run
 o updateDirection
protected void updateDirection(Point currentPoint)
Utility method for drawNextFrame. Given the current location of the text, this method determines whether the scrollState should be set to SCROLLING_IN, SCROLLING_OUT, DONE_SCROLLING_IN, or DONE_SCROLLING_OUT. This method actually modifies the 'scrollState' member of this class.

See Also:
drawNextFrame
 o validateOffScreenBuffers
protected boolean validateOffScreenBuffers()
Utility method of run This method checks to see whether the off screen images necessary for the animation already exist, and if so that they are of the correct size. If the buffers do not exist this method tries to create them. Due to a bug in some VMs componentResize events may not get sent correctly so we must also check that the sizes of the buffers are correct.

Returns:
a boolean indicating whether or not buffers exist by the end of this method which are sufficient for the animation.
See Also:
run

All Packages  Class Hierarchy  This Package  Previous  Next  Index