JGraph X 1.4.1.0


com.mxgraph.io.vdx
Class mxVdxUtils

java.lang.Object
  extended by com.mxgraph.io.vdx.mxVdxUtils

public class mxVdxUtils
extends Object

General utilities for .vdx format support


Constructor Summary
mxVdxUtils()
           
 
Method Summary
static mxPoint adjustConstraint(mxPoint constraint)
          Adjusts a constraint in the range of 0..1
static double conversionFactor()
          Returns the conversion factor from inches to pixels.
static List<Node> copyNodeList(NodeList nodeList)
          Copy a given NodeList into a List
static Object[] getOrderArray(List<PageShapeIDKey> orderList, HashMap<PageShapeIDKey,Object> map)
          Creates an array with the cells contained in the map, ordered according the order of the keys in orderList.
static HashMap<String,Object> getStyleMap(String style, String asig)
          Create a style map from a String with style definitions.
static String getStyleString(Map<String,Object> styleMap, String asig)
          Returns the string that represents the content of a given style map.
static boolean nodeListHasTag(NodeList nl, String tag)
          Checks if the NodeList has a Node with name = tag.
static Element nodeListTag(NodeList nl, String tag)
          Returns the first Element that has name = tag in Node List.
static Element nodeListTagIndexed(NodeList nl, String tag, String ix)
          Returns the Element that has name = tag and Index = ix in Node List.
static List<Element> nodeListTags(NodeList nl, String tag)
          Returns a list with the elements included in the Node List that have name = tag.
static void printPointList(List<mxPoint> list)
          Print a list of mxPoint in the standard output.
static String surroundedByTags(String text, String tag)
          Returns a text surrounded by tags html.
static String toInitialCapital(String text)
          Converts the initial letter of each word in text to uppercase
static String toSmallCaps(String text, String size)
          Trnsforms each lower case letter in text to small capital.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

mxVdxUtils

public mxVdxUtils()
Method Detail

nodeListHasTag

public static boolean nodeListHasTag(NodeList nl,
                                     String tag)
Checks if the NodeList has a Node with name = tag.

Parameters:
nl - NodeList
tag - Name of the node.
Returns:
Returns true if the Node List has a Node with name = tag.

nodeListTag

public static Element nodeListTag(NodeList nl,
                                  String tag)
Returns the first Element that has name = tag in Node List.

Parameters:
nl - NodeList
tag - Name of the Element
Returns:
Element with name = 'tag'.

nodeListTagIndexed

public static Element nodeListTagIndexed(NodeList nl,
                                         String tag,
                                         String ix)
Returns the Element that has name = tag and Index = ix in Node List.

Parameters:
nl - NodeList
tag - name of the Element
Returns:
Element that has name = tag and Index = ix in Node List..

nodeListTags

public static List<Element> nodeListTags(NodeList nl,
                                         String tag)
Returns a list with the elements included in the Node List that have name = tag.

Parameters:
nl - NodeList
tag - name of the Element.
Returns:
List with the indicated elements.

copyNodeList

public static List<Node> copyNodeList(NodeList nodeList)
Copy a given NodeList into a List

Parameters:
nodeList - Node List.
Returns:
List with the elements of nodeList.

conversionFactor

public static double conversionFactor()
Returns the conversion factor from inches to pixels.

Returns:
converison factor.

adjustConstraint

public static mxPoint adjustConstraint(mxPoint constraint)
Adjusts a constraint in the range of 0..1

Parameters:
constraint - Point with the constraint.

getStyleString

public static String getStyleString(Map<String,Object> styleMap,
                                    String asig)
Returns the string that represents the content of a given style map.

Parameters:
styleMap - Map with the styles values
Returns:
string that represents the style.

surroundedByTags

public static String surroundedByTags(String text,
                                      String tag)
Returns a text surrounded by tags html.

Parameters:
text - Text to be surrounded.
tag - Name of the tag.
Returns:
< tag > text < /tag >

toInitialCapital

public static String toInitialCapital(String text)
Converts the initial letter of each word in text to uppercase

Parameters:
text - Text to be transformed.
Returns:
Text with initial capitals.

toSmallCaps

public static String toSmallCaps(String text,
                                 String size)
Trnsforms each lower case letter in text to small capital.

Parameters:
text - Text to be transformed.
size - Size of the original text.
Returns:
Text in small capitals.

getStyleMap

public static HashMap<String,Object> getStyleMap(String style,
                                                 String asig)
Create a style map from a String with style definitions.

Parameters:
style - Definition of the style.
asig - Asignation simbol used in 'style'.
Returns:
Map with the style properties.

printPointList

public static void printPointList(List<mxPoint> list)
Print a list of mxPoint in the standard output.

Parameters:
list - Lis of mxPoint.

getOrderArray

public static Object[] getOrderArray(List<PageShapeIDKey> orderList,
                                     HashMap<PageShapeIDKey,Object> map)
Creates an array with the cells contained in the map, ordered according the order of the keys in orderList.

Parameters:
orderList - List of keys in the order desired.
map - Map with the object to be put in the array.
Returns:
Array with the cells.

JGraph X 1.4.1.0


Copyright (c) 2010 Gaudenz Alder. All rights reserved.