java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
com.inductiveautomation.factorypmi.application.runtime.InfoBar
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible
Direct Known Subclasses:
UpdateAvailableInfoBar

public class InfoBar extends JPanel implements ActionListener
An InfoBar is the bar that slides down from the top of the Client to notify users of something, like a new version of the project is available.
See Also:
  • Field Details

    • slide

      protected float slide
      Controls the animation position of the info bar. 0f - 1f
    • state

      protected InfoBar.State state
    • message

      protected JLabel message
    • action

      protected Action action
    • exit

      protected JLabel exit
    • animator

      protected org.jdesktop.animation.timing.Animator animator
    • clientPanel

      protected ClientPanel clientPanel
      The parent client panel for the infobar is needed to add and remove (show and hide) the bar
    • context

      protected ClientContextImpl context
    • bgColor

      protected Color bgColor
    • leftGradient

      protected Color leftGradient
    • rightGradient

      protected Color rightGradient
    • bgColorEdit

      protected long bgColorEdit
  • Constructor Details

  • Method Details

    • getLabel

      public JLabel getLabel()
    • newMessageLabel

      protected JLabel newMessageLabel()
      Creates the JLabel used as the message, and sets things like font and alignment on it. Good place to add an icon the the message label
    • getBGColor

      protected Color getBGColor()
      Calculates the "natural" background color for the project so that animating looks seamless.
    • setBgGradient

      protected void setBgGradient(Color left, Color right)
      Overrides the background color or gradient on the InfoBar. Supports gradients with each param being the left and right most color for the gradient.
    • setAction

      public void setAction(Action action, boolean closable)
      Sets the message label using the action's name, and sets the info bar up to be clicked upon, in order to run the action.
    • setMessage

      public void setMessage(String message)
      Sets the message label up to display a message, with no action. Clicking on the message will have no effect
    • paintComponent

      public void paintComponent(Graphics graphics)
      Overrides:
      paintComponent in class JComponent
    • hideBar

      public void hideBar()
      Immediately hides the info bar, with no slide-out animation
    • slideOut

      public void slideOut()
    • setSlide

      public void setSlide(float slide)
    • actionPerformed

      public void actionPerformed(ActionEvent e)
      Specified by:
      actionPerformed in interface ActionListener