jet.controls
Class JetUnitNumber

java.lang.Object
  extended by jet.controls.JetProperty
      extended by jet.controls.JetNumber
          extended by jet.controls.JetUnitNumber
All Implemented Interfaces:
jet.controls.Integerable, jet.convert.NumberInfo, jet.convert.PropInfo, jet.convert.UnitNumberInfo, jet.util.Propertiable

public class JetUnitNumber
extends JetNumber
implements jet.convert.UnitNumberInfo

JetUnitNumber ,for saving/retrieving an integer with unit



Field Summary
 
Fields inherited from class jet.controls.JetProperty
CHART_BACKGROUND_EDITOR, CHART_FILLPATTERN_EDITOR, CHART_FILTER_EDITOR, CHART_FILTER_EDITOR_NO_DATE, CHART_ICON_STYLE, CHART_PATTERN_LIST_EDITOR, CHART_PENSTYLE_EDITOR, CHART_TEXTSTYLE_EDITOR, CHOICE_EDITOR, COLOR_EDITOR, COMBO_EDITOR, COMMAND_EDITOR, CONTROL_SELECT_ITEMS, DATASOURCE_EDITOR, DBCOL_EDITOR, DETAIL_REPORT_EDITOR, EDIT_FORBIDDEN, EDIT_FORBIDDEN_INIT, EDITABLE_ALLTIME, INTERNAL, LINK_EDITOR, MULSEL_EDITOR, PARAMCOL_EDITOR, QUERY_EDITOR, RECORDDB_EDITOR, SECURITY_EDITOR, TEXT_EDITOR
 
Fields inherited from interface jet.util.Propertiable
BIGSTRING, BOOLEAN, CHG_FMTTINGBLNAME, CHG_FMTTINGFORMULA, CHG_OTHER, COLOR, COMPFML_RESOURCE, CUSTOMER, CUSTOMERLINK, DELIM, DELIMCHAR, DOUBLE, ENUMERATION, IGNORED, IMAGE, IMGVECTOR, MAPPINGTBL, NORMAL_RESOURCE, NUMBER, REFERENCE, STRING, SUB1_DELIM, UNIT, VAL_NORMALLENGTH, VAL_NORMALSTART, VECTOR
 
Constructor Summary
JetUnitNumber()
           
JetUnitNumber(jet.controls.JetObject parent, java.lang.String name)
          Constructor.
Create a JetUnitNumber instance with default value and normal value are 0unit.
JetUnitNumber(jet.controls.JetObject parent, java.lang.String name, int defval)
          Constructor.
Create a JetUnitNumber instance with specified unit value.
 
Method Summary
static int convertToPixel(java.lang.String value, int unit)
          Deprecated.  
static int convertToUnit(java.lang.String value, int unit)
          Deprecated.  
 double doubleValue()
          Deprecated.  
 float floatValue()
          Deprecated.  
 int get()
          Deprecated.  
static java.lang.String get(int value, int unit, int fraction)
          Deprecated.  
 java.lang.String getInspValue()
          Only For Designer UI: Convert the unit value to pixel as string
 java.lang.String getInspValue(int unit, int fraction)
          Only For Designer UI: Converts the unit value to inch or centimeter as formated string
 java.lang.Object getObject()
          Effective if JetProperty.isCurrentAutoValue() is false, returns a Integer Object.
comments by 'unknown' author: add for Layout group , they use "Integer" to cast getObject() of JetUnitNumber .
 int getUnit()
          According to the following priority return : normal value > default value
