public abstract class BasicBalloonTipPositioner extends BalloonTipPositioner
Modifier and Type | Field and Description |
---|---|
protected float |
attachLocationX |
protected float |
attachLocationY |
protected boolean |
fixedAttachLocation |
protected boolean |
flipX |
protected boolean |
flipY |
protected int |
hOffset |
protected int |
minimumHorizontalOffset |
protected boolean |
offsetCorrection |
protected boolean |
orientationCorrection |
protected int |
preferredHorizontalOffset |
protected int |
preferredVerticalOffset |
protected int |
x |
protected int |
y |
balloonTip
Constructor and Description |
---|
BasicBalloonTipPositioner(int hO,
int vO)
Constructor
|
Modifier and Type | Method and Description |
---|---|
protected void |
applyOffsetCorrection() |
void |
determineAndSetLocation(Rectangle attached)
Determine and set the current location of the balloon tip
|
protected abstract void |
determineLocation(Rectangle attached) |
void |
enableFixedAttachLocation(boolean fixedAttachLocation)
Set whether the tip should have a fixed location
|
void |
enableOffsetCorrection(boolean offsetCorrection)
Set offset correction
|
void |
enableOrientationCorrection(boolean orientationCorrection)
Set orientation correction
|
float |
getAttachLocationX()
Returns the percentage that determines the X-coordinate of the tip within the attached component
(whereas 0.0 is the left side and 1.0 is the right side)
|
float |
getAttachLocationY()
Returns the percentage that determines the Y-coordinate of the tip within the attached component
(whereas 0.0 is the top and 1.0 is the bottom)
|
int |
getPreferredHorizontalOffset()
Retrieve the preferred horizontal offset (in pixels)
|
int |
getPreferredVerticalOffset()
Retrieve the preferred vertical offset
|
Point |
getTipLocation()
Find the current location of the balloon's tip, relative to the top-level container
|
boolean |
isFixedAttachLocation()
Does the tip have a fixed location?
|
boolean |
isOffsetCorrected()
Is offset correction enabled?
|
boolean |
isOrientationCorrected()
Is orientation correction enabled?
|
protected void |
onStyleChange()
This method is called whenever the balloon tip's style changes.
|
void |
setAttachLocation(float attachLocationX,
float attachLocationY)
Set where the tip should be located, relative to the component the balloon is attached to.
|
void |
setPreferredHorizontalOffset(int preferredHorizontalOffset)
Set the preferred horizontal offset
|
void |
setPreferredVerticalOffset(int preferredVerticalOffset)
Set the preferred horizontal offset
|
finalize, getBalloonTip, setBalloonTip
protected int x
protected int y
protected int hOffset
protected boolean flipX
protected boolean flipY
protected int preferredHorizontalOffset
protected int preferredVerticalOffset
protected int minimumHorizontalOffset
protected boolean offsetCorrection
protected boolean orientationCorrection
protected boolean fixedAttachLocation
protected float attachLocationX
protected float attachLocationY
public BasicBalloonTipPositioner(int hO, int vO)
hO
- preferred horizontal offset (in pixels)vO
- preferred vertical offset (in pixels)protected void onStyleChange()
BalloonTipPositioner
onStyleChange
in class BalloonTipPositioner
public int getPreferredHorizontalOffset()
public void setPreferredHorizontalOffset(int preferredHorizontalOffset)
preferredHorizontalOffset
- preferred horizontal offset (in pixels)public int getPreferredVerticalOffset()
public void setPreferredVerticalOffset(int preferredVerticalOffset)
preferredVerticalOffset
- preferred horizontal offset (in pixels)public boolean isOffsetCorrected()
public void enableOffsetCorrection(boolean offsetCorrection)
offsetCorrection
- enabled if truepublic boolean isOrientationCorrected()
public void enableOrientationCorrection(boolean orientationCorrection)
orientationCorrection
- enabled if truepublic boolean isFixedAttachLocation()
public void enableFixedAttachLocation(boolean fixedAttachLocation)
fixedAttachLocation
- the tip has a fixed location if truepublic float getAttachLocationX()
public float getAttachLocationY()
public void setAttachLocation(float attachLocationX, float attachLocationY)
attachLocationX
- a number from 0.0 to 1.0 (whereas 0 is the left side; 1 is the right side)attachLocationY
- a number from 0.0 to 1.0 (whereas 0 is the top; 1 is the bottom)public Point getTipLocation()
BalloonTipPositioner
getTipLocation
in class BalloonTipPositioner
protected void applyOffsetCorrection()
public void determineAndSetLocation(Rectangle attached)
BalloonTipPositioner
determineAndSetLocation
in class BalloonTipPositioner
attached
- the rectangle to which the balloon tip attaches itselfprotected abstract void determineLocation(Rectangle attached)