java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.ignition.designer.blockandconnector.blockui.BasicBlockUI
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public abstract class BasicBlockUI extends JPanel
This is the "reference" UI used by the alarm pipeline editor. Developers are free to create their own UI styles by following the interfaces defined on Block. If you'd like a block style that looks like the ones found in the alarm pipelines, using this UI will save a lot of effort.
See Also:
  • Field Details

    • backgroundUnconnected

      protected Color backgroundUnconnected
    • backgroundConnected

      protected Color backgroundConnected
    • borderConnected

      protected Color borderConnected
    • borderSelected

      protected Color borderSelected
    • borderUnconnected

      protected Color borderUnconnected
    • pinHover

      protected Color pinHover
    • connected

      protected boolean connected
      Is this block "connected" meaning is there a path from the starting block to this one?
    • selected

      protected boolean selected
      Is this block "selected" meaning it is highlighted for moving around and editing
    • mirrored

      protected boolean mirrored
      When mirrored, the inputs are positioned on the right, and the outputs on the left, which is opposite of standard
    • block

      protected final Block block
  • Constructor Details

    • BasicBlockUI

      public BasicBlockUI(Block block)
  • Method Details

    • getBlock

      public Block getBlock()
    • install

      public void install(BlockComponent parent)
      Install this block ui onto the BlockComponent. Expected to be used during Block.initUI(BlockComponent)
    • setBounds

      public void setBounds(int x, int y, int width, int height)
      Overrides:
      setBounds in class Component
    • getAnchors

      protected abstract Collection<AnchorDescriptor> getAnchors()
      The inputs/outputs for the block
    • getTitle

      protected abstract String getTitle()
      The title for the header of the block
    • getIcon

      protected abstract Icon getIcon()
      The small icon for the header of the block
    • isDetailsPanelRequired

      protected abstract boolean isDetailsPanelRequired()
      Returning true from this will turn on a details panel beneath the inputs and outputs. If you return true from this, you should also override and implement initDetailsPanel(JPanel)
    • initDetailsPanel

      protected void initDetailsPanel(JPanel details)
      Override this to add contents to the details panel
    • getAnchorPoints

      public List<AnchorPoint> getAnchorPoints()

      Returns the list of anchor points created by this block UI. Intended to be used by Block implementations as the return value for Block.getAnchorPoints()

      WARNING These anchor points will be re-created when the UI changes (for example, due to a block structure change event). This means that you cannot hang onto them, e.g. in a Connection object. Please use LookupConnection to avoid this problem.

    • rebuildUI

      public void rebuildUI()
    • getBackgroundShape

      protected Shape getBackgroundShape(int w, int h)
    • paintComponent

      protected void paintComponent(Graphics graphics)
      Overrides:
      paintComponent in class JComponent
    • isMirrored

      public boolean isMirrored()
    • setMirrored

      public void setMirrored(boolean mirrored)
    • setConnected

      public void setConnected(boolean connected)
    • isConnected

      public boolean isConnected()
    • setSelected

      public void setSelected(boolean selected)
    • isSelected

      public boolean isSelected()
    • initHeader

      protected void initHeader(JPanel header)
      Initialize the header panel. Default implementation adds icon and title label
    • getBackgroundUnconnected

      public Color getBackgroundUnconnected()
    • setBackgroundUnconnected

      public void setBackgroundUnconnected(Color backgroundUnconnected)
    • getBackgroundConnected

      public Color getBackgroundConnected()
    • setBackgroundConnected

      public void setBackgroundConnected(Color backgroundConnected)
    • getBorderConnected

      public Color getBorderConnected()
    • setBorderConnected

      public void setBorderConnected(Color borderConnected)
    • getBorderSelected

      public Color getBorderSelected()
    • setBorderSelected

      public void setBorderSelected(Color borderSelected)
    • getBorderUnconnected

      public Color getBorderUnconnected()
    • setBorderUnconnected

      public void setBorderUnconnected(Color borderUnconnected)
    • getPinHover

      public Color getPinHover()
    • setPinHover

      public void setPinHover(Color pinHover)
    • initEmptyDetailsPanel

      protected void initEmptyDetailsPanel(JPanel bottom)
    • createEmpty

      protected BasicBlockUI.ParamPanel createEmpty(AnchorType ioType)