| java.lang.Object sun.awt.X11.XBaseWindow sun.awt.X11.XWindow sun.awt.X11.XBaseMenuWindow
All known Subclasses: sun.awt.X11.XMenuBarPeer, sun.awt.X11.XMenuWindow,
XBaseMenuWindow | abstract public class XBaseMenuWindow extends XWindow (Code) | | The abstract class XBaseMenuWindow is the superclass
of all menu windows.
|
Inner Class :static class MappingData implements Cloneable | |
Field Summary | |
protected Point | grabInputPoint If the PopupMenu is invoked as a result of right button click
first mouse event after grabInput would be MouseReleased.
We need to check if the user has moved mouse after input grab.
If yes - hide the PopupMenu. | protected boolean | hasPointerMoved |
Method Summary | |
public void | addItem(MenuItem item) Adds item to end of items vector. | XMenuItemPeer[] | copyItems() | public void | delItem(int index) Removes item at the specified index from items vector. | public void | dispose() | protected void | doDispose() Performs disposal of menu window. | void | doHandleJavaKeyEvent(KeyEvent event) | void | doHandleJavaMouseEvent(MouseEvent mouseEvent) | void | doHandleJavaPaintEvent(PaintEvent event) | void | draw3DRect(Graphics g, int x, int y, int width, int height, boolean raised) | Rectangle | fitWindowAbove(Rectangle itemBounds, Dimension windowSize, Dimension screenSize) Checks if window fits above specified item
returns rectangle that the window fits to or null. | Rectangle | fitWindowBelow(Rectangle itemBounds, Dimension windowSize, Dimension screenSize) Checks if window fits below specified item
returns rectangle that the window fits to or null. | Rectangle | fitWindowLeft(Rectangle itemBounds, Dimension windowSize, Dimension screenSize) Checks if window fits to the left specified item
returns rectangle that the window fits to or null. | Rectangle | fitWindowRight(Rectangle itemBounds, Dimension windowSize, Dimension screenSize) Checks if window fits to the right specified item
returns rectangle that the window fits to or null. | Rectangle | fitWindowToScreen(Dimension windowSize, Dimension screenSize) | Color | getBackgroundColor() | Color | getDarkShadowColor() | Color | getDisabledColor() | XMenuItemPeer | getFirstSelectableItem() | Color | getForegroundColor() | XMenuItemPeer | getItem(int index) | XMenuItemPeer | getItemFromPoint(Point pt) returns item thats mapped coordinates contain
specified point, null of none. | Color | getLightShadowColor() | MappingData | getMappingData() Returns array of mapped items, null if error
This function has to be not synchronized
and we have to guarantee that we return
some MappingData to user. | static Object | getMenuTreeLock() | XBaseMenuWindow | getMenuWindowFromPoint(Point pt) Returns window that contains pt. | XMenuItemPeer | getNextSelectableItem() Returns first item after currently selected
item that can be selected according to mapping array. | abstract protected XBaseMenuWindow | getParentMenuWindow() | XMenuItemPeer | getPrevSelectableItem() | XBaseMenuWindow | getRootMenuWindow() | Color | getSelectedColor() | XMenuItemPeer | getSelectedItem() | XBaseMenuWindow | getShowingLeaf() | XMenuPeer | getShowingSubmenu() | abstract protected Rectangle | getSubmenuBounds(Rectangle itemBounds, Dimension windowSize) Calculates placement of submenu window
given bounds of item with submenu and
size of submenu window. | public boolean | grabInput() | protected void | handleEvent(AWTEvent event) The implementation of base window performs processing
of paint events only. | void | instantPreInit(XCreateWindowParams params) | protected boolean | isEventDisabled(XEvent e) | abstract protected MappingData | map() Performs mapping of items in window. | void | postEvent(AWTEvent event) | void | postPaintEvent() | public void | reloadItems(Vector items) | void | replaceColors(Color backgroundColor) Calculates colors of various elements given
background color. | void | resetColors() This function is called before every painting. | protected void | resetMapping() This function is called to clear all saved
size data. | void | selectItem(XMenuItemPeer item, boolean showWindowIfMenu) Select specified item and shows/hides submenus if necessary
We can not select by index, so we need to select by ref. | final void | setItemsFont(Font font) | abstract protected void | updateSize() This function is to be called if it's likely that size
of items was changed. |
grabInputPoint | protected Point grabInputPoint(Code) | | If the PopupMenu is invoked as a result of right button click
first mouse event after grabInput would be MouseReleased.
We need to check if the user has moved mouse after input grab.
If yes - hide the PopupMenu. If no - do nothing
|
hasPointerMoved | protected boolean hasPointerMoved(Code) | | |
XBaseMenuWindow | XBaseMenuWindow()(Code) | | Construction
|
addItem | public void addItem(MenuItem item)(Code) | | Adds item to end of items vector.
Note that this function does not perform
check for adding duplicate items
Parameters: item - item to add |
delItem | public void delItem(int index)(Code) | | Removes item at the specified index from items vector.
Parameters: index - the position of the item to be removed |
dispose | public void dispose()(Code) | | Invokes disposal procedure on eventHandlerThread
|
doDispose | protected void doDispose()(Code) | | Performs disposal of menu window.
Should be called only on eventHandlerThread
|
doHandleJavaKeyEvent | void doHandleJavaKeyEvent(KeyEvent event)(Code) | | Performs handling of java keyboard event
Note that this function should be invoked
only from root of menu window's hierarchy
that grabs input focus
|
doHandleJavaMouseEvent | void doHandleJavaMouseEvent(MouseEvent mouseEvent)(Code) | | Performs handling of java mouse event
Note that this function should be invoked
only from root of menu window's hierarchy
that grabs input focus
|
doHandleJavaPaintEvent | void doHandleJavaPaintEvent(PaintEvent event)(Code) | | Performs repainting
|
draw3DRect | void draw3DRect(Graphics g, int x, int y, int width, int height, boolean raised)(Code) | | Draws raised or sunken rectangle on specified graphics
Parameters: g - the graphics on which to draw Parameters: x - the coordinate of left edge in coordinates of graphics Parameters: y - the coordinate of top edge in coordinates of graphics Parameters: width - the width of rectangle Parameters: height - the height of rectangle Parameters: raised - true to draw raised rectangle, false to draw sunken |
fitWindowAbove | Rectangle fitWindowAbove(Rectangle itemBounds, Dimension windowSize, Dimension screenSize)(Code) | | Checks if window fits above specified item
returns rectangle that the window fits to or null.
Parameters: itemBounds - rectangle of item in global coordinates Parameters: windowSize - size of submenu window to fit Parameters: screenSize - size of screen |
fitWindowBelow | Rectangle fitWindowBelow(Rectangle itemBounds, Dimension windowSize, Dimension screenSize)(Code) | | Checks if window fits below specified item
returns rectangle that the window fits to or null.
Parameters: itemBounds - rectangle of item in global coordinates Parameters: windowSize - size of submenu window to fit Parameters: screenSize - size of screen |
fitWindowLeft | Rectangle fitWindowLeft(Rectangle itemBounds, Dimension windowSize, Dimension screenSize)(Code) | | Checks if window fits to the left specified item
returns rectangle that the window fits to or null.
Parameters: itemBounds - rectangle of item in global coordinates Parameters: windowSize - size of submenu window to fit Parameters: screenSize - size of screen |
fitWindowRight | Rectangle fitWindowRight(Rectangle itemBounds, Dimension windowSize, Dimension screenSize)(Code) | | Checks if window fits to the right specified item
returns rectangle that the window fits to or null.
Parameters: itemBounds - rectangle of item in global coordinates Parameters: windowSize - size of submenu window to fit Parameters: screenSize - size of screen |
fitWindowToScreen | Rectangle fitWindowToScreen(Dimension windowSize, Dimension screenSize)(Code) | | The last thing we can do with the window
to fit it on screen - move it to the
top-left edge and cut by screen dimensions
Parameters: windowSize - size of submenu window to fit Parameters: screenSize - size of screen |
getFirstSelectableItem | XMenuItemPeer getFirstSelectableItem()(Code) | | Returns first selectable item
This function is intended for clearing selection
|
getItem | XMenuItemPeer getItem(int index)(Code) | | Thread-safely returns item at specified index
Parameters: index - the position of the item to be returned. |
getItemFromPoint | XMenuItemPeer getItemFromPoint(Point pt)(Code) | | returns item thats mapped coordinates contain
specified point, null of none.
Parameters: pt - the point in this window's coordinate system |
getMappingData | MappingData getMappingData()(Code) | | Returns array of mapped items, null if error
This function has to be not synchronized
and we have to guarantee that we return
some MappingData to user. It's OK if
this.mappingData is replaced meanwhile
|
getMenuTreeLock | static Object getMenuTreeLock()(Code) | | Returns static lock used for menus
|
getMenuWindowFromPoint | XBaseMenuWindow getMenuWindowFromPoint(Point pt)(Code) | | Returns window that contains pt.
search is started from leaf window
to return first window in Z-order
Parameters: pt - point in global coordinates |
getNextSelectableItem | XMenuItemPeer getNextSelectableItem()(Code) | | Returns first item after currently selected
item that can be selected according to mapping array.
(no separators and no disabled items).
Currently selected item if it's only selectable,
null if no item can be selected
|
getParentMenuWindow | abstract protected XBaseMenuWindow getParentMenuWindow()(Code) | | Returns parent menu window (not the X-heirarchy parent window)
|
getPrevSelectableItem | XMenuItemPeer getPrevSelectableItem()(Code) | | Returns first item before currently selected
see getNextSelectableItem() for comments
|
getRootMenuWindow | XBaseMenuWindow getRootMenuWindow()(Code) | | returns root menu window
or this if this window is topmost
|
getShowingLeaf | XBaseMenuWindow getShowingLeaf()(Code) | | returns leaf menu window or
this if no children are showing
|
getShowingSubmenu | XMenuPeer getShowingSubmenu()(Code) | | Returns showing submenu, if any
|
getSubmenuBounds | abstract protected Rectangle getSubmenuBounds(Rectangle itemBounds, Dimension windowSize)(Code) | | Calculates placement of submenu window
given bounds of item with submenu and
size of submenu window. Returns suggested
rectangle for submenu window in global coordinates
Parameters: itemBounds - the bounding rectangle of itemin local coordinates Parameters: windowSize - the desired size of submenu's window |
grabInput | public boolean grabInput()(Code) | | Save location of pointer for further use
then invoke superclass
|
handleEvent | protected void handleEvent(AWTEvent event)(Code) | | The implementation of base window performs processing
of paint events only. This behaviour is changed in
descendants.
|
isEventDisabled | protected boolean isEventDisabled(XEvent e)(Code) | | Filters X events
|
map | abstract protected MappingData map()(Code) | | Performs mapping of items in window.
This function creates and fills specific
descendant of MappingData
and sets mapping coordinates of items
This function should return default menu data
if errors occur
|
postEvent | void postEvent(AWTEvent event)(Code) | | Invokes event processing on eventHandlerThread
This function needs to be overriden since
XBaseMenuWindow has no corresponding component
so events can not be processed using standart means
|
postPaintEvent | void postPaintEvent()(Code) | | Invokes repaint procedure on eventHandlerThread
|
reloadItems | public void reloadItems(Vector items)(Code) | | Clears items vector and loads specified vector
Parameters: items - vector to be loaded |
replaceColors | void replaceColors(Color backgroundColor)(Code) | | Calculates colors of various elements given
background color. Uses MotifColorUtilities
Parameters: backgroundColor - the color of menu window's background. |
resetColors | void resetColors()(Code) | | This function is called before every painting.
TODO:It would be better to add PropertyChangeListener
to target component
TODO:It would be better to access background color
not invoking user-overridable function
|
resetMapping | protected void resetMapping()(Code) | | This function is called to clear all saved
size data.
|
selectItem | void selectItem(XMenuItemPeer item, boolean showWindowIfMenu)(Code) | | Select specified item and shows/hides submenus if necessary
We can not select by index, so we need to select by ref.
Parameters: item - the item to be selected, null to clear selection Parameters: showWindowIfMenu - if the item is XMenuPeer then itswindow is shown/hidden according to this param. |
setItemsFont | final void setItemsFont(Font font)(Code) | | |
updateSize | abstract protected void updateSize()(Code) | | This function is to be called if it's likely that size
of items was changed. It can be called from any thread
in any locked state, so it should not take locks
|
Methods inherited from sun.awt.X11.XWindow | public void dispose()(Code)(Java Doc) protected boolean doEraseBackground()(Code)(Java Doc) public void doLayout(int x, int y, int width, int height)(Code)(Java Doc) protected void flush()(Code)(Java Doc) native static int getAWTKeyCodeForKeySym(int keysym)(Code)(Java Doc) public ColorModel getColorModel(int transparency)(Code)(Java Doc) public ColorModel getColorModel()(Code)(Java Doc) public Component getEventSource()(Code)(Java Doc) public FontMetrics getFontMetrics(Font font)(Code)(Java Doc) Graphics getGraphics(SurfaceData surfData, Color afore, Color aback, Font afont)(Code)(Java Doc) public Graphics getGraphics()(Code)(Java Doc) public GraphicsConfiguration getGraphicsConfiguration()(Code)(Java Doc) public AwtGraphicsConfigData getGraphicsConfigurationData()(Code)(Java Doc) native static int getKeySymForAWTKeyCode(int keycode)(Code)(Java Doc) public Point getLocationOnScreen()(Code)(Java Doc) static int getModifiers(int state, int button, int keyCode)(Code)(Java Doc) static int getMouseMovementSmudge()(Code)(Java Doc) native int getNativeColor(Color clr, GraphicsConfiguration gc)(Code)(Java Doc) static long getParentWindowID(Component target)(Code)(Java Doc) static XWindow getParentXWindowObject(Component target)(Code)(Java Doc) static int getRightButtonNumber()(Code)(Java Doc) public SurfaceData getSurfaceData()(Code)(Java Doc) public Object getTarget()(Code)(Java Doc) public Rectangle getTargetBounds()(Code)(Java Doc) native long getTopWindow(long window, long rootWin)(Code)(Java Doc) protected String[] getWMClass()(Code)(Java Doc) native void getWMInsets(long window, long left, long top, long right, long bottom, long border)(Code)(Java Doc) public Color getWinBackground()(Code)(Java Doc) native void getWindowBounds(long window, long x, long y, long width, long height)(Code)(Java Doc) static int getXModifiers(AWTKeyStroke stroke)(Code)(Java Doc) public void handleButtonPressRelease(XEvent xev)(Code)(Java Doc) public void handleConfigureNotifyEvent(XEvent xev)(Code)(Java Doc) public void handleExposeEvent(XEvent xev)(Code)(Java Doc) public void handleExposeEvent(Component target, int x, int y, int w, int h)(Code)(Java Doc) public void handleKeyPress(XEvent xev)(Code)(Java Doc) final void handleKeyPress(XKeyEvent ev)(Code)(Java Doc) public void handleKeyRelease(XEvent xev)(Code)(Java Doc) public void handleMapNotifyEvent(XEvent xev)(Code)(Java Doc) public void handleMotionNotify(XEvent xev)(Code)(Java Doc) public void handleUnmapNotifyEvent(XEvent xev)(Code)(Java Doc) public void handleXCrossingEvent(XEvent xev)(Code)(Java Doc) native boolean haveCurrentX11InputMethodInstance()(Code)(Java Doc) protected void initGraphicsConfiguration()(Code)(Java Doc) public boolean isEmbedded()(Code)(Java Doc) boolean isLocationByPlatform()(Code)(Java Doc) boolean isParentOf(XWindow win)(Code)(Java Doc) boolean isReparented()(Code)(Java Doc) boolean isResizable()(Code)(Java Doc) boolean isShowing()(Code)(Java Doc) int keyEventType2Id(int xEventType)(Code)(Java Doc) char keysymToUnicode(long keysym, int state)(Code)(Java Doc) public void layout()(Code)(Java Doc) void logIncomingKeyEvent(XKeyEvent ev)(Code)(Java Doc) void paint(Graphics g)(Code)(Java Doc) public void popup(int x, int y, int width, int height)(Code)(Java Doc) void postEvent(AWTEvent event)(Code)(Java Doc) static void postEventStatic(AWTEvent event)(Code)(Java Doc) public void postEventToEventQueue(AWTEvent event)(Code)(Java Doc) void postInit(XCreateWindowParams params)(Code)(Java Doc) public void postKeyEvent(int id, long when, int keyCode, char keyChar, int keyLocation, int state, long event, int eventSize)(Code)(Java Doc) void preInit(XCreateWindowParams params)(Code)(Java Doc) boolean prePostEvent(AWTEvent e)(Code)(Java Doc) public void repaint(int x, int y, int width, int height)(Code)(Java Doc) public void repaint()(Code)(Java Doc) public void reshape(Rectangle bounds)(Code)(Java Doc) public void reshape(int x, int y, int width, int height)(Code)(Java Doc) static void sendEvent(AWTEvent e)(Code)(Java Doc) static void setBData(KeyEvent e, byte[] data)(Code)(Java Doc) public void setBackground(Color c)(Code)(Java Doc) void setReparented(boolean newValue)(Code)(Java Doc) void updateSizeHints()(Code)(Java Doc) void updateSizeHints(int x, int y, int width, int height)(Code)(Java Doc) void updateSizeHints(int x, int y)(Code)(Java Doc) void validateSurface()(Code)(Java Doc) void winBackground(Color c)(Code)(Java Doc) native public boolean x11inputMethodLookupString(long event, long[] keysymArray)(Code)(Java Doc) final public void xSetBackground(Color c)(Code)(Java Doc)
|
Methods inherited from sun.awt.X11.XBaseWindow | void awtLock()(Code)(Java Doc) void awtLockNotifyAll()(Code)(Java Doc) void awtLockWait() throws InterruptedException(Code)(Java Doc) void awtUnlock()(Code)(Java Doc) public boolean checkInitialised()(Code)(Java Doc) protected void checkParams(XCreateWindowParams params)(Code)(Java Doc) static void checkSecurity()(Code)(Java Doc) public boolean contains(int x, int y)(Code)(Java Doc) public boolean containsGlobal(int x, int y)(Code)(Java Doc) void destroy()(Code)(Java Doc) public void dispatchEvent(XEvent xev)(Code)(Java Doc) static void dispatchToWindow(XEvent ev)(Code)(Java Doc) void flush()(Code)(Java Doc) public int getAbsoluteX()(Code)(Java Doc) public int getAbsoluteY()(Code)(Java Doc) public Rectangle getBounds()(Code)(Java Doc) public Set<Long> getChildren()(Code)(Java Doc) public long getContentWindow()(Code)(Java Doc) public XBaseWindow getContentXWindow()(Code)(Java Doc) public XCreateWindowParams getDelayedParams()(Code)(Java Doc) int getHeight()(Code)(Java Doc) public XSizeHints getHints()(Code)(Java Doc) public XBaseWindow getParentWindow()(Code)(Java Doc) long getScreen()(Code)(Java Doc) long getScreenNumber()(Code)(Java Doc) static long getScreenOfWindow(long window)(Code)(Java Doc) public Dimension getSize()(Code)(Java Doc) Object getStateLock()(Code)(Java Doc) public XWindowPeer getToplevelXWindow()(Code)(Java Doc) public XWMHints getWMHints()(Code)(Java Doc) protected String getWMName()(Code)(Java Doc) int getWidth()(Code)(Java Doc) public long getWindow()(Code)(Java Doc) int getX()(Code)(Java Doc) static XRootWindow getXAWTRootWindow()(Code)(Java Doc) int getY()(Code)(Java Doc) public boolean grabInput()(Code)(Java Doc) public void handleButtonPressRelease(XEvent xev)(Code)(Java Doc) public void handleClientMessage(XEvent xev)(Code)(Java Doc) public void handleConfigureNotifyEvent(XEvent xev)(Code)(Java Doc) public void handleCreateNotify(XEvent xev)(Code)(Java Doc) public void handleDestroyNotify(XEvent xev)(Code)(Java Doc) public void handleExposeEvent(XEvent xev)(Code)(Java Doc) public void handleKeyPress(XEvent xev)(Code)(Java Doc) public void handleKeyRelease(XEvent xev)(Code)(Java Doc) public void handleMapNotifyEvent(XEvent xev)(Code)(Java Doc) public void handleMotionNotify(XEvent xev)(Code)(Java Doc) public void handlePropertyNotify(XEvent xev)(Code)(Java Doc) public void handleReparentNotifyEvent(XEvent xev)(Code)(Java Doc) public void handleUnmapNotifyEvent(XEvent xev)(Code)(Java Doc) public void handleVisibilityEvent(XEvent xev)(Code)(Java Doc) public void handleXCrossingEvent(XEvent xev)(Code)(Java Doc) final protected void init(long parentWindow, Rectangle bounds)(Code)(Java Doc) final protected void init(XCreateWindowParams params)(Code)(Java Doc) protected void initClientLeader()(Code)(Java Doc) void instantPreInit(XCreateWindowParams params)(Code)(Java Doc) boolean isDisposed()(Code)(Java Doc) protected boolean isEventDisabled(XEvent e)(Code)(Java Doc) static boolean isFullRelease(int buttonState, int button)(Code)(Java Doc) static boolean isGrabbedEvent(XEvent ev, XBaseWindow target)(Code)(Java Doc) boolean isMapped()(Code)(Java Doc) public boolean isMinSizeSet()(Code)(Java Doc) boolean isVisible()(Code)(Java Doc) final protected void postInit()(Code)(Java Doc) void postInit(XCreateWindowParams params)(Code)(Java Doc) final protected void preInit()(Code)(Java Doc) void preInit(XCreateWindowParams params)(Code)(Java Doc) void setDisposed(boolean d)(Code)(Java Doc) public void setSizeHints(long flags, int x, int y, int width, int height)(Code)(Java Doc) void setWMClass(String[] cl)(Code)(Java Doc) final public void setWMHints(XWMHints hints)(Code)(Java Doc) public void toFront()(Code)(Java Doc) Rectangle toGlobal(Rectangle rec)(Code)(Java Doc) Point toGlobal(Point pt)(Code)(Java Doc) Point toGlobal(int x, int y)(Code)(Java Doc) Point toLocal(Point pt)(Code)(Java Doc) Point toLocal(int x, int y)(Code)(Java Doc) static Point toOtherWindow(long src, long dst, int x, int y)(Code)(Java Doc) public String toString()(Code)(Java Doc) static void ungrabInput()(Code)(Java Doc) void ungrabInputImpl()(Code)(Java Doc) void updateWMName()(Code)(Java Doc) public static long xGetInputFocus()(Code)(Java Doc) public void xRequestFocus(long time)(Code)(Java Doc) public void xRequestFocus()(Code)(Java Doc) public void xSetBounds(Rectangle bounds)(Code)(Java Doc) public void xSetBounds(int x, int y, int width, int height)(Code)(Java Doc) public void xSetVisible(boolean visible)(Code)(Java Doc)
|
|
|