static java.lang.String getUnit(int value, int unit, int fraction)
          Deprecated.  
 int intValue()
          Deprecated.  
 long longValue()
          Deprecated.  
 void set(double value)
          Deprecated.  
 void set(float value)
          Deprecated.  
 void set(int value)
          Deprecated.  
 void set(long value)
          Deprecated.  
 void set(java.lang.String theval)
          Deprecated.  
 void setCanChangeByOthers(boolean bSet)
          Sets can the property be changed by 'another object'.
 void setInt(int value)
          Sets normal value via specified unit value;
 void setUnitValue(int theval)
          Sets normal value via specified unit value;
 void setUnitValue(java.lang.String theval)
          Sets normal value via specified String that be treated as unit value;
 java.lang.String toCentimeterString()
          Deprecated.  
 java.lang.String toInchString()
          Deprecated.  
 java.lang.String toString()
          Convert the unit value to pixel as string
 java.lang.String toUnitString()
          Effective if JetProperty.isCurrentAutoValue() is false; returns the unit value as string, the unit value is (with priority)normal value > default value
 
Methods inherited from class jet.controls.JetNumber
addToAtomicAction, getInt, getMatchingSqlType, getPropertyChoice, setPropertyChoice, setValue
 
Methods inherited from class jet.controls.JetProperty
canChangeByBL, canChangeByFmtt, canChangeByOthers, enableAllChangeBys, getChangeBy, getChangeByBL, getChangeByBLName, getChangeByBLType, getChangeByFmtt, getChangeByFmttName, getChangeByObject, getChangeByObjectName, getChangeByOtherType, getCurrentValue, getCurrentValue, getEditFlag, getEditorType, getName, getNormalObject, getParent, getPropType, getRuntimeChangeBy, getUnifiedObject, getValue, isChagneByFmtt, isChangeByBL, isChangeByOther, isCurrentAutoValue, isEnableAutoValue, isNull, isSetAnyChangeBy, isSetRuntimeChgBy, isTransient, loadFullChangeBy, propertyChanged, saveFullChangeBy, setAsAutoValue, setCanChangeByBL, setCanChangeByFmtt, setChangeByBL, setChangeByBL, setChangeByFmtt, setChangeByObject, setChangeByObject, setEditFlag, setEditorType, setEnableAutoValue, setObject, setRuntimeChangeBy, setTransient
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jet.convert.NumberInfo
getInt
 
Methods inherited from interface jet.convert.PropInfo
getChangeByObjectName, getName, getValue, isChangeByOther, isNull
 

Constructor Detail

JetUnitNumber

public JetUnitNumber()

JetUnitNumber

public JetUnitNumber(jet.controls.JetObject parent,
                     java.lang.String name)
Constructor.
Create a JetUnitNumber instance with default value and normal value are 0unit.

Parameters:
parent - owner
name - name

JetUnitNumber

public JetUnitNumber(jet.controls.JetObject parent,
                     java.lang.String name,
                     int defval)
Constructor.
Create a JetUnitNumber instance with specified unit value.

Parameters:
parent - owner
name - name
defval - the unit value set to default value and normal value
Method Detail

convertToPixel

public static int convertToPixel(java.lang.String value,
                                 int unit)
Deprecated. 

Converts the value from inch or centimeter to the pixel value.

Parameters:
value - the string can converted to double value
unit - the unit-type of value, MUST BE Unit.INCH or Unit.CENTIMETER
Throws:
java.lang.NumberFormatException - if the value does not contain parsable number.
See Also:
Unit.INCH, Unit.CENTIMETER, Unit.convertInchToPixel(double), Unit.convertCentimeterToPixel(double), DecimalFormat.parse(String, ParsePosition)

get

public static java.lang.String get(int value,
                                   int unit,
                                   int fraction)
Deprecated. 

Converts the pixel value to inch or centimeter then return as formated string

Parameters:
value - the pixel value
unit - the unit-type of return MUST BE Unit.INCH or Unit.CENTIMETER
fraction - the fraction
See Also:
Unit.INCH, Unit.CENTIMETER, Unit.convertPixelToInch(int), Unit.convertPixelToCentimeter(int), NumberFormat.format(double), DecimalFormat.setMaximumFractionDigits(int)

convertToUnit

public static int convertToUnit(java.lang.String value,
                                int unit)
Deprecated. 

Converts the value from inch or centimeter to unit

Parameters:
value - the string can converted to double value
unit - the unit-type of value, MUST BE Unit.INCH or Unit.CENTIMETER
Throws:
java.lang.NumberFormatException - if the value does not contain parsable number.
See Also:
Unit.INCH, Unit.CENTIMETER, Unit.convertInchToUnit(double), Unit.convertCentimeterToUnit(double), DecimalFormat.parse(String, ParsePosition)

getUnit

public static java.lang.String getUnit(int value,
                                       int unit,
                                       int fraction)
Deprecated. 

Converts the unit value to inch or centimeter then return as formated string

Parameters:
value - the unit value
unit - the unit-type of result MUST BE Unit.INCH or Unit.CENTIMETER
fraction - the fraction
See Also:
Unit.INCH, Unit.CENTIMETER, Unit.convertUnitToInch(int), Unit.convertUnitToCentimeter(int), NumberFormat.format(double), DecimalFormat.setMaximumFractionDigits(int)

set

public void set(int value)
Deprecated. 

Sets normal value via specified pixel value

Overrides:
set in class JetNumber
Parameters:
value - the pixel value
See Also:
setUnitValue(int), setInt(int), Unit.convertPixelToUnit(int)

set

public void set(long value)
Deprecated. 

Sets normal value via specified pixel value;

Overrides:
set in class JetNumber
Parameters:
value - the pixel value
See Also:
setUnitValue(int), Unit.convertPixelToUnit(long)

set

public void set(float value)
Deprecated. 

Sets normal value via specified pixel value;

Overrides:
set in class JetNumber
Parameters:
value - : the pixel value
See Also:
setUnitValue(int), Unit.convertPixelToUnit(float)

set

public void set(double value)
Deprecated. 

Sets normal value via pixel value;

Overrides:
set in class JetNumber
Parameters:
value - the pixel value
See Also:
setUnitValue(int), Unit.convertPixelToUnit(double)

set

public void set(java.lang.String theval)
Deprecated. 

Sets normal value via specified string that be treated as integer pixel value;

Specified by:
set in interface jet.util.Propertiable
Overrides:
set in class JetNumber
Parameters:
theval - a String that be treated as integer pixel value
Throws:
java.lang.NumberFormatException - if the value does not contain parsable integer.
See Also:
setUnitValue(String), Unit.convertPixelToUnit(int)

setInt

public void setInt(int value)
Sets normal value via specified unit value;

Specified by:
setInt in interface jet.controls.Integerable
Overrides:
setInt in class JetNumber
Parameters:
value - a unit value
See Also:
setUnitValue(int)

setUnitValue

public void setUnitValue(java.lang.String theval)
Sets normal value via specified String that be treated as unit value;

Overrides:
setUnitValue in class JetProperty
Parameters:
theval - a String that be treated as unit value, null or empty-string means default value
See Also:
JetProperty.toUnitString()

setUnitValue

public void setUnitValue(int theval)
Sets normal value via specified unit value;

Parameters:
theval - a unit value

intValue

public int intValue()
Deprecated. 

Description copied from class: JetNumber
Effective if JetProperty.isCurrentAutoValue() is false;according to the following priority return : normal value > default value as integer

Specified by:
intValue in interface jet.convert.NumberInfo
Overrides:
intValue in class JetNumber
Returns:
the pixel value in integer.
See Also:
Unit.convertUnitToPixel(int), getUnit()

longValue

public long longValue()
Deprecated. 

Description copied from class: JetNumber
Effective if JetProperty.isCurrentAutoValue() is false;according to the following priority return : normal value > default value as long

Specified by:
longValue in interface jet.convert.NumberInfo
Overrides:
longValue in class JetNumber
Returns:
the pixel value in long.
See Also:
Unit.convertUnitToPixel(long), getUnit()

floatValue

public float floatValue()
Deprecated. 

Description copied from class: JetNumber
Effective if JetProperty.isCurrentAutoValue() is false;according to the following priority return : normal value > default value as float

Specified by:
floatValue in interface jet.convert.NumberInfo
Overrides:
floatValue in class JetNumber
Returns:
the pixel value in float.
See Also:
Unit.convertUnitToPixel(float), getUnit()

doubleValue

public double doubleValue()
Deprecated. 

Description copied from class: JetNumber
Effective if JetProperty.isCurrentAutoValue() is false;according to the following priority return : normal value > default value as double

Specified by:
doubleValue in interface jet.convert.NumberInfo
Overrides:
doubleValue in class JetNumber
Returns:
the pixel value in double.
See Also:
Unit.convertUnitToPixel(double), getUnit()

get

public int get()
Deprecated. 

Description copied from class: JetNumber
Effective if JetProperty.isCurrentAutoValue() is false; according to the following priority return : normal value > default value as integer

Specified by:
get in interface jet.convert.NumberInfo
Overrides:
get in class JetNumber
Returns:
the pixel value in integer
See Also:
Unit.convertUnitToPixel(int), getUnit()

getUnit

public int getUnit()
According to the following priority return : normal value > default value

Specified by:
getUnit in interface jet.convert.UnitNumberInfo
Returns:
the unit value in integer .

getInspValue

public java.lang.String getInspValue(int unit,
                                     int fraction)
Only For Designer UI: Converts the unit value to inch or centimeter as formated string

Overrides:
getInspValue in class JetProperty
Parameters:
unit - unit-type of return, must be one of Unit.INCH or Unit.CENTIMETER
fraction -
See Also:
getUnit(int, int, int), Unit.INCH, Unit.CENTIMETER, Unit.convertUnitToInch(int), Unit.convertUnitToCentimeter(int), DecimalFormat.setMaximumFractionDigits(int), NumberFormat.format(double)

getInspValue

public java.lang.String getInspValue()
Only For Designer UI: Convert the unit value to pixel as string

Specified by:
getInspValue in interface jet.convert.PropInfo
Overrides:
getInspValue in class JetProperty
Returns:
the string as pixel value
See Also:
toString()

toInchString

public java.lang.String toInchString()
Deprecated. 

Specified by:
toInchString in interface jet.convert.UnitNumberInfo
Returns:
the String as inch value
See Also:
Unit.convertUnitToInch(int), getUnit()

toCentimeterString

public java.lang.String toCentimeterString()
Deprecated. 

Specified by:
toCentimeterString in interface jet.convert.UnitNumberInfo
Returns:
the String as centimeter value
See Also:
Unit.convertUnitToCentimeter(int), getUnit()

toUnitString

public java.lang.String toUnitString()
Description copied from class: JetProperty
Effective if JetProperty.isCurrentAutoValue() is false; returns the unit value as string, the unit value is (with priority)normal value > default value

Specified by:
toUnitString in interface jet.convert.PropInfo
Specified by:
toUnitString in interface jet.convert.UnitNumberInfo
Overrides:
toUnitString in class JetProperty
Returns:
the string
See Also:
Object.toString(), JetProperty.isCurrentAutoValue()

toString

public java.lang.String toString()
Convert the unit value to pixel as string

Specified by:
toString in interface jet.convert.PropInfo
Overrides:
toString in class JetNumber
Returns:
the string as pixel value
See Also:
JetNumber.set(String), String.valueOf(int), String.valueOf(float), String.valueOf(double), String.valueOf(long), JetProperty.isCurrentAutoValue()

setCanChangeByOthers

public void setCanChangeByOthers(boolean bSet)
Description copied from class: JetProperty
Sets can the property be changed by 'another object'.

Overrides:
setCanChangeByOthers in class JetProperty
See Also:
JetProperty.canChangeByOther, JetProperty.canChangeByOthers(), JetProperty.enableAllChangeBys(boolean)

getObject

public java.lang.Object getObject()
Effective if JetProperty.isCurrentAutoValue() is false, returns a Integer Object.
comments by 'unknown' author: add for Layout group , they use "Integer" to cast getObject() of JetUnitNumber .

Specified by:
getObject in interface jet.util.Propertiable
Overrides:
getObject in class JetProperty
See Also:
JetProperty.isCurrentAutoValue()