physicon.graphLib
Class GraphElementBase

java.lang.Object
  |
  +--physicon.graphLib.GraphElementBase
Direct Known Subclasses:
Arrow, Chart, CoordLine, CurveHatching, GraphCurveBase, GraphLabel, GraphMarkerBase, GraphScaleBase, Hatching, Label

public abstract class GraphElementBase
extends java.lang.Object
implements physicon.GraphEngine.GEInterface, GraphElementInterface

Represents the abstract Graph Element.


Constructor Summary
GraphElementBase(DrawerBase _drawer)
          Constructor
 
Method Summary
 void addDependent(GraphElementBase element)
           
 boolean contains(int x, int y)
           
 boolean contains(java.awt.Point point)
           
 GraphContainerBase getContainer()
          Returns the container of the object
 GraphContextBase getContext()
          Returns GraphContextBase object converting its coordinates
 java.util.Vector getDepend()
           
 DrawerBase getDrawer()
          Returns drawer object fo rthe corrent object
 physicon.GraphEngine.GEObject getGEObject()
          Updates the drawer object and returns it.
 GraphElementBase getGraphElement()
          Following functions are used by this library and by GraphEngine one
 boolean getRedrawFlag()
          Returns redraw flag
 DoublePoint getRefPoint()
          returns refPoint for the current graphic element.
 DoubleRectangle getRoughRect()
          Must return bounding Rectangle for the current graphic element.
 double getZLevel()
          Returns current Z - level for the object
 boolean isCreated()
          Returns true if element is created
 boolean isVisible()
           
 void setDrawer(DrawerBase _drawer)
           
 void setRedrawFlag(boolean flag)
          Sets or clears the redraw flag
 void setRefPoint(DoublePoint _pt)
          sets refPoint for the current graphic element.
 void setVisible(boolean flag)
           
 void setZLevel(double _zLevel)
          Sets Z - level for the object.
 void update()
          Updates the object and the dependent object state.
 void updateDrawer()
          This function must update the drawer object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphElementBase

public GraphElementBase(DrawerBase _drawer)
Constructor
Parameters:
_drawer - - drawer object
See Also:
DrawerBase
Method Detail

getContainer

public final GraphContainerBase getContainer()
Returns the container of the object

getContext

public final GraphContextBase getContext()
Returns GraphContextBase object converting its coordinates
See Also:
GraphContextBase

setZLevel

public final void setZLevel(double _zLevel)
Sets Z - level for the object.
Parameters:
_zLevel - new Z - level for the object. This parameter is double to make easy insertion new objects before this one.

getZLevel

public final double getZLevel()
Returns current Z - level for the object

getRefPoint

public DoublePoint getRefPoint()
returns refPoint for the current graphic element. Point is in logical coordinates.
See Also:
DoublePoint

setRefPoint

public void setRefPoint(DoublePoint _pt)
sets refPoint for the current graphic element.
Parameters:
_pt - - New refPoint in logical coordinates

addDependent

public void addDependent(GraphElementBase element)

getDepend

public java.util.Vector getDepend()

getRoughRect

public DoubleRectangle getRoughRect()
Must return bounding Rectangle for the current graphic element. This rectangle is in logical coordinates Default returns null

getGraphElement

public final GraphElementBase getGraphElement()
Following functions are used by this library and by GraphEngine one
Specified by:
getGraphElement in interface GraphElementInterface

getDrawer

public DrawerBase getDrawer()
Returns drawer object fo rthe corrent object

setDrawer

public void setDrawer(DrawerBase _drawer)

updateDrawer

public void updateDrawer()
This function must update the drawer object. Do not forget call super.updateDrawer in the begining of this function in the delivered class

update

public void update()
Updates the object and the dependent object state.

getGEObject

public final physicon.GraphEngine.GEObject getGEObject()
Updates the drawer object and returns it.
Specified by:
getGEObject in interface physicon.GraphEngine.GEInterface

setRedrawFlag

public void setRedrawFlag(boolean flag)
Sets or clears the redraw flag
Specified by:
setRedrawFlag in interface physicon.GraphEngine.GEInterface
Parameters:
flag - - true if redraw flag is to be set; false otherwise

getRedrawFlag

public final boolean getRedrawFlag()
Returns redraw flag
Specified by:
getRedrawFlag in interface physicon.GraphEngine.GEInterface

setVisible

public void setVisible(boolean flag)

isVisible

public boolean isVisible()

isCreated

public boolean isCreated()
Returns true if element is created

contains

public boolean contains(java.awt.Point point)

contains

public boolean contains(int x,
                        int y)