Top Description Inners Constructors Methods
com.sun.jna.examples

public Class BalloonManager

extends Object
Class Inheritance
Imports
java.awt.BorderLayout, .Color, .Component, .Dimension, .GradientPaint, .Graphics, .Graphics2D, .Point, .Shape, .Window, java.awt.event.ComponentAdapter, .ComponentEvent, .ComponentListener, .WindowAdapter, .WindowEvent, java.awt.geom.AffineTransform, .Area, .GeneralPath, .RoundRectangle2D, javax.swing.Box, .JWindow, .Popup, .SwingUtilities

Provides a popup balloon containing an arbitrary component. This provides a form of content-specific decoration less transient than a tooltip, and less heavyweight and more adaptable to changing content than a dedicated window. Clients are responsible for invoking show and hide on the provided popup.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static Popup
getBalloon(final Component owner, final Component content, int x, int y)

Get a balloon pointing to the given location.

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BalloonManagerback to summary
public BalloonManager()

Method Detail

getBalloonback to summary
public static Popup getBalloon(final Component owner, final Component content, int x, int y)

Get a balloon pointing to the given location. The coordinates are relative to owner, which if null, indicates the coordinates are absolute.

useDropShadowback to summary
private static boolean useDropShadow()
com.sun.jna.examples back to summary

private final Class BalloonManager.BubbleWindow

extends JWindow
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final int
private Area
private Dimension
private ComponentListener
private Point
private static final int
Inherited from javax.swing.JWindow:
accessibleContextrootPanerootPaneCheckingEnabled

Constructor Summary

AccessConstructor and Description
public
BubbleWindow(Window owner, Component content)

Method Summary

Modifier and TypeMethod and Description
public void
dispose()

Overrides java.awt.Window.dispose.

Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children.
private Shape
getMask(int w, int h)

public Dimension
getPreferredSize()

Overrides java.awt.Container.getPreferredSize.

Returns the preferred size of this container.
public void
setAnchorLocation(int x, int y)

public void
setBounds(int
the new x-coordinate of this component
x
,
int
the new y-coordinate of this component
y
,
int
the new width of this component
w
,
int
the new height of this component
h
)

Overrides java.awt.Window.setBounds.

Moves and resizes this component.
Inherited from javax.swing.JWindow:
addImplcreateRootPanegetAccessibleContextgetContentPanegetGlassPanegetGraphicsgetLayeredPanegetRootPanegetTransferHandlerisRootPaneCheckingEnabledparamStringremoverepaintsetContentPanesetGlassPanesetLayeredPanesetLayoutsetRootPanesetRootPaneCheckingEnabledsetTransferHandlerupdatewindowInit

Field Detail

ARCback to summary
private static final int ARC
maskback to summary
private Area mask
maskSizeback to summary
private Dimension maskSize
moveTrackerback to summary
private ComponentListener moveTracker
offsetback to summary
private Point offset
Y_OFFSETback to summary
private static final int Y_OFFSET

Constructor Detail

BubbleWindowback to summary
public BubbleWindow(Window owner, Component content)

Method Detail

disposeback to summary
public void dispose()

Overrides java.awt.Window.dispose.

Doc from java.awt.Window.dispose.

Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be marked as undisplayable.

The Window and its subcomponents can be made displayable again by rebuilding the native resources with a subsequent call to pack or show. The states of the recreated Window and its subcomponents will be identical to the states of these objects at the point where the Window was disposed (not accounting for additional modifications between those actions).

Note

When the last displayable window within the Java virtual machine (VM) is disposed of, the VM may terminate. See AWT Threading Issues for more information.

getMaskback to summary
private Shape getMask(int w, int h)
getPreferredSizeback to summary
public Dimension getPreferredSize()

Overrides java.awt.Container.getPreferredSize.

Doc from java.awt.Container.getPreferredSize.

Returns the preferred size of this container. If the preferred size has not been set explicitly by Component#setPreferredSize(Dimension) and this Container has a non-null LayoutManager, then LayoutManager#preferredLayoutSize(Container) is used to calculate the preferred size.

Note

some implementations may cache the value returned from the LayoutManager. Implementations that cache need not invoke preferredLayoutSize on the LayoutManager every time this method is invoked, rather the LayoutManager will only be queried after the Container becomes invalid.

Returns:Dimension

an instance of Dimension that represents the preferred size of this container.

setAnchorLocationback to summary
public void setAnchorLocation(int x, int y)
setBoundsback to summary
public void setBounds(int x, int y, int w, int h)

Overrides java.awt.Window.setBounds.

Doc from java.awt.Window.setBounds.

Moves and resizes this component. The new location of the top-left corner is specified by x and y, and the new size is specified by width and height.

This method changes layout-related information, and therefore, invalidates the component hierarchy.

The width or height values are automatically enlarged if either is less than the minimum size as specified by previous call to setMinimumSize.

The method changes the geometry-related data. Therefore, the native windowing system may ignore such requests, or it may modify the requested data, so that the Window object is placed and sized in a way that corresponds closely to the desktop settings.

Parameters
x:int

Doc from java.awt.Component.setBounds.

the new x-coordinate of this component

y:int

Doc from java.awt.Component.setBounds.

the new y-coordinate of this component

w:int

Doc from java.awt.Component.setBounds.

the new width of this component

h:int

Doc from java.awt.Component.setBounds.

the new height of this component

com.sun.jna.examples back to summary

private Class BalloonManager.DropShadow

extends JWindow
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final double
private static final Color
private ComponentListener
private static final Point
private Shape
private static final float
private static final float
Inherited from javax.swing.JWindow:
accessibleContextrootPanerootPaneCheckingEnabled

Constructor Summary

AccessConstructor and Description
public
DropShadow(final Window parent, Shape mask)

Method Summary

Modifier and TypeMethod and Description
private Shape
public Dimension
getPreferredSize()

Overrides java.awt.Container.getPreferredSize.

Returns the preferred size of this container.
public void
paint(Graphics
the specified Graphics window
graphics
)

Overrides java.awt.Window.paint.

Paints the container.
Inherited from javax.swing.JWindow:
addImplcreateRootPanegetAccessibleContextgetContentPanegetGlassPanegetGraphicsgetLayeredPanegetRootPanegetTransferHandlerisRootPaneCheckingEnabledparamStringremoverepaintsetContentPanesetGlassPanesetLayeredPanesetLayoutsetRootPanesetRootPaneCheckingEnabledsetTransferHandlerupdatewindowInit

Field Detail

ANGLEback to summary
private static final double ANGLE
COLORback to summary
private static final Color COLOR
listenerback to summary
private ComponentListener listener
OFFSETback to summary
private static final Point OFFSET
parentMaskback to summary
private Shape parentMask
SHADOW_ALPHAback to summary
private static final float SHADOW_ALPHA
YSCALEback to summary
private static final float YSCALE

Constructor Detail

DropShadowback to summary
public DropShadow(final Window parent, Shape mask)

Method Detail

getMaskback to summary
private Shape getMask()
getPreferredSizeback to summary
public Dimension getPreferredSize()

Overrides java.awt.Container.getPreferredSize.

Doc from java.awt.Container.getPreferredSize.

Returns the preferred size of this container. If the preferred size has not been set explicitly by Component#setPreferredSize(Dimension) and this Container has a non-null LayoutManager, then LayoutManager#preferredLayoutSize(Container) is used to calculate the preferred size.

Note

some implementations may cache the value returned from the LayoutManager. Implementations that cache need not invoke preferredLayoutSize on the LayoutManager every time this method is invoked, rather the LayoutManager will only be queried after the Container becomes invalid.

Returns:Dimension

an instance of Dimension that represents the preferred size of this container.

paintback to summary
public void paint(Graphics graphics)

Overrides java.awt.Window.paint.

Doc from java.awt.Window.paint.

Paints the container. This forwards the paint to any lightweight components that are children of this container. If this method is reimplemented, super.paint(g) should be called so that lightweight components are properly rendered. If a child component is entirely clipped by the current clipping setting in g, paint() will not be forwarded to that child.

Parameters
graphics:Graphics

Doc from java.awt.Container.paint.

the specified Graphics window