org.processmining.exporting.petrinet.cpnexport
Class ColoredPlace

java.lang.Object
  extended by att.grappa.Element
      extended by att.grappa.Node
          extended by org.processmining.framework.models.ModelGraphVertex
              extended by org.processmining.framework.models.petrinet.PNNode
                  extended by org.processmining.framework.models.petrinet.Place
                      extended by org.processmining.exporting.petrinet.cpnexport.ColoredPlace
All Implemented Interfaces:
att.grappa.GrappaConstants, java.lang.Cloneable, java.lang.Comparable

public class ColoredPlace
extends Place

A place being part of a high-level Petri net simulation model.

Author:
Anne Rozinat (a.rozinat@tm.tue.nl), Ronny Mans
See Also:
ColoredPetriNet, ColoredTransition, ColoredEdge

Field Summary
 
Fields inherited from class org.processmining.framework.models.ModelGraphVertex
identifier, object2, value, visualObject
 
Fields inherited from class att.grappa.Node
defaultNamePrefix
 
Fields inherited from class att.grappa.Element
counter, highlight, linewidth, object, printAllAttributes, printDefaultAttributes, usePrintList, visible
 
Fields inherited from interface att.grappa.GrappaConstants
_NO_TYPE, ANONYMOUS_PREFIX, BBOX_ATTR, BBOX_HASH, BOX_SHAPE, BOX_TYPE, CLUSTERRANK_ATTR, COLOR_ATTR, COLOR_HASH, COLOR_TYPE, CUSTOM_ATTR, CUSTOM_HASH, CUSTOM_SHAPE, DELETION_MASK, DIAMOND_SHAPE, DIR_ATTR, DIR_HASH, DIR_TYPE, DISTORTION_ATTR, DISTORTION_HASH, DOUBLE_TYPE, DOUBLECIRCLE_SHAPE, DOUBLEOCTAGON_SHAPE, EDGE, EGG_SHAPE, FILLCOLOR_ATTR, FILLCOLOR_HASH, FONTCOLOR_ATTR, FONTCOLOR_HASH, FONTNAME_ATTR, FONTNAME_HASH, FONTSIZE_ATTR, FONTSIZE_HASH, FONTSTYLE_ATTR, FONTSTYLE_HASH, FONTSTYLE_TYPE, GRAPPA_BACKGROUND_COLOR_ATTR, GRAPPA_BACKGROUND_COLOR_HASH, GRAPPA_DELETION_STYLE_ATTR, GRAPPA_DELETION_STYLE_HASH, GRAPPA_FONTSIZE_ADJUSTMENT_ATTR, GRAPPA_FONTSIZE_ADJUSTMENT_HASH, GRAPPA_SELECTION_STYLE_ATTR, GRAPPA_SELECTION_STYLE_HASH, GRAPPA_SHAPE, HASHLIST_TYPE, HEIGHT_ATTR, HEIGHT_HASH, HEXAGON_SHAPE, HIGHLIGHT_MASK, HIGHLIGHT_OFF, HIGHLIGHT_ON, HIGHLIGHT_TOGGLE, HOUSE_SHAPE, IDENTXFRM, IMAGE_ATTR, IMAGE_HASH, INTEGER_TYPE, INVERTEDHOUSE_SHAPE, INVERTEDTRAPEZIUM_SHAPE, INVERTEDTRIANGLE_SHAPE, LABEL_ATTR, LABEL_HASH, LINE_SHAPE, LINE_TYPE, LOG10, LP_ATTR, LP_HASH, MARGIN_ATTR, MARGIN_HASH, MCIRCLE_SHAPE, MCLIMIT_ATTR, MCLIMIT_HASH, MDIAMOND_SHAPE, MINBOX_ATTR, MINBOX_HASH, MINLEN_ATTR, MINLEN_HASH, MINSIZE_ATTR, MINSIZE_HASH, MRECORD_SHAPE, MSQUARE_SHAPE, NBSP, NEW_LINE, NO_SHAPE, NODE, NODESEP_ATTR, NODESEP_HASH, OCTAGON_SHAPE, ORIENTATION_ATTR, ORIENTATION_HASH, OVAL_SHAPE, PACKAGE_PREFIX, PARALLELOGRAM_SHAPE, PATCH_ATTR, PATCH_HASH, PENTAGON_SHAPE, PERIPHERIES_ATTR, PERIPHERIES_HASH, PERIPHERY_GAP, PKG_LOWER, PKG_UPLOW, PKG_UPPER, PLAINTEXT_SHAPE, POINT_TYPE, PointsPerInch, POLYGON_SHAPE, POS_ATTR, POS_HASH, PRINTLIST_ATTR, PRINTLIST_HASH, RANKDIR_ATTR, RANKDIR_HASH, RANKSEP_ATTR, RANKSEP_HASH, RECORD_SHAPE, RECTS_ATTR, RECTS_HASH, ROTATION_ATTR, ROTATION_HASH, ROUNDEDBOX_SHAPE, SELECTION_MASK, SHAPE_ATTR, SHAPE_HASH, SHAPE_MASK, SHAPE_TYPE, SIDES_ATTR, SIDES_HASH, SIZE_ATTR, SIZE_HASH, SIZE_TYPE, SKEW_ATTR, SKEW_HASH, STRING_TYPE, STYLE_ATTR, STYLE_HASH, STYLE_TYPE, SUBGRAPH, SYSTEM, TAG_ATTR, TAG_HASH, TIP_ATTR, TIP_HASH, TRAPEZIUM_SHAPE, TRIANGLE_SHAPE, TRIPLEOCTAGON_SHAPE, TYPES_SHIFT, WEIGHT_ATTR, WEIGHT_HASH, WIDTH_ATTR, WIDTH_HASH
 
