public interface Block
Modifier and Type | Method and Description |
---|---|
void |
addBlockListener(BlockListener listener)
The block should notify this change listener when it moves
|
Block |
copy(java.util.Map<java.util.UUID,java.util.UUID> newIds)
Copy the settings of this block into a new block instance.
|
java.util.Collection<AnchorPoint> |
getAnchorPoints()
The valid origins and terminus points for connectors coming into or out of this block
|
AnchorPoint |
getDefaultDropAnchor(AnchorPoint oppositeAnchor)
When a connector is being dropped on this block, what anchor point should it attach to if it isn't specifically
over an anchor's hotspot (may return null)
|
java.util.UUID |
getId()
Each block in a model is identified by a UUID
|
java.awt.Point |
getLocation()
The upper left-most point of the block in the diagram.
|
void |
initUI(BlockComponent panel)
Used to initialize the display of a block.
|
void |
removeBlockListener(BlockListener listener) |
void |
setLocation(java.awt.Point newLocation)
Don't forget to fire a change so that the UI knows the block has moved
|
java.util.UUID getId()
void addBlockListener(BlockListener listener)
void removeBlockListener(BlockListener listener)
java.awt.Point getLocation()
void setLocation(java.awt.Point newLocation)
Block copy(java.util.Map<java.util.UUID,java.util.UUID> newIds)
newIds
- a map of all new ids for copied blocks (including this one). Should be used to point outgoing
connections to blocks in the copied set to their new ids.java.util.Collection<AnchorPoint> getAnchorPoints()
AnchorPoint getDefaultDropAnchor(AnchorPoint oppositeAnchor)
oppositeAnchor
- The anchor point that would be the opposite anchor on the connector being hovered over
this block.void initUI(BlockComponent panel)