|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLayeredPane
org.malai.widget.MLayeredPane
public class MLayeredPane
Overrides the widget JLayeredPane to be used within Malai.
This file is part of Malai.
Copyright (c) 2009-2012 Arnaud BLOUIN
Malai is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later version.
Malai is distributed without any warranty; without even the implied
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
12/20/2010
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JLayeredPane |
---|
javax.swing.JLayeredPane.AccessibleJLayeredPane |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected java.util.List<javax.swing.JComponent> |
componentsToResize
The components that must be resized when the layered pane dimensions change. |
protected SwingEventManager |
eventManager
The event manager that listens events produced by the panel. |
protected MScrollPane |
scrollpane
The possible scrollpane that contains the panel. |
private static long |
serialVersionUID
|
Fields inherited from class javax.swing.JLayeredPane |
---|
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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 | |
---|---|
MLayeredPane(boolean withScrollPane,
boolean withEvtManager)
Creates and initialises the layred pane. |
Method Summary | |
---|---|
java.awt.Component |
add(java.awt.Component comp)
|
java.awt.Component |
add(java.awt.Component comp,
int index)
|
void |
add(java.awt.Component comp,
java.lang.Object constraints)
|
void |
add(java.awt.Component comp,
java.lang.Object constraints,
int index)
|
java.awt.Component |
add(java.lang.String name,
java.awt.Component comp)
|
void |
addComponentsToResize(javax.swing.JComponent component)
Components of the pane may have to be automatically resized when the pane is resized. |
boolean |
contains(java.lang.Object obj)
Tests if the given object is contained by the calling picker. |
SwingEventManager |
getEventManager()
|
Pickable |
getPickableAt(double x,
double y)
|
Picker |
getPickerAt(double x,
double y)
|
java.awt.geom.Point2D |
getRelativePoint(double x,
double y,
java.lang.Object o)
|
protected javax.swing.JScrollBar |
getScrollbar(boolean vertical)
|
MScrollPane |
getScrollpane()
|
boolean |
hasEventManager()
|
boolean |
hasScrollPane()
|
boolean |
isHorizontalScrollbarVisible()
|
boolean |
isVerticalScrollbarVisible()
|
protected void |
scroll(int increment,
boolean vertical)
Scroll the vertical or horizontal scroll bar, if possible, using the given increment. |
void |
scrollHorizontally(int increment)
Scroll the vertical scroll bar, if possible, using the given increment. |
void |
scrollVertically(int increment)
Scroll the vertical scroll bar, if possible, using the given increment. |
protected void |
updateComponentSize(javax.swing.JComponent component)
Updates the size of the given component. |
Methods inherited from class javax.swing.JLayeredPane |
---|
addImpl, getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getComponentToLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getObjectForLayer, getPosition, highestLayer, insertIndexForLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, paramString, putLayer, remove, removeAll, setLayer, setLayer, setPosition |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
Methods inherited from class java.awt.Container |
---|
addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
protected MScrollPane scrollpane
protected SwingEventManager eventManager
protected java.util.List<javax.swing.JComponent> componentsToResize
Constructor Detail |
---|
public MLayeredPane(boolean withScrollPane, boolean withEvtManager)
withScrollPane
- True: a scrollpane will be created and will contain the panel.withEvtManager
- True: the panel will have an event manager.Method Detail |
---|
protected void updateComponentSize(javax.swing.JComponent component)
component
- The component to modify.public void addComponentsToResize(javax.swing.JComponent component)
component
- The component to resize.public java.awt.geom.Point2D getRelativePoint(double x, double y, java.lang.Object o)
getRelativePoint
in interface Picker
x
- The x-coordinate of the position to convert.y
- The y-coordinate of the position to convert.o
- An object contained by the calling picker. This function will computed the real position of the given
point in o
.
o1
that contains an other object o2
at position (10, 10)
. o1.getRelativePoint(30, 30, o2)
will return (20, 20)
.public Pickable getPickableAt(double x, double y)
getPickableAt
in interface Picker
x
- The x-coordinate of the position used to get the pickable object.y
- The y-coordinate of the position used to get the pickable object.
public Picker getPickerAt(double x, double y)
getPickerAt
in interface Picker
x
- The x-coordinate of the position used to get the picker object.y
- The y-coordinate of the position used to get the picker object.
public boolean contains(java.lang.Object obj)
Picker
contains
in interface Picker
obj
- The object to test.
public boolean hasScrollPane()
hasScrollPane
in interface Scrollable
public MScrollPane getScrollpane()
getScrollpane
in interface Scrollable
public boolean isHorizontalScrollbarVisible()
public boolean isVerticalScrollbarVisible()
protected javax.swing.JScrollBar getScrollbar(boolean vertical)
vertical
- True: the vertical scrollbar is returned. Otherwise, the horizontal scroll bar.
public void scrollHorizontally(int increment)
increment
- The increment to apply on the vertical scroll bar.public void scrollVertically(int increment)
increment
- The increment to apply on the vertical scroll bar.protected void scroll(int increment, boolean vertical)
increment
- The increment to apply on the vertical scroll bar.vertical
- True: the vertical scroll bar ispublic SwingEventManager getEventManager()
getEventManager
in interface Eventable
public java.awt.Component add(java.awt.Component comp, int index)
add
in class java.awt.Container
public void add(java.awt.Component comp, java.lang.Object constraints, int index)
add
in class java.awt.Container
public void add(java.awt.Component comp, java.lang.Object constraints)
add
in class java.awt.Container
public java.awt.Component add(java.awt.Component comp)
add
in class java.awt.Container
public java.awt.Component add(java.lang.String name, java.awt.Component comp)
add
in class java.awt.Container
public boolean hasEventManager()
hasEventManager
in interface Eventable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |