Class BasicBlockUI
- 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:
- java.awt.image.ImageObserver,- java.awt.MenuContainer,- java.io.Serializable,- javax.accessibility.Accessible
 
 public abstract class BasicBlockUI extends javax.swing.JPanelThis 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:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description protected classBasicBlockUI.InParamPanelprotected classBasicBlockUI.OutParamPanelprotected classBasicBlockUI.ParamPanel- 
Nested classes/interfaces inherited from class javax.swing.JPaneljavax.swing.JPanel.AccessibleJPanel
 - 
Nested classes/interfaces inherited from class javax.swing.JComponentjavax.swing.JComponent.AccessibleJComponent
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected java.awt.ColorbackgroundConnectedprotected java.awt.ColorbackgroundUnconnectedprotected Blockblockprotected java.awt.ColorborderConnectedprotected java.awt.ColorborderSelectedprotected java.awt.ColorborderUnconnectedprotected booleanconnectedIs this block "connected" meaning is there a path from the starting block to this one?protected javax.swing.JPanelheaderprotected booleanmirroredWhen mirrored, the inputs are positioned on the right, and the outputs on the left, which is opposite of standardprotected java.awt.ColorpinHoverprotected booleanselectedIs this block "selected" meaning it is highlighted for moving around and editing- 
Fields inherited from class javax.swing.JComponentlistenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
- 
 - 
Constructor SummaryConstructors Constructor Description BasicBlockUI(Block block)
 - 
Method SummaryAll Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected BasicBlockUI.ParamPanelcreateEmpty(AnchorType ioType)java.util.List<AnchorPoint>getAnchorPoints()Returns the list of anchor points created by this block UI.protected abstract java.util.Collection<AnchorDescriptor>getAnchors()The inputs/outputs for the blockjava.awt.ColorgetBackgroundConnected()protected java.awt.ShapegetBackgroundShape(int w, int h)java.awt.ColorgetBackgroundUnconnected()BlockgetBlock()java.awt.ColorgetBorderConnected()java.awt.ColorgetBorderSelected()java.awt.ColorgetBorderUnconnected()protected abstract javax.swing.IcongetIcon()The small icon for the header of the blockjava.awt.ColorgetPinHover()protected abstract java.lang.StringgetTitle()The title for the header of the blockprotected voidinitDetailsPanel(javax.swing.JPanel details)Override this to add contents to the details panelprotected voidinitEmptyDetailsPanel(javax.swing.JPanel bottom)protected voidinitHeader(javax.swing.JPanel header)Initialize the header panel.voidinstall(BlockComponent parent)Install this block ui onto the BlockComponent.booleanisConnected()protected abstract booleanisDetailsPanelRequired()Returning true from this will turn on a details panel beneath the inputs and outputs.booleanisMirrored()booleanisSelected()protected voidpaintComponent(java.awt.Graphics graphics)voidrebuildUI()voidsetBackgroundConnected(java.awt.Color backgroundConnected)voidsetBackgroundUnconnected(java.awt.Color backgroundUnconnected)voidsetBorderConnected(java.awt.Color borderConnected)voidsetBorderSelected(java.awt.Color borderSelected)voidsetBorderUnconnected(java.awt.Color borderUnconnected)voidsetBounds(int x, int y, int width, int height)voidsetConnected(boolean connected)voidsetMirrored(boolean mirrored)voidsetPinHover(java.awt.Color pinHover)voidsetSelected(boolean selected)- 
Methods inherited from class javax.swing.JPanelgetAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 - 
Methods inherited from class javax.swing.JComponentaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 - 
Methods inherited from class java.awt.Containeradd, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
 - 
Methods inherited from class java.awt.Componentaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
- 
 
- 
- 
- 
Field Detail- 
backgroundUnconnectedprotected java.awt.Color backgroundUnconnected 
 - 
backgroundConnectedprotected java.awt.Color backgroundConnected 
 - 
borderConnectedprotected java.awt.Color borderConnected 
 - 
borderSelectedprotected java.awt.Color borderSelected 
 - 
