com.jaxfront.swing.ui.tools
Class HeaderPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.jaxfront.swing.ui.tools.HeaderPanel
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible

public class HeaderPanel
extends javax.swing.JPanel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener

An instance of this class is a panel that can display several types of header. Note that jaxfront use three type of header which are a modern separator, a classic seperator and a header. Use the main methode to demostrate the header's.

Version:
1.60
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
static int SEPARATOR_CLASSIC
           
static int SEPARATOR_MODERN
           
static int SEPARATOR_NONE
           
static int SEPARATOR_VERTICAL
           
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
HeaderPanel(java.lang.String text)
          Creates a new instance of this class which draws a header with the specified text, seperator type.
HeaderPanel(java.lang.String name, int separator)
          Creates a new instance of this class which draws a header with the specified text and seperator type.
HeaderPanel(java.lang.String name, int height, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor)
          Creates a new instance of this class which draws a header with the specified text, height and colors.
HeaderPanel(java.lang.String text, int height, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator)
          Creates a new instance of this class which draws a header with the specified text, height, colors and separator type.
HeaderPanel(java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator)
          Creates a new instance of this class which draws a header with the specified text, height, colors and separator type.
HeaderPanel(java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, javax.swing.ImageIcon imageIcon)
          Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.
HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator)
          Creates a new instance of this class which draws a header with the specified text, height, colors and separator type.
HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator, java.awt.Font textFont)
          Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.
HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator, java.awt.Font textFont, javax.swing.ImageIcon imageIcon)
          Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.
HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, java.awt.Color startColor, java.awt.Color endColor, int separator, java.awt.Font textFont, javax.swing.ImageIcon imageIcon, boolean enableCopyPastePopup)
          Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.
HeaderPanel(Type type, java.lang.String text, int height, int topSpacing, int bottomSpacing, java.awt.Color textColor, javax.swing.ImageIcon imageIcon)
          Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.
 
Method Summary
 void drawText(java.awt.Graphics g, java.lang.String text, int x, int y)
           
 java.awt.Font getFont()
           
 FunctionalGraphics getFunctionalGrapics()
          This is a lazy method!
 java.lang.String getHeaderTitle()
           
 int getInsetHeight()
           
 java.awt.Dimension getPreferredSize()
          If the preferredSize has been set to a non-null value just return it.
 int getSeparatorType()
           
 java.awt.Color getTextColor()
           
 void initListener()
           
 boolean isPopupMenuEnabled()
           
