All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class tw.edu.ncnu.im.cnclab.JGAP.UI.GraphCanvas

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----tw.edu.ncnu.im.cnclab.JGAP.UI.GraphCanvas

public class GraphCanvas
extends Canvas
The GraphCanvas class implements the Canvas of Graph.

Version:
0.4 Jul 8, 1999
Author:
Ding-Yi Chen

Variable Index

 o ADJ_LIST
Indicate the Graph showing as adjacency-linked-list.
 o ADJ_MATRIX
Indicate the Graph showing as adjacency-matrix.
 o defaultHeight
 o defaultWidth
 o doublePrecision
Specifies the number of digits to appear after the decimal point.
 o GRAPH
Indicate the Graph showing as graph.
 o selfLoopRadius
The radius of self-looped.

Constructor Index

 o GraphCanvas(Graph, Window)
Constructor of GraphCanvas
 o GraphCanvas(Graph, Window, int, int)
Constructor of GraphCanvas

Method Index

 o edgePrompt(Edge)
Return the String representation of edge.
 o getMinimumSize()
 o getPreferredSize()
 o getRepresentType()
Return the type of presentation.
 o paint(Graphics)
 o prePaint()
 o setRepresentType(int)
Set the type of presentation.
 o setSize(int, int)
Set the size of Canvas.
 o update(Graphics)

Variables

 o GRAPH
 public static final int GRAPH
Indicate the Graph showing as graph.

 o ADJ_MATRIX
 public static final int ADJ_MATRIX
Indicate the Graph showing as adjacency-matrix.

 o ADJ_LIST
 public static final int ADJ_LIST
Indicate the Graph showing as adjacency-linked-list.

 o defaultWidth
 public static int defaultWidth
 o defaultHeight
 public static int defaultHeight
 o doublePrecision
 public static final int doublePrecision
Specifies the number of digits to appear after the decimal point.

 o selfLoopRadius
 public static final int selfLoopRadius
The radius of self-looped.

Constructors

 o GraphCanvas
 public GraphCanvas(Graph graph,
                    Window parent)
Constructor of GraphCanvas

Parameters:
graph - The graph.
parent - the window that contain the canvas.
 o GraphCanvas
 public GraphCanvas(Graph graph,
                    Window parent,
                    int width,
                    int height)
Constructor of GraphCanvas

Parameters:
graph - The graph.
parent - The window that contain the canvas.
width - The width of canvas.
height - The height of canvas.

Methods

 o setSize
 public void setSize(int width,
                     int height)
Set the size of Canvas.

Parameters:
width - The width of canvas.
height - The height of canvas.
Overrides:
setSize in class Component
 o getRepresentType
 public int getRepresentType()
Return the type of presentation.

Returns:
the represent type of the graph
 o setRepresentType
 public void setRepresentType(int representType)
Set the type of presentation.

Parameters:
representType - The type of presentation.
See Also:
GRAPH, ADJ_MATRIX, ADJ_LIST
 o getMinimumSize
 public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Component
 o edgePrompt
 protected String edgePrompt(Edge edge)
Return the String representation of edge.

 o prePaint
 public void prePaint()
 o paint
 public void paint(Graphics g)
Overrides:
paint in class Canvas
 o update
 public void update(Graphics g)
Overrides:
update in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index