public abstract class GEntryVectorAbstract extends GComponent
GEntryIntVector
and GEntryRealVector
. The code
included is :GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GEntryVectorAbstract(String name)
Constructor.
|
GEntryVectorAbstract(String widgetId,
String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
add(int rank,
Object value)
Adds an item to the vector.
|
void |
addGInterval(GIntervalAbstract interval)
Adds an interval to the interval list and update the status of all the entries taking into
account the new intervals.
|
protected void |
addItem(int rank,
GNumberFieldAbstract field,
Object value)
Adds a new element to the vector.
|
GComponent |
getGComponent(int rank)
Get the component corresponding to the specified rank.
|
GLabelWithIndicator |
getGLabelWithIndicator()
Return the GLabel associated with the vector.
|
GNumberFieldAbstract |
getGNumberField(int rank)
Get the GNumberFieldAbstract corresponding to the specified rank.
|
abstract GPopupList |
getGUnitMenu()
Get the unit menu widget.
|
protected GIntervalList |
getIntervalList()
Get the interval list.
|
GConstraint |
getLabelConstraint()
Get the constraint of the label.
|
String |
getName()
Return the name of the vector.
|
String |
getNameInConfigFile()
Get the name of the vector in the configuration file.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
protected GUnit |
getUnitInConfig()
Get the unit in configuration file.
|
Object |
getValue(int rank)
Get the value of the element corresponding to the index "rank".
|
Object[] |
getValueArray()
Return the array of the values contained in the vector.
|
abstract boolean |
handleEvent(GEvent event)
Method used by GTable1D to allow the vector to handle the events received at GTable1D level.
|
boolean |
isEnabled()
Gets the enable status of the widget.
|
protected abstract Object |
parseValue(String stringValue)
Parse the value in string format and return a Number to be stored in the vector.
|
void |
read(org.jdom.Element e)
Read the vector from file.
|
protected abstract void |
readVector(org.jdom.Element e,
String readUnit)
Reads the elements of the vector from file.
|
void |
remove(int rank)
Remove an element from the vector.
|
abstract void |
removeAll()
Remove all the elements from the vector.
|
void |
removeAllInternal()
Remove all the elements of the vector.
|
void |
removeGInterval(GIntervalAbstract interval)
Remove a validity interval of the field.
|
void |
setComponentConstraint(GTable1D.TableOrientation orientation,
int rank)
Set the components constraints.
|
protected void |
setDefaultConstraints()
Set default constraints.
|
abstract void |
setDefaultValue(Object defaultValue)
Set the new default value.
|
void |
setEnabled(boolean flag)
Set the enable status of the component.
|
protected void |
setFieldValue(int rank,
Object objectValue)
Sets the value of a field in the vector but does not update the status of the vector.
|
void |
setLabelAndUnitConstraint(GTable1D.TableOrientation orientation,
int rank)
Set the label and unit constraints.
|
void |
setLabelConstraint(GConstraint constraint)
Set the constraint of the label.
|
void |
setNameInConfigFile(String name)
Set the name of the vector in the configuration file.
|
abstract void |
setSavedValue(int rank,
Object objectValue)
Sets the saved value of an element of the vector and then updates the modified indicator.
|
void |
setToolTipText(String text)
Set the tooltip text for the entry's label.
|
void |
setValue(int rank,
Object objectValue)
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.
|
int |
size()
Get the number of items in the vector.
|
void |
updateGInterval(GIntervalAbstract oldInterval,
GIntervalAbstract newInterval)
Update a validity interval of the field.
|
protected void |
updateIntervalMessage(GUnit currentUnit,
GEnvironment.Format currentFormat)
Updates the interval message with units and format requested.
|
protected void |
updateIsModifiedIndicator()
Updates the is modified indicator.
|
abstract void |
updateStatus()
Update the status information of the vector.
|
protected void |
updateStatus(GUnit currentUnit,
int fracDigits)
Update the status information of the vector, comparing the values against the intervals.
|
void |
write(org.jdom.Element parentElement)
Write the vector to file.
|
protected abstract void |
writeVector(org.jdom.Element e)
Writes the elements of the vector to the file.
|
activateConstraintsByType, 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, isModified, 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, writeConfigItem
public GEntryVectorAbstract(String name)
name
- of the array used to group the values in the configuration file.protected void setDefaultConstraints()
setDefaultConstraints
in class GComponent
public void setWidgetId(String widgetId)
setWidgetId
in class GComponent
widgetId
- the widget identifier of the component.public final void setNameInConfigFile(String name)
setNameInConfigFile
in class GComponent
name
- of the vector in the configuration file.public String getNameInConfigFile()
getNameInConfigFile
in class GComponent
protected GIntervalList getIntervalList()
public Object getValue(int rank)
rank
- index of the element for which the value is returned.public Object[] getValueArray()
public abstract GPopupList getGUnitMenu()
protected GUnit getUnitInConfig()
public void setValue(int rank, Object objectValue) throws GArithmeticException
rank
- of the value to update.objectValue
- the value in SI units, it will be displayed in the field after the
appropriate unit transformation.GArithmeticException
- in case the values in NaN.public abstract void setDefaultValue(Object defaultValue) throws GArithmeticException
defaultValue
- new default value.GArithmeticException
- if defaultValue is NaN.public void setEnabled(boolean flag)
GComponent
setEnabled
in class GComponent
flag
- new enable status of the component.public boolean isEnabled()
GComponent
isEnabled
in class GComponent
public int size()
protected void updateIntervalMessage(GUnit currentUnit, GEnvironment.Format currentFormat)
currentUnit
- the current unitcurrentFormat
- the current format of fieldpublic abstract boolean handleEvent(GEvent event)
event
- to process.public GComponent getGComponent(int rank)
rank
- to get the GComponent.public GNumberFieldAbstract getGNumberField(int rank)
rank
- to get the GNumberFieldAbstract.public String getName()
getName
in class GComponent
public GLabelWithIndicator getGLabelWithIndicator()
public abstract void add(int rank, Object value) throws GArithmeticException, GException
rank
- of the new item.value
- of the new item.GArithmeticException
- if value is NaNGException
- in case the value can not be parsed.public void remove(int rank)
rank
- of the element to remove.public abstract void removeAll()
public void removeAllInternal()
protected abstract Object parseValue(String stringValue) throws GException
stringValue
- string containing the value to be parsed.GException
- in case of error parsing the value.protected void setFieldValue(int rank, Object objectValue)
rank
- of the value to update.objectValue
- the value in SI units, it will be displayed in the field after the
appropriate unit transformation.public void write(org.jdom.Element parentElement) throws GException
parentElement
- where the vector is written.GException
- in case of problem writing the vector to file.public void read(org.jdom.Element e) throws GException
e
- from where the vector is read.GException
- in case of problem reading the vector from file.public void addGInterval(GIntervalAbstract interval) throws GIntervalException
interval
- to add to the list.GIntervalException
- in case the interval overlaps with an existing one.public void updateGInterval(GIntervalAbstract oldInterval, GIntervalAbstract newInterval) throws GIntervalException
oldInterval
- to update.newInterval
- to update newInterval.GIntervalException
- in case oldInterval is not found in the list of intervals defined
for the field.public void removeGInterval(GIntervalAbstract interval)
interval
- to be removedpublic void setLabelConstraint(GConstraint constraint)
constraint
- of the label.public GConstraint getLabelConstraint()
public void setLabelAndUnitConstraint(GTable1D.TableOrientation orientation, int rank)
orientation
- of the table using the vector.rank
- of the vector within the table.public void setComponentConstraint(GTable1D.TableOrientation orientation, int rank)
orientation
- of the table using the vector.rank
- of the vector within the table.public void setToolTipText(String text)
setToolTipText
in class GComponent
text
- the tooltip text for the entry's label.protected void addItem(int rank, GNumberFieldAbstract field, Object value)
rank
- where the element shall be added.field
- the field to use for the element.value
- to assign to the new element.protected abstract void writeVector(org.jdom.Element e) throws GException
e
- where the values are stored.GException
- in case of problem writing the vector to file.readVector(Element, String).
protected abstract void readVector(org.jdom.Element e, String readUnit) throws GException
e
- from where the values are read.readUnit
- 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.writeVector(Element).
protected void updateIsModifiedIndicator()
updateIsModifiedIndicator
in class GComponent
public abstract void updateStatus()
protected void updateStatus(GUnit currentUnit, int fracDigits)
currentUnit
- the current unit of the field.fracDigits
- the number of fract digits of the field.public GComponent getSubComponent(int position) throws GComponentException
getSubComponent
in class GComponent
position
- position of the requested component.GComponentException
- in case the position argument is invalid.public abstract void setSavedValue(int rank, Object objectValue) throws GArithmeticException, GException
rank
- of the value to update its saved status.objectValue
- the value in SI units.GArithmeticException
- if objectValue is NaNGException
- if the rank is out of boundsCopyright © 2024. All rights reserved.