public abstract class Item
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
private java.awt.Rectangle |
boundary
Rectangle if selected of the Node.
|
private java.awt.Point |
point
Point of the Node.
|
private java.util.List<DetailBarPropertyEntry> |
propertyBar
saves the entries for the properties bar.
|
private java.util.List<DetailDrawPropertyEntry> |
propertyDraw
saves the entries for the properties draw.
|
private int |
radius
radius of the Node.
|
private boolean |
selected
Boolean if selected.
|
| Constructor and Description |
|---|
Item() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
accept(ItemVisitor itemVisitor)
accept-method for nodevisitor (VisitorPattern).
|
abstract void |
acceptConnectVisitor(ConnectVisitor visitor)
accept-method for connectvisitor (VisitorPattern).
|
boolean |
contains(java.awt.Point p)
Return true if this node contains p.
|
java.lang.Boolean |
containsVaByIdentifier(VariableAssignment assignment)
The comparison method which evaluates if a variable assignment contains the identifier in the
detail bar.
|
abstract void |
draw(java.awt.Graphics g)
Draw this item.
|
java.awt.Rectangle |
getBoundary()
Üblicher Getter für das Attribut b.
|
java.awt.Point |
getPoint()
Üblicher Getter für das Attribut p.
|
java.util.List<DetailBarPropertyEntry> |
getPropertyBar()
getter for the properties bar.
|
java.util.List<DetailDrawPropertyEntry> |
getPropertyDraw()
getter for the properties draw.
|
boolean |
getSelected()
Return true if this node is selected.
|
static void |
getSelectedNodes(java.util.List<Item> list,
java.util.List<Item> selected)
Collected all the selected nodes in list.
|
abstract void |
markAsSelected(java.awt.Graphics g)
mark the item when it is selected.
|
static void |
selectAll(java.util.List<Item> list)
Select all items.
|
static boolean |
selectMultiple(java.util.List<Item> list,
java.awt.Point p)
Returns true if node in List already selected.
|
static void |
selectNone(java.util.List<Item> list)
Select no nodes.
|
static boolean |
selectOne(java.util.List<Item> list,
java.awt.Point p)
Select a single node; return true if not already selected.
|
static void |
selectRect(java.util.List<Item> list,
java.awt.Rectangle r)
Select each node in r.
|
static void |
selectToggle(java.util.List<Item> list,
java.awt.Point p)
Toggle selected state of each node containing p.
|
void |
setBoundary()
Calculate this node's rectangular boundary.
|
void |
setPoint(java.awt.Point p)
Üblicher Setter für das Attribut p.
|
void |
setSelected(boolean selected)
Mark this node as selected.
|
static void |
updatePosition(java.util.List<Item> list,
java.awt.Point delta)
Update each node's position by d (delta).
|
private java.awt.Point point
private final int radius
private boolean selected
private final java.awt.Rectangle boundary
private final java.util.List<DetailDrawPropertyEntry> propertyDraw
private final java.util.List<DetailBarPropertyEntry> propertyBar
public final java.util.List<DetailDrawPropertyEntry> getPropertyDraw()
public final java.util.List<DetailBarPropertyEntry> getPropertyBar()
public boolean contains(java.awt.Point p)
p - the Pointpublic boolean getSelected()
public void setSelected(boolean selected)
selected - selects the node.public java.awt.Point getPoint()
public void setPoint(java.awt.Point p)
p - Setzt den Parameter p in das Feld p.public java.awt.Rectangle getBoundary()
public void setBoundary()
public abstract void draw(java.awt.Graphics g)
g - to be drawnpublic abstract void markAsSelected(java.awt.Graphics g)
g - the Graphic.public final java.lang.Boolean containsVaByIdentifier(VariableAssignment assignment)
assignment - the variable assignmentpublic static void getSelectedNodes(java.util.List<Item> list, java.util.List<Item> selected)
list - list of all nodesselected - list of selected nodespublic static void selectNone(java.util.List<Item> list)
list - List of nodes that should not be selectedpublic static boolean selectOne(java.util.List<Item> list, java.awt.Point p)
list - list of Nodes.p - pointpublic static boolean selectMultiple(java.util.List<Item> list, java.awt.Point p)
list - List of nodes.p - the point.public static void selectAll(java.util.List<Item> list)
list - list of items.public static void selectRect(java.util.List<Item> list, java.awt.Rectangle r)
list - list of nodes in the rectangler - the rectanglepublic static void selectToggle(java.util.List<Item> list, java.awt.Point p)
list - list of selected nodes that contain point pp - the pointpublic static void updatePosition(java.util.List<Item> list, java.awt.Point delta)
list - list of nodes that need to update their positiondelta - delta of the new position and the previouspublic abstract void accept(ItemVisitor itemVisitor)
itemVisitor - the nodevisitor.public abstract void acceptConnectVisitor(ConnectVisitor visitor)
visitor - the connectvisitor.