public class GRealField extends GNumberFieldAbstract implements GListener
GTextField.GDocumentFieldFilterAbstract
GComponent.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.
|
getIsNotAnInstanceIfNumberError
actionPerformed, computeDefaultWidth, display, focusGained, focusLost, getCharWidth, getComponent, getJTextField, getText, keyPressed, keyReleased, keyTyped, setDocumentFilter, setEnabled, setText
activateConstraintsByType, 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, writeConfigItem
public 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 GNumberFieldAbstract
public 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 GListener
before
in class GTextField
e
- event to processed.GException
- in case there is a problem managing the event.public void after(GEvent e) throws GException
after
in interface GListener
after
in class GTextField
e
- processed event.GException
- in case there is a problem managing the event.public void setValue(Object numberValue)
setValue
in class GNumberFieldAbstract
numberValue
- new value of the widget.public Object getValue()
getValue
in class GNumberFieldAbstract
public String getUnitString()
getUnitString
in class GNumberFieldAbstract
public String getFormattedValue()
getFormattedValue
in class GNumberFieldAbstract
public String getFormattedValue(Object value)
getFormattedValue
in class GNumberFieldAbstract
value
- to format.public int getFracDigits()
getFracDigits
in class GNumberFieldAbstract
Copyright © 2024. All rights reserved.