Class ParseTreeTableModel

  • All Implemented Interfaces:
    javax.swing.tree.TreeModel

    public class ParseTreeTableModel
    extends java.lang.Object
    implements javax.swing.tree.TreeModel
    The model that backs the parse tree in the GUI.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTreeModelListener​(javax.swing.event.TreeModelListener listener)  
      java.lang.Object getChild​(java.lang.Object parent, int index)  
      int getChildCount​(java.lang.Object parent)  
      java.lang.Class<?> getColumnClass​(int column)
      Returns type of specified column number.
      int getColumnCount()
      Returns number of available column.
      java.lang.String getColumnName​(int column)
      Returns column name of specified column number.
      int getIndexOfChild​(java.lang.Object parent, java.lang.Object child)  
      java.lang.Object getRoot()  
      java.lang.Object getValueAt​(java.lang.Object node, int column)
      Returns the value to be displayed for node at column number.
      boolean isCellEditable​(int column)
      Indicates whether the the value for node node, at column number column is editable.
      boolean isLeaf​(java.lang.Object node)  
      void removeTreeModelListener​(javax.swing.event.TreeModelListener listener)  
      protected void setParseMode​(MainFrameModel.ParseMode mode)
      Set parse mode.
      protected void setParseTree​(DetailAST parseTree)
      Sets parse tree.
      void valueForPathChanged​(javax.swing.tree.TreePath path, java.lang.Object newValue)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParseTreeTableModel

        public ParseTreeTableModel​(DetailAST parseTree)
        Initialise pModel.
        Parameters:
        parseTree - DetailAST parse tree.
    • Method Detail

      • setParseTree

        protected final void setParseTree​(DetailAST parseTree)
        Sets parse tree.
        Parameters:
        parseTree - DetailAST parse tree.
      • setParseMode

        protected void setParseMode​(MainFrameModel.ParseMode mode)
        Set parse mode.
        Parameters:
        mode - ParseMode enum
      • getColumnCount

        public int getColumnCount()
        Returns number of available column.
        Returns:
        the number of available column.
      • getColumnName

        public java.lang.String getColumnName​(int column)
        Returns column name of specified column number.
        Parameters:
        column - the column number
        Returns:
        the name for column number column.
      • getColumnClass

        public java.lang.Class<?> getColumnClass​(int column)
        Returns type of specified column number.
        Parameters:
        column - the column number
        Returns:
        the type for column number column.
      • getValueAt

        public java.lang.Object getValueAt​(java.lang.Object node,
                                           int column)
        Returns the value to be displayed for node at column number.
        Parameters:
        node - the node
        column - the column number
        Returns:
        the value to be displayed for node node, at column number column.
      • getChild

        public java.lang.Object getChild​(java.lang.Object parent,
                                         int index)
        Specified by:
        getChild in interface javax.swing.tree.TreeModel
      • getChildCount

        public int getChildCount​(java.lang.Object parent)
        Specified by:
        getChildCount in interface javax.swing.tree.TreeModel
      • valueForPathChanged

        public void valueForPathChanged​(javax.swing.tree.TreePath path,
                                        java.lang.Object newValue)
        Specified by:
        valueForPathChanged in interface javax.swing.tree.TreeModel
      • getRoot

        public java.lang.Object getRoot()
        Specified by:
        getRoot in interface javax.swing.tree.TreeModel
      • isLeaf

        public boolean isLeaf​(java.lang.Object node)
        Specified by:
        isLeaf in interface javax.swing.tree.TreeModel
      • getIndexOfChild

        public int getIndexOfChild​(java.lang.Object parent,
                                   java.lang.Object child)
        Specified by:
        getIndexOfChild in interface javax.swing.tree.TreeModel
      • addTreeModelListener

        public void addTreeModelListener​(javax.swing.event.TreeModelListener listener)
        Specified by:
        addTreeModelListener in interface javax.swing.tree.TreeModel
      • removeTreeModelListener

        public void removeTreeModelListener​(javax.swing.event.TreeModelListener listener)
        Specified by:
        removeTreeModelListener in interface javax.swing.tree.TreeModel
      • isCellEditable

        public boolean isCellEditable​(int column)
        Indicates whether the the value for node node, at column number column is editable.
        Parameters:
        column - the column number
        Returns:
        true if editable