|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.bsd.x2svg.Container
public class Container
This class holds all information about an element and its children. The paint() method is used to draw them on screen.
Field Summary | |
---|---|
java.util.List<java.lang.String> |
attributes
Attributes of this element |
Cardinality |
cardinality
The cardinality of this element. |
java.util.List<Container> |
children
The children of this container |
java.lang.String |
comment
A comment for this element |
ContentModel |
content
The content model of the children of this container |
boolean |
isAbstract
Is this an abstract element (XSD use) |
boolean |
isAny
|
boolean |
isEmpty
Can the element NOT contain children (is it marked as EMPTY)? |
boolean |
isPcData
Can the element contain text? |
boolean |
isReference
Is this a real element or a references to one already defined somewhere up the hierarchy? |
boolean |
isSubstitution
Is this a substitutionGroup (XSD use) |
boolean |
isType
Is this a named (complex) type (XSD use) |
int |
localHeight
Height of the element plus its surrounding content box |
int |
localWidth
Width of the element plus its surrounding content box |
java.lang.String |
name
Name of this element. |
Container |
parent
A link to the parent container or null if this is the root of the tree |
int |
totalHeight
Height of this element and enclosed ones |
int |
totalWidth
Width of this element including the with of included elements |
int |
xPos
Top left position of this container |
int |
yPos
Top left position of this container |
Constructor Summary | |
---|---|
Container()
|
Method Summary | |
---|---|
private void |
drawContentModel(org.apache.batik.svggen.SVGGraphics2D svg,
int x,
int y)
Helper to draw the content model if the container has children |
static boolean |
hasChildren(Container rootCont)
Safely determine if the passed container has children |
boolean |
isElementInHierarchy(java.lang.String elementName)
See if an item with the passed name already exists on our way to the root of the container tree. |
int |
paint(org.apache.batik.svggen.SVGGraphics2D svg,
int startX,
int startY)
Paints a container and its children. |
private void |
setStroke(org.apache.batik.svggen.SVGGraphics2D svg,
java.awt.Stroke stroke)
Set the stroke to dashed if the container is optional. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public java.lang.String name
public int totalWidth
public int totalHeight
public int localWidth
public int localHeight
public java.util.List<Container> children
public boolean isPcData
public boolean isAny
public boolean isEmpty
public ContentModel content
public Container parent
public Cardinality cardinality
public int xPos
public int yPos
public boolean isReference
public boolean isAbstract
public boolean isSubstitution
public boolean isType
public java.util.List<java.lang.String> attributes
public java.lang.String comment
Constructor Detail |
---|
public Container()
Method Detail |
---|
public int paint(org.apache.batik.svggen.SVGGraphics2D svg, int startX, int startY)
svg
- a svg canvas to draw onstartX
- top left corner of the area to draw instartY
- top left corner of the area to draw in
private void drawContentModel(org.apache.batik.svggen.SVGGraphics2D svg, int x, int y)
svg
- svg canvas to draw onx
- top left corner of the content model boxy
- top left corner of the content model boxprivate void setStroke(org.apache.batik.svggen.SVGGraphics2D svg, java.awt.Stroke stroke)
svg
- svg canvasstroke
- alternate stroke if the container is not optionalpublic static boolean hasChildren(Container rootCont)
rootCont
- Container to examine
public boolean isElementInHierarchy(java.lang.String elementName)
elementName
- Name of an Element
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |