com.sun.electric.database.topology
Class Geometric

java.lang.Object
  extended by com.sun.electric.database.variable.ElectricObject
      extended by com.sun.electric.database.topology.Geometric
All Implemented Interfaces:
RTBounds, java.io.Serializable
Direct Known Subclasses:
ArcInst, NodeInst

public abstract class Geometric
extends ElectricObject
implements RTBounds

This class is the superclass for the Electric classes that have visual bounds on the screen, specifically NodeInst and ArcInst.

See Also:
Serialized Form

Field Summary
protected  Cell parent
          Cell containing this Geometric object.
 
Constructor Summary
protected Geometric(Cell parent)
          The constructor is only called from subclasses.
 
Method Summary
 void checkChanging()
          Routing to check whether changing of this cell allowed or not.
 java.lang.String describe(boolean withQuotes)
          Method to describe this Geometric as a string.
abstract  java.awt.geom.Rectangle2D getBounds()
          Method to return the bounds of this Geometric.
 EDatabase getDatabase()
          Returns database to which this Geometric belongs.
 java.awt.geom.Rectangle2D getGridBounds(java.awt.geom.Rectangle2D r)
          Method to fill the bounds of this Geometric in grid units into specified Rectangle2D.
 void getInfo()
          Method to write a description of this Geometric.
 java.awt.geom.Rectangle2D getLambdaBounds(java.awt.geom.Rectangle2D r)
          Method to fill the bounds of this Geometric in lambda units into specified Rectangle2D.
 Cell getParent()
          Method to return the Cell that contains this Geometric object.
abstract  java.util.Iterator<Poly> getShape(Poly.Builder polyBuilder)
          Returns the polygons that describe this Geometric.
 java.awt.geom.Point2D getTrueCenter()
          Method to return the center coordinate of this Geometric.
 double getTrueCenterX()
          Method to return the center X coordinate of this Geometric.
 double getTrueCenterY()
          Method to return the center Y coordinate of this Geometric.
abstract  boolean isConnected(Geometric geom)
          Method to tell whether this Geometric object is connected directly to another (that is, an arcinst connected to a nodeinst).
 Cell whichCell()
          Method to determine the appropriate Cell associated with this ElectricObject.
 int whichMultiPage()
          Method to determine which page of a multi-page schematic this Geometric is on.
 
Methods inherited from class com.sun.electric.database.variable.ElectricObject
addDisplayableVariables, addVar, check, checkExamine, checkUndoing, computeTextPoly, copyTextDescriptorFrom, copyVarsFrom, delVar, getArtwork, getCode, getD, getDisplayableVariables, getGeneric, getMutableTextDescriptor, getNumVariables, getParameterOrVariable, getParameterOrVariable, getParametersAndVariables, getPolyList, getSchematics, getTech, getTechPool, getTextBounds, getTextDescriptor, getVar, getVar, getVariables, getVarValue, getVarValue, isDatabaseObject, isDeprecatedVariable, isLinked, isParam, newDisplayVar, newVar, newVar, newVar, newVar, numDisplayableVariables, renameVar, renameVar, setOff, setTextDescriptor, toString, uniqueObjectName, uniqueObjectName, updateVar, updateVarCode, updateVarText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

parent

protected final Cell parent
Cell containing this Geometric object.

Constructor Detail

Geometric

protected Geometric(Cell parent)
The constructor is only called from subclasses.

Method Detail

describe

public java.lang.String describe(boolean withQuotes)
Method to describe this Geometric as a string. This method is overridden by NodeInst and ArcInst.

Parameters:
withQuotes - to wrap description between quotes
Returns:
a description of this Geometric as a string.

checkChanging

public void checkChanging()
Routing to check whether changing of this cell allowed or not. By default checks whole database change. Overriden in subclasses.

Overrides:
checkChanging in class ElectricObject

whichCell

public Cell whichCell()
Method to determine the appropriate Cell associated with this ElectricObject.

Overrides:
whichCell in class ElectricObject
Returns:
the appropriate Cell associated with this ElectricicObject.

whichMultiPage

public int whichMultiPage()
Method to determine which page of a multi-page schematic this Geometric is on.

Returns:
the page number (0-based).

getDatabase

public EDatabase getDatabase()
Returns database to which this Geometric belongs. Some objects are not in database, for example Geometrics in PaletteFrame. Method returns null for non-database objects.

Specified by:
getDatabase in class ElectricObject
Returns:
database to which this Geometric belongs.

getInfo

public void getInfo()
Method to write a description of this Geometric. Displays the description in the Messages Window.

Overrides:
getInfo in class ElectricObject

getParent

public Cell getParent()
Method to return the Cell that contains this Geometric object.

Returns:
the Cell that contains this Geometric object.

getShape

public abstract java.util.Iterator<Poly> getShape(Poly.Builder polyBuilder)
Returns the polygons that describe this Geometric.

Parameters:
polyBuilder - Poly builder.
Returns:
an iterator on Poly objects that describes this Geometric graphically. These Polys include displayable variables on the Geometric.

getBounds

public abstract java.awt.geom.Rectangle2D getBounds()
Method to return the bounds of this Geometric.

Specified by:
getBounds in interface RTBounds
Returns:
the bounds of this Geometric.

getLambdaBounds

public java.awt.geom.Rectangle2D getLambdaBounds(java.awt.geom.Rectangle2D r)
Method to fill the bounds of this Geometric in lambda units into specified Rectangle2D. If specified Rectangle2D is null, a new Rectangle2D.Double is allocated.

Parameters:
r - rectangle to fill
Returns:
the bounds of this Geometric.

getGridBounds

public java.awt.geom.Rectangle2D getGridBounds(java.awt.geom.Rectangle2D r)
Method to fill the bounds of this Geometric in grid units into specified Rectangle2D. If specified Rectangle2D is null, a new Rectangle2D.Double is allocated.

Parameters:
r - rectangle to fill
Returns:
the bounds of this Geometric.

getTrueCenterX

public double getTrueCenterX()
Method to return the center X coordinate of this Geometric.

Returns:
the center X coordinate of this Geometric.

getTrueCenterY

public double getTrueCenterY()
Method to return the center Y coordinate of this Geometric.

Returns:
the center Y coordinate of this Geometric.

getTrueCenter

public java.awt.geom.Point2D getTrueCenter()
Method to return the center coordinate of this Geometric.

Returns:
the center coordinate of this Geometric.

isConnected

public abstract boolean isConnected(Geometric geom)
Method to tell whether this Geometric object is connected directly to another (that is, an arcinst connected to a nodeinst). The method returns true if they are connected.

Parameters:
geom - other Geometric object.
Returns:
true if this and other Geometric objects are connected.