|
||||||||||
| 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.JPanel
net.infonode.gui.panel.BaseContainer
net.infonode.gui.shaped.panel.ShapedPanel
public class ShapedPanel
A panel that has support for a ComponentPainter and a ShapedBorder.
The background of the panel is painted as normal and then the ComponentPainter
paints the area inside the ShapedBorder or the complete component area if the
its border isn't a ShapedBorder.
If a ShapedBorder is applied to this panel, mouse events etc. are only triggered
for this panel if the point is inside the Shape of the ShapedBorder. Child
components of this panel can optionally be clipped using the Shape.
A ShapedBorder wrapped inside CompoundBorder's will be used by the ShapedPanel,
but a ShapedBorder wrapped inside other border types can't be found and is hence not
used by the panel.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
javax.swing.JPanel.AccessibleJPanel |
| 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 | |
|---|---|
private boolean |
clipChildren
|
private Direction |
direction
|
private boolean |
horizontalFlip
|
private ComponentPainter |
painter
|
private ShapedBorder |
shapedBorder
|
private java.awt.Insets |
shapedInsets
|
private boolean |
verticalFlip
|
| 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 | |
|---|---|
ShapedPanel()
|
|
ShapedPanel(java.awt.Component component)
|
|
ShapedPanel(ComponentPainter painter)
|
|
ShapedPanel(ComponentPainter painter,
javax.swing.border.Border border)
|
|
ShapedPanel(java.awt.LayoutManager l)
|
|
| Method Summary | |
|---|---|
boolean |
contains(int x,
int y)
|
private boolean |
findShapedBorder(javax.swing.border.Border border,
java.awt.Insets i)
|
ComponentPainter |
getComponentPainter()
Returns the ComponentPainter that is used to paint the background of this object. |
Direction |
getDirection()
|
java.awt.Shape |
getShape()
|
ShapedBorder |
getShapedBorder()
|
boolean |
inside(int x,
int y)
|
boolean |
isClipChildren()
|
boolean |
isHorizontalFlip()
|
boolean |
isVerticalFlip()
|
protected void |
paintChildren(java.awt.Graphics g)
|
protected void |
paintComponent(java.awt.Graphics g)
|
void |
setBorder(javax.swing.border.Border border)
|
void |
setClipChildren(boolean clipChildren)
|
void |
setComponentPainter(ComponentPainter painter)
|
void |
setDirection(Direction direction)
|
void |
setHorizontalFlip(boolean horizontalFlip)
|
void |
setVerticalFlip(boolean verticalFlip)
|
| Methods inherited from class net.infonode.gui.panel.BaseContainer |
|---|
setBackground, setFont, setForeground, setOpaque, setUI |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, 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, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, 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, remove, removeAll, 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, 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 Direction direction
private boolean horizontalFlip
private boolean verticalFlip
private boolean clipChildren
private ComponentPainter painter
private ShapedBorder shapedBorder
private java.awt.Insets shapedInsets
| Constructor Detail |
|---|
public ShapedPanel()
public ShapedPanel(java.awt.LayoutManager l)
public ShapedPanel(ComponentPainter painter)
public ShapedPanel(ComponentPainter painter,
javax.swing.border.Border border)
public ShapedPanel(java.awt.Component component)
| Method Detail |
|---|
public java.awt.Shape getShape()
public ComponentPainter getComponentPainter()
BackgroundPainterComponentPainter that is used to paint the background of this object.
getComponentPainter in interface BackgroundPainterComponentPainter that is used to paint the background of this object, null if there is nonepublic void setComponentPainter(ComponentPainter painter)
public Direction getDirection()
public boolean isHorizontalFlip()
public void setHorizontalFlip(boolean horizontalFlip)
public boolean isVerticalFlip()
public void setVerticalFlip(boolean verticalFlip)
public void setDirection(Direction direction)
public boolean isClipChildren()
public void setClipChildren(boolean clipChildren)
public ShapedBorder getShapedBorder()
public void setBorder(javax.swing.border.Border border)
setBorder in class javax.swing.JComponentprotected void paintChildren(java.awt.Graphics g)
paintChildren in class javax.swing.JComponentprotected void paintComponent(java.awt.Graphics g)
paintComponent in class BaseContainer
public boolean contains(int x,
int y)
contains in class javax.swing.JComponent
public boolean inside(int x,
int y)
inside in class java.awt.Component
private boolean findShapedBorder(javax.swing.border.Border border,
java.awt.Insets i)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||