Interface Block
- All Known Implementing Classes:
- AbstractBlock,- PipelineBlock,- PropertySetBlock,- StartBlock
public interface Block
Represents an observable block
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddBlockListener(BlockListener listener) The block should notify this change listener when it movesCopy the settings of this block into a new block instance.The valid origins and terminus points for connectors coming into or out of this blockgetDefaultDropAnchor(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)getId()Each block in a model is identified by a UUIDThe upper left-most point of the block in the diagram.voidinitUI(BlockComponent panel) Used to initialize the display of a block.voidremoveBlockListener(BlockListener listener) voidsetLocation(Point newLocation) Don't forget to fire a change so that the UI knows the block has moved
- 
Method Details- 
getIdUUID getId()Each block in a model is identified by a UUID
- 
addBlockListenerThe block should notify this change listener when it moves
- 
removeBlockListener
- 
getLocationPoint getLocation()The upper left-most point of the block in the diagram. The size of the block is determined by the block's ui
- 
setLocationDon't forget to fire a change so that the UI knows the block has moved
- 
copyCopy the settings of this block into a new block instance. Any outgoing connections originating at this block should also be copied. If the destination of those connections is in the id set, it should point to the new block.- Parameters:
- 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.
 
- 
getAnchorPointsCollection<AnchorPoint> getAnchorPoints()The valid origins and terminus points for connectors coming into or out of this block
- 
getDefaultDropAnchorWhen 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)- Parameters:
- oppositeAnchor- The anchor point that would be the opposite anchor on the connector being hovered over this block.
 
- 
initUIUsed to initialize the display of a block. The block component is just a JPanel, so you can add whatever you want to it and set its layout manager. The block's size will be the preferred size of the contents that you add.
 
-