org.kahina.core.visual.chart
Class KahinaChartView

java.lang.Object
  extended by org.kahina.core.visual.KahinaView<KahinaChart>
      extended by org.kahina.core.visual.chart.KahinaChartView
All Implemented Interfaces:
KahinaListener

public class KahinaChartView
extends KahinaView<KahinaChart>


Field Summary
 
Fields inherited from class org.kahina.core.visual.KahinaView
model
 
Constructor Summary
KahinaChartView(KahinaChart chartModel, KahinaController control)
           
KahinaChartView(KahinaController control)
           
 
Method Summary
 void display(KahinaChart chartModel)
           
 int edgeAtCoordinates(int x, int y)
           
 KahinaChartViewConfiguration getConfig()
           
 int getDisplayHeight()
           
 int getDisplayWidth()
           
 String getEdgeCaption(int edgeID)
           
 Color getEdgeColor(int edgeID)
           
 Font getEdgeFont(int edgeID)
           
 int getEdgeHeight(int edgeID)
           
 Color getEdgeHighlightColor(int edgeID)
           
 Iterable<Integer> getEdgeIDs()
           
 Stroke getEdgeStroke(int edgeID)
           
 int getEdgeWidth(int edgeID)
           
 int getEdgeX(int edgeID)
           
 int getEdgeY(int edgeID)
           
 FontMetrics getFontMetrics(Font f, Stroke s, int fontSize)
           
 int getMarkedEdge()
           
 int getNumberOfSegments()
           
 String getSegmentCaption(int segmentID)
           
 int getSegmentOffset(int segmentID)
           
 int getSegmentWidth(int segmentID)
           
 Iterable<Integer> getVisibleEdgeIDs()
           
protected  void processEvent(KahinaChartUpdateEvent e)
           
 void processEvent(KahinaEvent e)
           
 void recalculate()
          Override this method to define necessary operations after changes to the model (coordinate recomputations etc.)
 boolean segmentDisplayed(int id)
           
 void setDisplayDecider(KahinaChartEdgeDisplayDecider displayDecider)
           
 void setMarkedEdge(int markedEdge)
           
 void setStatusAutoColorEncoding(int status, Color color)
          Define the color encoding for a status.
 void setStatusColorEncoding(int status, Color color)
          Define the color of normal (non-highlighted) edges with a certain status.
 void setStatusFontEncoding(int status, Font font)
           
 void setStatusHighlightColorEncoding(int status, Color color)
          Define the color of highlighted edges with a certain status.
 void updateHighlightings()
           
 JComponent wrapInPanel(KahinaController control)
          Returns the panel that represents this view in the GUI.
 
Methods inherited from class org.kahina.core.visual.KahinaView
display, doDisplay, getModel, getTitle, processEvent, setConfig, setTitle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KahinaChartView

public KahinaChartView(KahinaController control)

KahinaChartView

public KahinaChartView(KahinaChart chartModel,
                       KahinaController control)
Method Detail

getConfig

public KahinaChartViewConfiguration getConfig()
Overrides:
getConfig in class KahinaView<KahinaChart>

display

public void display(KahinaChart chartModel)

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<KahinaChart>

setDisplayDecider

public void setDisplayDecider(KahinaChartEdgeDisplayDecider displayDecider)

segmentDisplayed

public boolean segmentDisplayed(int id)

getNumberOfSegments

public int getNumberOfSegments()

getEdgeColor

public Color getEdgeColor(int edgeID)
Parameters:
edgeID -
Returns:
highlight color for highlighted edges

getEdgeHighlightColor

public Color getEdgeHighlightColor(int edgeID)
Parameters:
edgeID -
Returns:
always returns highlight color, even if edge is not highlighted

getEdgeStroke

public Stroke getEdgeStroke(int edgeID)

getEdgeFont

public Font getEdgeFont(int edgeID)

getEdgeIDs

public Iterable<Integer> getEdgeIDs()

getVisibleEdgeIDs

public Iterable<Integer> getVisibleEdgeIDs()

getEdgeX

public int getEdgeX(int edgeID)

getEdgeY

public int getEdgeY(int edgeID)

getEdgeHeight

public int getEdgeHeight(int edgeID)

getEdgeWidth

public int getEdgeWidth(int edgeID)

getEdgeCaption

public String getEdgeCaption(int edgeID)

getSegmentCaption

public String getSegmentCaption(int segmentID)

getSegmentOffset

public int getSegmentOffset(int segmentID)

getFontMetrics

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

getDisplayWidth

public int getDisplayWidth()

getDisplayHeight

public int getDisplayHeight()

getSegmentWidth

public int getSegmentWidth(int segmentID)

setStatusColorEncoding

public void setStatusColorEncoding(int status,
                                   Color color)
Define the color of normal (non-highlighted) edges with a certain status.

Parameters:
status - - the status the color will be assigned to
color - - the color for normal edges of that status

setStatusHighlightColorEncoding

public void setStatusHighlightColorEncoding(int status,
                                            Color color)
Define the color of highlighted edges with a certain status.

Parameters:
status - - the status the color will be assigned to
color - - the color for highlighted edges of that status

setStatusAutoColorEncoding

public void setStatusAutoColorEncoding(int status,
                                       Color color)
Define the color encoding for a status. Automatically generates a dimmer variant for normal edges and a more saturated variant for highlighted edges. More customizable variant: encode colors separately using setStatusColorEncoding(int, Color) and setStatusHighlightColorEncoding(int, Color).

Parameters:
status - - the status the color will be assigned to
color - - the base color to encode the status

setStatusFontEncoding

public void setStatusFontEncoding(int status,
                                  Font font)

getMarkedEdge

public int getMarkedEdge()

setMarkedEdge

public void setMarkedEdge(int markedEdge)

updateHighlightings

public void updateHighlightings()

edgeAtCoordinates

public int edgeAtCoordinates(int x,
                             int y)

wrapInPanel

public JComponent wrapInPanel(KahinaController control)
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:
wrapInPanel in class KahinaView<KahinaChart>
Returns:

processEvent

public void processEvent(KahinaEvent e)
Specified by:
processEvent in interface KahinaListener
Overrides:
processEvent in class KahinaView<KahinaChart>

processEvent

protected void processEvent(KahinaChartUpdateEvent e)