Class AbstractNodeModel

java.lang.Object
com.jsql.view.swing.tree.model.AbstractNodeModel
Direct Known Subclasses:
NodeModelDatabase, NodeModelEmpty, NodeModelTable

public abstract class AbstractNodeModel extends Object
Model adding functional layer to the node ; used by renderer and editor.
  • Constructor Details

    • AbstractNodeModel

      protected AbstractNodeModel(AbstractElementDatabase elementDatabase)
      Create a functional model for tree node.
      Parameters:
      elementDatabase - Database structural component
    • AbstractNodeModel

      protected AbstractNodeModel(String emptyObject)
      Create an empty model for tree node.
      Parameters:
      emptyObject - Empty tree default node
  • Method Details

    • buildMenu

      protected abstract void buildMenu(JPopupMenuCustomExtract tablePopupMenu, TreePath path)
      Display a popupmenu on mouse right click if needed.
      Parameters:
      tablePopupMenu - Menu to display
      path - Treepath of current node
    • isPopupDisplayable

      public abstract boolean isPopupDisplayable()
      Check if menu should be opened. i.e: does not show menu on database except during injection.
      Returns:
      True if popupup should be opened, false otherwise
    • getLeafIcon

      protected abstract Icon getLeafIcon(boolean isLeaf)
      Get icon displayed next to the node text.
      Parameters:
      isLeaf - True will display an arrow icon, false won't
      Returns:
      Icon to display
    • runAction

      public abstract void runAction()
      Run injection process (see GUIMediator.model().dao). Used by database and table nodes.
    • showPopup

      public void showPopup(DefaultMutableTreeNode currentTableNode, TreePath path, MouseEvent e)
      Display a popup menu for a database or table node.
      Parameters:
      currentTableNode - Current node
      path - Path of current node
    • getComponent

      public Component getComponent(JTree tree, Object nodeRenderer, boolean isSelected, boolean isLeaf, boolean hasFocus)
      Draw the panel component based on node model.
      Parameters:
      tree -
      nodeRenderer -
      isSelected -
      isLeaf -
      hasFocus -
      Returns:
    • displayProgress

      protected void displayProgress(PanelNode panelNode, DefaultMutableTreeNode currentNode)
      Update progressbar ; display the pause icon if node is paused.
      Parameters:
      panelNode - Panel that contains the bar to update
      currentNode - Functional node model object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getParent

      protected AbstractElementDatabase getParent()
      Get the database parent of current node.
      Returns:
      Parent
    • getElementDatabase

      public AbstractElementDatabase getElementDatabase()
    • getIndexProgress

      public int getIndexProgress()
    • setIndexProgress

      public void setIndexProgress(int indexProgress)
    • isSelected

      public boolean isSelected()
    • setSelected

      public void setSelected(boolean isSelected)
    • isRunning

      public boolean isRunning()
    • setRunning

      public void setRunning(boolean isRunning)
    • isContainingSelection

      public boolean isContainingSelection()
    • setContainingSelection

      public void setContainingSelection(boolean isContainingSelection)
    • isLoaded

      public boolean isLoaded()
    • setLoaded

      public void setLoaded(boolean isLoaded)
    • isProgressing

      public boolean isProgressing()
    • setProgressing

      public void setProgressing(boolean isProgressing)
    • isLoading

      public boolean isLoading()
    • setLoading

      public void setLoading(boolean isLoading)
    • getPanel

      public PanelNode getPanel()
    • setIsEdited

      public void setIsEdited(boolean isEdited)
    • setText

      public void setText(String textI18n)