borderUnconnectedprotected java.awt.Color borderUnconnected 
 - 
pinHoverprotected java.awt.Color pinHover 
 - 
headerprotected javax.swing.JPanel header 
 - 
connectedprotected boolean connected Is this block "connected" meaning is there a path from the starting block to this one?
 - 
selectedprotected boolean selected Is this block "selected" meaning it is highlighted for moving around and editing
 - 
mirroredprotected boolean mirrored When mirrored, the inputs are positioned on the right, and the outputs on the left, which is opposite of standard
 - 
blockprotected final Block block 
 
- 
 - 
Constructor Detail- 
BasicBlockUIpublic BasicBlockUI(Block block) 
 
- 
 - 
Method Detail- 
getBlockpublic Block getBlock() 
 - 
installpublic void install(BlockComponent parent) Install this block ui onto the BlockComponent. Expected to be used duringBlock.initUI(BlockComponent)
 - 
setBoundspublic void setBounds(int x, int y, int width, int height)- Overrides:
- setBoundsin class- java.awt.Component
 
 - 
getAnchorsprotected abstract java.util.Collection<AnchorDescriptor> getAnchors() The inputs/outputs for the block
 - 
getTitleprotected abstract java.lang.String getTitle() The title for the header of the block
 - 
getIconprotected abstract javax.swing.Icon getIcon() The small icon for the header of the block
 - 
isDetailsPanelRequiredprotected 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 implementinitDetailsPanel(JPanel)
 - 
initDetailsPanelprotected void initDetailsPanel(javax.swing.JPanel details) Override this to add contents to the details panel
 - 
getAnchorPointspublic java.util.List<AnchorPoint> getAnchorPoints() Returns the list of anchor points created by this block UI. Intended to be used by Blockimplementations as the return value forBlock.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 Connectionobject. Please useLookupConnectionto avoid this problem.
 - 
rebuildUIpublic void rebuildUI() 
 - 
getBackgroundShapeprotected java.awt.Shape getBackgroundShape(int w, int h)
 - 
paintComponentprotected void paintComponent(java.awt.Graphics graphics) - Overrides:
- paintComponentin class- javax.swing.JComponent
 
 - 
isMirroredpublic boolean isMirrored() 
 - 
setMirroredpublic void setMirrored(boolean mirrored) 
 - 
setConnectedpublic void setConnected(boolean connected) 
 - 
isConnectedpublic boolean isConnected() 
 - 
setSelectedpublic void setSelected(boolean selected) 
 - 
isSelectedpublic boolean isSelected() 
 - 
initHeaderprotected void initHeader(javax.swing.JPanel header) Initialize the header panel. Default implementation adds icon and title label
 - 
getBackgroundUnconnectedpublic java.awt.Color getBackgroundUnconnected() 
 - 
setBackgroundUnconnectedpublic void setBackgroundUnconnected(java.awt.Color backgroundUnconnected) 
 - 
getBackgroundConnectedpublic java.awt.Color getBackgroundConnected() 
 - 
setBackgroundConnectedpublic void setBackgroundConnected(java.awt.Color backgroundConnected) 
 - 
getBorderConnectedpublic java.awt.Color getBorderConnected() 
 - 
setBorderConnectedpublic void setBorderConnected(java.awt.Color borderConnected) 
 - 
getBorderSelectedpublic java.awt.Color getBorderSelected() 
 - 
setBorderSelectedpublic void setBorderSelected(java.awt.Color borderSelected) 
 - 
getBorderUnconnectedpublic java.awt.Color getBorderUnconnected() 
 - 
setBorderUnconnectedpublic void setBorderUnconnected(java.awt.Color borderUnconnected) 
 - 
getPinHoverpublic java.awt.Color getPinHover() 
 - 
setPinHoverpublic void setPinHover(java.awt.Color pinHover) 
 - 
initEmptyDetailsPanelprotected void initEmptyDetailsPanel(javax.swing.JPanel bottom) 
 - 
createEmptyprotected BasicBlockUI.ParamPanel createEmpty(AnchorType ioType) 
 
- 
 
-