org.zaval.lw
Class LwPopupLayer
java.lang.Object
|
+--org.zaval.lw.LwCanvas
|
+--org.zaval.lw.LwPanel
|
+--org.zaval.lw.LwBaseLayer
|
+--org.zaval.lw.LwPopupLayer
- All Implemented Interfaces:
- java.util.EventListener, Layoutable, LayoutContainer, LwActionListener, LwChildrenListener, LwComponent, LwContainer, LwLayer, LwLayout, PosListener, java.lang.Runnable, Validationable
- public class LwPopupLayer
- extends LwBaseLayer
- implements LwLayout, LwActionListener, PosListener, java.lang.Runnable, LwChildrenListener
This is popup menu layer. The layer is used to show any popup menu (LwMenu).
As usual you should not use the layer directly, in common case you should use
the LwPopupManager class to specify a popup menu. After that the popup menu will
appear automatically when it is necessary.
|
Field Summary |
static java.lang.String |
ID
The layer id. |
| Fields inherited from class org.zaval.lw.LwCanvas |
bits, bottom, height, isValidValue, left, parent, psHeight, psWidth, right, skins, temporary, top, width, x, y |
|
Method Summary |
void |
actionPerformed(java.lang.Object src,
java.lang.Object data)
Invoked when an action event occurred. |
java.awt.Dimension |
calcPreferredSize(LayoutContainer target)
Calculates the preferred size dimension for the layout container.
|
void |
childPerformed(LwVCLEvent e)
Invoked whenever the child event has been performed. |
void |
componentAdded(java.lang.Object id,
Layoutable lw,
int index)
Invoked when the specified layoutable component was added to the layout container
(that uses the layout manager). |
void |
componentRemoved(Layoutable lw,
int index)
Invoked when the specified layoutable component was removed from the layout
container, that uses the layout manager. |
protected LwLayout |
getDefaultLayout()
Gets the default layout manager that is set with the container during initialization.
|
boolean |
isActive()
Tests if the layer is active. |
boolean |
isActiveAt(int x,
int y)
Tests if the layer is active at the specified location. |
void |
layout(LayoutContainer target)
Lays out the child layoutable components inside the layout container. |
void |
mousePressed(int x,
int y,
int mask)
Invoked whenever a mouse button has been pressed. |
void |
posChanged(java.lang.Object target,
int prevOffset,
int prevLine,
int prevCol)
Invoked when a virtual position has been changed. |
void |
remove(int index)
Removes the component, specified by the index, from this container.
|
void |
run()
|
void |
setMenuBar(LwComponent mb)
Invoked whenever the menu bar component has been activated. |
| Methods inherited from class org.zaval.lw.LwPanel |
add, add, calcPreferredSize, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, getPreferredSize, indexOf, insert, insert, invalidate, isInvalidatedByChild, laidout, paintOnTop, remove, removeAll, setBackground, setLwLayout, setOpaque, setSize, toFront, updateCashedPs, validate |
| Methods inherited from class org.zaval.lw.LwCanvas |
calcInsets, canHaveFocus, customize, cvp, getBackground, getBottom, getBounds, getHeight, getInsets, getLeft, getLocation, getLwParent, getOrigin, getPSImpl, getRight, getSize, getTop, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, isEnabled, isOpaque, isValid, isVisible, paint, recalc, repaint, repaint, repaint, requestFocus, setEnabled, setInsets, setLocation, setLwParent, setPSSize, setViewMan, setVisible, update, viewManChanged, vrp |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.zaval.lw.LwComponent |
canHaveFocus, getBackground, getLwComponentAt, getLwParent, getOrigin, getViewMan, getVisiblePart, isEnabled, isOpaque, paint, repaint, repaint, repaint, setBackground, setEnabled, setInsets, setLwParent, setOpaque, setViewMan, setVisible, update |
| Methods inherited from interface org.zaval.lw.Layoutable |
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize |
ID
public static final java.lang.String ID
- The layer id.
LwPopupLayer
public LwPopupLayer()
- Constructs the layer.
run
public void run()
- Specified by:
run in interface java.lang.Runnable
mousePressed
public void mousePressed(int x,
int y,
int mask)
- Description copied from interface:
LwLayer
- Invoked whenever a mouse button has been pressed.
- Overrides:
mousePressed in class LwBaseLayer
- Following copied from interface:
org.zaval.lw.LwLayer
- Parameters:
x - the x coordinate of the mouse pointer.y - the y coordinate of the mouse pointer.mask - the mask that specifies mouse buttons states.
childPerformed
public void childPerformed(LwVCLEvent e)
- Description copied from interface:
LwChildrenListener
- Invoked whenever the child event has been performed.
- Specified by:
childPerformed in interface LwChildrenListener
- Following copied from interface:
org.zaval.lw.event.LwChildrenListener
- Parameters:
e - the child event.
isActive
public boolean isActive()
- Description copied from interface:
LwLayer
- Tests if the layer is active.
- Overrides:
isActive in class LwBaseLayer
- Following copied from interface:
org.zaval.lw.LwLayer
- Returns:
true if the layer is active.
isActiveAt
public boolean isActiveAt(int x,
int y)
- Description copied from interface:
LwLayer
- Tests if the layer is active at the specified location. As rule the method is called when
a mouse (pointer) event happened.
- Overrides:
isActiveAt in class LwBaseLayer
- Following copied from interface:
org.zaval.lw.LwLayer
- Parameters:
x - the x coordinate.y - the y coordinate.- Returns:
true if the layer is active.
remove
public void remove(int index)
- Description copied from interface:
LwContainer
- Removes the component, specified by the index, from this container.
The layout manager of this container should be informed by calling
the
componentRemoved method of the manager.
- Overrides:
remove in class LwPanel
- Following copied from interface:
org.zaval.lw.LwContainer
- Parameters:
i - the index of the component to be removed.
posChanged
public void posChanged(java.lang.Object target,
int prevOffset,
int prevLine,
int prevCol)
- Description copied from interface:
PosListener
- Invoked when a virtual position has been changed.
- Specified by:
posChanged in interface PosListener
- Following copied from interface:
org.zaval.misc.event.PosListener
- Parameters:
target - the specified pos controller.prevOffset - the previous offset.prevLine - the previous line.prevColumn - the previous column.
actionPerformed
public void actionPerformed(java.lang.Object src,
java.lang.Object data)
- Description copied from interface:
LwActionListener
- Invoked when an action event occurred.
- Specified by:
actionPerformed in interface LwActionListener
- Following copied from interface:
org.zaval.lw.event.LwActionListener
- Parameters:
src - the specified source where the event has been originated.data - the event data.
setMenuBar
public void setMenuBar(LwComponent mb)
- Invoked whenever the menu bar component has been activated.
- Parameters:
mb - the specified menu bar component.
componentAdded
public void componentAdded(java.lang.Object id,
Layoutable lw,
int index)
- Description copied from interface:
LwLayout
- Invoked when the specified layoutable component was added to the layout container
(that uses the layout manager). The specified constraints, layoutable component
and child index are passed as arguments into the method.
- Specified by:
componentAdded in interface LwLayout
- Following copied from interface:
org.zaval.lw.LwLayout
- Parameters:
id - the layoutable component constraints.lw - the layoutable component that has been added.index - the child index.
componentRemoved
public void componentRemoved(Layoutable lw,
int index)
- Description copied from interface:
LwLayout
- Invoked when the specified layoutable component was removed from the layout
container, that uses the layout manager.
- Specified by:
componentRemoved in interface LwLayout
- Following copied from interface:
org.zaval.lw.LwLayout
- Parameters:
lw - the layoutable component that has been removed.index - the child component index.
calcPreferredSize
public java.awt.Dimension calcPreferredSize(LayoutContainer target)
- Description copied from interface:
LwLayout
- Calculates the preferred size dimension for the layout container.
The method has to calculate "pure" preferred size, it means that container insets
should not be taken into account.
- Specified by:
calcPreferredSize in interface LwLayout
- Following copied from interface:
org.zaval.lw.LwLayout
- Parameters:
target - the layout container.- Returns:
- a "pure" preferred size.
layout
public void layout(LayoutContainer target)
- Description copied from interface:
LwLayout
- Lays out the child layoutable components inside the layout container.
- Specified by:
layout in interface LwLayout
- Following copied from interface:
org.zaval.lw.LwLayout
- Parameters:
target - the layout container.
getDefaultLayout
protected LwLayout getDefaultLayout()
- Description copied from class:
LwPanel
- Gets the default layout manager that is set with the container during initialization.
This implementation of the method returns LwRastLayout as the default layout manager, the
layout manager is got as a static object by "def.lay" key.
- Overrides:
getDefaultLayout in class LwPanel
- Following copied from class:
org.zaval.lw.LwPanel
- Returns:
- a layout manager.
|