Constructor Summary
ColoredPlace(Place template, ColoredPetriNet net)
          The constructor creates a ColoredPlace from an ordinary place.
ColoredPlace(Place template, ColoredPetriNet net, int x, int y, int w, int h)
          The constructor creates a ColoredPlace from an ordinary place, but the position, width and heigth have to be provided
ColoredPlace(java.lang.String name, ColoredPetriNet net)
          Constructor to create a ColoredPlace without having a template place.
ColoredPlace(java.lang.String name, PetriNet net, int x, int y, int w, int h)
          Constructor to create a ColoredPlace without having a template place.
 
Method Summary
 java.lang.String getCpnID()
          Returns the cpnID for this place.
 int getHeight()
          Retrieves the height of this node.
 java.lang.String getInitMark()
          Retrieves the initial marking of this place.
 java.lang.String getNameFusionPlace()
          Retrieves the name of the fusion place.
 java.lang.String getPlaceType()
          Retrieves the place type of this place.
 int getWidth()
          Retrieves the width of this node.
 int getXCoordinate()
          Retrieves the x coordinate of the center point.
 int getYCoordinate()
          Retrieves the y coordinate of the center point.
 int hashCode()
          Make a deep copy of the object.
 void setCpnID(java.lang.String id)
          Sets the cpnID for this place.
 void setHeight(int value)
          Sets the height of this node.
 void setInitMark(java.lang.String init)
          Sets the initial marking of this place.
 void setNameFusionPlace(java.lang.String name)
          Sets the name of the fusion place (in cpn)
 void setPlaceType(java.lang.String type)
          Sets the place type of this place.
 void setWidth(int value)
          Sets the width of this node.
 void setXCoordinate(int value)
          Sets the x coordinate of the center point.
 void setYCoordinate(int value)
          Sets the y coordinate of the center point.
 void write(java.io.BufferedWriter bw, ColoredTransition topTransition)
          Writes this place to the cpn-file.
 
Methods inherited from class org.processmining.framework.models.petrinet.Place
addToken, clone, compareTo, equals, getNumber, getNumberOfTokens, getNumberOfTokens, getRandomAvailableToken, getRandomAvailableToken, hasIdentifier, removeAllTokens, removeToken, removeToken, setNumber
 
Methods inherited from class org.processmining.framework.models.ModelGraphVertex
getIdentifier, getIncidentEdges, getInEdgesIterator, getNeighbors, getOutEdgesIterator, getPredecessors, getSuccessors, getValue, getVerticesOnlyPredecessor, getVerticesOnlySuccessor, getVerticesPredecessorAndSuccessor, setIdentifier, setValue, toString
 
Methods inherited from class att.grappa.Node
addEdge, attributeType, edgeElements, findInEdgeByKey, findOutEdgeByKey, getCenterPoint, getInEdges, getOutEdges, getType, inDegree, inEdgeElements, isNode, outDegree, outEdgeElements, printNode, removeEdge
 
Methods inherited from class att.grappa.Element
addTag, attrNotOfInterest, attrOfInterest, bdfs, buildShape, canonString, canonValue, clearBBox, delete, getAttribute, getAttributePairs, getAttributeValue, getDefaultAttribute, getDefaultAttribute, getGraph, getGrappaNexus, getId, getIdKey, getLocalAttribute, getLocalAttributeKeys, getLocalAttributePairs, getName, getSubgraph, getThisAttribute, getThisAttributeValue, hasAttributeForKey, hasDefaultTag, hasDefaultTags, hasLocalTag, hasLocalTags, hasTag, hasTags, isEdge, isOfInterest, isSubgraph, listAttrsOfInterest, printElement, removeTag, removeTags, setAttribute, setAttribute, setDefaultAttribute, setDefaultAttribute, setDefaultAttribute, setDefaultAttribute, setIdKey, setSubgraph, setUserAttributeType, typeString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColoredPlace

public ColoredPlace(java.lang.String name,
                    ColoredPetriNet net)
Constructor to create a ColoredPlace without having a template place.

Parameters:
name - the identifier is to be passed to super class
net - the Petri net it belongs to (to be passed to super class)

ColoredPlace

public ColoredPlace(java.lang.String name,
                    PetriNet net,
                    int x,
                    int y,
                    int w,
                    int h)
Constructor to create a ColoredPlace without having a template place.

Parameters:
name - the identifier is to be passed to super class
net - the Petri net it belongs to (to be passed to super class)
x - The x coordinate of the center point for this place
y - The y coordinate of the center point for this place
w - The width of this place
h - The height of this place

ColoredPlace

public ColoredPlace(Place template,
                    ColoredPetriNet net)
The constructor creates a ColoredPlace from an ordinary place.

Parameters:
template - place (whose identifier is to be passed to super class)
net - the Petri net it belongs to (to be passed to super class)

ColoredPlace

public ColoredPlace(Place template,
                    ColoredPetriNet net,
                    int x,
                    int y,
                    int w,
                    int h)
The constructor creates a ColoredPlace from an ordinary place, but the position, width and heigth have to be provided

Parameters:
template - Place Place (whose identifier is to be passed to super class)
net - ColoredPetriNet The Petri net it belongs to (to be passed to the super class)
x - int The x coordinate of the center point for this place
y - int The y coordinate of the center point for this place
w - int The width of this place
h - int The height of this place
Method Detail

write

public void write(java.io.BufferedWriter bw,
                  ColoredTransition topTransition)
           throws java.io.IOException
Writes this place to the cpn-file.

Parameters:
bw - BufferedWriter used to stream the data to the file.
topTransition - the transition that is the top of the subpage in which this place is located. Null if no such top transition exists.
Throws:
java.io.IOException

getCpnID

public java.lang.String getCpnID()
Returns the cpnID for this place.

Returns:
String the cpnID for this place or "" if no such cpnID exists.

setCpnID

public void setCpnID(java.lang.String id)
Sets the cpnID for this place.

Parameters:
id - String the cpnID.

setNameFusionPlace

public void setNameFusionPlace(java.lang.String name)
Sets the name of the fusion place (in cpn)

Parameters:
name - String the name of the fusion place or "" if this place does not need to be a fusion place

getPlaceType

public java.lang.String getPlaceType()
Retrieves the place type of this place. Note that it is not checked whether a corresponding colorset has been defined in the declaration section of the CPN model.

Returns:
the place type

getInitMark

public java.lang.String getInitMark()
Retrieves the initial marking of this place. Note that it is not checked whether this complies with the type of this place.

Returns:
the initial marking

getXCoordinate

public int getXCoordinate()
Retrieves the x coordinate of the center point.

Returns:
the x coordinate.

getYCoordinate

public int getYCoordinate()
Retrieves the y coordinate of the center point.

Returns:
the y coordinate

getWidth

public int getWidth()
Retrieves the width of this node.

Returns:
the width

getHeight

public int getHeight()
Retrieves the height of this node.

Returns:
the height

getNameFusionPlace

public java.lang.String getNameFusionPlace()
Retrieves the name of the fusion place.

Returns:
String the name of the fusion place or "" if this place does not need to be a fusion place.

setPlaceType

public void setPlaceType(java.lang.String type)
Sets the place type of this place. Note that it is not checked whether a corresponding colorset has been defined in the declaration section of the CPN model.

Parameters:
type - the place type

setInitMark

public void setInitMark(java.lang.String init)
Sets the initial marking of this place. Note that it is not checked whether this complies with the type of this place.

Parameters:
init - the initial marking

setXCoordinate

public void setXCoordinate(int value)
Sets the x coordinate of the center point.

Parameters:
value - the new x coordinate to be assigned

setYCoordinate

public void setYCoordinate(int value)
Sets the y coordinate of the center point.

Parameters:
value - the new y coordinate to be assigned

setWidth

public void setWidth(int value)
Sets the width of this node.

Parameters:
value - the new width to be assigned

setHeight

public void setHeight(int value)
Sets the height of this node.

Parameters:
value - the new height to be assigned

hashCode

public int hashCode()
Make a deep copy of the object. Note that this method needs to be extended as soon as there are attributes added to the class which are not primitive or immutable.
Note further that the belonging Simulated Petri net is not cloned (so the cloned object will point to the same one as this object). Only the ColoredPetriNet.clone() method will update the refernce correspondingly.

Overrides:
hashCode in class Place
Returns:
Object the cloned object