public class Xholon2Svg extends Xholon implements IXholon2Gui
See the various profiles in config/Xholon2Svg.
This class can be pasted in at runtime, for example:
<Xholon2Svg/>
or
<Xholon2Svg> <Attribute_String roleName="strokeColor">#000000</Attribute_String> <Attribute_String roleName="fontFamily">Arial</Attribute_String> <Attribute_String roleName="shapeFillColor">#afc6e9</Attribute_String> <Attribute_String roleName="shapeFillColorAlternate">#beb7c8</Attribute_String> <Attribute_int roleName="levelTranslateX">50</Attribute_int> <Attribute_int roleName="levelTranslateY">100</Attribute_int> <Attribute_int roleName="siblingTranslateX">10</Attribute_int> <Attribute_int roleName="siblingTranslateY">5</Attribute_int> <!-- possible values for svgClientOption: null help run copy --> <Attribute_String roleName="svgClientOption">run</Attribute_String> <!-- create the SVG as a String rather than as a File --> <Attribute_String roleName="svgFileName">data:image/svg+xml,</Attribute_String> <Attribute_String roleName="writeValType">double</Attribute_String> </Xholon2Svg>
Ports
Two additional attributes can be used to specify ports or arrow heads (start and end of a connector line). (Note that rect MUST be pasted in using & and NOT as the less-than symbol):<Attribute_String roleName="portTemplate"><rect id="%s" x="%f" y="%f" width="3" height="3" fill="#ff0000" stroke="#0000ff" stroke-width="1px"/></Attribute_String> <Attribute_String roleName="portConjugatedTemplate"><rect id="%s" x="%f" y="%f" width="3" height="3" fill="#0000ff" stroke="#e0e0f8" stroke-width="1px"/></Attribute_String>or as a triangle:
<Attribute_String roleName="portTemplate"><polygon id="%s" points="0,0 0,6 6,3" transform="translate(%f,%f)" width="6" height="6" fill="#e0e0f8" stroke="#0000ff" stroke-width="1px"/></Attribute_String>These attributes control the creation of ports and connectors between ports:
<Attribute_boolean roleName="shouldShowPorts">false</Attribute_boolean> <Attribute_boolean roleName="shouldShowConnectors">false</Attribute_boolean> <Attribute_boolean roleName="useInkscape">false</Attribute_boolean> <Attribute_boolean roleName="shouldCommentConnectors">false</Attribute_boolean>
GUI_TYPE_CONTOUR, GUI_TYPE_DOMAINSPECIFIC, GUI_TYPE_NONE, GUI_TYPE_ROOTONLY, GUI_TYPE_TREE
DEFAULT_SIZE_MSG_Q, DEFAULT_SIZE_SYSTEM_MSG_Q, GETNAME_DEFAULT, GETNAME_LOCALPART_ID, GETNAME_NOROLENAME, GETNAME_ROLENAME_OR_CLASSNAME, GETNAME_ROLENAMESEP_, GETNAME_SIZE_TEMPLATE, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx, XHOLON_ID_DEFAULT, XHOLON_ID_NULL
Constructor and Description |
---|
Xholon2Svg()
constructor
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getConnectorStrokeColor() |
float |
getConnectorStrokeWidth() |
java.lang.String |
getFontColor()
Font color (default: "black").
|
java.lang.String |
getFontFamily()
Font family (default: "Verdana").
|
float |
getFontSize()
Font size (default: 8.0f).
|
float |
getFontSizeInc()
Font size increment (default: 1.0f).
|
int |
getLevelTranslateX()
How far a new group (container) is translated in the x direction.
|
int |
getLevelTranslateY()
How far a new group (container) is translated in the y direction.
|
java.lang.String |
getModelName() |
java.lang.String |
getNameTemplate() |
java.lang.String |
getNameTemplate4Ports() |
float |
getPageHeight()
Page width in px (default: 765.0f).
|
float |
getPageWidth()
Page width in px (default: 990.0f).
|
float |
getPortCenterX() |
float |
getPortCenterY() |
java.lang.String |
getPortConjugatedTemplate() |
java.lang.String |
getPortTemplate() |
XholonSortedNode |
getReffedRoot() |
IXholon |
getRoot() |
java.lang.String |
getShapeFillColor()
Shape fill color (default: "white").
|
java.lang.String |
getShapeFillColorAlternate()
Alternate shape fill color (default: "") light greenish.
|
float |
getShapeRx()
Optional rx value on rect, for a rounded rectangle.
|
float |
getShapeRy()
Optional ry value on rect, for a rounded rectangle.
|
int |
getSiblingTranslateX()
How far a new sibling node is translated in the x direction.
|
int |
getSiblingTranslateY()
How far a new sibling node is translated in the y direction.
|
java.lang.String |
getStrokeColor()
Stroke color (default: "#a121f1") purplish.
|
float |
getStrokeWidth()
Stroke width in px (default: 1.0f).
|
float |
getStrokeWidthInc()
Stroke width in px (default: 0.05f).
|
java.lang.String |
getSvgClientOption() |
java.lang.String |
getSvgFileName() |
java.lang.String |
getSvgPathName() |
java.util.Date |
getTimeNow() |
long |
getTimeStamp() |
java.lang.String |
getWriteValType() |
IXPath |
getXPathLocal() |
boolean |
initialize(java.lang.Object out,
java.lang.String modelName,
IXholon root)
Initialize.
|
boolean |
isSelectedNodesOnly()
Should take selected nodes only?
If this option is chosen, then only a root node
and any descendant nodes that are available from the Node Selection Service,
are included in the generated SVG.
|
boolean |
isShouldCommentConnectors()
Should all the connector lines be commented out?
This is useful when using the Inkscape-specific syntax,
because Inkscape often looses the connector lines when the image is being edited.
|
boolean |
isShouldFlatten()
Should flatten the composite structure hierarchy?
If this option is chosen, then only a root node
and its descendant leaf nodes are included in the generated SVG.
|
boolean |
isShouldShowConnectors() |
boolean |
isShouldShowPorts() |
boolean |
isShouldWriteStylesheet()
Whether to write a stylesheet (true), or inline XML attributes.
|
boolean |
isShowStates()
Whether or not to show state machines.
|
boolean |
isUseInkscape()
Whether or not to write connectors using Inkscape-specific syntax.
|
void |
postConfigure()
This method will only be called if an instance of this class is pasted in.
|
void |
setModelName(java.lang.String modelName) |
void |
setParams(java.lang.String params)
Set various run time parameters for generating and launching a GUI.
|
void |
setReffedRoot(XholonSortedNode reffedRoot) |
void |
setRoot(IXholon root) |
void |
setSvgClientOption(java.lang.String svgClientOption) |
void |
setSvgFileName(java.lang.String svgFileName) |
void |
setSvgPathName(java.lang.String svgPathName) |
void |
setTimeNow(java.util.Date timeNow) |
void |
setTimeStamp(long timeStamp) |
void |
setWriteValType(java.lang.String writeValType) |
void |
setXPathLocal(IXPath xPathLocal) |
boolean |
visit(IXholon visitee)
Visit another IXholon, and perform some operation.
|
void |
writeAll()
Write out all parts of the GUI file.
|
act, actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, compareTo, configure, configure, consoleLog, decVal, decVal, depth, doAction, equals, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getActionList, getAllPorts, getAnnotation, getApp, getAttributeNodeXh, getAttributeXh, getChildNodes, getClassNode, getClassNode, getFactory, getFirstChild, getFirstSibling, getId, getInteraction, getInteractionsEnabled, getIQueueImplName, getLastChild, getLastSibling, getLogger, getMsgQ, getName, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumLevels, getNumSiblings, getParentNode, getPort, getPort, getPreviousSibling, getRoleName, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getService, getSiblings, getSystemMsgQ, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, getXPath, handleNodeSelection, handleNodeSelection, hasAncestor, hasAnnotation, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertFirstChild, isActiveObject, isAttributeHandler, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, isUniqueSibling, isUniqueSiblingRoleName, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, reconfigure, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodes, searchForReferencingNodesRecurse, sendMessage, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setActionList, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPort, setPort, setPorts, setRoleName, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_Object, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, terminate, toString, toXml, toXmlAttribute, toXmlAttributes, toXmlText, treeSize
public void postConfigure()
postConfigure
in interface IXholon
postConfigure
in class Xholon
Xholon.postConfigure()
public boolean initialize(java.lang.Object out, java.lang.String modelName, IXholon root)
IXholon2Gui
initialize
in interface IXholon2Gui
out
- Name of the output GUI file, or an instance of Writer, or another type of output object.modelName
- Name of the model.root
- Root of the hierarchy to write out (composite or inheritance structure).public boolean visit(IXholon visitee)
IXholon
If a visitor and visitee object are the same, then the default implementation of the visit method will not call its visitor.
visit
in interface IXholon
visit
in class Xholon
visitee
- The node in the tree that is currently being visited.IXholon.visit(org.primordion.xholon.base.IXholon)
public void setParams(java.lang.String params)
IXholon2Gui
setParams
in interface IXholon2Gui
params
- A String containing a comma delimited series of parameters.
The parameters, in their proper order, are:
guiPathName guiType widthInPixels webSite shouldShowDescription shouldShowStateMachineEntities shouldLaunchGui
ex: ./gui/,1,200,file:///C:/Xholon/gui/,true,false,true
ex: /jetty-6.1.5/webapps/xholon/,2,200,http://localhost:8080/xholon/,false,false,true
public void writeAll()
IXholon2Gui
writeAll
in interface IXholon2Gui
public java.lang.String getSvgFileName()
public void setSvgFileName(java.lang.String svgFileName)
public java.lang.String getModelName()
public void setModelName(java.lang.String modelName)
public IXholon getRoot()
public void setRoot(IXholon root)
public java.lang.String getSvgPathName()
public void setSvgPathName(java.lang.String svgPathName)
public java.util.Date getTimeNow()
public void setTimeNow(java.util.Date timeNow)
public long getTimeStamp()
public void setTimeStamp(long timeStamp)
public XholonSortedNode getReffedRoot()
public void setReffedRoot(XholonSortedNode reffedRoot)
public IXPath getXPathLocal()
public void setXPathLocal(IXPath xPathLocal)
public java.lang.String getSvgClientOption()
public void setSvgClientOption(java.lang.String svgClientOption)
public java.lang.String getWriteValType()
public void setWriteValType(java.lang.String writeValType)
public boolean isShowStates()
public java.lang.String getNameTemplate()
public java.lang.String getNameTemplate4Ports()
public java.lang.String getFontFamily()
public float getFontSize()
public float getFontSizeInc()
public java.lang.String getFontColor()
public float getStrokeWidth()
public float getStrokeWidthInc()
public java.lang.String getStrokeColor()
public java.lang.String getShapeFillColor()
public java.lang.String getShapeFillColorAlternate()
public float getShapeRx()
public float getShapeRy()
public float getPageWidth()
public float getPageHeight()
public boolean isShouldShowPorts()
public java.lang.String getPortTemplate()
public java.lang.String getPortConjugatedTemplate()
public float getPortCenterX()
public float getPortCenterY()
public java.lang.String getConnectorStrokeColor()
public float getConnectorStrokeWidth()
public boolean isShouldShowConnectors()
public boolean isUseInkscape()
public boolean isShouldCommentConnectors()
public boolean isShouldFlatten()
public boolean isSelectedNodesOnly()
public boolean isShouldWriteStylesheet()
public int getLevelTranslateX()
public int getLevelTranslateY()
public int getSiblingTranslateX()
public int getSiblingTranslateY()