JIDE 3.5.15

com.jidesoft.tooltip.shapes
Class RoundedRectangularShape

java.lang.Object
  extended by com.jidesoft.tooltip.shapes.RoundedRectangularShape
All Implemented Interfaces:
BalloonShape
Direct Known Subclasses:
RectangularShape

public class RoundedRectangularShape
extends Object
implements BalloonShape

A balloon shape implementation, a rounded rectangle shape.


Constructor Summary
RoundedRectangularShape()
           
 
Method Summary
 Shape createOutline(Dimension balloonSize, Dimension contentSize)
          Create the outline of the rounded rectangle.
 int getCornerSize()
           
static double getDistance(Point p, Rectangle rect, int cornerSize)
          Gets distance from pixel to the rounded rectangle
 double getEdgeDistance(Point pixel, BalloonTip balloonTip)
          Get the closest distance between the current pixel and the edge of the balloon outline.
 Point getHotSpot(Dimension balloonSize)
          Gets the arrow vertex position.
 Insets getInsets(Dimension contentSize)
          Get the insets around the content component.
 void setCornerSize(int cornerSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoundedRectangularShape

public RoundedRectangularShape()
Method Detail

createOutline

public Shape createOutline(Dimension balloonSize,
                           Dimension contentSize)
Create the outline of the rounded rectangle.

Specified by:
createOutline in interface BalloonShape
Parameters:
balloonSize - the preferred size of the balloon.
contentSize - the preferred size of the content
Returns:
the balloon the shape

getHotSpot

public Point getHotSpot(Dimension balloonSize)
Description copied from interface: BalloonShape
Gets the arrow vertex position. BalloonTip has an arrow pointing out. The vertex should point to the place that needs the tooltip.

Specified by:
getHotSpot in interface BalloonShape
Parameters:
balloonSize - the preferred size of the balloon.
Returns:
the arrow vertex position.

getInsets

public Insets getInsets(Dimension contentSize)
Description copied from interface: BalloonShape
Get the insets around the content component.

Specified by:
getInsets in interface BalloonShape
Parameters:
contentSize - the preferred size of the content component.
Returns:
the insets around the content component, including the outline shape.

getEdgeDistance

public double getEdgeDistance(Point pixel,
                              BalloonTip balloonTip)
Description copied from interface: BalloonShape
Get the closest distance between the current pixel and the edge of the balloon outline. Used to determin the edge light effect.

Specified by:
getEdgeDistance in interface BalloonShape
Parameters:
pixel - current point in the balloon coordinate system.
balloonTip - the balloon tip.
Returns:
the closest or effective distance of the pixel to the balloon outline.

getDistance

public static double getDistance(Point p,
                                 Rectangle rect,
                                 int cornerSize)
Gets distance from pixel to the rounded rectangle

Parameters:
p - point
rect - rectangle
cornerSize - the corner size of the rounded rectangle
Returns:
the distance

getCornerSize

public int getCornerSize()

setCornerSize

public void setCornerSize(int cornerSize)

JIDE 3.5.15