Class ElementOverlayManager
java.lang.Object
org.apache.batik.apps.svgbrowser.ElementOverlayManager
Manages element overlay on the canvas.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected JSVGCanvasThe canvas.protected ElementOverlayControllerThe controller for the element overlay.protected OverlayThe element overlay.protected ColorThe color of the element overlay.protected ColorThe color of the outline of the element overlay.protected ArrayListElements to paint.protected booleanWhether the ElementOverlay is enabled.protected booleanThe xor mode. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElement(Element elem) Adds an element to the element selection.protected RectangleGet the current selection bounds.protected RectanglegetElementBounds(GraphicsNode node) The bounds of a given graphics node.protected RectanglegetElementBounds(Element elem) The bounds of a given element.Gets the elementOverlay.Gets the elementOverlayColor.Gets the elementOverlayStrokeColor.booleanIf the element overlay is enabled.booleanGets the xorMode.protected RectangleIncreases the given rectangle area for a given amount of units in a rectangle increasement manner.voidremoveElement(Element elem) Removes the element from the element selection and adds its bound to the 'dirty' region.voidRemoves all elements from the element selection list.voidRemoves the elementOverlay.voidrepaint()Repaints the canvas.voidsetController(ElementOverlayController controller) Sets the element overlay controller.voidsetElementOverlayColor(Color selectionOverlayColor) Sets the color to use for the element overlay.voidsetElementOverlayStrokeColor(Color selectionOverlayStrokeColor) Sets the color to use for stroking the element overlay.voidsetOverlayEnabled(boolean isOverlayEnabled) Enables / disables the Element overlay.voidsetXorMode(boolean xorMode) Sets the xor mode.
-
Field Details
-
elementOverlayStrokeColor
The color of the outline of the element overlay. -
elementOverlayColor
The color of the element overlay. -
xorMode
protected boolean xorModeThe xor mode. -
canvas
The canvas. -
elementOverlay
The element overlay. -
elements
Elements to paint. -
controller
The controller for the element overlay. -
isOverlayEnabled
protected boolean isOverlayEnabledWhether the ElementOverlay is enabled.
-
-
Constructor Details
-
ElementOverlayManager
-
-
Method Details
-
addElement
Adds an element to the element selection.- Parameters:
elem- The element to add
-
removeElement
Removes the element from the element selection and adds its bound to the 'dirty' region.- Parameters:
elem- The element to remove
-
removeElements
public void removeElements()Removes all elements from the element selection list. -
getAllElementsBounds
Get the current selection bounds.- Returns:
- the current selection bounds
-
getElementBounds
-
getElementBounds
The bounds of a given graphics node.- Parameters:
node- The given graphics node- Returns:
- the bounds
-
outset
-
repaint
public void repaint()Repaints the canvas. -
getElementOverlayColor
Gets the elementOverlayColor.- Returns:
- the elementOverlayColor
-
setElementOverlayColor
Sets the color to use for the element overlay.- Parameters:
selectionOverlayColor- The new element overlay color.
-
getElementOverlayStrokeColor
Gets the elementOverlayStrokeColor.- Returns:
- the elementOverlayStrokeColor
-
setElementOverlayStrokeColor
Sets the color to use for stroking the element overlay.- Parameters:
selectionOverlayStrokeColor- The new element overlay stroking color.
-
isXorMode
public boolean isXorMode()Gets the xorMode.- Returns:
- the xorMode
-
setXorMode
public void setXorMode(boolean xorMode) Sets the xor mode.- Parameters:
xorMode- the xorMode to set
-
getElementOverlay
-
removeOverlay
public void removeOverlay()Removes the elementOverlay. -
setController
Sets the element overlay controller.- Parameters:
controller- The element overlay controller
-
isOverlayEnabled
public boolean isOverlayEnabled()If the element overlay is enabled.- Returns:
- isOverlayEnabled
-
setOverlayEnabled
public void setOverlayEnabled(boolean isOverlayEnabled) Enables / disables the Element overlay.
-