Package ca.phon.ui

Class MultiActionButton

java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.jdesktop.swingx.JXPanel
ca.phon.ui.MultiActionButton
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Scrollable
Direct Known Subclasses:
CorpusHeaderButton, ErrorBanner, FileSelectionButton, FontSelectionButton, HidablePanel, LocalProjectButton, PhonTaskButton, ProjectButton, WorkspaceButton

public class MultiActionButton extends org.jdesktop.swingx.JXPanel implements Scrollable
A 'on click' button which includes the following features: - support for multiple actions. Each action is displayed as a button on mouse-over. To display actions all the time, use setAlwaysDisplayActions(true). - suppot for custom components to be displayed as the buttons 'content'. Display pane is available using method getDisplayPane() - since component is based on swingx, supports background painter See setBackgroundPainter().
See Also:
  • Constructor Details

    • MultiActionButton

      public MultiActionButton()
      Constructor
  • Method Details

    • addAction

      public void addAction(Action act)
    • getTopLabel

      public org.jdesktop.swingx.JXLabel getTopLabel()
    • getBottomLabel

      public org.jdesktop.swingx.JXLabel getBottomLabel()
    • setTopLabelText

      public void setTopLabelText(String txt)
    • setBottomLabelText

      public void setBottomLabelText(String txt)
    • setDefaultAction

      public void setDefaultAction(Action act)
      Set the default action. This also sets tooltip for the component.
      Parameters:
      act -
    • removeAction

      public void removeAction(Action act)
    • clearActions

      public void clearActions()
    • getActionButton

      protected org.jdesktop.swingx.JXButton getActionButton(Action act)
    • paintComponent

      public void paintComponent(Graphics g)
      Overrides:
      paintComponent in class org.jdesktop.swingx.JXPanel
    • getInsets

      public Insets getInsets()
      Overrides:
      getInsets in class JComponent
    • isAlwaysDisplayActions

      public boolean isAlwaysDisplayActions()
    • setAlwaysDisplayActions

      public void setAlwaysDisplayActions(boolean v)
    • isDisplayDefaultAction

      public boolean isDisplayDefaultAction()
    • setDisplayDefaultAction

      public void setDisplayDefaultAction(boolean displayDefaultAction)