org.kahina.core.visual.chart
Class KahinaChartView
java.lang.Object
org.kahina.core.visual.KahinaView<KahinaChart>
org.kahina.core.visual.chart.KahinaChartView
- All Implemented Interfaces:
- KahinaListener
public class KahinaChartView
- extends KahinaView<KahinaChart>
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
KahinaChartView
public KahinaChartView(KahinaController control)
KahinaChartView
public KahinaChartView(KahinaChart chartModel,
KahinaController control)
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 tocolor - - 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 tocolor - - 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 tocolor - - 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)