|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
javax.swing.JWindow
edu.wisc.ssec.mcidasv.ui.ComponentPopup
public class ComponentPopup
A popup window that attaches itself to a parent and can display an component without preventing user interaction like a JComboBox.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JWindow |
|---|
JWindow.AccessibleJWindow |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
private static int |
FLUFF
Number of pixels to use to compensate for when the mouse is moved slowly thereby hiding this popup when between components. |
private MouseAdapter |
ourHideAdapter
Determines if the mouse is on me. |
private Component |
parent
|
private ComponentAdapter |
parentsCompAdapter
What to do if the parent compoentn state changes. |
private MouseAdapter |
parentsHideAdapter
Determines if the mouse is on my dad. |
private static long |
serialVersionUID
|
| Fields inherited from class javax.swing.JWindow |
|---|
accessibleContext, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
ComponentPopup(Component parent)
Create an instance associated with the given parent. |
|
| Method Summary | |
|---|---|
protected void |
addImpl(Component comp,
Object constraints,
int index)
Overridden to make sure our hide listeners are added to child components. |
boolean |
containsPoint(Component comp,
Point point)
Does the component contain the screen relative point. |
boolean |
containsPoint(Component comp,
Point point,
int fluff)
Does the component contain the screen relative point. |
private static void |
createAndShowGui()
Test method. |
protected boolean |
fitsAbove()
Do we fit between the top of the parent and the top edge of the screen. |
protected boolean |
fitsBelow()
Do we fit between the bottom of the parent and the edge of the screen. |
protected static Dimension |
getScreenSize()
Get the calculated total screen size. |
static void |
main(String[] args)
Test method. |
void |
setParent(Component comp)
Set our parent. |
void |
showAbove()
Show this popup above the parent. |
void |
showBelow()
Show this popup below the parent. |
void |
showPopup()
Show this popup deciding whether to show it above or below the parent component. |
void |
showPopupAt(int x,
int y)
Show at the specified X and Y. |
| Methods inherited from class javax.swing.JWindow |
|---|
createRootPane, getAccessibleContext, getContentPane, getGlassPane, getGraphics, getLayeredPane, getRootPane, getTransferHandler, isRootPaneCheckingEnabled, paramString, remove, repaint, setContentPane, setGlassPane, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update, windowInit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final long serialVersionUID
private static final int FLUFF
private final MouseAdapter ourHideAdapter
private final MouseAdapter parentsHideAdapter
private final ComponentAdapter parentsCompAdapter
private Component parent
| Constructor Detail |
|---|
public ComponentPopup(Component parent)
parent - The component to attach this instance to.| Method Detail |
|---|
protected static Dimension getScreenSize()
public boolean containsPoint(Component comp,
Point point,
int fluff)
comp - The component to check.point - Screen relative point.fluff - Size in pixels of the area added to both sides of the
component in the x and y directions and used for the contains
calculation.
public boolean containsPoint(Component comp,
Point point)
comp - The component to check.point - Screen relative point.
public void setParent(Component comp)
comp - public void showAbove()
public void showBelow()
protected boolean fitsAbove()
protected boolean fitsBelow()
public void showPopupAt(int x,
int y)
x - y - public void showPopup()
protected void addImpl(Component comp,
Object constraints,
int index)
addImpl in class JWindowJWindow.addImpl(java.awt.Component, java.lang.Object, int)private static void createAndShowGui()
public static void main(String[] args)
args -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||