Overview | Package | Class | Tree | Deprecated | Index | Help
| Apache JMeter
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.jmeter.gui
Class AbstractJMeterGuiComponent

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  javax.swing.JPanel
                      org.apache.jmeter.gui.AbstractJMeterGuiComponent

All Implemented Interfaces:
  Accessible, ImageObserver, JMeterGUIComponent, MenuContainer, Printable, Serializable

Direct Known Subclasses:
  AbstractAssertionGui, AbstractConfigGui, AbstractControllerGui, AbstractListenerGui, AbstractPostProcessorGui, AbstractPreProcessorGui, AbstractReportGui, AbstractSamplerGui, AbstractTimerGui, ObsoleteGui, TestBeanGUI, TestPlanGui, ThreadGroupGui, WorkBenchGui

public abstract class AbstractJMeterGuiComponent
extends JPanel
implements JMeterGUIComponent, Printable

This abstract class takes care of the most basic functions necessary to create a viable JMeter GUI component. It extends JPanel and implements JMeterGUIComponent. This abstract class is, in turn, extended by several other abstract classes that create different classes of GUI components for JMeter (Visualizers, Timers, Samplers, Modifiers, Controllers, etc).

See Also:
  `JMeterGUIComponent`, `AbstractConfigGui`, `AbstractAssertionGui`, `AbstractControllerGui`, `AbstractTimerGui`, `AbstractVisualizer`, `AbstractSamplerGui`, Serialized Form

Nested Class Summary

Nested classes inherited from class javax.swing.JPanel
`JPanel.AccessibleJPanel`

Nested classes inherited from class javax.swing.JComponent
`JComponent.AccessibleJComponent`

Nested classes inherited from class java.awt.Container
`Container.AccessibleAWTContainer`

Nested classes inherited from class java.awt.Component
`Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy`

Field Summary
`protected NamePanel` | `namePanel` A GUI panel containing the name of this component.

Fields inherited from class javax.swing.JComponent
`accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
`AbstractJMeterGuiComponent()` When constructing a new component, this takes care of basic tasks like setting up the Name Panel and assigning the class's static label as the name to start.

Method Summary
`void` | `clearGui()` Provides a default implementation that resets the name field to the value of getStaticLabel(), reset comment and sets enabled to true.
`void` | `configure(TestElement element)` A newly created gui component can be initialized with the contents of a Test Element object by calling this method.
`protected void` | `configureTestElement(TestElement mc)` This provides a convenience for extenders when they implement the `JMeterGUIComponent.modifyTestElement(TestElement)` method.
`protected Component` | `createTitleLabel()` Provides a label containing the title for the component.
`String` | `getComment()` Provides a default implementation for the comment property.
`String` | `getDocAnchor()` Get the component's document anchor name.
`String` | `getName()` Provides a default implementation for the name property.
`protected NamePanel` | `getNamePanel()` Provides the Name Panel for extending classes.
`protected TreeNode` | `getNode()` Provides a default implementation for the node property.
`JComponent` | `getPrintableComponent()` Subclasses need to over-ride this method, if they wish to return something other than the Visualizer itself.
`String` | `getStaticLabel()` Get the component's label.
`boolean` | `isEnabled()` Provides a default implementation for the enabled property.
`protected Border` | `makeBorder()` Create a top-level Border which can be added to JMeter components.
`protected JScrollPane` | `makeScrollPane(Component comp)` Create a scroll panel that sets it's preferred size to it's minimum size.
`protected JScrollPane` | `makeScrollPane(Component comp, int verticalPolicy, int horizontalPolicy)` Create a scroll panel that sets it's preferred size to it's minimum size.
`protected Container` | `makeTitlePanel()` Create a standard title section for JMeter components.
`void` | `setComment(String comment)` Provides a default implementation for setting the comment property.
`void` | `setEnabled(boolean e)` Provides a default implementation for the enabled property.
`void` | `setName(String name)` Provides a default implementation for setting the name property.
`void` | `setNode(TreeNode node)` Provides a default implementation for the node property.

Methods inherited from class javax.swing.JPanel
`getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI`

Methods inherited from class javax.swing.JComponent
`addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree`

Methods inherited from class java.awt.Component
`action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.apache.jmeter.gui.JMeterGUIComponent
`createPopupMenu, createTestElement, getLabelResource, getMenuCategories, modifyTestElement`

Field Detail

### namePanel

    protected NamePanel namePanel

  A GUI panel containing the name of this component.

Constructor Detail

### AbstractJMeterGuiComponent

    public AbstractJMeterGuiComponent()

  When constructing a new component, this takes care of basic tasks like setting up the Name Panel and assigning the class's static label as the name to start.

Method Detail

### setName

    public void setName(String name)

  Provides a default implementation for setting the name property. It's unlikely developers will need to override.

  Specified by:
    `setName` in interface `JMeterGUIComponent`

### setComment

    public void setComment(String comment)

  Provides a default implementation for setting the comment property. It's unlikely developers will need to override.

### isEnabled

    public boolean isEnabled()

  Provides a default implementation for the enabled property. It's unlikely developers will need to override.

  Specified by:
    `isEnabled` in interface `JMeterGUIComponent`

### setEnabled

    public void setEnabled(boolean e)

  Provides a default implementation for the enabled property. It's unlikely developers will need to override.

  Specified by:
    `setEnabled` in interface `JMeterGUIComponent`

### getName

    public String getName()

  Provides a default implementation for the name property. It's unlikely developers will need to override.

  Specified by:
    `getName` in interface `JMeterGUIComponent`

### getComment

    public String getComment()

  Provides a default implementation for the comment property. It's unlikely developers will need to override.

### getNamePanel

    protected NamePanel getNamePanel()

  Provides the Name Panel for extending classes. Extending classes are free to place it as desired within the component, or not at all. Most components place the NamePanel automatically by calling `makeTitlePanel()` instead of directly calling this method.

  Returns:
    a NamePanel containing the name of this component

### createTitleLabel

    protected Component createTitleLabel()

  Provides a label containing the title for the component. Subclasses typically place this label at the top of their GUI. The title is set to the name returned from the component's `getStaticLabel()` method. Most components place this label automatically by calling `makeTitlePanel()` instead of directly calling this method.

  Returns:
    a JLabel which subclasses can add to their GUI

### configure

    public void configure(TestElement element)

  A newly created gui component can be initialized with the contents of a Test Element object by calling this method. The component is responsible for querying the Test Element object for the relevant information to display in its GUI.

  AbstractJMeterGuiComponent provides a partial implementation of this method, setting the name of the component and its enabled status. Subclasses should override this method, performing their own configuration as needed, but also calling this super-implementation.

  Specified by:
    `configure` in interface `JMeterGUIComponent`
  Parameters:
    `element` - the TestElement to configure

### clearGui

    public void clearGui()

  Provides a default implementation that resets the name field to the value of getStaticLabel(), reset comment and sets enabled to true. Your GUI may need more things cleared, in which case you should override, clear the extra fields, and still call super.clearGui().

  Specified by:
    `clearGui` in interface `JMeterGUIComponent`

### configureTestElement

    protected void configureTestElement(TestElement mc)

  This provides a convenience for extenders when they implement the `JMeterGUIComponent.modifyTestElement(TestElement)` method. This method will set the name, gui class, and test class for the created Test Element. It should be called by every extending class when creating/modifying Test Elements, as that will best assure consistent behavior.

  Parameters:
    `mc` - the TestElement being created.

### setNode

    public void setNode(TreeNode node)

  Provides a default implementation for the node property. It is unlikely developers would need to override this method.

  Specified by:
    `setNode` in interface `JMeterGUIComponent`
  Parameters:
    `node` - the tree node corresponding to this component

### getNode

    protected TreeNode getNode()

  Provides a default implementation for the node property. It is unlikely developers would need to override this method.

### makeTitlePanel

    protected Container makeTitlePanel()

  Create a standard title section for JMeter components. This includes the title for the component and the Name Panel allowing the user to change the name for the component. This method is typically added to the top of the component at the beginning of the component's init method.

  Returns:
    a panel containing the component title and name panel

### makeBorder

    protected Border makeBorder()

  Create a top-level Border which can be added to JMeter components. Components typically set this as their border in their init method. It simply provides a nice spacing between the GUI components used and the edges of the window in which they appear.

  Returns:
    a Border for JMeter components

### makeScrollPane

    protected JScrollPane makeScrollPane(Component comp)

  Create a scroll panel that sets it's preferred size to it's minimum size. Explicitly for scroll panes that live inside other scroll panes, or within containers that stretch components to fill the area they exist in. Use this for any component you would put in a scroll pane (such as TextAreas, tables, JLists, etc). It is here for convenience and to avoid duplicate code. JMeter displays best if you follow this custom.

  Parameters:
    `comp` - the component which should be placed inside the scroll pane
  Returns:
    a JScrollPane containing the specified component

### makeScrollPane

    protected JScrollPane makeScrollPane(Component comp,
                                         int verticalPolicy,
                                         int horizontalPolicy)

  Create a scroll panel that sets it's preferred size to it's minimum size. Explicitly for scroll panes that live inside other scroll panes, or within containers that stretch components to fill the area they exist in. Use this for any component you would put in a scroll pane (such as TextAreas, tables, JLists, etc). It is here for convenience and to avoid duplicate code. JMeter displays best if you follow this custom.

  Parameters:
    `comp` - the component which should be placed inside the scroll pane
    `verticalPolicy` - the vertical scroll policy
    `horizontalPolicy` - the horizontal scroll policy
  Returns:
    a JScrollPane containing the specified component
  See Also:
    `ScrollPaneConstants`

### getStaticLabel

    public String getStaticLabel()

  Description copied from interface: `JMeterGUIComponent`
  Get the component's label. This label is used in drop down lists that give the user the option of choosing one type of component in a list of many. It should therefore be a descriptive name for the end user to see. It must be unique to the class. It is also used by Help to find the appropriate location in the documentation. Normally getLabelResource() should be overridden instead of this method; the definition of this method in AbstractJMeterGuiComponent is intended for general use.

  Specified by:
    `getStaticLabel` in interface `JMeterGUIComponent`
  Returns:
    GUI label for the component.
  See Also:
    `JMeterGUIComponent.getLabelResource()`

### getDocAnchor

    public String getDocAnchor()

  Description copied from interface: `JMeterGUIComponent`
  Get the component's document anchor name. Used by Help to find the appropriate location in the documentation

  Specified by:
    `getDocAnchor` in interface `JMeterGUIComponent`
  Returns:
    Document anchor (#ref) for the component.

### getPrintableComponent

    public JComponent getPrintableComponent()

  Subclasses need to over-ride this method, if they wish to return something other than the Visualizer itself.

  Specified by:
    `getPrintableComponent` in interface `Printable`
  Returns:
    this object

Overview | Package | Class | Tree | Deprecated | Index | Help
| Apache JMeter
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1998-2009 Apache Software Foundation. All Rights Reserved.