public class ElementOverlayManager
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
ElementOverlayManager.ElementOverlay
The element overlay.
|
Modifier and Type | Field and Description |
---|---|
protected JSVGCanvas |
canvas
The canvas.
|
protected ElementOverlayController |
controller
The controller for the element overlay.
|
protected Overlay |
elementOverlay
The element overlay.
|
protected java.awt.Color |
elementOverlayColor
The color of the element overlay.
|
protected java.awt.Color |
elementOverlayStrokeColor
The color of the outline of the element overlay.
|
protected java.util.ArrayList |
elements
Elements to paint.
|
protected boolean |
isOverlayEnabled
Whether the ElementOverlay is enabled.
|
protected boolean |
xorMode
The xor mode.
|
Constructor and Description |
---|
ElementOverlayManager(JSVGCanvas canvas)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(Element elem)
Adds an element to the element selection.
|
protected java.awt.Rectangle |
getAllElementsBounds()
Get the current selection bounds.
|
protected java.awt.Rectangle |
getElementBounds(Element elem)
The bounds of a given element.
|
protected java.awt.Rectangle |
getElementBounds(GraphicsNode node)
The bounds of a given graphics node.
|
Overlay |
getElementOverlay()
Gets the elementOverlay.
|
java.awt.Color |
getElementOverlayColor()
Gets the elementOverlayColor.
|
java.awt.Color |
getElementOverlayStrokeColor()
Gets the elementOverlayStrokeColor.
|
boolean |
isOverlayEnabled()
If the element overlay is enabled.
|
boolean |
isXorMode()
Gets the xorMode.
|
protected java.awt.Rectangle |
outset(java.awt.Rectangle r,
int amount)
Increases the given rectangle area for a given amount of units in a
rectangle increasement manner.
|
void |
removeElement(Element elem)
Removes the element from the element selection and adds its bound to the
'dirty' region.
|
void |
removeElements()
Removes all elements from the element selection list.
|
void |
removeOverlay()
Removes the elementOverlay.
|
void |
repaint()
Repaints the canvas.
|
void |
setController(ElementOverlayController controller)
Sets the element overlay controller.
|
void |
setElementOverlayColor(java.awt.Color selectionOverlayColor)
Sets the color to use for the element overlay.
|
void |
setElementOverlayStrokeColor(java.awt.Color selectionOverlayStrokeColor)
Sets the color to use for stroking the element overlay.
|
void |
setOverlayEnabled(boolean isOverlayEnabled)
Enables / disables the Element overlay.
|
void |
setXorMode(boolean xorMode)
Sets the xor mode.
|
protected java.awt.Color elementOverlayStrokeColor
protected java.awt.Color elementOverlayColor
protected boolean xorMode
protected JSVGCanvas canvas
protected Overlay elementOverlay
protected java.util.ArrayList elements
protected ElementOverlayController controller
protected boolean isOverlayEnabled
public ElementOverlayManager(JSVGCanvas canvas)
canvas
- The parent canvaspublic void addElement(Element elem)
elem
- The element to addpublic void removeElement(Element elem)
elem
- The element to removepublic void removeElements()
protected java.awt.Rectangle getAllElementsBounds()
protected java.awt.Rectangle getElementBounds(Element elem)
elem
- The given elementprotected java.awt.Rectangle getElementBounds(GraphicsNode node)
node
- The given graphics nodeprotected java.awt.Rectangle outset(java.awt.Rectangle r, int amount)
r
- The given rectangleamount
- The given amount of unitsr
public void repaint()
public java.awt.Color getElementOverlayColor()
public void setElementOverlayColor(java.awt.Color selectionOverlayColor)
selectionOverlayColor
- The new element overlay color.public java.awt.Color getElementOverlayStrokeColor()
public void setElementOverlayStrokeColor(java.awt.Color selectionOverlayStrokeColor)
selectionOverlayStrokeColor
- The new element overlay stroking color.public boolean isXorMode()
public void setXorMode(boolean xorMode)
xorMode
- the xorMode to setpublic Overlay getElementOverlay()
public void removeOverlay()
public void setController(ElementOverlayController controller)
controller
- The element overlay controllerpublic boolean isOverlayEnabled()
public void setOverlayEnabled(boolean isOverlayEnabled)
Copyright © 2022 Apache Software Foundation. All Rights Reserved.