package net.mkonrad.synes.data;

import java.util.ArrayList;

import net.mkonrad.synes.gui.elements.AbstractGraphLine;

public abstract class AbstractGraph extends ArrayList
{  
  /** Is it opened, or closed? */
  protected int _state;
  
  /** ID of the Layer that this graph belongs to */
  protected int _layerLevel;
  
  /** ID of the graph */
  protected int _id;
  
  /** Graphical representation belonging to this graph */
  protected AbstractGraphLine _graphLine = null;
  
  public AbstractGraph(int state)
  {
    _state = state;
    _id = ++IdCounter.BEATGRAPH_IDS;
    _layerLevel = -1;
  }
    
  public AbstractGraphLine getGraphLine()
  {
    return _graphLine;
  }

  public void setGraphLine(AbstractGraphLine graphLine)
  {
    _graphLine = graphLine;
  }

  public int getId()
  {
    return _id;
  }

  public void setId(int id)
  {
    _id = id;
  }
  
  public void setLayerLevel(int l)
  {
    _layerLevel = l;
  }
  
  public int getLayerLevel()
  {
    return _layerLevel;
  }

  public void setState(int s)
  {
    _state = s;
  }
  
  public int getState()
  {
    return _state;
  }

  public Object getLast()
  {
    return get(size() - 1);
  }
}
