|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.text.JTextComponent
javax.swing.JTextField
fr.esrf.tangoatk.widget.util.JAutoScrolledText
fr.esrf.tangoatk.widget.attribute.SimpleScalarViewer
public class SimpleScalarViewer
A light weigth viewer which display a scalar attribute (String or Number) and its unit. Here is an example of use:
fr.esrf.tangoatk.core.AttributeList attributeList = new
fr.esrf.tangoatk.core.AttributeList();
SimpleScalarViewer snv = new SimpleScalarViewer();
INumberScalar model = (INumberScalar) attributeList.add("jlp/test/1/att_quatre");
snv.setModel(model);
attributeList.startRefresher();
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JTextField |
|---|
javax.swing.JTextField.AccessibleJTextField |
| Nested classes/interfaces inherited from class javax.swing.text.JTextComponent |
|---|
javax.swing.text.JTextComponent.AccessibleJTextComponent, javax.swing.text.JTextComponent.KeyBinding |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class fr.esrf.tangoatk.widget.util.JAutoScrolledText |
|---|
CENTER_ALIGNMENT, CLASSIC_BEHAVIOR, LEFT_ALIGNMENT, MATRIX_BEHAVIOR, RIGHT_ALIGNMENT, SCROLL_LOOP, SCROLL_TO_SEE_END |
| Fields inherited from class javax.swing.JTextField |
|---|
notifyAction |
| Fields inherited from class javax.swing.text.JTextComponent |
|---|
DEFAULT_KEYMAP, FOCUS_ACCELERATOR_KEY |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, 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, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
SimpleScalarViewer()
Contructs a SimpleScalar viewer. |
|
| Method Summary | |
|---|---|
void |
booleanScalarChange(BooleanScalarEvent evt)
|
void |
clearModel()
Clears all model and listener attached to the components |
void |
errorChange(ErrorEvent evt)
|
java.awt.Color |
getBackgroundColor()
Returns the current background color of this viewer. |
IBooleanScalar |
getBooleanModel()
|
javax.swing.JComponent |
getComponent()
Returns the JComponent that implements this interface. |
java.lang.String |
getDescription(java.lang.String name)
Get a description of this extensions. |
java.lang.String |
getExtendedParam(java.lang.String name)
Returns the specified parameter value. |
java.lang.String[] |
getExtensionList()
Returns list of extension name for this objects (Empty array for none). |
boolean |
getHasToolTip()
getHasToolTip returns true if the viewer has a tooltip (attribute full name) |
java.lang.String |
getInvalidText()
Returns the current text which is displayed in case of error. |
INumberScalar |
getNumberModel()
|
boolean |
getQualityInTooltip()
getQualityInTooltip returns true if the attribute quality factor is displayed inside the viewer's tooltip |
IStringScalar |
getStringModel()
|
boolean |
getUnitVisible()
Detemines wether the unit is visible |
java.lang.String |
getUserFormat()
Returns the user format. |
void |
initForEditing()
Call after a component of a JDSwingObject is created, this give a default look and feel for editing. |
boolean |
isAlarmEnabled()
Determines whether the background color is overrided by the quality factor. |
static void |
main(java.lang.String[] args)
Test function |
void |
numberScalarChange(NumberScalarEvent evt)
|
void |
propertyChange(java.beans.PropertyChangeEvent evt)
|
void |
setAlarmEnabled(boolean b)
Enables or disables alarm background (represents the attribute quality factor). |
void |
setBackgroundColor(java.awt.Color bg)
Sets the 'VALID' background color of this viewer. |
boolean |
setExtendedParam(java.lang.String name,
java.lang.String value,
boolean popupErr)
Sets the specified param. |
void |
setHasToolTip(boolean b)
setHasToolTip display or not a tooltip for this viewer |
void |
setInvalidText(java.lang.String s)
Set the text which will be displayed in case of error or INVALID quality. |
void |
setModel(IBooleanScalar scalar)
Sets the model for this viewer. |
void |
setModel(INumberScalar scalar)
Sets the model for this viewer. |
void |
setModel(IStringScalar scalar)
Sets the model for this viewer. |
void |
setQualityInTooltip(boolean b)
setQualityInTooltip display or not the attribute quality factor inside the tooltip |
void |
setUnitVisible(boolean b)
Displays or hides the unit. |
void |
setUserFormat(ATKFormat format)
Sets the ATK user format of this viewer. |
void |
setUserFormat(java.lang.String format)
Overrides the format property of the attribute. |
void |
stateChange(AttributeStateEvent evt)
|
void |
stringScalarChange(StringScalarEvent evt)
|
| Methods inherited from class fr.esrf.tangoatk.widget.util.JAutoScrolledText |
|---|
addTextListener, getHorizontalOffset, getMargin, getMinimumSize, getPreferredSize, getScrollingMode, getSizingBehavior, getSleepTime, getText, getVerticalOffset, getWaitTime, paint, removeTextListener, setAutoScroll, setHorizontalAlignment, setHorizontalOffset, setMargin, setScrollingMode, setSizingBehavior, setSleepTime, setText, setValueOffsets, setVerticalOffset, setWaitTime |
| Methods inherited from class javax.swing.JTextField |
|---|
addActionListener, configurePropertiesFromAction, createActionPropertyChangeListener, createDefaultModel, fireActionPerformed, getAccessibleContext, getAction, getActionListeners, getActions, getColumns, getColumnWidth, getHorizontalAlignment, getHorizontalVisibility, getScrollOffset, getUIClassID, isValidateRoot, paramString, postActionEvent, removeActionListener, scrollRectToVisible, setAction, setActionCommand, setColumns, setDocument, setFont, setScrollOffset |
| Methods inherited from class javax.swing.text.JTextComponent |
|---|
addCaretListener, addInputMethodListener, addKeymap, copy, cut, fireCaretUpdate, getCaret, getCaretColor, getCaretListeners, getCaretPosition, getDisabledTextColor, getDocument, getDragEnabled, getFocusAccelerator, getHighlighter, getInputMethodRequests, getKeymap, getKeymap, getNavigationFilter, getPreferredScrollableViewportSize, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedText, getSelectedTextColor, getSelectionColor, getSelectionEnd, getSelectionStart, getText, getToolTipText, getUI, isEditable, loadKeymap, modelToView, moveCaretPosition, paste, processInputMethodEvent, read, removeCaretListener, removeKeymap, removeNotify, replaceSelection, select, selectAll, setCaret, setCaretColor, setCaretPosition, setComponentOrientation, setDisabledTextColor, setDragEnabled, setEditable, setFocusAccelerator, setHighlighter, setKeymap, setNavigationFilter, setSelectedTextColor, setSelectionColor, setSelectionEnd, setSelectionStart, setUI, updateUI, viewToModel, write |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, 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, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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 |
| Constructor Detail |
|---|
public SimpleScalarViewer()
| Method Detail |
|---|
public java.awt.Color getBackgroundColor()
public void setBackgroundColor(java.awt.Color bg)
bg - Background color.setAlarmEnabled(boolean)public void initForEditing()
JDrawable
initForEditing in interface JDrawablepublic javax.swing.JComponent getComponent()
JDrawable
getComponent in interface JDrawablepublic java.lang.String getDescription(java.lang.String name)
JDrawable
getDescription in interface JDrawablename - Extension name
public java.lang.String[] getExtensionList()
JDrawable
getExtensionList in interface JDrawable
public boolean setExtendedParam(java.lang.String name,
java.lang.String value,
boolean popupErr)
JDrawable
setExtendedParam in interface JDrawablename - Parameter name (Case unsensitive).value - Parameter value.popupErr - true when the JDrawable should display a popup if
the parameter value is incorrect, false otherwise. Note that the JDrawable
must not display an error message if the parameter does not exists even
if popupAllowed is true.
public java.lang.String getExtendedParam(java.lang.String name)
JDrawable
getExtendedParam in interface JDrawablename - Param name (Case unsensitive).
public void stringScalarChange(StringScalarEvent evt)
stringScalarChange in interface IStringScalarListenerpublic void numberScalarChange(NumberScalarEvent evt)
numberScalarChange in interface INumberScalarListenerpublic void booleanScalarChange(BooleanScalarEvent evt)
booleanScalarChange in interface IBooleanScalarListenerpublic void setUserFormat(java.lang.String format)
format - C like Format (ex: %5.2f) , null or "" to disable.public void setUserFormat(ATKFormat format)
Ex of use:
time_format = new ATKFormat() {
public String format(Number n) {
int d = n.intValue() / 60;
Object[] o = {new Integer(d / 60), new Integer(d % 60)};
return Format.sprintf("%02dh %02dmn", o);
}
};
myViewer.setUserFormat(time_format);
format - ATKFormat object or null to disable.public java.lang.String getUserFormat()
setUserFormat(java.lang.String)public void setUnitVisible(boolean b)
b - true to display the unit, false otherwisepublic boolean getUnitVisible()
public void setAlarmEnabled(boolean b)
b - True to enable alarm.setBackgroundColor(java.awt.Color)public boolean isAlarmEnabled()
setAlarmEnabled(boolean),
setBackgroundColor(java.awt.Color)public void stateChange(AttributeStateEvent evt)
stateChange in interface IAttributeStateListenerpublic void errorChange(ErrorEvent evt)
errorChange in interface IErrorListenerpublic void propertyChange(java.beans.PropertyChangeEvent evt)
propertyChange in interface java.beans.PropertyChangeListenerpublic void setModel(INumberScalar scalar)
scalar - scalar modelpublic void setModel(IStringScalar scalar)
scalar - modelpublic void setModel(IBooleanScalar scalar)
scalar - modelpublic void clearModel()
public void setInvalidText(java.lang.String s)
s - Text to be displayed.public java.lang.String getInvalidText()
setInvalidText(java.lang.String)public INumberScalar getNumberModel()
public IStringScalar getStringModel()
public IBooleanScalar getBooleanModel()
public boolean getHasToolTip()
getHasToolTip returns true if the viewer has a tooltip (attribute full name)
boolean valuepublic void setHasToolTip(boolean b)
setHasToolTip display or not a tooltip for this viewer
b - If True the attribute full name will be displayed as tooltip for the viewerpublic boolean getQualityInTooltip()
getQualityInTooltip returns true if the attribute quality factor is displayed inside the viewer's tooltip
boolean valuepublic void setQualityInTooltip(boolean b)
setQualityInTooltip display or not the attribute quality factor inside the tooltip
b - If True the attribute quality factor will be displayed inside the tooltip.
public static void main(java.lang.String[] args)
throws java.lang.Exception
args - Not used
java.lang.Exception
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||