org.kahina.core.visual.tree
Class KahinaTreeView

java.lang.Object
  extended by org.kahina.core.visual.KahinaView<KahinaTree>
      extended by org.kahina.core.visual.tree.KahinaAbstractTreeView
          extended by org.kahina.core.visual.tree.KahinaTreeView
All Implemented Interfaces:
KahinaListener
Direct Known Subclasses:
FormulaTreeView

public class KahinaTreeView
extends KahinaAbstractTreeView


Field Summary
protected  KahinaTreeViewConfiguration config
           
static boolean VERBOSE
           
 
Fields inherited from class org.kahina.core.visual.KahinaView
kahina, model
 
Constructor Summary
KahinaTreeView(KahinaInstance<?,?,?> kahina)
           
 
Method Summary
 void avoidClashesByAdaptingHorizontalDistance()
          tell the GUI to adapt horizontal distance in order to avoid clashes will be overridden by manual distance adaptation
 void calculateCoordinates()
           
 void display(KahinaTree treeModel)
           
 void display(KahinaTree layerModel, int layerID, int referenceNode)
           
 void displaySecondaryTree(KahinaTree treeModel)
           
 boolean displaysNode(int nodeID)
           
 KahinaTreeViewConfiguration getConfig()
           
 KahinaTree getContentfulTreeModel()
           
 int getDisplayHeight()
           
 int getDisplayWidth()
           
 int getEdgeStyle(int nodeID)
          Returns the edge style for the edge leading to a node.
 FontMetrics getFontMetrics(Font f, Stroke s, int fontSize)
           
 int getMarkedNode()
           
 Color getNodeBorderColor(int nodeID)
           
 Color getNodeColor(int nodeID)
           
 Font getNodeFont(int nodeID)
           
 int getNodeHeight(int nodeID)
           
 Integer getNodeX(int nodeID)
           
 Integer getNodeY(int nodeID)
           
 KahinaTree getSecondaryModel()
           
 int getTreeLayer()
           
 KahinaTree getTreeModel()
           
 boolean isSecondDimensionDisplayed()
           
 JComponent makePanel()
          Returns the panel that represents this view in the GUI.
 int nodeAtCoordinates(int x, int y)
           
 boolean nodeIsVisible(int nodeID)
           
protected  void processEvent(KahinaUpdateEvent e)
          HACK: if an update listener is defined on the tree view, the selected node will be marked
 void recalculate()
          Override this method to define necessary operations after changes to the model (coordinate recomputations etc.)
 void resetAllStructures()
           
 void setConfig(KahinaTreeViewConfiguration config)
           
 void setMarkedNode(int markedNode)
           
 void setNodeBorderColor(int nodeID, Color color)
           
 void setStatusColorEncoding(int status, Color color)
           
 void setStatusFontEncoding(int status, Font font)
           
 void setTreeLayer(int treeLayer)
           
 String showLevels()
           
 void swapDimensions()
           
 
Methods inherited from class org.kahina.core.visual.KahinaView
display, doDisplay, getModel, getTitle, isVisible, makeEditorPanel, processEvent, setConfig, setTitle, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERBOSE

public static final boolean VERBOSE
See Also:
Constant Field Values

config

protected KahinaTreeViewConfiguration config
Constructor Detail

KahinaTreeView

public KahinaTreeView(KahinaInstance<?,?,?> kahina)
Method Detail

display

public void display(KahinaTree treeModel)

displaySecondaryTree

public void displaySecondaryTree(KahinaTree treeModel)
Specified by:
displaySecondaryTree in class KahinaAbstractTreeView

display

public void display(KahinaTree layerModel,
                    int layerID,
                    int referenceNode)

getSecondaryModel

public KahinaTree getSecondaryModel()
Specified by:
getSecondaryModel in class KahinaAbstractTreeView

getConfig

public KahinaTreeViewConfiguration getConfig()
Overrides:
getConfig in class KahinaView<KahinaTree>

setConfig

public void setConfig(KahinaTreeViewConfiguration config)

isSecondDimensionDisplayed

public boolean isSecondDimensionDisplayed()

getDisplayWidth

public int getDisplayWidth()

getDisplayHeight

public int getDisplayHeight()

getNodeFont

public Font getNodeFont(int nodeID)

getNodeColor

public Color getNodeColor(int nodeID)

setNodeBorderColor

public void setNodeBorderColor(int nodeID,
                               Color color)

getNodeBorderColor

public Color getNodeBorderColor(int nodeID)

getEdgeStyle

public int getEdgeStyle(int nodeID)
Returns the edge style for the edge leading to a node. At the moment, this is a constant since dotted lines are not yet implemented.

Parameters:
nodeID -
Returns:
KahinaTreeViewOptions.COMPLETE_LINES

getNodeX

public Integer getNodeX(int nodeID)

getNodeY

public Integer getNodeY(int nodeID)

getNodeHeight

public int getNodeHeight(int nodeID)

getTreeLayer

public int getTreeLayer()

setTreeLayer

public void setTreeLayer(int treeLayer)

setStatusColorEncoding

public void setStatusColorEncoding(int status,
                                   Color color)
Specified by:
setStatusColorEncoding in class KahinaAbstractTreeView

setStatusFontEncoding

public void setStatusFontEncoding(int status,
                                  Font font)

getMarkedNode

public int getMarkedNode()

setMarkedNode

public void setMarkedNode(int markedNode)

resetAllStructures

public void resetAllStructures()

calculateCoordinates

public void calculateCoordinates()

displaysNode

public boolean displaysNode(int nodeID)

nodeIsVisible

public boolean nodeIsVisible(int nodeID)

getFontMetrics

public FontMetrics getFontMetrics(Font f,
                                  Stroke s,
                                  int fontSize)

showLevels

public String showLevels()

swapDimensions

public void swapDimensions()

nodeAtCoordinates

public int nodeAtCoordinates(int x,
                             int y)

getTreeModel

public KahinaTree getTreeModel()

getContentfulTreeModel

public KahinaTree getContentfulTreeModel()

makePanel

public JComponent makePanel()
Description copied from class: KahinaView
Returns the panel that represents this view in the GUI. This method must be invoked from the event dispatch thread.

Specified by:
makePanel in class KahinaView<KahinaTree>
Returns:

recalculate

public void recalculate()
Description copied from class: KahinaView
Override this method to define necessary operations after changes to the model (coordinate recomputations etc.)

Overrides:
recalculate in class KahinaView<KahinaTree>

avoidClashesByAdaptingHorizontalDistance

public void avoidClashesByAdaptingHorizontalDistance()
tell the GUI to adapt horizontal distance in order to avoid clashes will be overridden by manual distance adaptation


processEvent

protected void processEvent(KahinaUpdateEvent e)
HACK: if an update listener is defined on the tree view, the selected node will be marked

Overrides:
processEvent in class KahinaView<KahinaTree>