public class SVGDefaultGraphicFactory extends Object implements SVGGraphicFactory
SVGGraphicFactory
.SVGDocumentReader
,
SVGDocumentReaderConfigurator.setGraphicFactory(ilog.views.svg.SVGGraphicFactory)
Constructor and Description |
---|
SVGDefaultGraphicFactory()
Creates a new default graphic factory for importing SVG files as
Rogue Wave JViews graphic objects.
|
Modifier and Type | Method and Description |
---|---|
void |
addObject(IlvGraphic obj,
IlvGraphicBag bag)
Adds a graphic object to a given graphic bag.
|
void |
addObject(IlvGraphic obj,
IlvManager manager,
int layerIndex)
Adds a graphic object to a given layer of a manager.
|
IlvGeneralPath |
createGeneralPath()
Creates a general path graphic object.
|
IlvGraphicSet |
createGraphicSet()
Creates a graphic set object.
|
IlvIcon |
createIcon(String location,
IlvRect rect)
Creates an icon graphic object.
|
IlvIcon |
createIcon(URL url,
IlvRect rect)
Creates an icon graphic object.
|
IlvText |
createText(IlvPoint position,
String text)
Creates a text graphic object.
|
IlvTextPath |
createTextPath(Shape shape,
String text)
Creates a text path graphic object.
|
IlvZoomableLabel |
createZoomableLabel(IlvPoint position,
String label)
Creates a zoomable label graphic object.
|
IlvManagerLayer |
findFreeLayer(IlvManager manager)
Finds a new free manager layer.
|
public SVGDefaultGraphicFactory()
public void addObject(IlvGraphic obj, IlvManager manager, int layerIndex)
The SVG reader calls this method if the content of the SVG file is read
into an IlvManager
or a subclass. Otherwise,
if the reading is done in another type of IlvGraphicBag
,
for instance in an IlvGraphicSet
, the reader calls
the method addObject(IlvGraphic, IlvGraphicBag)
.
addObject
in interface SVGGraphicFactory
obj
- The graphic object to be added to the manager.manager
- The manager into which the content of the SVG file is read.layerIndex
- The index of the manager layer where the object must
be added.public void addObject(IlvGraphic obj, IlvGraphicBag bag)
The SVG reader calls this method if the content of the SVG file is read
into a IlvGraphicBag
which is not an IlvManager
or
a subclass, for instance an IlvGraphicSet
.
Otherwise, if the reading is done in an IlvManager
or a subclass,
the reader calls the method addObject(IlvGraphic, IlvManager, int)
.
addObject
in interface SVGGraphicFactory
obj
- The graphic object to be added to the bag.bag
- The bag where the graphic object must be added.public IlvManagerLayer findFreeLayer(IlvManager manager)
The default implementation adds a new layer on top of the existing layers (if any).
Note the following:
layerIndex
argument of the method
addObject(IlvGraphic, IlvManager, int)
the index of the
layer (see IlvManagerLayer.getIndex()
) returned by the
method prepareLayer
for the corresponding layer.
findFreeLayer
in interface SVGGraphicFactory
manager
- The manager into which the content of the SVG file is read.manager
.public IlvGeneralPath createGeneralPath()
createGeneralPath
in interface SVGGraphicFactory
public IlvGraphicSet createGraphicSet()
createGraphicSet
in interface SVGGraphicFactory
public IlvIcon createIcon(URL url, IlvRect rect)
createIcon
in interface SVGGraphicFactory
url
- The URL of the bitmap image.rect
- The definition rectangle of the object.public IlvIcon createIcon(String location, IlvRect rect)
createIcon
in interface SVGGraphicFactory
location
- The location of the bitmap image. This is in particular used
when the location is "data: ..."rect
- The definition rectangle of the object.public IlvTextPath createTextPath(Shape shape, String text)
createTextPath
in interface SVGGraphicFactory
shape
- The baseline of the text path.text
- The text.public IlvZoomableLabel createZoomableLabel(IlvPoint position, String label)
createZoomableLabel
in interface SVGGraphicFactory
position
- The position of the label object.label
- The text of the label.public IlvText createText(IlvPoint position, String text)
createText
in interface SVGGraphicFactory
position
- The position of the text object.text
- The text.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.