net.java.balloontip.styles
Class ModernBalloonStyle

java.lang.Object
  extended by net.java.balloontip.styles.BalloonTipStyle
      extended by net.java.balloontip.styles.ModernBalloonStyle
All Implemented Interfaces:
javax.swing.border.Border

public class ModernBalloonStyle
extends BalloonTipStyle

A balloon tip with a vertical linear gradient background The border's thickness can be adjusted and anti-aliased. You can also choose which corners should be rounded corners or just plain corners.

Author:
Tim Molderez

Field Summary
 
Fields inherited from class net.java.balloontip.styles.BalloonTipStyle
flipX, flipY, horizontalOffset, verticalOffset
 
Constructor Summary
ModernBalloonStyle(int arcWidth, int arcHeight, java.awt.Color topFillColor, java.awt.Color bottomFillColor, java.awt.Color borderColor)
          Constructor
 
Method Summary
 void enableAntiAliasing(boolean enable)
          Enable/disable anti-aliasing for this balloon tip
 java.awt.Insets getBorderInsets(java.awt.Component c)
          Retrieve the balloon tip's border insets
 int getMinimalHorizontalOffset()
          Get the minimum value of the horizontal offset (Also useful as a maximum; maximum horizontaloffset = balloon tip width - minimum horizontal offset)
 boolean isBorderOpaque()
          Is this balloon tip opaque?
 void paintBorder(java.awt.Component c, java.awt.Graphics g, int x, int y, int width, int height)
           
 void setBorderThickness(int thickness)
          Set the thickness of the balloon tip's border
 void setCornerStyles(boolean topLeft, boolean topRight, boolean bottomLeft, boolean bottomRight)
          Sets the style for each corner.
 
Methods inherited from class net.java.balloontip.styles.BalloonTipStyle
flip, flipX, flipY, setHorizontalOffset, setVerticalOffset
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModernBalloonStyle

public ModernBalloonStyle(int arcWidth,
                          int arcHeight,
                          java.awt.Color topFillColor,
                          java.awt.Color bottomFillColor,
                          java.awt.Color borderColor)
Constructor

Parameters:
arcWidth - width of the rounded corner
arcHeight - height of the rounded color
borderColor - line color
topFillColor - top color of the lineair gradient fill color
bottomFillColor - bottom color of the lineair gradient fill color
Method Detail

setCornerStyles

public void setCornerStyles(boolean topLeft,
                            boolean topRight,
                            boolean bottomLeft,
                            boolean bottomRight)
Sets the style for each corner. If true, this corner will be rounded; if false, it's just a regular corner

Parameters:
topLeft - if true, the top-left corner is rounded
topRight - if true, the top-right corner is rounded
bottomLeft - if true, the bottom-left corner is rounded
bottomRight - if true, the bottom-right corner is rounded

setBorderThickness

public void setBorderThickness(int thickness)
Set the thickness of the balloon tip's border

Parameters:
thickness - border thickness in pixels

enableAntiAliasing

public void enableAntiAliasing(boolean enable)
Enable/disable anti-aliasing for this balloon tip

Parameters:
enable - if true, AA is enabled; if false, the settings remain untouched

getBorderInsets

public java.awt.Insets getBorderInsets(java.awt.Component c)
Description copied from class: BalloonTipStyle
Retrieve the balloon tip's border insets

Specified by:
getBorderInsets in interface javax.swing.border.Border
Specified by:
getBorderInsets in class BalloonTipStyle
Returns:
The balloon tip's border insets

isBorderOpaque

public boolean isBorderOpaque()
Description copied from class: BalloonTipStyle
Is this balloon tip opaque?

Specified by:
isBorderOpaque in interface javax.swing.border.Border
Overrides:
isBorderOpaque in class BalloonTipStyle
Returns:
True if opaque, false if the border uses transparency

paintBorder

public void paintBorder(java.awt.Component c,
                        java.awt.Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)

getMinimalHorizontalOffset

public int getMinimalHorizontalOffset()
Description copied from class: BalloonTipStyle
Get the minimum value of the horizontal offset (Also useful as a maximum; maximum horizontaloffset = balloon tip width - minimum horizontal offset)

Overrides:
getMinimalHorizontalOffset in class BalloonTipStyle
Returns:
Minimul horizontal offset


http://balloontip.java.net/