public class OverlayLayer extends CanvasLayer implements VisibleComponent
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 and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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.
|
getCanvasPane, getLayerBounds, getParent, getToolTipText, getTransformContext, repaint, repaint, setParent
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getParent, getTransformContext, repaint, repaint
public OverlayLayer()
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
Copyright © 2025 Central Laboratory of the Research Councils. All Rights Reserved.