public class SVGContext
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
SVGContext() |
Modifier and Type | Method and Description |
---|---|
void |
addSVGHeadCustomAttribute(java.lang.String key,
java.lang.String value) |
void |
appendBackgroundHeadCustomAttribute(java.lang.StringBuffer sb,
java.lang.Object element) |
void |
appendElementBodyCustomAttribute(java.lang.StringBuffer sb,
java.lang.Object element) |
void |
appendElementHeadCustomAttribute(java.lang.StringBuffer sb,
java.lang.Object element)
Appends custom attribute String to the given StringBuffer.
|
void |
appendGradientDefinitionSVG(java.lang.StringBuffer sb)
Append the svg gradient definition to the stringbuffer
|
void |
appendShapePoints(java.lang.StringBuffer head,
java.util.List points,
int size) |
java.lang.StringBuffer |
appendValue(java.lang.StringBuffer sb,
java.lang.String attribute,
double value)
Append value string to the stringbuffer by the attribute and the double value
|
java.lang.StringBuffer |
appendValue(java.lang.StringBuffer sb,
java.lang.String attribute,
int value)
Append value string to the stringbuffer by the attribute and the int value
|
java.lang.StringBuffer |
appendValue(java.lang.StringBuffer sb,
java.lang.String attribute,
java.lang.String value)
Append value string to the stringbuffer by the attribute and the string value
|
java.lang.StringBuffer |
appendValue(java.lang.StringBuffer sb,
java.lang.String attribute,
java.lang.String value,
boolean withNull)
Append value string to the stringbuffer by the attribute and the string value
|
void |
clearSVGHeadCustomAttribute() |
java.lang.String |
format(double value)
Specialization of format.
|
protected java.lang.String |
getAlarmAttachmentSVG(Element element) |
Generator |
getBackgroundAttributeGenerator() |
java.awt.Rectangle |
getBounds(Element element)
Gets the bounds of the element from the cache map
|
java.lang.Object |
getCurrentSubNetworkID() |
java.awt.Color |
getDefaultBackgroundColor()
Gets default background's color
|
java.lang.String |
getDefaultFontFamily() |
int |
getDefaultFontSize() |
java.lang.String |
getDefaultFontWeight() |
java.lang.String |
getDefaultValue(java.lang.String attribute)
Gets the default value by attribute name from cache map
|
java.lang.String |
getDefsNodeID() |
java.lang.String |
getDescription()
Gets the description of svg
|
java.text.NumberFormat |
getDoubleFormat()
Gets the double format instance
|
Generator |
getElementBodyCustomAttributeGenerator() |
Generator |
getElementHeadCustomAttributeGenerator() |
java.awt.Point |
getFromPoint(Link link)
Gets the point of the from point from the cache map
|
java.awt.Shape |
getGroupShape(Group group)
Gets the shape of the group from the cache map
|
java.lang.String |
getImageFilePath()
Gets the image file path string
|
java.lang.String |
getImageID(java.lang.String url,
java.awt.Color color)
Gets the image ID by the url and the colors from cache map
|
java.lang.String |
getImageURLPrefix()
Gets the image url's prefix
|
java.awt.geom.GeneralPath |
getLinkPath(Link link)
Gets the generalpath of the link from the cache map
|
protected java.lang.String |
getMessageAttachmentSVG(Element element) |
java.awt.Dimension |
getMinBackgroundSize()
Gets the minimum background's size
|
java.lang.String |
getOutGNodeID() |
double |
getStartX() |
double |
getStartY() |
SVGStruct |
getSVGStruct(Element element)
Gets the svgstruct by element from cache map
|
java.lang.String |
getSVGXMLNS()
Gets the svg xml namespace string
|
java.awt.Point |
getToPoint(Link link)
Gets the point of the to point from the cache map
|
java.lang.String |
getWebPhysicalPath() |
protected void |
initTransientProperty() |
boolean |
isEnableElementLabelInteract() |
boolean |
isEnableElementTooltip() |
boolean |
isEnableInteract() |
boolean |
isEscapeText() |
boolean |
isImageCache()
Checks whether imagecache
|
boolean |
isSaveImageToFileUseCache() |
boolean |
isShapeEditable()
Checks whether shape is editable in svg.
|
boolean |
isShowAlarmOnTop()
Checks whether alarm show on top in the network
|
boolean |
isSizeByImageBackgroundSize() |
boolean |
isSvgHeader() |
boolean |
isTextEscape()
Checks whether escape element' s label text for XML format, there are two ways: CData or WebUtil.xmlEscape
|
boolean |
isUseBase64()
Checks whether this svg use base64 to export image
|
boolean |
isUseCDATA()
Checks whether use CDATA
|
void |
registerAlarmAttachment(Element element,
java.lang.String alarmAttachmentSVG)
Register the string of element's alarm attachments
|
void |
registerBounds(Element element,
java.awt.Rectangle bounds)
Register the bounds of element to cache map
|
void |
registerCustomDefinition(java.lang.String definitionContext)
Register the definition context to cache map
|
void |
registerDefaultValue(java.lang.String attribute,
java.lang.String value)
Register the default value to cache map
|
void |
registerFromPoint(Link link,
java.awt.Point point)
Register the point of the form link to cache map
|
void |
registerGradientID(java.lang.String gradientID)
Register the gradient ID to cache map
|
void |
registerGroupShape(Group group,
java.awt.Shape shape)
Register the group's shape of element to cache map
|
void |
registerLinkPath(Link link,
java.awt.geom.GeneralPath path)
Register the generalpath of the link to cache map
|
void |
registerMessageAttachment(Element element,
java.lang.String messageAttachmentSVG)
Register the string of element's message attachments
|
void |
registerSVGStruct(Element element,
SVGStruct svgStruct)
Register the svgstruct of the element to cache map
|
void |
registerTexturePatternID(java.lang.String textureType,
java.lang.String texturePatternID)
Register texture pattern ID to cache map
|
void |
registerToPoint(Link link,
java.awt.Point point)
Register the point of the to link to cache map
|
void |
removeSVGHeadCustomAttribute(java.lang.String key) |
void |
setBackgroundAttributeGenerator(Generator backgroundAttributeGenerator)
Append customer's attribute to background tag .
|
void |
setCurrentSubNetworkID(java.lang.Object currentSubNetworkID) |
void |
setDefaultBackgroundColor(java.awt.Color defaultBackgroundColor)
Sets the default background's color
|
void |
setDefaultFontFamily(java.lang.String defaultFontFamily) |
void |
setDefaultFontSize(int defaultFontSize) |
void |
setDefaultFontWeight(java.lang.String defaultFontWeight) |
void |
setDefsNodeID(java.lang.String defsNodeID) |
void |
setDescription(java.lang.String description)
Sets the description of svg
|
void |
setDoubleFormat(java.text.NumberFormat doubleFormat)
Sets the double format
|
void |
setElementBodyCustomAttributeGenerator(Generator elementBodyAttributeGenerator)
Append customer's attribute to tag 'up'.
|
void |
setElementHeadCustomAttributeGenerator(Generator elementHeadCustomAttributeGenerator)
Append customer's attribute to tag 'g'.
|
void |
setEnableElementLabelInteract(boolean enableElementLabelInteract) |
void |
setEnableElementTooltip(boolean enableElementTooltip)
Sets enable element tooltip.
|
void |
setEnableInteract(boolean enableInteract) |
void |
setEscapeText(boolean isEscapeText) |
void |
setImageCache(boolean imageCache)
Sets whether export image with cache.If yes,the url of image will be added a random number.
|
void |
setImageFilePath(java.lang.String imageFilePath)
Sets the image file's path
|
void |
setImageURLPrefix(java.lang.String imageURLPrefix)
Sets the image url's prefix
|
void |
setMinBackgroundSize(java.awt.Dimension minBackgroundSize)
Sets the minimun background's size
|
void |
setOutGNodeID(java.lang.String outGNodeID) |
void |
setSaveImageToFileUseCache(boolean isSaveImageToFileUseCache)
ImageUtils.saveImageToFile use cache.
|
void |
setShapeEditable(boolean isShapeEditable)
Sets shape whether is editable in svg.
|
void |
setShowAlarmOnTop(boolean showAlarmAttachmentOnTop)
Sets whether alarm show on top in the network
|
void |
setSizeByImageBackgroundSize(boolean isSizeByImageBackgroundSize) |
void |
setStartX(double startX) |
void |
setStartY(double startY) |
void |
setSvgHeader(boolean svgHeader) |
void |
setSVGXMLNS(java.lang.String svgXMLNS)
Sets the svg xml namespace by the string
|
void |
setTextEscape(boolean textEscape)
Sets whether escape element' s label text for XML format
|
void |
setUseBase64(boolean useBase64)
Sets whether this svg use base64 to export image
|
void |
setUseCDATA(boolean useCDATAWithElementLabel)
Sets whether use CDATA
|
protected void initTransientProperty()
public void registerAlarmAttachment(Element element, java.lang.String alarmAttachmentSVG)
element
- alarmAttachmentSVG
- protected java.lang.String getAlarmAttachmentSVG(Element element)
public void registerMessageAttachment(Element element, java.lang.String messageAttachmentSVG)
element
- messageAttachmentSVG
- protected java.lang.String getMessageAttachmentSVG(Element element)
public void registerBounds(Element element, java.awt.Rectangle bounds)
element
- bounds
- public java.awt.Rectangle getBounds(Element element)
element
- public void registerGroupShape(Group group, java.awt.Shape shape)
group
- shape
- public java.awt.Shape getGroupShape(Group group)
group
- public void registerFromPoint(Link link, java.awt.Point point)
link
- point
- public void registerToPoint(Link link, java.awt.Point point)
link
- point
- public java.awt.Point getFromPoint(Link link)
link
- public java.awt.Point getToPoint(Link link)
link
- public void registerLinkPath(Link link, java.awt.geom.GeneralPath path)
link
- path
- public java.awt.geom.GeneralPath getLinkPath(Link link)
link
- public void registerSVGStruct(Element element, SVGStruct svgStruct)
element
- svgStruct
- public SVGStruct getSVGStruct(Element element)
element
- public void registerDefaultValue(java.lang.String attribute, java.lang.String value)
attribute
- value
- public java.lang.StringBuffer appendValue(java.lang.StringBuffer sb, java.lang.String attribute, int value)
sb
- attribute
- value
- public java.lang.StringBuffer appendValue(java.lang.StringBuffer sb, java.lang.String attribute, double value)
sb
- attribute
- value
- public java.lang.StringBuffer appendValue(java.lang.StringBuffer sb, java.lang.String attribute, java.lang.String value, boolean withNull)
sb
- attribute
- value
- withNull
- public void appendShapePoints(java.lang.StringBuffer head, java.util.List points, int size)
public java.lang.StringBuffer appendValue(java.lang.StringBuffer sb, java.lang.String attribute, java.lang.String value)
sb
- attribute
- value
- public java.lang.String getDefaultValue(java.lang.String attribute)
attribute
- public void registerCustomDefinition(java.lang.String definitionContext)
definitionContext
- public void registerGradientID(java.lang.String gradientID)
gradientID
- public void registerTexturePatternID(java.lang.String textureType, java.lang.String texturePatternID)
textureType
- texturePatternID
- public java.lang.String getImageID(java.lang.String url, java.awt.Color color)
url
- color
- public void appendGradientDefinitionSVG(java.lang.StringBuffer sb)
sb
- public java.lang.String getSVGXMLNS()
public void setSVGXMLNS(java.lang.String svgXMLNS)
svgXMLNS
- public java.lang.String getImageFilePath()
public void setImageFilePath(java.lang.String imageFilePath)
imageFilePath
- public java.lang.String getImageURLPrefix()
public void setImageURLPrefix(java.lang.String imageURLPrefix)
imageURLPrefix
- public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- public boolean isUseCDATA()
public void setUseCDATA(boolean useCDATAWithElementLabel)
useCDATAWithElementLabel
- public boolean isTextEscape()
public void setTextEscape(boolean textEscape)
textEscape
- public boolean isShowAlarmOnTop()
public void setShowAlarmOnTop(boolean showAlarmAttachmentOnTop)
showAlarmAttachmentOnTop
- public java.text.NumberFormat getDoubleFormat()
public void setDoubleFormat(java.text.NumberFormat doubleFormat)
doubleFormat
- public java.lang.String format(double value)
value
- public boolean isUseBase64()
public void setUseBase64(boolean useBase64)
useBase64
- public java.awt.Color getDefaultBackgroundColor()
public void setDefaultBackgroundColor(java.awt.Color defaultBackgroundColor)
defaultBackgroundColor
- public java.awt.Dimension getMinBackgroundSize()
public void setMinBackgroundSize(java.awt.Dimension minBackgroundSize)
minBackgroundSize
- public boolean isImageCache()
public void setImageCache(boolean imageCache)
imageCache
- public void appendElementHeadCustomAttribute(java.lang.StringBuffer sb, java.lang.Object element)
sb
- element
- public void appendBackgroundHeadCustomAttribute(java.lang.StringBuffer sb, java.lang.Object element)
public void appendElementBodyCustomAttribute(java.lang.StringBuffer sb, java.lang.Object element)
public Generator getBackgroundAttributeGenerator()
public void setBackgroundAttributeGenerator(Generator backgroundAttributeGenerator)
backgroundAttributeGenerator
- public Generator getElementHeadCustomAttributeGenerator()
public void setElementHeadCustomAttributeGenerator(Generator elementHeadCustomAttributeGenerator)
elementHeadCustomAttributeGenerator
- public Generator getElementBodyCustomAttributeGenerator()
public void setElementBodyCustomAttributeGenerator(Generator elementBodyAttributeGenerator)
elementBodyAttributeGenerator
- public boolean isSvgHeader()
public void setSvgHeader(boolean svgHeader)
public double getStartX()
public void setStartX(double startX)
public double getStartY()
public void setStartY(double startY)
public java.lang.Object getCurrentSubNetworkID()
public void setCurrentSubNetworkID(java.lang.Object currentSubNetworkID)
public java.lang.String getDefsNodeID()
public void setDefsNodeID(java.lang.String defsNodeID)
public java.lang.String getOutGNodeID()
public void setOutGNodeID(java.lang.String outGNodeID)
public boolean isEnableInteract()
public void setEnableInteract(boolean enableInteract)
public boolean isEnableElementLabelInteract()
public void setEnableElementLabelInteract(boolean enableElementLabelInteract)
public boolean isSizeByImageBackgroundSize()
public void setSizeByImageBackgroundSize(boolean isSizeByImageBackgroundSize)
public boolean isShapeEditable()
public void setShapeEditable(boolean isShapeEditable)
isShapeEditable
- public boolean isSaveImageToFileUseCache()
public void setSaveImageToFileUseCache(boolean isSaveImageToFileUseCache)
isSaveImageToFileUseCache
- public boolean isEnableElementTooltip()
public void setEnableElementTooltip(boolean enableElementTooltip)
enableElementTooltip
- public java.lang.String getDefaultFontFamily()
public void setDefaultFontFamily(java.lang.String defaultFontFamily)
public int getDefaultFontSize()
public void setDefaultFontSize(int defaultFontSize)
public java.lang.String getDefaultFontWeight()
public void setDefaultFontWeight(java.lang.String defaultFontWeight)
public boolean isEscapeText()
public void setEscapeText(boolean isEscapeText)
public void addSVGHeadCustomAttribute(java.lang.String key, java.lang.String value)
public void removeSVGHeadCustomAttribute(java.lang.String key)
public void clearSVGHeadCustomAttribute()
public java.lang.String getWebPhysicalPath()
Copyright © 2002 - 2010 Serva Software. All Rights Reserved.