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 boolean
addGlossaryIds(String id)
boolean
addIncoming(Shape current)
boolean
addOutgoing(Shape out)
Adds a new shape to the outgoingsboolean
equals(Object obj)
Bounds
getBounds()
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()
double
getHeight()
ArrayList<Shape>
getIncomings()
Point
getLowerRight()
ArrayList<Shape>
getOutgoing()
Deprecated.ArrayList<Shape>
getOutgoings()
Give an array of outgoing shapesShape
getParent()
HashMap<String,String>
getProperties()
return a HashMap with all properties, name as key, value as valueString
getProperty(String name)
Gives the value of the property with the given nameString
getResourceId()
returns the unique shape id, generated by the editorStencilType
getStencil()
Gives the Stencil object of the shapeString
getStencilId()
Gives the stencil id of an objectShape
getTarget()
Gives the target of shape, which defined another associated shapePoint
getUpperLeft()
double
getWidth()
int
hashCode()
String
putProperty(String key, String value)
changes an existing property with the same name, or adds a new onevoid
setBounds(Bounds bounds)
Set a new bounds for a shapevoid
setChildShapes(ArrayList<Shape> childShapes)
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 canvasvoid
setGlossaryIds(ArrayList<String> glossaryIds)
void
setIncomings(ArrayList<Shape> cur)
void
setOutgoing(ArrayList<Shape> outgoing)
Deprecated.void
setOutgoings(ArrayList<Shape> outgoings)
Set a new array of outgoing shapesvoid
setParent(Shape parent)
void
setProperties(HashMap<String,String> properties)
set a new property hash mapvoid
setResourceId(String resourceId)
set unique shape id, usually generated by the editorvoid
setStencil(StencilType stencil)
Set a new Stencil Object for the shapevoid
setTarget(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:Stencil
Gives the stencil id of an object- Specified by:
getStencilId
in 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:
getUpperLeft
in interfaceBounded
- Returns:
- Point Object of the upper left
-
getLowerRight
public Point getLowerRight()
- Specified by:
getLowerRight
in 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()
-
-