Package org.graffiti.graphics
Class NodeGraphicAttribute
java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.AbstractCollectionAttribute
org.graffiti.attributes.HashMapAttribute
org.graffiti.graphics.GraphElementGraphicAttribute
org.graffiti.graphics.NodeGraphicAttribute
- All Implemented Interfaces:
Comparable<Object>,Attribute,CollectionAttribute,DeepCopy,GraphicAttributeConstants,Displayable
public class NodeGraphicAttribute extends GraphElementGraphicAttribute
Defines all grahic attributes of a node
- Version:
- $Revision: 1.6 $
- Author:
- breu
-
Field Summary
Fields inherited from interface org.graffiti.graphics.GraphicAttributeConstants
ABOVE, ABOVELEFT, ABOVERIGHT, ABSHOR, ABSVERT, ALIGNMENT, ALIGNSEGMENT, ANCHOR, ARROWHEAD, ARROWTAIL, AUTO_OUTSIDE, AXISCOLOR, BELOW, BELOWLEFT, BELOWRIGHT, BENDS, BENDS_PATH, BGIMAGE, BLUE, BORDER_BOTTOM_CENTER, BORDER_BOTTOM_LEFT, BORDER_BOTTOM_RIGHT, BORDER_LEFT_BOTTOM, BORDER_LEFT_CENTER, BORDER_LEFT_TOP, BORDER_RIGHT_BOTTOM, BORDER_RIGHT_CENTER, BORDER_RIGHT_TOP, BORDER_TOP_CENTER, BORDER_TOP_LEFT, BORDER_TOP_RIGHT, CATEGORY_BACKGROUND_A, CATEGORY_BACKGROUND_B, CATEGORY_BACKGROUND_C, CENTERED, CENTERED_FIT, CHARTBACKGROUNDCOLOR, CIRCLE_CLASSNAME, COLOR, COMMON, COORD_PATH, COORDINATE, COORDX_PATH, COORDY_PATH, CUBICSPLINE, CUBICSPLINE_CLASSNAME, DEFAULT_CAP_B, DEFAULT_CAP_R, DEFAULT_JOIN, DEFAULT_MITER, DIM_PATH, DIMENSION, DIMH_PATH, DIMW_PATH, DOCKING, DOCKING_PATH, ELLIPSE_CLASSNAME, FILLCOLOR, FILLCOLOR_PATH, FONTNAME, FONTSIZE, FONTSTYLE, FRAMECOLOR, FRAMETHICKNESS, FRAMETHICKNESS_PATH, GRADIENT, GRAPHICS, GREEN, GRIDCOLOR, HEATMAP_LOWER_COL, HEATMAP_MIDDLE_COL, HEATMAP_UPPER_COL, HEIGHT, HIDDEN, IMAGE, IN, INSIDEBOTTOM, INSIDEBOTTOMLEFT, INSIDEBOTTOMRIGHT, INSIDELEFT, INSIDERIGHT, INSIDETOP, INSIDETOPLEFT, INSIDETOPRIGHT, LABEL, LABEL_ATTRIBUTE_PATH, LABEL_DISTANCE, LABELGRAPHICS, LABELOFFSET, LEFT, LINEMODE, LINETYPE, LINEWIDTH_PATH, LOCALALIGN, MAXIMIZE, NAME, NEARSOURCE, NEARTARGET, OPAC, OUT, OUTLINE_PATH, POLYCLOSED_CLASSNAME, POLYLINE, POLYLINE_CLASSNAME, PORT, PORTS, PORTS_PATH, POSITION, RECTANGLE_CLASSNAME, RED, REF, RELALIGN, RELHOR, RELVERT, RIGHT, ROUNDING, SHADOWCOLOR, SHADOWOFFSET, SHAPE, SHAPE_DESC_PATH, SHAPE_PATH, SHAPEDESCRIPTION, SMOOTH_CLASSNAME, SMOOTHLINE, SOURCE, SQUARESPLINE, SQUARESPLINE_CLASSNAME, STRAIGHTLINE, STRAIGHTLINE_CLASSNAME, TARGET, TEXTCOLOR, THICKNESS, TILED, WIDTH, X, Y -
Constructor Summary
Constructors Constructor Description NodeGraphicAttribute()Constructor for NodeGraphicAttribute.NodeGraphicAttribute(double x, double y, double h, double w, PortsAttribute p)Constructor for NodeGraphicAttribute.NodeGraphicAttribute(Point2D position, Dimension size)NodeGraphicAttribute(Point2D c, Dimension d, PortsAttribute p)Constructor for NodeGraphicAttribute.NodeGraphicAttribute(String id)Constructor that sets the id to the given value, and initializes the other attributes with default values.NodeGraphicAttribute(CoordinateAttribute c, DimensionAttribute d, PortsAttribute p)Constructor for NodeGraphicAttribute. -
Method Summary
Modifier and Type Method Description voidadd(Attribute a)Adds a given attribute to the collection.voidadd(Attribute a, boolean inform)Adds a given attribute to the collection.CoordinateAttributegetCoordinate()Returns the 'coordinate'-value of the encapsulated node.DimensionAttributegetDimension()Returns the 'dimension'-value of the encapsulated node.PortsAttributegetPorts()Returns the 'ports'-value of the encapsulated node.voidsetCollection(Map<String,Attribute> attrs)Sets the collection of attributes contained within this CollectionAttribute.voidsetCoordinate(CoordinateAttribute c)Sets the 'coordinate'-value.voidsetDimension(DimensionAttribute d)Sets the 'dimension'-value.voidsetPorts(PortsAttribute p)Sets the 'ports'-value.Methods inherited from class org.graffiti.graphics.GraphElementGraphicAttribute
getBackgroundImage, getFillcolor, getFramecolor, getFrameThickness, getLineMode, getOpacity, getRoundedEdges, getShape, getUseGradient, setBackgroundImage, setFillcolor, setFramecolor, setFrameThickness, setLineMode, setOpacity, setRoundedEdges, setShape, setUseGradientMethods inherited from class org.graffiti.attributes.HashMapAttribute
compareTo, copy, getCollection, setDefaultValue, sizeMethods inherited from class org.graffiti.attributes.AbstractCollectionAttribute
getAttributable, getAttribute, getValue, isEmpty, remove, remove, setAttributable, toString, toXMLStringMethods inherited from class org.graffiti.attributes.AbstractAttribute
addEdgeAttributeType, addNodeAttributeType, getDescription, getIcon, getId, getName, getParent, getPath, getTypedAttribute, isDeleted, isTypedAttributeFromID, setDeleted, setDescription, setId, setParent, setValue, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.graffiti.attributes.Attribute
getAttributable, getId, getParent, getPath, getValue, isDeleted, setDeleted, setId, setParent, setValue, toStringMethods inherited from interface org.graffiti.attributes.CollectionAttribute
getAttribute, isEmpty, remove, remove, setAttributableMethods inherited from interface org.graffiti.plugin.Displayable
getDescription, getIcon, getName, setDescription, toXMLString
-
Constructor Details
-
NodeGraphicAttribute
Constructor that sets the id to the given value, and initializes the other attributes with default values.- Parameters:
id- DOCUMENT ME!
-
NodeGraphicAttribute
public NodeGraphicAttribute(CoordinateAttribute c, DimensionAttribute d, PortsAttribute p) throws IllegalIdExceptionConstructor for NodeGraphicAttribute.- Parameters:
c- the coordinate-value of the attriubte.d- the dimension-value of the attribute.p- the ports-value of the attribute.- Throws:
IllegalIdException
-
NodeGraphicAttribute
Constructor for NodeGraphicAttribute.- Parameters:
c- the coordinate-value of the attriubte.d- the dimension-value of the attribute.p- the ports-value of the attribute.- Throws:
IllegalIdException
-
NodeGraphicAttribute
- Throws:
IllegalIdException
-
NodeGraphicAttribute
public NodeGraphicAttribute(double x, double y, double h, double w, PortsAttribute p) throws IllegalIdExceptionConstructor for NodeGraphicAttribute.- Parameters:
x- the x-coordinate-value of the attriubte.y- the y-coordinate-value of the attriubte.h- the height-value of the attribute.w- the width-value of the attribute.p- the ports-value of the attribute.- Throws:
IllegalIdException
-
NodeGraphicAttribute
Constructor for NodeGraphicAttribute.- Throws:
IllegalIdException
-
-
Method Details
-
add
public void add(Attribute a, boolean inform) throws AttributeExistsException, FieldAlreadySetExceptionDescription copied from class:AbstractCollectionAttributeAdds a given attribute to the collection. Only informs theListenerManagerabout the addition wheninformis set to true.- Specified by:
addin interfaceCollectionAttribute- Overrides:
addin classAbstractCollectionAttribute- Parameters:
a- the new attribute to add to the list.inform- when true,ListenerManagergets informed otherwise not- Throws:
AttributeExistsException- if there is already an attribute with the id of a.FieldAlreadySetException- thrown if Attribute a already has a parent or attributable associated with it.
-
add
Description copied from class:AbstractCollectionAttributeAdds a given attribute to the collection. Informs theListenerManagerabout the addition.- Specified by:
addin interfaceCollectionAttribute- Overrides:
addin classAbstractCollectionAttribute- Parameters:
a- the new attribute to add to the list.- Throws:
AttributeExistsException- if there is already an attribute with the id of a.FieldAlreadySetException- thrown if Attribute a already has a parent or attributable associated with it.
-
setCollection
Sets the collection of attributes contained within this CollectionAttribute. The known graphic attributes are set, additional values are simply added (that means that if there exists already a subattribute with the same id, an exception will be thrown).- Specified by:
setCollectionin interfaceCollectionAttribute- Overrides:
setCollectionin classHashMapAttribute- Parameters:
attrs- the map that contains all attributes.- Throws:
IllegalArgumentException- DOCUMENT ME!
-
setCoordinate
Sets the 'coordinate'-value.- Parameters:
c- the 'coordinate'-value to be set.
-
getCoordinate
Returns the 'coordinate'-value of the encapsulated node.- Returns:
- the 'coordinate'-value of the encapsulated node.
-
setDimension
Sets the 'dimension'-value.- Parameters:
d- the 'dimension'-value to be set.
-
getDimension
Returns the 'dimension'-value of the encapsulated node.- Returns:
- the 'dimension'-value of the encapsulated node.
-
setPorts
Sets the 'ports'-value.- Parameters:
p- the 'ports'-value to be set.
-
getPorts
Returns the 'ports'-value of the encapsulated node.- Returns:
- the 'ports'-value of the encapsulated node.
-