|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiva.canvas.CanvasLayer
diva.canvas.OverlayLayer
public class OverlayLayer
OutlineLayer is a layer that is used to display the grey figures commonly used for drag-selection, reshaping items, and so on. It can have shapes added to it, which are all drawn in outline in grey (by default -- the color can be changed). There is no concept of a display list or z-depth in this layer, as all shapes are drawn in exactly the same color.
Although currently it does not do so, this class will become optimized so that repaints of this layer do not require a repaint of backing layers.
Constructor Summary | |
---|---|
OverlayLayer()
Create a new OverlayLayer with a default one-pixel stroke and a light grey stroke color. |
|
OverlayLayer(Stroke s,
Paint p)
Create a new OverlayLayer with the given stroke and paint |
Method Summary | |
---|---|
void |
add(Shape s)
Add a new shape to the list of shapes in this layer |
void |
clear()
Clear the layer |
Paint |
getPaint()
Get the current paint |
Stroke |
getStroke()
Get the current paint stroke |
boolean |
isVisible()
Test the visibility flag of this layer. |
void |
paint(Graphics2D g)
Paint this layer onto a 2D graphics object. |
void |
paint(Graphics2D g,
Rectangle2D region)
Paint this layer onto a 2D graphics object, within the given region. |
void |
remove(Shape s)
Remove a shape from the list of shapes in this layer |
void |
repaint(Rectangle2D region)
Schedule a repaint of this layer over the given shape. |
void |
repaint(Shape shape)
Schedule a repaint of this layer over the given shape. |
void |
setPaint(Paint p)
Set the paint. |
void |
setStroke(Stroke s)
Set the stroke. |
void |
setVisible(boolean flag)
Set the visibility flag of this layer. |
Iterator |
shapes()
Return an iterator over the shapes currently in this layer. |
Methods inherited from class diva.canvas.CanvasLayer |
---|
getCanvasPane, getLayerBounds, getParent, getToolTipText, getTransformContext, repaint, repaint, setParent |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface diva.canvas.CanvasComponent |
---|
getParent, getTransformContext, repaint, repaint |
Constructor Detail |
---|
public OverlayLayer()
public OverlayLayer(Stroke s, Paint p)
Method Detail |
---|
public void add(Shape s)
public void clear()
public Stroke getStroke()
public Paint getPaint()
public boolean isVisible()
isVisible
in interface VisibleComponent
public void paint(Graphics2D g)
paint
in interface VisibleComponent
public void paint(Graphics2D g, Rectangle2D region)
paint
in interface VisibleComponent
public void remove(Shape s)
public void repaint(Rectangle2D region)
public void repaint(Shape shape)
public Iterator shapes()
public void setStroke(Stroke s)
public void setPaint(Paint p)
public void setVisible(boolean flag)
setVisible
in interface VisibleComponent
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |