public class LayoutUtils extends Object
Constructor and Description |
---|
LayoutUtils() |
Modifier and Type | Method and Description |
---|---|
static org.w3c.dom.svg.SVGDocument |
createSVGDoc()
Create an SVG Document using a default DOM implementation.
|
static HashMap<Comparable,String> |
getLabelsForData(Vector<Comparable> entries)
Get alphanumeric unique labels for a set of entries (i.e.
|
static FontMetrics |
getSVGFontMetrics(Font font) |
static Font |
scaleFont(Dimension dim,
Font font,
Graphics g,
String label)
Scale a Font so that a given label fits into a specific dimension.
|
static Font |
scaleSVGFont(Dimension dim,
Font font,
String label)
Scale a Font so that a given label fits into a specific dimension in an SVG context.
|
static void |
TransferGraphicsToDocument(org.w3c.dom.svg.SVGDocument doc,
Dimension canvasdimension,
org.apache.batik.svggen.SVGGraphics2D g)
Transfer data that was writen to an
SVGGraphics2D context to a document using a specified canvasdimension. |
public static org.w3c.dom.svg.SVGDocument createSVGDoc()
public static FontMetrics getSVGFontMetrics(Font font)
public static void TransferGraphicsToDocument(org.w3c.dom.svg.SVGDocument doc, Dimension canvasdimension, org.apache.batik.svggen.SVGGraphics2D g)
SVGGraphics2D
context to a document using a specified canvasdimension.doc
- - the SVGDocument
to write to.canvasdimension
- - the target canvas dimension (can be null
, in which instance default sizes are used (400/290)g
- - The SVGGraphics2D
Context to write in.public static Font scaleSVGFont(Dimension dim, Font font, String label)
dim
- - the dimension the label should fit in.font
- - the font to scale.label
- - the String that should fit into the dimension.public static Font scaleFont(Dimension dim, Font font, Graphics g, String label)
dim
- - the dimension the label should fit in.font
- - the font to scale.g
- - the graphics context to uselabel
- - the String that should fit into the dimension.public static HashMap<Comparable,String> getLabelsForData(Vector<Comparable> entries)
entries
- - Comparable objects (not necessarily of the same type)Copyright © 2018. All rights reserved.