physicon.graphLib
Class GraphContainerBase

java.lang.Object
  |
  +--physicon.graphLib.GraphContainerBase
Direct Known Subclasses:
ComponentGraphContainer, GraphContainer, SimGraphContainer

public abstract class GraphContainerBase
extends java.lang.Object

Represents the abstract container of the GraphElementBase elements


Constructor Summary
GraphContainerBase(GraphContextBase _context)
          Constructor.
 
Method Summary
 void addElement(GraphElementInterface _element)
          Adds the given object to the end of element array.
 void addScale(GraphElementInterface _element)
          Adds the given object to the end of scale array.
abstract  boolean contains(DoublePoint _dpt)
          Returns true if the point is in the container
 GraphElementBase elementAt(int _index)
          Returns GraphElement at the given index.
 int elementsNumber()
          Returns the number of elements in the elements array
abstract  java.awt.Component getComponent()
          Must return the reference to the current component
 GraphContextBase getContext()
          returns the reference to the GraphContextBase object
 int indexOfElement(GraphElementInterface _element)
          Returns the index of the given GraphElementInterface in the elements array of the container.
 int indexOfScale(GraphElementInterface _element)
          Returns the index of the given GraphElementInterface in the scales array of the container.
 void insertElementAt(GraphElementInterface _element, int _index)
          Adds the given object to given position of element array.
 void insertScaleAt(GraphElementInterface element, int index)
          Adds the given object to given position of scale array.
 void invalidateAll()
          Sets redrawflag -> true to all elements and scales Do not forget call this method in case of overriding it.
 GraphElementInterface realElementAt(int _index)
          Returns GraphElementInterface at the given index from the elements array.
 GraphElementInterface realScaleAt(int _index)
          Returns GraphElementInterface at the given index from the scales array.
 void removeAllElements()
          Removes all elements from the elements array
 void removeAllScales()
          Removes all elements from the scales array
 void removeElement(GraphElementInterface element)
           
 void removeElementAt(int _index)
          Removes the element from the elements array at the given index
 void removeScale(GraphElementInterface element)
           
 void removeScaleAt(int _index)
          Removes the element from the scales array at the given index
 GraphScaleBase scaleAt(int _index)
          Returns GraphElement at the given index.
 int scalesNumber()
          Returns the number of elements in the scales array
 void showAllElements(boolean _b)
          Shows or hides all the elements.
 void showAllScales(boolean _b)
          Shows or hides all the scales.
abstract  void showElement(GraphElementInterface _element, boolean _show)
          Must show or hide given element.
abstract  void showScale(GraphElementInterface _element, boolean _show)
          Must show or hide given scale.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphContainerBase

public GraphContainerBase(GraphContextBase _context)
Constructor.
Parameters:
_context - - the GraphContextBase object for current GraphContainer
See Also:
GraphContextBase
Method Detail

addElement

public final void addElement(GraphElementInterface _element)
Adds the given object to the end of element array. The Z - level of this element is larger then the Z - level of the last element in this array.
Parameters:
_element - - given element

insertElementAt

public final void insertElementAt(GraphElementInterface _element,
                                  int _index)
Adds the given object to given position of element array. The Z - level of this element is larger then the Z - level of the previous element in this array, but less then the Z - level of the next element in the array
Parameters:
_element - - given element
_index - - the given position of the element

addScale

public final void addScale(GraphElementInterface _element)
Adds the given object to the end of scale array. The Z - level of this element is larger then the Z - level of the last element in this array but less then the Z - level of the first element in the elements array
Parameters:
_element - - given element

insertScaleAt

public final void insertScaleAt(GraphElementInterface element,
                                int index)
Adds the given object to given position of scale array. The Z - level of this element is larger then the Z - level of the previous element in this array, but less then the Z - level of the next element in the array
Parameters:
_element - - given element
_index - - the given position of the element

showElement

public abstract void showElement(GraphElementInterface _element,
                                 boolean _show)
Must show or hide given element.
Parameters:
_element - - the given element
_show - - true is the element is to be shown false if the element is to be hidden

showScale

public abstract void showScale(GraphElementInterface _element,
                               boolean _show)
Must show or hide given scale.
Parameters:
_element - - the given scale
_show - - true is the scale is to be shown false if the scale is to be hidden

elementAt

public final GraphElementBase elementAt(int _index)
Returns GraphElement at the given index. This function returns GraphElementBase object, not the GraphElementInterface object
Parameters:
_index - - the given index
See Also:
GraphElementInterface, GraphElementBase

scaleAt

public final GraphScaleBase scaleAt(int _index)
Returns GraphElement at the given index. This function returns GraphScaleBase object, not the GraphElementInterface object
Parameters:
_index - - the given index
See Also:
GraphElementInterface, GraphScaleBase

realElementAt

public final GraphElementInterface realElementAt(int _index)
Returns GraphElementInterface at the given index from the elements array.
Parameters:
_index - - the given index
See Also:
GraphElementInterface, GraphElementBase

realScaleAt

public final GraphElementInterface realScaleAt(int _index)
Returns GraphElementInterface at the given index from the scales array.
Parameters:
_index - - the given index
See Also:
GraphElementInterface, GraphScaleBase

indexOfElement

public final int indexOfElement(GraphElementInterface _element)
Returns the index of the given GraphElementInterface in the elements array of the container. If the object is not in elements array -1 is returned
Parameters:
_element - - the given element

indexOfScale

public final int indexOfScale(GraphElementInterface _element)
Returns the index of the given GraphElementInterface in the scales array of the container. If the object is not in scales array -1 is returned
Parameters:
_element - - the given element

removeElementAt

public void removeElementAt(int _index)
Removes the element from the elements array at the given index
Parameters:
_index - - the given index

removeAllElements

public final void removeAllElements()
Removes all elements from the elements array

removeScaleAt

public void removeScaleAt(int _index)
Removes the element from the scales array at the given index
Parameters:
_index - - the given index

removeElement

public void removeElement(GraphElementInterface element)

removeScale

public void removeScale(GraphElementInterface element)

removeAllScales

public final void removeAllScales()
Removes all elements from the scales array

elementsNumber

public final int elementsNumber()
Returns the number of elements in the elements array

showAllElements

public void showAllElements(boolean _b)
Shows or hides all the elements.
Parameters:
_b. - If _b is true then all elements are to be shown. All elements are to be hidden in other case.

showAllScales

public void showAllScales(boolean _b)
Shows or hides all the scales.
Parameters:
_b. - If _b is true then all scales are to be shown. All scales are to be hidden in other case.

scalesNumber

public final int scalesNumber()
Returns the number of elements in the scales array

getContext

public GraphContextBase getContext()
returns the reference to the GraphContextBase object
See Also:
GraphContextBase

invalidateAll

public void invalidateAll()
Sets redrawflag -> true to all elements and scales Do not forget call this method in case of overriding it.

getComponent

public abstract java.awt.Component getComponent()
Must return the reference to the current component

contains

public abstract boolean contains(DoublePoint _dpt)
Returns true if the point is in the container