static void main(java.lang.String[] args)
          Main method to start a demo of this class.
 void mouseClicked(java.awt.event.MouseEvent e)
          Invoked when the mouse has been clicked on a component.
 void mouseDragged(java.awt.event.MouseEvent e)
          Invoked when a mouse button is pressed on a component and then dragged.
 void mouseEntered(java.awt.event.MouseEvent e)
          Invoked when the mouse enters a component.
 void mouseExited(java.awt.event.MouseEvent e)
          Invoked when the mouse exits a component.
 void mouseMoved(java.awt.event.MouseEvent e)
          Invoked when the mouse button has been moved on a component (with no buttons no down).
 void mousePressed(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been pressed on a component.
 void mouseReleased(java.awt.event.MouseEvent e)
          Invoked when a mouse button has been released on a component.
 void paint(java.awt.Graphics g)
          This method is invoked by Swing to draw components.
 void paintClassic(java.awt.Graphics g)
           
 void paintHorizontal(java.awt.Graphics g)
           
 void paintImage(java.awt.Graphics g)
           
 void paintModern(java.awt.Graphics g)
           
 void paintVertical(java.awt.Graphics g)
           
 void releaseListener()
           
 void setFont(java.awt.Font textFont)
           
 void setHeaderTitle(java.lang.String text)
          Sets the title for the header.
 void setInsetHeight(int height)
           
 void setLink(java.lang.String linkURL)
          Sets an HTML link to the header.
 void setPopupMenuEnabled(boolean enabled)
           
 void setStartColor(java.awt.Color startColor)
           
 void setTextColor(java.awt.Color textColor)
           
 void setTextIndent(int indent)
           
 void setToolTipText(java.lang.String toolTipText)
          Sets a tool tip to the header.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEPARATOR_NONE

public static final int SEPARATOR_NONE
See Also:
Constant Field Values

SEPARATOR_CLASSIC

public static final int SEPARATOR_CLASSIC
See Also:
Constant Field Values

SEPARATOR_MODERN

public static final int SEPARATOR_MODERN
See Also:
Constant Field Values

SEPARATOR_VERTICAL

public static final int SEPARATOR_VERTICAL
See Also:
Constant Field Values
Constructor Detail

HeaderPanel

public HeaderPanel(java.lang.String text)
Creates a new instance of this class which draws a header with the specified text, seperator type. The text color is yellow. The gradient color starts with black and fade to light gray.

Parameters:
text - the text that should be displayed

HeaderPanel

public HeaderPanel(java.lang.String name,
                   int separator)
Creates a new instance of this class which draws a header with the specified text and seperator type. The color of the gradient starts with black and fade to light gray.

Parameters:
text - the text that should be displayed
separator - the seperator type

HeaderPanel

public HeaderPanel(java.lang.String text,
                   int height,
                   int topSpacing,
                   int bottomSpacing,
                   java.awt.Color textColor,
                   java.awt.Color startColor,
                   java.awt.Color endColor,
                   int separator)
Creates a new instance of this class which draws a header with the specified text, height, colors and separator type. The gradient spaces for bottom and top is one and font is the default font.

Parameters:
text - the text that should be displayed
height - the height of the header
topSpacing - the space at top
bottomSpacing - the space at bottom
textColor - the color for the text
startColor - the start color of the header
endColor - the end color of the header
separator - the sepearot type

HeaderPanel

public HeaderPanel(Type type,
                   java.lang.String text,
                   int height,
                   int topSpacing,
                   int bottomSpacing,
                   java.awt.Color textColor,
                   java.awt.Color startColor,
                   java.awt.Color endColor,
                   int separator)
Creates a new instance of this class which draws a header with the specified text, height, colors and separator type. The gradient spaces for bottom and top is one and font is the default font.

Parameters:
type - JAXFront type to hold on (for copy/paste content actions)
text - the text that should be displayed
height - the height of the header
topSpacing - the space at top
bottomSpacing - the space at bottom
textColor - the color for the text
startColor - the start color of the header
endColor - the end color of the header
separator - the sepearot type

HeaderPanel

public HeaderPanel(Type type,
                   java.lang.String text,
                   int height,
                   int topSpacing,
                   int bottomSpacing,
                   java.awt.Color textColor,
                   java.awt.Color startColor,
                   java.awt.Color endColor,
                   int separator,
                   java.awt.Font textFont)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.

Parameters:
type - JAXFront type to hold on (for copy/paste content actions)
text - the text that should be displayed
height - the height of the header
topSpacing - the space at top
bottomSpacing - the space at bottom
textColor - the colot for the text
startColor - the start color of the header
endColor - the end color of the header
separator - the sepearot type
textFont - the font for the text

HeaderPanel

public HeaderPanel(Type type,
                   java.lang.String text,
                   int height,
                   int topSpacing,
                   int bottomSpacing,
                   java.awt.Color textColor,
                   java.awt.Color startColor,
                   java.awt.Color endColor,
                   int separator,
                   java.awt.Font textFont,
                   javax.swing.ImageIcon imageIcon)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.

Parameters:
type - JAXFront type to hold on (for copy/paste content actions)
text - the text that should be displayed
height - the height of the header
topSpacing - the space at top
bottomSpacing - the space at bottom
textColor - the colot for the text
startColor - the start color of the header
endColor - the end color of the header
separator - the sepearot type
textFont - the font for the text

HeaderPanel

public HeaderPanel(Type type,
                   java.lang.String text,
                   int height,
                   int topSpacing,
                   int bottomSpacing,
                   java.awt.Color textColor,
                   java.awt.Color startColor,
                   java.awt.Color endColor,
                   int separator,
                   java.awt.Font textFont,
                   javax.swing.ImageIcon imageIcon,
                   boolean enableCopyPastePopup)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.

Parameters:
type - JAXFront type to hold on (for copy/paste content actions)
text - the text that should be displayed
height - the height of the header
topSpacing - the space at top
bottomSpacing - the space at bottom
textColor - the colot for the text
startColor - the start color of the header
endColor - the end color of the header
separator - the sepearot type
textFont - the font for the text

HeaderPanel

public HeaderPanel(java.lang.String text,
                   int height,
                   int topSpacing,
                   int bottomSpacing,
                   java.awt.Color textColor,
                   javax.swing.ImageIcon imageIcon)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.

Parameters:
text - the text that should be displayed
height - the height of the header
topSpacing - the space at top
bottomSpacing - the space at bottom
textColor - the colot for the text
startColor - the start color of the header
endColor - the end color of the header
separator - the sepearot type
textFont - the font for the text

HeaderPanel

public HeaderPanel(Type type,
                   java.lang.String text,
                   int height,
                   int topSpacing,
                   int bottomSpacing,
                   java.awt.Color textColor,
                   javax.swing.ImageIcon imageIcon)
Creates a new instance of this class which draws a header with the specified text, height, the spaces at top and bottom, the colors, which separator type and the font for the text.

Parameters:
text - the text that should be displayed
height - the height of the header
topSpacing - the space at top
bottomSpacing - the space at bottom
textColor - the colot for the text
startColor - the start color of the header
endColor - the end color of the header
separator - the sepearot type
textFont - the font for the text

HeaderPanel

public HeaderPanel(java.lang.String name,
                   int height,
                   java.awt.Color textColor,
                   java.awt.Color startColor,
                   java.awt.Color endColor)
Creates a new instance of this class which draws a header with the specified text, height and colors. The gradient spaces for bottom and top is one and font is the default font.

Parameters:
text - the text that should be displayed
height - the height of the header
textColor - the colot for the text
startColor - the start color of the header
endColor - the end color of the header

HeaderPanel

public HeaderPanel(java.lang.String text,
                   int height,
                   java.awt.Color textColor,
                   java.awt.Color startColor,
                   java.awt.Color endColor,
                   int separator)
Creates a new instance of this class which draws a header with the specified text, height, colors and separator type. The gradient spaces for bottom and top is one and font is the default font.

Parameters:
text - the text that should be displayed
height - the height of the header
textColor - the colot for the text
startColor - the start color of the header
endColor - the end color of the header
separator - the sepearot type
Method Detail

getPreferredSize

public java.awt.Dimension getPreferredSize()
If the preferredSize has been set to a non-null value just return it. If the UI delegates getPreferredSize() method returns a non null then value return that, otherwise defer to the components layout manager.

Overrides:
getPreferredSize in class javax.swing.JComponent
Returns:
the value of the preferredSize property.
See Also:
JComponent.setPreferredSize(java.awt.Dimension)

main

public static void main(java.lang.String[] args)
Main method to start a demo of this class.

Parameters:
args[] - none arguments are required to start this demo

paint

public void paint(java.awt.Graphics g)
This method is invoked by Swing to draw components. Applications should not invoke paint directly, but should instead use the repaint method to schedule the component for redrawing.

This method actually delegates the work of painting to three protected methods: paintComponent,paintBorder, and paintChildren. They're called in the order listed to ensure that children appear on top of component itself. Generally speaking, the component and its children should not paint in the insets area allocated to the border. Subclasses can just override this method, as always. A subclass that just wants to specialize the UI (look and feel) delegates paint method should just override paintComponent.

Overrides:
paint in class javax.swing.JComponent
See Also:
JComponent.paintComponent(java.awt.Graphics), JComponent.paintBorder(java.awt.Graphics), JComponent.paintChildren(java.awt.Graphics), JComponent.getComponentGraphics(java.awt.Graphics), JComponent.repaint(long, int, int, int, int)

paintHorizontal

public void paintHorizontal(java.awt.Graphics g)

drawText

public void drawText(java.awt.Graphics g,
                     java.lang.String text,
                     int x,
                     int y)

setTextIndent

public void setTextIndent(int indent)

paintImage

public void paintImage(java.awt.Graphics g)

paintVertical

public void paintVertical(java.awt.Graphics g)

paintClassic

public void paintClassic(java.awt.Graphics g)

paintModern

public void paintModern(java.awt.Graphics g)

setHeaderTitle

public void setHeaderTitle(java.lang.String text)
Sets the title for the header.

Parameters:
text - a title

getHeaderTitle

public java.lang.String getHeaderTitle()

setLink

public void setLink(java.lang.String linkURL)
Sets an HTML link to the header.

Parameters:
linkURL - an HTML link

setToolTipText

public void setToolTipText(java.lang.String toolTipText)
Sets a tool tip to the header.

Overrides:
setToolTipText in class javax.swing.JComponent
Parameters:
toolTipText - a text for the toolTip
See Also:
JComponent.setToolTipText(java.lang.String)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Invoked when the mouse has been clicked on a component.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
e - a mouse event that occured

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e - a mouse event that occured

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Invoked when the mouse enters a component.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
e - a mouse event that occured

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Invoked when the mouse exits a component.

Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
e - a mouse event that occured

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Invoked when the mouse button has been moved on a component (with no buttons no down).

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - a mouse event that occured

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Invoked when a mouse button has been pressed on a component.

Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
e - a mouse event that occured

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Invoked when a mouse button has been released on a component.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
e - a mouse event that occured

setPopupMenuEnabled

public void setPopupMenuEnabled(boolean enabled)

isPopupMenuEnabled

public boolean isPopupMenuEnabled()

setFont

public void setFont(java.awt.Font textFont)
Overrides:
setFont in class javax.swing.JComponent
Parameters:
_textFont - The _textFont to set.

getSeparatorType

public int getSeparatorType()

releaseListener

public void releaseListener()

initListener

public void initListener()

getFont

public java.awt.Font getFont()
Specified by:
getFont in interface java.awt.MenuContainer
Overrides:
getFont in class java.awt.Component
Returns:
Returns the _textFont.

setInsetHeight

public void setInsetHeight(int height)
Parameters:
_insetHeight - The _insetHeight to set.

getInsetHeight

public int getInsetHeight()
Parameters:
_insetHeight - The _insetHeight of the component.

setTextColor

public void setTextColor(java.awt.Color textColor)
Parameters:
_textColor - The _textColor to set.

setStartColor

public void setStartColor(java.awt.Color startColor)

getTextColor

public java.awt.Color getTextColor()
Returns:
Returns the _textColor.

getFunctionalGrapics

public FunctionalGraphics getFunctionalGrapics()
This is a lazy method! Please call only if you want to add an action

Returns:
Returns the _funcGrap.