net.infonode.gui.shaped.panel

Class ShapedPanel

public class ShapedPanel extends BaseContainer implements BackgroundPainter

A panel that has support for a {@link ComponentPainter} and a {@link ShapedBorder}. The background of the panel is painted as normal and then the {@link ComponentPainter} paints the area inside the {@link ShapedBorder} or the complete component area if the its border isn't a {@link ShapedBorder}.

If a {@link ShapedBorder} is applied to this panel, mouse events etc. are only triggered for this panel if the point is inside the {@link Shape} of the {@link ShapedBorder}. Child components of this panel can optionally be clipped using the {@link Shape}.

A {@link ShapedBorder} wrapped inside {@link CompoundBorder}'s will be used by the ShapedPanel, but a {@link ShapedBorder} wrapped inside other border types can't be found and is hence not used by the panel.

Author: johan

Constructor Summary
ShapedPanel()
ShapedPanel(LayoutManager l)
ShapedPanel(ComponentPainter painter)
ShapedPanel(ComponentPainter painter, Border border)
ShapedPanel(Component component)
Method Summary
booleancontains(int x, int y)
ComponentPaintergetComponentPainter()
DirectiongetDirection()
ShapegetShape()
ShapedBordergetShapedBorder()
booleaninside(int x, int y)
booleanisClipChildren()
booleanisHorizontalFlip()
booleanisVerticalFlip()
protected voidpaintChildren(Graphics g)
protected voidpaintComponent(Graphics g)
voidsetBorder(Border border)
voidsetClipChildren(boolean clipChildren)
voidsetComponentPainter(ComponentPainter painter)
voidsetDirection(Direction direction)
voidsetHorizontalFlip(boolean horizontalFlip)
voidsetVerticalFlip(boolean verticalFlip)

Constructor Detail

ShapedPanel

public ShapedPanel()

ShapedPanel

public ShapedPanel(LayoutManager l)

ShapedPanel

public ShapedPanel(ComponentPainter painter)

ShapedPanel

public ShapedPanel(ComponentPainter painter, Border border)

ShapedPanel

public ShapedPanel(Component component)

Method Detail

contains

public boolean contains(int x, int y)

getComponentPainter

public ComponentPainter getComponentPainter()

getDirection

public Direction getDirection()

getShape

public Shape getShape()

getShapedBorder

public ShapedBorder getShapedBorder()

inside

public boolean inside(int x, int y)

isClipChildren

public boolean isClipChildren()

isHorizontalFlip

public boolean isHorizontalFlip()

isVerticalFlip

public boolean isVerticalFlip()

paintChildren

protected void paintChildren(Graphics g)

paintComponent

protected void paintComponent(Graphics g)

setBorder

public void setBorder(Border border)

setClipChildren

public void setClipChildren(boolean clipChildren)

setComponentPainter

public void setComponentPainter(ComponentPainter painter)

setDirection

public void setDirection(Direction direction)

setHorizontalFlip

public void setHorizontalFlip(boolean horizontalFlip)

setVerticalFlip

public void setVerticalFlip(boolean verticalFlip)