Package org.jbpm.designer.server.diagram
Class Shape
- java.lang.Object
-
- org.jbpm.designer.server.diagram.Shape
-
-
Constructor Summary
Constructors Constructor Description Shape(String resourceId)set a new id for the shapeShape(String resourceId, StencilType stencil)Constructs a new shape with id and stencil
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanaddGlossaryIds(String id)booleanaddIncoming(Shape current)booleanaddOutgoing(Shape out)Adds a new shape to the outgoingsbooleanequals(Object obj)BoundsgetBounds()Returns the bounds of a shape.ArrayList<Shape>getChildShapes()ArrayList<Point>getDockers()Gives the point list of dockers for a shape, dockers usually appears on edgesArrayList<String>getGlossaryIds()doublegetHeight()ArrayList<Shape>getIncomings()PointgetLowerRight()ArrayList<Shape>getOutgoing()Deprecated.ArrayList<Shape>getOutgoings()Give an array of outgoing shapesShapegetParent()HashMap<String,String>getProperties()return a HashMap with all properties, name as key, value as valueStringgetProperty(String name)Gives the value of the property with the given nameStringgetResourceId()returns the unique shape id, generated by the editorStencilTypegetStencil()Gives the Stencil object of the shapeStringgetStencilId()Gives the stencil id of an objectShapegetTarget()Gives the target of shape, which defined another associated shapePointgetUpperLeft()doublegetWidth()inthashCode()StringputProperty(String key, String value)changes an existing property with the same name, or adds a new onevoidsetBounds(Bounds bounds)Set a new bounds for a shapevoidsetChildShapes(ArrayList<Shape> childShapes)voidsetDockers(ArrayList<Point> dockers)set a ArrayList with all attached dockers for a shape, dockers usually appears on edges A docker is a point on the canvasvoidsetGlossaryIds(ArrayList<String> glossaryIds)voidsetIncomings(ArrayList<Shape> cur)voidsetOutgoing(ArrayList<Shape> outgoing)Deprecated.voidsetOutgoings(ArrayList<Shape> outgoings)Set a new array of outgoing shapesvoidsetParent(Shape parent)voidsetProperties(HashMap<String,String> properties)set a new property hash mapvoidsetResourceId(String resourceId)set unique shape id, usually generated by the editorvoidsetStencil(StencilType stencil)Set a new Stencil Object for the shapevoidsetTarget(Shape target)Set a new target shape for a shape
-
-
-
Constructor Detail
-
Shape
public Shape(String resourceId, StencilType stencil)
Constructs a new shape with id and stencil- Parameters:
resourceId- unique shape id, generated by the editorstencil- StencilType with stencilId
-
Shape
public Shape(String resourceId)
set a new id for the shape- Parameters:
resourceId-
-
-
Method Detail
-
getParent
public Shape getParent()
- Returns:
- the parent
-
setParent
public void setParent(Shape parent)
- Parameters:
parent- the parent to set
-
getStencilId
public String getStencilId()
Description copied from interface:StencilGives the stencil id of an object- Specified by:
getStencilIdin interfaceStencil- Returns:
- the id of an associated stencil
-
getResourceId
public String getResourceId()
returns the unique shape id, generated by the editor- Returns:
- the resourceId
-
setResourceId
public void setResourceId(String resourceId)
set unique shape id, usually generated by the editor- Parameters:
resourceId- the resourceId to set
-
getProperty
public String getProperty(String name)
Gives the value of the property with the given name- Parameters:
name- name of the property- Returns:
- value of the property or null if no mapping available for the name
-
getProperties
public HashMap<String,String> getProperties()
return a HashMap with all properties, name as key, value as value- Returns:
- the properties
-
setProperties
public void setProperties(HashMap<String,String> properties)
set a new property hash map- Parameters:
properties- the properties to set
-
putProperty
public String putProperty(String key, String value)
changes an existing property with the same name, or adds a new one- Parameters:
key- property name with which the specified value is to be associatedvalue- value to be associated with the specified property name- Returns:
- the previous value associated with property name, or null if there was no mapping for property name. (A null return can also indicate that the map previously associated null with key.)
-
getStencil
public StencilType getStencil()
Gives the Stencil object of the shape- Returns:
- the stencil associated with the shape
-
setStencil
public void setStencil(StencilType stencil)
Set a new Stencil Object for the shape- Parameters:
stencil- the stencil to set
-
setChildShapes
public void setChildShapes(ArrayList<Shape> childShapes)
- Parameters:
childShapes- the childShapes to set
-
getOutgoing
@Deprecated public ArrayList<Shape> getOutgoing()
Deprecated.
-
setOutgoing
@Deprecated public void setOutgoing(ArrayList<Shape> outgoing)
Deprecated.
-
getOutgoings
public ArrayList<Shape> getOutgoings()
Give an array of outgoing shapes- Returns:
- the outgoing shape objects of the shape
-
setOutgoings
public void setOutgoings(ArrayList<Shape> outgoings)
Set a new array of outgoing shapes- Parameters:
outgoings- the outgoing shapes to set
-
addOutgoing
public boolean addOutgoing(Shape out)
Adds a new shape to the outgoings- Parameters:
out- shape to append- Returns:
- true if add was successful
-
getDockers
public ArrayList<Point> getDockers()
Gives the point list of dockers for a shape, dockers usually appears on edges- Returns:
- the dockers, a list of points
-
setDockers
public void setDockers(ArrayList<Point> dockers)
set a ArrayList with all attached dockers for a shape, dockers usually appears on edges A docker is a point on the canvas- Parameters:
dockers- the list of points to set
-
getTarget
public Shape getTarget()
Gives the target of shape, which defined another associated shape- Returns:
- the target shape
-
setTarget
public void setTarget(Shape target)
Set a new target shape for a shape- Parameters:
target- the target shape to set
-
getBounds
public Bounds getBounds()
Returns the bounds of a shape. Bounds defined the space a shape spans over the canvas- Returns:
- the bounds object of a shape
-
setBounds
public void setBounds(Bounds bounds)
Set a new bounds for a shape- Parameters:
bounds- the bounds to set
-
getUpperLeft
public Point getUpperLeft()
- Specified by:
getUpperLeftin interfaceBounded- Returns:
- Point Object of the upper left
-
getLowerRight
public Point getLowerRight()
- Specified by:
getLowerRightin interfaceBounded- Returns:
- Point Object of the lower right
-
setGlossaryIds
public void setGlossaryIds(ArrayList<String> glossaryIds)
- Parameters:
glossaryIds- the glossaryIds to set
-
addGlossaryIds
public boolean addGlossaryIds(String id)
-
addIncoming
public boolean addIncoming(Shape current)
-
getHeight
public double getHeight()
-
-