Class WalkwayCanvas
Class WalkwayCanvas
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----WalkwayCanvas
- class WalkwayCanvas
- extends Canvas
-
CREATE
-
-
EDIT
-
-
offscreenG
-
-
offscreenImg
-
-
parent
-
-
buildCampus()
- Macro to build the initial campus walkways
-
Clip()
- Tells the status of the select rectangle
-
DrawingMode()
-
-
DrawingMode(int)
- Set's Drawing Mode
-
keyDown(Event, int)
-
-
mouseDown(Event, int, int)
- Mouse Down Event Handler
-
mouseDrag(Event, int, int)
- Mouse Drag Event Handler
-
mouseUp(Event, int, int)
- Mouse Up Event Handler
-
paint(Graphics)
- Paints the canvas with the graph, and select rectangle (if visible),
and sketch line (if creating an edge).
-
resize(int)
- Resize all the nodes on the display
-
SetClip(boolean)
- Sets the select rectangle to be visible or not
-
update(Graphics)
- Update Routine- does not need to clear buffer since we are going
to copy buffer while double buffering
CREATE
public final int CREATE
EDIT
public final int EDIT
offscreenImg
public Image offscreenImg
offscreenG
public Graphics offscreenG
parent
protected IWalkways parent
DrawingMode
public int DrawingMode()
DrawingMode
public void DrawingMode(int m)
- Set's Drawing Mode
- Parameters:
- m - Drawing mode
Clip
public boolean Clip()
- Tells the status of the select rectangle
- Returns:
- boolean- true if on (visible), false if off (not displayed)
SetClip
public void SetClip(boolean cl)
- Sets the select rectangle to be visible or not
- Parameters:
- cl - clip rectangle status- true visible, false invisible
update
public void update(Graphics g)
- Update Routine- does not need to clear buffer since we are going
to copy buffer while double buffering
- Parameters:
- g - graphics to draw into
- Overrides:
- update in class Component
mouseUp
public boolean mouseUp(Event evt,
int x,
int y)
- Mouse Up Event Handler
- Parameters:
- evt - event to be handled
- x - x mouse position
- y - y mouse position
- Returns:
- boolean- true if event handled, (all cases true)
- Overrides:
- mouseUp in class Component
mouseDown
public boolean mouseDown(Event evt,
int x,
int y)
- Mouse Down Event Handler
- Parameters:
- x - x mouse position
- y - y mouse position
- Returns:
- boolean- true if event handled, (all cases true)
- Overrides:
- mouseDown in class Component
mouseDrag
public boolean mouseDrag(Event evt,
int x,
int y)
- Mouse Drag Event Handler
- Parameters:
- x - x mouse position
- y - y mouse position
- Returns:
- boolean- true if event handled, (all cases true)
- Overrides:
- mouseDrag in class Component
keyDown
public boolean keyDown(Event evt,
int key)
- Overrides:
- keyDown in class Component
buildCampus
public void buildCampus()
- Macro to build the initial campus walkways
paint
public void paint(Graphics g)
- Paints the canvas with the graph, and select rectangle (if visible),
and sketch line (if creating an edge).
Double buffering is done here
- Parameters:
- g - graphics context
- Overrides:
- paint in class Canvas
resize
public void resize(int newsize)
- Resize all the nodes on the display
- Parameters:
- newsize - new node size