FreeHEP API
Version current

hep.graphics.heprep1.adapter
Class AbstractHepRepInstanceAdapter

java.lang.Object
  extended byhep.graphics.heprep.ref.DefaultHepRepAttribute
      extended byhep.graphics.heprep.ref.DefaultHepRepDefinition
          extended byhep.graphics.heprep1.adapter.HepRepAttributeAdapter
              extended byhep.graphics.heprep1.adapter.AbstractHepRepInstanceAdapter
All Implemented Interfaces:
HepRepAttribute, HepRepConstants, HepRepDefinition, HepRepInstance, Serializable
Direct Known Subclasses:
HepRepInstanceFromHepRepAdapter, HepRepInstanceFromInstanceAdapter, HepRepInstanceFromPrimitiveAdapter

public abstract class AbstractHepRepInstanceAdapter
extends HepRepAttributeAdapter
implements HepRepInstance

Version:
$Id: AbstractHepRepInstanceAdapter.java,v 1.4 2004/07/30 22:32:13 duns Exp $
Author:
Mark Donszelmann
See Also:
Serialized Form
Source Code:
AbstractHepRepInstanceAdapter.java

Field Summary
 
Fields inherited from class hep.graphics.heprep.ref.DefaultHepRepDefinition
cvsId
 
Fields inherited from interface hep.graphics.heprep.HepRepConstants
SHOW_DESC, SHOW_EXTRA, SHOW_NAME, SHOW_NONE, SHOW_VALUE, TYPE_BOOLEAN, TYPE_COLOR, TYPE_DOUBLE, TYPE_INT, TYPE_LONG, TYPE_STRING, TYPE_UNKNOWN
 
Constructor Summary
AbstractHepRepInstanceAdapter(HepRepAttribute parentAttribute, HepRepAttribute attribute, HepRepInstance parent, HepRepType type)
           
AbstractHepRepInstanceAdapter(HepRepAttribute attribute, HepRepInstance parent, HepRepType type)
           
 
Method Summary
 void addInstance(HepRepInstance instance)
          Adds an sub-instance to this instance.
 void addPoint(HepRepPoint point)
          Adds a point to this instance.
 HepRepInstance copy(HepRepTypeTree typeTree, HepRepInstance parent)
          Returns a deep copy of this instance.
 HepRepInstance copy(HepRepTypeTree typeTree, HepRepInstance parent, HepRepSelectFilter filter)
          Returns a deep copy of this instance.
 HepRepInstance copy(HepRepTypeTree typeTree, HepRepInstanceTree parent)
          Returns a deep copy of this instance.
 HepRepInstance copy(HepRepTypeTree typeTree, HepRepInstanceTree parent, HepRepSelectFilter filter)
          Returns a deep copy of this instance.
 HepRepAttValue getAttValue(String name)
          search for attribute on node, then search on type
 List getInstances()
          Returns a collection of all sub-instances this instance keeps.
 String getLayer()
          Returns String layername.
 int getPoints(double[][] xyz)
          Fills a double[3][n] array with the coordinates of all points, if none of the points have any attributes defined on them.
 HepRepInstance getSuperInstance()
          Returns the parent of this instance.
 HepRepType getType()
          Returns the associated type for this instance.
 Object getUserObject()
          Returns a user object previously set on this instance.
 boolean hasFrame()
          Returns true if this instance has a frame.
 void overlay(HepRepInstance instance)
          Overlays the instance on the current instance.
 void removeInstance(HepRepInstance instance)
          Removes a sub-instance from this instance.
 void setUserObject(Object object)
          Sets a User Object on this instance.
 
Methods inherited from class hep.graphics.heprep1.adapter.HepRepAttributeAdapter
getAttDef
 
Methods inherited from class hep.graphics.heprep.ref.DefaultHepRepDefinition
addAttDef, addAttDef, equals, getAttDefFromNode, getAttDefsFromNode
 
Methods inherited from class hep.graphics.heprep.ref.DefaultHepRepAttribute
addAttColor, addAttColor, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, getAttValueFromNode, getAttValuesFromNode, removeAttValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hep.graphics.heprep.HepRepInstance
getPoints
 
Methods inherited from interface hep.graphics.heprep.HepRepAttribute
addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, addAttValue, getAttValueFromNode, getAttValuesFromNode, removeAttValue
 

Constructor Detail

AbstractHepRepInstanceAdapter

public AbstractHepRepInstanceAdapter(HepRepAttribute attribute,
                                     HepRepInstance parent,
                                     HepRepType type)

AbstractHepRepInstanceAdapter

public AbstractHepRepInstanceAdapter(HepRepAttribute parentAttribute,
                                     HepRepAttribute attribute,
                                     HepRepInstance parent,
                                     HepRepType type)
Method Detail

overlay

public void overlay(HepRepInstance instance)
Description copied from interface: HepRepInstance
Overlays the instance on the current instance. Attributes of the instance override or are added to the current instance. Sub-instances of the instance are added only if the current instance has no sub-instances. Points of the instance are added only if the current instance has no points.

Specified by:
overlay in interface HepRepInstance

addInstance

public void addInstance(HepRepInstance instance)
Description copied from interface: HepRepInstance
Adds an sub-instance to this instance.

Specified by:
addInstance in interface HepRepInstance
Parameters:
instance - sub-instance.

removeInstance

public void removeInstance(HepRepInstance instance)
Description copied from interface: HepRepInstance
Removes a sub-instance from this instance.

Specified by:
removeInstance in interface HepRepInstance
Parameters:
instance - sub-instance.

getInstances

public List getInstances()
Description copied from interface: HepRepInstance
Returns a collection of all sub-instances this instance keeps.

Specified by:
getInstances in interface HepRepInstance
Returns:
collection of HepRepInstances.

addPoint

public void addPoint(HepRepPoint point)
Description copied from interface: HepRepInstance
Adds a point to this instance.

Specified by:
addPoint in interface HepRepInstance
Parameters:
point - to be added.

getType

public HepRepType getType()
Description copied from interface: HepRepInstance
Returns the associated type for this instance.

Specified by:
getType in interface HepRepInstance
Returns:
associated HepRepType.

getPoints

public int getPoints(double[][] xyz)
Description copied from interface: HepRepInstance
Fills a double[3][n] array with the coordinates of all points, if none of the points have any attributes defined on them. The actual number of points filled is returned. In case the number of points is larger than n, or if any points have attributes, -1 is returned. One could then call getPoint().

Specified by:
getPoints in interface HepRepInstance
Returns:
number of points filled in xyz, or -1 in case of error or non-implementation. ONLY in JAVA
See Also:
HepRepInstance.getPoints()

getSuperInstance

public HepRepInstance getSuperInstance()
Description copied from interface: HepRepInstance
Returns the parent of this instance.

Specified by:
getSuperInstance in interface HepRepInstance
Returns:
parent of instance, or null if top-level.

copy

public HepRepInstance copy(HepRepTypeTree typeTree,
                           HepRepInstance parent)
                    throws CloneNotSupportedException
Description copied from interface: HepRepInstance
Returns a deep copy of this instance.

Specified by:
copy in interface HepRepInstance
Parameters:
typeTree - needed to find the associated type.
parent - to which the copy is added.
Returns:
copy of this instance.
Throws:
CloneNotSupportedException - if copying is not possible.

copy

public HepRepInstance copy(HepRepTypeTree typeTree,
                           HepRepInstance parent,
                           HepRepSelectFilter filter)
                    throws CloneNotSupportedException
Description copied from interface: HepRepInstance
Returns a deep copy of this instance.

Specified by:
copy in interface HepRepInstance
Parameters:
typeTree - needed to find the associated type.
parent - to which the copy is added.
filter - run on all instances before copying.
Returns:
copy of this instance.
Throws:
CloneNotSupportedException - if copying is not possible.

copy

public HepRepInstance copy(HepRepTypeTree typeTree,
                           HepRepInstanceTree parent)
                    throws CloneNotSupportedException
Description copied from interface: HepRepInstance
Returns a deep copy of this instance.

Specified by:
copy in interface HepRepInstance
Parameters:
typeTree - needed to find the associated type.
parent - to which the copy is added.
Returns:
copy of this instance.
Throws:
CloneNotSupportedException - if copying is not possible.

copy

public HepRepInstance copy(HepRepTypeTree typeTree,
                           HepRepInstanceTree parent,
                           HepRepSelectFilter filter)
                    throws CloneNotSupportedException
Description copied from interface: HepRepInstance
Returns a deep copy of this instance.

Specified by:
copy in interface HepRepInstance
Parameters:
typeTree - needed to find the associated type.
parent - to which the copy is added.
filter - run on all instances before copying.
Returns:
copy of this instance.
Throws:
CloneNotSupportedException - if copying is not possible.

setUserObject

public void setUserObject(Object object)
Description copied from interface: HepRepInstance
Sets a User Object on this instance.

Specified by:
setUserObject in interface HepRepInstance
Parameters:
object - User Object.

getUserObject

public Object getUserObject()
Description copied from interface: HepRepInstance
Returns a user object previously set on this instance.

Specified by:
getUserObject in interface HepRepInstance
Returns:
User Object.

getAttValue

public HepRepAttValue getAttValue(String name)
search for attribute on node, then search on type

Specified by:
getAttValue in interface HepRepAttribute
Specified by:
getAttValue in class DefaultHepRepAttribute

getLayer

public String getLayer()
Description copied from interface: HepRepInstance
Returns String layername. Speedy access for iterator. ONLY in JAVA

Specified by:
getLayer in interface HepRepInstance

hasFrame

public boolean hasFrame()
Description copied from interface: HepRepInstance
Returns true if this instance has a frame. Speedy access for iterator. ONLY in JAVA

Specified by:
hasFrame in interface HepRepInstance

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.