|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcodeblockutil.StackCard
class StackCard
A StackCard is used by explorers to interface between a CSwing Canvas and a CSwing explorer. An explorer explores Canvases. This is the foundation onto which the factory UI is built. However, an Explorer and a Canvas are two very different objects. One is a high-level CSwing UI that manages the display of internal components and controls the position and visibility of internal components. The other (that is, the Canvas) is a low-level CSwing component that has no control over itself (or at least it shouldn't). An mediator is required to link the two objects together. We solve this interface problem by employing a mediator between an Explorer and a Canvas. That's where a StackCard comes in. A StackCard (whose visibility should be limited within the package) takes commands from it's parent Explorer and directs it's Canvas to follow the commands. In the opposite direction, a drawer also takes in user-generated actions and informs the parent explorer of what had just happed, so that the parent explorer can decide what to do with it.
Constructor Summary | |
---|---|
StackCard(Canvas canvas)
Constructs new StackCard with a parent Explorer |
|
StackCard(Canvas canvas,
StackExplorer explorer)
Constucts a new StackCard with an explorer |
Method Summary | |
---|---|
(package private) void |
animate()
|
(package private) java.awt.Rectangle |
getDestination()
|
(package private) javax.swing.JComponent |
getJComponent()
|
(package private) java.awt.Rectangle |
getOrigin()
|
(package private) void |
goToDestination()
move to destination |
(package private) void |
goToOrigin()
move to Origin |
(package private) boolean |
isDirectedToDestination()
True iff directed to DESTINATION |
void |
propertyChange(java.beans.PropertyChangeEvent e)
|
(package private) void |
reformDrawer(java.awt.Rectangle origin,
java.awt.Rectangle destination)
reassigns the source bounds and the destination bounds of this this StackCard. |
(package private) void |
setBounds(int x,
int y,
int width,
int height)
sets the bounds of this drawer |
(package private) void |
setBounds(java.awt.Rectangle r)
sets the bounds of this drawer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
StackCard(Canvas canvas)
canvas
- StackCard(Canvas canvas, StackExplorer explorer)
canvas
- explorer
-
java.lang.RuntimeException
- if canvas==null || canvas.name==null
|| canvas.JCOmponent == nullMethod Detail |
---|
public void propertyChange(java.beans.PropertyChangeEvent e)
propertyChange
in interface java.beans.PropertyChangeListener
boolean isDirectedToDestination()
void setBounds(java.awt.Rectangle r)
r
- void setBounds(int x, int y, int width, int height)
x
- y
- width
- height
- java.awt.Rectangle getDestination()
java.awt.Rectangle getOrigin()
javax.swing.JComponent getJComponent()
void reformDrawer(java.awt.Rectangle origin, java.awt.Rectangle destination)
origin
- destination
- void goToOrigin()
void goToDestination()
void animate()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |