org.jplot2d.env
Class PropertyInfo
- java.lang.Object
-
- org.jplot2d.env.PropertyInfo
-
- All Implemented Interfaces:
- java.lang.Comparable<PropertyInfo>
public class PropertyInfo extends java.lang.Object implements java.lang.Comparable<PropertyInfo>
Information of a property. If a property is read-only,getWriteMethod()will returnnull.
-
-
Constructor Summary
Constructors Constructor and Description PropertyInfo(java.lang.String pname, java.lang.reflect.Method reader, java.lang.reflect.Method writer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intcompareTo(PropertyInfo o)intgetDisplayDigits()Returns the number of significant digits should display for the value.java.lang.StringgetDisplayName()Gets the localized display name of this feature.java.lang.StringgetName()Gets the programmatic name of this feature.intgetOrder()java.lang.Class<?>getPropertyType()Gets the Class object for the property.java.lang.reflect.MethodgetReadMethod()Gets the method that should be used to read the property value.java.lang.StringgetShortDescription()Gets the short description of this feature.java.lang.reflect.MethodgetWriteMethod()Gets the method that should be used to write the property value.booleanisReadOnly()Returnstrueonly when there is a read-only annotation on the property.booleanisStyleable()voidsetDisplayDigits(int digits)Sets the number of significant digits should display for the value.voidsetDisplayName(java.lang.String displayName)Sets the localized display name of this feature.voidsetOrder(int order)voidsetReadOnly(boolean readOnly)voidsetShortDescription(java.lang.String text)You can associate a short descriptive string with a feature.voidsetStyleable(boolean styleable)java.lang.StringtoString()
-
-
-
Constructor Detail
-
PropertyInfo
public PropertyInfo(java.lang.String pname, java.lang.reflect.Method reader, java.lang.reflect.Method writer) throws java.beans.IntrospectionException- Throws:
java.beans.IntrospectionException
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the programmatic name of this feature.- Returns:
- The programmatic name of the property/method/event
-
getPropertyType
public java.lang.Class<?> getPropertyType()
Gets the Class object for the property.- Returns:
- The Java type info for the property. Note that the "Class" object may describe a built-in Java type such
as "int". The result may be "null" if this is an indexed property that does not support non-indexed
access.
This is the type that will be returned by the ReadMethod.
-
getReadMethod
public java.lang.reflect.Method getReadMethod()
Gets the method that should be used to read the property value.- Returns:
- The method that should be used to read the property value. May return null if the property can't be read.
-
getWriteMethod
public java.lang.reflect.Method getWriteMethod()
Gets the method that should be used to write the property value.- Returns:
- The method that should be used to write the property value. May return null if the property can't be written.
-
getDisplayName
public java.lang.String getDisplayName()
Gets the localized display name of this feature.- Returns:
- The localized display name for the property/method/event. This defaults to the same as its programmatic name from getName.
-
setDisplayName
public void setDisplayName(java.lang.String displayName)
Sets the localized display name of this feature.- Parameters:
displayName- The localized display name for the property/method/event.
-
getDisplayDigits
public int getDisplayDigits()
Returns the number of significant digits should display for the value. Only useful for float and double property.- Returns:
- the number of significant digits
-
setDisplayDigits
public void setDisplayDigits(int digits)
Sets the number of significant digits should display for the value. Only useful for float and double property.- Parameters:
digits- the number of significant digits
-
getShortDescription
public java.lang.String getShortDescription()
Gets the short description of this feature.- Returns:
- A localized short description associated with this property/method/event. This defaults to be the display name.
-
setShortDescription
public void setShortDescription(java.lang.String text)
You can associate a short descriptive string with a feature. Normally these descriptive strings should be less than about 40 characters.- Parameters:
text- A (localized) short description to be associated with this property/method/event.
-
isReadOnly
public boolean isReadOnly()
Returnstrueonly when there is a read-only annotation on the property.- Returns:
trueif the property is marked as read-only
-
setReadOnly
public void setReadOnly(boolean readOnly)
-
getOrder
public int getOrder()
-
setOrder
public void setOrder(int order)
-
isStyleable
public boolean isStyleable()
-
setStyleable
public void setStyleable(boolean styleable)
-
compareTo
public int compareTo(PropertyInfo o)
- Specified by:
compareToin interfacejava.lang.Comparable<PropertyInfo>
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG