Methods from java.awt.Component: |
---|
access$000, access$100, action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, adjustListeningChildrenOnParent, applyComponentOrientation, areFocusTraversalKeysSet, areInputMethodsEnabled, autoProcessMouseWheel, autoTransferFocus, bounds, canBeFocusOwner, checkGD, checkImage, checkImage, checkWindowClosingException, clearCurrentFocusCycleRootOnHide, clearMostRecentFocusOwnerOnHide, coalesceEvents, constructComponentName, contains, contains, containsFocus, countHierarchyMembers, createBufferStrategy, createBufferStrategy, createHierarchyEvents, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, dispatchMouseWheelToAncestor, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, eventTypeEnabled, findUnderMouseInWindow, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackBuffer, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getBoundsOp, getBufferStrategy, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getContainingWindow, getContainingWindow, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFocusTraversalKeys_NoIDCheck, getFont, getFontMetrics, getFont_NoClientCode, getForeground, getGraphics, getGraphicsConfiguration, getGraphicsConfiguration_NoClientCode, getGraphics_NoClientCode, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getLocationOnScreen_NoTreeLock, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getNativeContainer, getParent, getParent_NoClientCode, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initializeFocusTraversalKeys, inside, invalidate, isBackgroundSet, isCoalescingEnabled, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFocusTraversableOverridden, isFocusable, isFontSet, isForegroundSet, isInstanceOf, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isRecursivelyVisible, isSameOrAncestorOf, isShowing, isValid, isVisible, isVisible_NoClientCode, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, nextFocusHelper, numListening, paint, paintAll, paintHeavyweightComponents, paramString, pointRelativeToComponent, postEvent, postNextFocusHelper, postsOldMouseEvents, preNextFocusHelper, preferredSize, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusHelper, requestFocusHelper, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resetGC, reshape, resize, resize, setBackground, setBounds, setBounds, setBoundsOp, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFocusTraversalKeys_NoIDCheck, setFocusable, setFont, setForeground, setGCFromPeer, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setRequestFocusController, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, updateCursorImmediately, validate |
Method from org.apache.jmeter.gui.AbstractJMeterGuiComponent Detail: |
public void clearGui() {
initGui();
enabled = true;
}
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(). |
public void configure(TestElement element) {
setName(element.getName());
if (element.getProperty(TestElement.ENABLED) instanceof NullProperty) {
enabled = true;
} else {
enabled = element.getPropertyAsBoolean(TestElement.ENABLED);
}
getCommentPanel().setText(element.getComment());
}
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. |
protected void configureTestElement(TestElement mc) {
mc.setName(getName());
mc.setProperty(new StringProperty(TestElement.GUI_CLASS, this.getClass().getName()));
mc.setProperty(new StringProperty(TestElement.TEST_CLASS, mc.getClass().getName()));
// This stores the state of the TestElement
log.debug("setting element to enabled: " + enabled);
mc.setProperty(new BooleanProperty(TestElement.ENABLED, enabled));
mc.setComment(getComment());
}
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. |
protected Component createTitleLabel() {
JLabel titleLabel = new JLabel(getStaticLabel());
Font curFont = titleLabel.getFont();
titleLabel.setFont(curFont.deriveFont((float) curFont.getSize() + 4));
return titleLabel;
}
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. |
public String getComment() {
if (getCommentPanel() != null) {
return getCommentPanel().getText();
}
return ""; // $NON-NLS-1$
}
Provides a default implementation for the comment property. It's unlikely
developers will need to override. |
public String getDocAnchor() {
return getStaticLabel().replace(' ', '_');
}
|
public String getName() {
if (getNamePanel() != null) {
return getNamePanel().getName();
}
return ""; // $NON-NLS-1$
}
Provides a default implementation for the name property. It's unlikely
developers will need to override. |
protected NamePanel getNamePanel() {
return namePanel;
}
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. |
protected TreeNode getNode() {
return node;
}
Provides a default implementation for the node property. It is unlikely
developers would need to override this method. |
public JComponent getPrintableComponent() {
return this;
}
Subclasses need to over-ride this method, if they wish to return
something other than the Visualizer itself. |
public String getStaticLabel() {
return JMeterUtils.getResString(getLabelResource());
}
|
public boolean isEnabled() {
return enabled;
}
Provides a default implementation for the enabled property. It's unlikely
developers will need to override. |
protected Border makeBorder() {
return BorderFactory.createEmptyBorder(10, 10, 5, 10);
}
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. |
protected JScrollPane makeScrollPane(Component comp) {
JScrollPane pane = new JScrollPane(comp);
pane.setPreferredSize(pane.getMinimumSize());
return pane;
}
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. |
protected JScrollPane makeScrollPane(Component comp,
int verticalPolicy,
int horizontalPolicy) {
JScrollPane pane = new JScrollPane(comp, verticalPolicy, horizontalPolicy);
pane.setPreferredSize(pane.getMinimumSize());
return pane;
}
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. |
protected Container makeTitlePanel() {
VerticalPanel titlePanel = new VerticalPanel();
titlePanel.add(createTitleLabel());
VerticalPanel contentPanel = new VerticalPanel();
contentPanel.setBorder(BorderFactory.createEtchedBorder());
contentPanel.add(getNamePanel());
contentPanel.add(getCommentPanel());
titlePanel.add(contentPanel);
return titlePanel;
}
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. |
public void setComment(String comment) {
commentPanel.setText(comment);
}
Provides a default implementation for setting the comment property. It's unlikely
developers will need to override. |
public void setEnabled(boolean e) {
log.debug("Setting enabled: " + e);
enabled = e;
}
Provides a default implementation for the enabled property. It's unlikely
developers will need to override. |
public void setName(String name) {
namePanel.setName(name);
}
Provides a default implementation for setting the name property. It's unlikely
developers will need to override. |
public void setNode(TreeNode node) {
this.node = node;
getNamePanel().setNode(node);
}
Provides a default implementation for the node property. It is unlikely
developers would need to override this method. |