public class GRealField extends GNumberFieldAbstract implements GListener
GTextField.GDocumentFieldFilterAbstractGComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_FRAC_DIGITS |
NAME_ATTRIBUTE| Constructor and Description |
|---|
GRealField(double value)
Constructor.
|
GRealField(String widgetId,
double value)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
after(GEvent e)
Called after the event is processed.
|
void |
before(GEvent e)
Called before the event is processed.
|
String |
formatValue(double value,
GEnvironment.Format format)
Format the value to display according to the formatting options of the field.
|
GEnvironment.Format |
getCurrentFormat()
Get the current format of the field.
|
String |
getFormattedValue()
Return the value contained by the field in the format that shall be used to read/write from/to file.
|
String |
getFormattedValue(Object value)
Return the value contained by the field in the format that shall be used to read/write from/to file.
|
int |
getFracDigits()
Get the number of fractinal digits of the field.
|
String |
getUnitString()
Get the unit string present in the field or null if no unit is present.
|
Object |
getValue()
Get the current value of the widget.
|
void |
setCurrentFormat(GEnvironment.Format formatMode)
Sets the current format.
|
void |
setFormatMode(GEnvironment.Format formatMode)
Sets the format allowed for the field.
|
void |
setFracDigits(int fracDigits)
Set the number of fractional digits.
|
void |
setValue(Object numberValue)
Set the value of the widget.
|
getIsNotAnInstanceIfNumberErroractionPerformed, computeDefaultWidth, display, focusGained, focusLost, getCharWidth, getComponent, getJTextField, getText, keyPressed, keyReleased, keyTyped, setDocumentFilter, setEnabled, setTextactivateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItempublic static final int MAX_FRAC_DIGITS
public GRealField(double value)
value - to display in the field.public GRealField(String widgetId, double value)
widgetId - widget identificator.value - to display in the widget.public void setFormatMode(GEnvironment.Format formatMode)
formatMode - allowed for the field.public void setCurrentFormat(GEnvironment.Format formatMode)
formatMode - the current format.public GEnvironment.Format getCurrentFormat()
getCurrentFormat in class GNumberFieldAbstractpublic void setFracDigits(int fracDigits)
throws GEntryRealException
fracDigits - number of fractional digits.GEntryRealException - if fracDigits <= 0 or > 15.public String formatValue(double value, GEnvironment.Format format)
value - value to format.format - used to format the value, either NORMAL or SCIENTIFIC.public void before(GEvent e) throws GException
before in interface GListenerbefore in class GTextFielde - event to processed.GException - in case there is a problem managing the event.public void after(GEvent e) throws GException
after in interface GListenerafter in class GTextFielde - processed event.GException - in case there is a problem managing the event.public void setValue(Object numberValue)
setValue in class GNumberFieldAbstractnumberValue - new value of the widget.public Object getValue()
getValue in class GNumberFieldAbstractpublic String getUnitString()
getUnitString in class GNumberFieldAbstractpublic String getFormattedValue()
getFormattedValue in class GNumberFieldAbstractpublic String getFormattedValue(Object value)
getFormattedValue in class GNumberFieldAbstractvalue - to format.public int getFracDigits()
getFracDigits in class GNumberFieldAbstractCopyright © 2024. All rights reserved.