public class GEntryRealVector extends GEntryVectorAbstract
GTable1D object. This object is composed of a list of
input fields of real numbers and a pull-down menu of type GPopupList to display units when units
are defined for the vector. This class implements save and load of values in the configuration file
following the definition of the class GEntryVectorAbstract. The class GEntryRealVector is a
sub-class of GEntryVectorAbstract which is in charge of:
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.OperationNAME_ATTRIBUTE| Constructor and Description |
|---|
GEntryRealVector(String name,
ArrayList<Double> valueList)
Constructor.
|
GEntryRealVector(String name,
double[] valueArray)
Constructor.
|
GEntryRealVector(String name,
double[] valueArray,
GUnit[] unitArray)
Constructor.
|
GEntryRealVector(String name,
List<Double> valueList,
GUnit[] unitArray)
Constructor.
|
GEntryRealVector(String widgetId,
String name,
ArrayList<Double> valueList)
Constructor.
|
GEntryRealVector(String widgetId,
String name,
double[] valueArray)
Constructor.
|
GEntryRealVector(String widgetId,
String name,
double[] valueArray,
GUnit[] unitArray)
Constructor.
|
GEntryRealVector(String widgetId,
String name,
List<Double> valueList,
GUnit[] unitArray)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int rank,
Object value)
Adds an item to the vector.
|
double[] |
getDoubleArray()
Returns the array of values stored in the array as doubles.
|
GPopupList |
getGUnitMenu()
Get the unit menu widget.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
protected GUnit |
getUnitInConfig()
Get the unit in configuration file.
|
Number |
getValue(int rank)
Get the value of the element corresponding to the index "rank".
|
boolean |
handleEvent(GEvent event)
Handles an event provided by the GTable1D.
|
boolean |
isModified()
Gets the modification status of the component against the last set of values loaded or saved.
|
protected Number |
parseValue(String value)
Parse the value in string format and return a Number to be stored in the vector.
|
protected void |
readVector(org.jdom.Element e,
String unitString)
Reads the elements of the vector from file.
|
void |
remove(int rank)
Remove an element from the vector.
|
void |
removeAll()
Remove all the elements from the vector.
|
void |
setDefaultValue(Object defaultValue)
Set the new default value.
|
void |
setEnabled(boolean flag)
Set the enable status of the component.
|
void |
setFormatMode(GEnvironment.Format formatMode)
Sets the format allowed for the field.
|
void |
setFracDigits(int fracDigits)
Set the number of fractional digits.
|
void |
setSavedValue(int rank,
Object numberValue)
Sets the saved value of an element of the vector and then updates the modified indicator.
|
void |
setValue(int rank,
Object numberValue)
Sets the value of an element of the vector and then updates the status of the vector.
|
void |
setWidgetId(String widgetId)
Sets the widget identifier of the component.
|
void |
updateStatus()
Update the status information of the vector.
|
protected void |
writeVector(org.jdom.Element parentElement)
Writes the elements of the vector to the file.
|
addGInterval, addItem, getGComponent, getGLabelWithIndicator, getGNumberField, getIntervalList, getLabelConstraint, getName, getNameInConfigFile, getValueArray, isEnabled, read, removeAllInternal, removeGInterval, setComponentConstraint, setDefaultConstraints, setFieldValue, setLabelAndUnitConstraint, setLabelConstraint, setNameInConfigFile, setToolTipText, size, updateGInterval, updateIntervalMessage, updateIsModifiedIndicator, updateStatus, writeactivateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getComponent, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isForcedStatus, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setWidth, setWindowBusyCursor, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItempublic GEntryRealVector(String name, double[] valueArray)
name - of the vector.valueArray - list of initial values.public GEntryRealVector(String widgetId, String name, double[] valueArray)
widgetId - widget identifier.name - of the vector.valueArray - list of initial values.public GEntryRealVector(String name, ArrayList<Double> valueList)
name - of the vector.valueList - list of initial values.public GEntryRealVector(String widgetId, String name, ArrayList<Double> valueList)
widgetId - widget identifier.name - of the vector.valueList - list of initial values.public GEntryRealVector(String name, double[] valueArray, GUnit[] unitArray)
name - of the vector.valueArray - list of initial values.unitArray - array containing the GUnits applicable to the field.public GEntryRealVector(String widgetId, String name, double[] valueArray, GUnit[] unitArray)
widgetId - widget identifier.name - of the vector.valueArray - list of initial values.unitArray - array containing the GUnits applicable to the field.public GEntryRealVector(String name, List<Double> valueList, GUnit[] unitArray)
name - of the vector.valueList - list of initial values.unitArray - array containing the GUnits applicable to the field.public GEntryRealVector(String widgetId, String name, List<Double> valueList, GUnit[] unitArray)
widgetId - widget identifier.name - of the vector.valueList - list of initial values.unitArray - array containing the GUnits applicable to the field.public double[] getDoubleArray()
public void add(int rank,
Object value)
throws GArithmeticException
add in class GEntryVectorAbstractrank - of the new item.value - of the new item.GArithmeticException - if memoryValue is NaNpublic void remove(int rank)
GEntryVectorAbstractremove in class GEntryVectorAbstractrank - of the element to remove.public void removeAll()
GEntryVectorAbstractremoveAll in class GEntryVectorAbstractpublic GPopupList getGUnitMenu()
GEntryVectorAbstractgetGUnitMenu in class GEntryVectorAbstractprotected GUnit getUnitInConfig()
GEntryVectorAbstractgetUnitInConfig in class GEntryVectorAbstractpublic Number getValue(int rank)
GEntryVectorAbstractgetValue in class GEntryVectorAbstractrank - index of the element for which the value is returned.public void setValue(int rank,
Object numberValue)
throws GArithmeticException
setValue in class GEntryVectorAbstractrank - of the value to update.numberValue - the value in SI units, it will be displayed in the field after the
appropriate unit transformation.GArithmeticException - if numberValue is NaNpublic void setSavedValue(int rank,
Object numberValue)
throws GArithmeticException,
GException
setSavedValue in class GEntryVectorAbstractrank - of the value to update its saved status.numberValue - the value in SI units.GArithmeticException - if numberValue is NaN.GException - if numberValue is NaN or if rank is out of bounds.public void setEnabled(boolean flag)
GComponentsetEnabled in class GEntryVectorAbstractflag - new enable status of the component.protected void writeVector(org.jdom.Element parentElement)
GEntryVectorAbstractwriteVector in class GEntryVectorAbstractparentElement - where the values are stored.GEntryVectorAbstract.readVector(Element, String).protected void readVector(org.jdom.Element e,
String unitString)
throws GException
GEntryVectorAbstractreadVector in class GEntryVectorAbstracte - from where the values are read.unitString - unit read from the configuration file, that shall be used to set the current
unit at vector level.GException - in case of problem reading the vector from file.GEntryVectorAbstract.writeVector(Element).protected Number parseValue(String value)
GEntryVectorAbstractparseValue in class GEntryVectorAbstractvalue - string containing the value to be parsed.public void setWidgetId(String widgetId)
setWidgetId in class GEntryVectorAbstractwidgetId - the widget identifier of the component.public void setFracDigits(int fracDigits)
throws GEntryRealException
fracDigits - number of fractional digits.GEntryRealException - in case the number of fractionary digits is bigger than the MAX_FRAC_DIGITS (defaults to
15).public void setFormatMode(GEnvironment.Format formatMode)
formatMode - allowed for the field.public boolean handleEvent(GEvent event)
handleEvent in class GEntryVectorAbstractevent - to treat.public boolean isModified()
GComponentisModified in class GComponentpublic void updateStatus()
GEntryVectorAbstractupdateStatus in class GEntryVectorAbstractpublic void setDefaultValue(Object defaultValue) throws GArithmeticException
setDefaultValue in class GEntryVectorAbstractdefaultValue - new default value.GArithmeticException - if defaultValue is NaNpublic GComponent getSubComponent(int position) throws GComponentException
getSubComponent in class GEntryVectorAbstractposition - position of the requested component.GComponentException - in case the position argument is invalid.Copyright © 2024. All rights reserved.