igeo

## Class IObject

- java.lang.Object
- - igeo.IObject

- Direct Known Subclasses:
    IAgent, ICurveR, IGeometry, ILayer, IMeshR, IPointR, IPolycurve, ISurfaceR, IVectorObject

      public class IObject
      extends java.lang.Object

  A base class of iGeo object to be contained by IServer. Only instances of sub-classes of IObject can be carried by IServer. IObject contains three types of subobjects. One IParameterObject, multiple IGraphicObject and multiple IDynamics. If you assign IServerI in the constructor, the instance is contained by the server. If not the instance is contained by a server found in static IG methods.
  Author:
    Satoru Sugihara

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `IAttribute` | `attribute` object attributes like color, layer, etc.
    `java.util.ArrayList<IDynamics>` | `dynamics`
    `java.util.ArrayList<IGraphicObject>` | `graphics`
    `IParameterObject` | `parameter`
    `IServer` | `server`
    `java.lang.Object[]` | `userData` for user's custom data

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `IObject()` IObject is stored in default IServer (through current static IG instance)
    `IObject(IObject e)`
    `IObject(IServerI holder)` IObject is stored in the IServer via holder
    `IObject(IServerI holder, IObject e)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDynamics(IDynamics dyna)`
    `IObject` | `addUserData(java.lang.Object data)` set user's custom data
    `IObject` | `addUserData(java.lang.String key, java.lang.String value)` set user's custom data
    `float` | `alpha()`
    `int` | `alphaInt()`
    `IAttribute` | `attr()` get attributes
    `IObject` | `attr(IAttribute at)` set attributes
    `IObject` | `attr(IObject obj)` set a duplicate of attributes of another object.
    `java.awt.Color` | `awtColor()`
    `float` | `blue()`
    `int` | `blueInt()`
    `float` | `brightness()`
    `static java.util.HashMap<java.lang.String,java.lang.String>` | `castStringHashMap(java.util.HashMap m)`
    `void` | `clearDynamics()`
    `void` | `clearGraphics()`
    `IColor` | `clr()`
    `IObject` | `clr(java.awt.Color c)`
    `IObject` | `clr(java.awt.Color c, double alpha)`
    `IObject` | `clr(java.awt.Color c, float alpha)`
    `IObject` | `clr(java.awt.Color c, int alpha)`
    `IObject` | `clr(double dgray)`
    `IObject` | `clr(double dgray, double dalpha)`
    `IObject` | `clr(double dr, double dg, double db)`
    `IObject` | `clr(double dr, double dg, double db, double da)`
    `IObject` | `clr(float fgray)`
    `IObject` | `clr(float fgray, float falpha)`
    `IObject` | `clr(float fr, float fg, float fb)`
    `IObject` | `clr(float fr, float fg, float fb, float fa)`
    `IObject` | `clr(IColor c)` to set an object color
    `IObject` | `clr(IColor c, double alpha)` to set color, with alpha value overwritten
    `IObject` | `clr(IColor c, float alpha)` to set color, with alpha value overwritten
    `IObject` | `clr(IColor c, int alpha)` to set color, with alpha value overwritten
    `IObject` | `clr(int gray)`
    `IObject` | `clr(int gray, int alpha)`
    `IObject` | `clr(int r, int g, int b)`
    `IObject` | `clr(int r, int g, int b, int a)`
    `IObject` | `clr(IObject o)` to set the same color with the object
    `IObject` | `cp()` alias of dup()
    `IGraphicObject` | `createGraphic(IGraphicMode m)`
    `IAttribute` | `defaultAttribute()` default setting in each object class; to be overridden in a child class
    `void` | `del()`
    `void` | `deletDynamics(int index)`
    `void` | `deleteDynamics()`
    `void` | `deleteDynamics(IDynamics dyn)`
    `void` | `deleteGraphic()` delete all graphics
    `IObject` | `dup()` duplicate object
    `int` | `dynamicsNum()`
    `java.awt.Color` | `getAWTColor()`
    `IColor` | `getColor()`
    `IDynamics` | `getDynamics(int i)`
    `IGraphicObject` | `getGraphic(IGraphicMode m)`
    `IGraphicObject` | `getGraphic(int i)`
    `IParameterObject` | `getParameter()`
    `int` | `graphicsNum()`
    `float` | `gray()`
    `int` | `grayInt()`
    `float` | `green()`
    `int` | `greenInt()`
    `float` | `grey()`
    `int` | `greyInt()`
    `IObject` | `hide()`
    `IObject` | `hsb(double dh, double ds, double db)`
    `IObject` | `hsb(double dh, double ds, double db, double da)`
    `IObject` | `hsb(float h, float s, float b)`
    `IObject` | `hsb(float h, float s, float b, float a)`
    `float` | `hue()`
    `void` | `initGraphic(IServerI holder)`
    `void` | `initObject(IServerI holder)`
    `boolean` | `isValid()` checking parameters validity.
    `boolean` | `isVisible()`
    `ILayer` | `layer()` Get layer of the object
    `IObject` | `layer(ILayer l)` Set layer by ILayer object
    `IObject` | `layer(java.lang.String layerName)` Set layer by layer name.
    `java.lang.String` | `name()`
    `IObject` | `name(java.lang.String name)`
    `float` | `red()`
    `int` | `redInt()`
    `void` | `resetGraphic()` update whole graphic by deleting current one when there is major change.
    `float` | `saturation()`
    `IServer` | `server()`
    `IObject` | `setColor(java.awt.Color c)`
    `IObject` | `setColor(java.awt.Color c, double alpha)`
    `IObject` | `setColor(java.awt.Color c, float alpha)`
    `IObject` | `setColor(java.awt.Color c, int alpha)`
    `IObject` | `setColor(double dgray)`
    `IObject` | `setColor(double dgray, double dalpha)`
    `IObject` | `setColor(double dr, double dg, double db)`
    `IObject` | `setColor(double dr, double dg, double db, double da)`
    `IObject` | `setColor(float fgray)`
    `IObject` | `setColor(float fgray, float falpha)`
    `IObject` | `setColor(float fr, float fg, float fb)`
    `IObject` | `setColor(float fr, float fg, float fb, float fa)`
    `IObject` | `setColor(IColor c)`
    `IObject` | `setColor(IColor c, double alpha)`
    `IObject` | `setColor(IColor c, float alpha)`
    `IObject` | `setColor(IColor c, int alpha)`
    `IObject` | `setColor(int gray)`
    `IObject` | `setColor(int gray, int alpha)`
    `IObject` | `setColor(int r, int g, int b)`
    `IObject` | `setColor(int r, int g, int b, int a)`
    `IObject` | `setHSBColor(double h, double s, double b)`
    `IObject` | `setHSBColor(double h, double s, double b, double a)`
    `IObject` | `setHSBColor(float h, float s, float b)`
    `IObject` | `setHSBColor(float h, float s, float b, float a)`
    `void` | `setParameter(IParameterObject param)`
    `IObject` | `setTexture(ITexture tex)`
    `IObject` | `show()`
    `void` | `syncColor()` update color of all graphics by the color in attribute
    `void` | `syncGraphic()` update all graphics by the attribute
    `void` | `syncVisibility()` update color of all graphics by the color in attribute
    `void` | `syncWeight()` update weight of all graphics by the color in attribute
    `IObject` | `texture(ITexture tex)`
    `void` | `updateGraphic()` update graphic when control point location changes or some minor change.
    `java.lang.Object[]` | `userData()` get user's custom data
    `java.lang.Object` | `userData(int index)` get user's custom data
    `IObject` | `userData(java.lang.Object[] data)` set user's custom data
    `int` | `userDataNum()` get user's custom data
    `boolean` | `visible()`
    `float` | `weight()`
    `IObject` | `weight(double w)`
    `IObject` | `weight(float w)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### server

          public IServer server

    - #### parameter

          public IParameterObject parameter

    - #### graphics

          public java.util.ArrayList<IGraphicObject> graphics

    - #### dynamics

          public java.util.ArrayList<IDynamics> dynamics

    - #### attribute

          public IAttribute attribute

      object attributes like color, layer, etc.

    - #### userData

          public java.lang.Object[] userData

      for user's custom data

  - ### Constructor Detail

    - #### IObject

          public IObject()

      IObject is stored in default IServer (through current static IG instance)

    - #### IObject

          public IObject(IServerI holder)

      IObject is stored in the IServer via holder

    - #### IObject

          public IObject(IObject e)

    - #### IObject

          public IObject(IServerI holder,
                         IObject e)

  - ### Method Detail

    - #### dup

          public IObject dup()

      duplicate object

    - #### cp

          public IObject cp()

      alias of dup()

    - #### initObject

          public void initObject(IServerI holder)

    - #### initGraphic

          public void initGraphic(IServerI holder)

    - #### del

          public void del()

    - #### isValid

          public boolean isValid()

      checking parameters validity. to be overriden.

    - #### setParameter

          public void setParameter(IParameterObject param)

    - #### addDynamics

          public void addDynamics(IDynamics dyna)

    - #### getParameter

          public IParameterObject getParameter()

    - #### getGraphic

          public IGraphicObject getGraphic(int i)

    - #### getDynamics

          public IDynamics getDynamics(int i)

    - #### graphicsNum

          public int graphicsNum()

    - #### dynamicsNum

          public int dynamicsNum()

    - #### clearGraphics

          public void clearGraphics()

    - #### clearDynamics

          public void clearDynamics()

    - #### deletDynamics

          public void deletDynamics(int index)

    - #### deleteDynamics

          public void deleteDynamics(IDynamics dyn)

    - #### deleteDynamics

          public void deleteDynamics()

    - #### getGraphic

          public IGraphicObject getGraphic(IGraphicMode m)

    - #### createGraphic

          public IGraphicObject createGraphic(IGraphicMode m)

    - #### deleteGraphic

          public void deleteGraphic()

      delete all graphics

    - #### updateGraphic

          public void updateGraphic()

      update graphic when control point location changes or some minor change.

    - #### resetGraphic

          public void resetGraphic()

      update whole graphic by deleting current one when there is major change.

    - #### server

          public IServer server()

    - #### name

          public java.lang.String name()

    - #### name

          public IObject name(java.lang.String name)

    - #### layer

          public ILayer layer()

      Get layer of the object

    - #### layer

          public IObject layer(ILayer l)

      Set layer by ILayer object

    - #### layer

          public IObject layer(java.lang.String layerName)

      Set layer by layer name. If the layer specified by the name is not existing in the server, a new layer is automatically created in the server

    - #### attr

          public IAttribute attr()

      get attributes

    - #### attr

          public IObject attr(IAttribute at)

      set attributes

    - #### attr

          public IObject attr(IObject obj)

      set a duplicate of attributes of another object. if obj is null or its attributes is null, ignored.

    - #### defaultAttribute

          public IAttribute defaultAttribute()

      default setting in each object class; to be overridden in a child class

    - #### userData

          public java.lang.Object[] userData()

      get user's custom data

    - #### userData

          public java.lang.Object userData(int index)

      get user's custom data

    - #### userDataNum

          public int userDataNum()

      get user's custom data

    - #### userData

          public IObject userData(java.lang.Object[] data)

      set user's custom data

    - #### addUserData

          public IObject addUserData(java.lang.Object data)

      set user's custom data

    - #### addUserData

          public IObject addUserData(java.lang.String key,
                                     java.lang.String value)

      set user's custom data

    - #### castStringHashMap

          public static java.util.HashMap<java.lang.String,java.lang.String> castStringHashMap(java.util.HashMap m)

    - #### visible

          public boolean visible()

    - #### isVisible

          public boolean isVisible()

    - #### hide

          public IObject hide()

    - #### show

          public IObject show()

    - #### syncGraphic

          public void syncGraphic()

      update all graphics by the attribute

    - #### syncColor

          public void syncColor()

      update color of all graphics by the color in attribute

    - #### syncVisibility

          public void syncVisibility()

      update color of all graphics by the color in attribute

    - #### syncWeight

          public void syncWeight()

      update weight of all graphics by the color in attribute

    - #### clr

          public IColor clr()

      Returns:
        returns whatever Color of any graphics member. (first found)

    - #### weight

          public float weight()

      Returns:
        returns weight in attribute if any attribute exists. if not default weight in IConfig

    - #### redInt

          public int redInt()

    - #### greenInt

          public int greenInt()

    - #### blueInt

          public int blueInt()

    - #### alphaInt

          public int alphaInt()

    - #### greyInt

          public int greyInt()

    - #### grayInt

          public int grayInt()

    - #### red

          public float red()

    - #### green

          public float green()

    - #### blue

          public float blue()

    - #### alpha

          public float alpha()

    - #### grey

          public float grey()

    - #### gray

          public float gray()

    - #### hue

          public float hue()

    - #### saturation

          public float saturation()

    - #### brightness

          public float brightness()

    - #### clr

          public IObject clr(IColor c)

      to set an object color

    - #### clr

          public IObject clr(IColor c,
                             int alpha)

      to set color, with alpha value overwritten

    - #### clr

          public IObject clr(IColor c,
                             float alpha)

      to set color, with alpha value overwritten

    - #### clr

          public IObject clr(IColor c,
                             double alpha)

      to set color, with alpha value overwritten

    - #### clr

          public IObject clr(IObject o)

      to set the same color with the object

    - #### awtColor

          public java.awt.Color awtColor()

      Returns:
        returns whatever Color of any graphics member. (first found)

    - #### getAWTColor

          public java.awt.Color getAWTColor()

    - #### clr

          public IObject clr(java.awt.Color c)

    - #### clr

          public IObject clr(java.awt.Color c,
                             int alpha)

    - #### clr

          public IObject clr(java.awt.Color c,
                             float alpha)

    - #### clr

          public IObject clr(java.awt.Color c,
                             double alpha)

    - #### getColor

          public IColor getColor()

      Returns:
        returns whatever Color of any graphics member. (first found)

    - #### clr

          public IObject clr(int gray)

    - #### clr

          public IObject clr(double dgray)

    - #### clr

          public IObject clr(float fgray)

    - #### clr

          public IObject clr(int gray,
                             int alpha)

    - #### clr

          public IObject clr(double dgray,
                             double dalpha)

    - #### clr

          public IObject clr(float fgray,
                             float falpha)

    - #### clr

          public IObject clr(int r,
                             int g,
                             int b)

    - #### clr

          public IObject clr(double dr,
                             double dg,
                             double db)

    - #### clr

          public IObject clr(float fr,
                             float fg,
                             float fb)

    - #### clr

          public IObject clr(int r,
                             int g,
                             int b,
                             int a)

    - #### clr

          public IObject clr(double dr,
                             double dg,
                             double db,
                             double da)

    - #### clr

          public IObject clr(float fr,
                             float fg,
                             float fb,
                             float fa)

    - #### hsb

          public IObject hsb(double dh,
                             double ds,
                             double db,
                             double da)

    - #### hsb

          public IObject hsb(float h,
                             float s,
                             float b,
                             float a)

    - #### hsb

          public IObject hsb(double dh,
                             double ds,
                             double db)

    - #### hsb

          public IObject hsb(float h,
                             float s,
                             float b)

    - #### weight

          public IObject weight(double w)

    - #### weight

          public IObject weight(float w)

    - #### setColor

          public IObject setColor(IColor c)

    - #### setColor

          public IObject setColor(IColor c,
                                  int alpha)

    - #### setColor

          public IObject setColor(IColor c,
                                  float alpha)

    - #### setColor

          public IObject setColor(IColor c,
                                  double alpha)

    - #### setColor

          public IObject setColor(java.awt.Color c)

    - #### setColor

          public IObject setColor(java.awt.Color c,
                                  int alpha)

    - #### setColor

          public IObject setColor(java.awt.Color c,
                                  float alpha)

    - #### setColor

          public IObject setColor(java.awt.Color c,
                                  double alpha)

    - #### setColor

          public IObject setColor(int gray)

    - #### setColor

          public IObject setColor(float fgray)

    - #### setColor

          public IObject setColor(double dgray)

    - #### setColor

          public IObject setColor(int gray,
                                  int alpha)

    - #### setColor

          public IObject setColor(float fgray,
                                  float falpha)

    - #### setColor

          public IObject setColor(double dgray,
                                  double dalpha)

    - #### setColor

          public IObject setColor(int r,
                                  int g,
                                  int b)

    - #### setColor

          public IObject setColor(float fr,
                                  float fg,
                                  float fb)

    - #### setColor

          public IObject setColor(double dr,
                                  double dg,
                                  double db)

    - #### setColor

          public IObject setColor(int r,
                                  int g,
                                  int b,
                                  int a)

    - #### setColor

          public IObject setColor(float fr,
                                  float fg,
                                  float fb,
                                  float fa)

    - #### setColor

          public IObject setColor(double dr,
                                  double dg,
                                  double db,
                                  double da)

    - #### setHSBColor

          public IObject setHSBColor(float h,
                                     float s,
                                     float b,
                                     float a)

    - #### setHSBColor

          public IObject setHSBColor(double h,
                                     double s,
                                     double b,
                                     double a)

    - #### setHSBColor

          public IObject setHSBColor(float h,
                                     float s,
                                     float b)

    - #### setHSBColor

          public IObject setHSBColor(double h,
                                     double s,
                                     double b)

    - #### texture

          public IObject texture(ITexture tex)

    - #### setTexture

          public IObject setTexture(ITexture tex)