|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectprioritizer.PlanningGame
Defines the Planning Game prioritization method.
Nested Class Summary | |
(package private) class |
PlanningGame.Card
Defines a Card representing a Requirement in the Planning Game method |
(package private) class |
PlanningGame.Pile
Defines a Pile where the cards can be put |
Field Summary | |
static int |
CARD_HEIGHT
|
static int |
CARD_WIDTH
|
private java.util.LinkedList |
cardsInCurrentPile
|
private java.util.LinkedList |
cardsOnDeskList
|
private javax.swing.JPanel |
desk
|
static int |
DESK
|
private int |
deskHeight
|
private int |
deskWidth
|
private int |
dx
|
private int |
dy
|
private PlanningGame.Pile |
high
|
static int |
HIGH
|
private PlanningGame.Pile |
low
|
static int |
LOW
|
private PlanningGame.Pile |
medium
|
static int |
MEDIUM
|
private int |
oldX
|
private int |
oldY
|
private java.util.Random |
rand
|
private RequirementList |
rList
|
private PlanningGame.Card |
selectedCard
|
private java.util.LinkedList |
selectedCardsList
|
Constructor Summary | |
PlanningGame(RequirementList rList)
Constructor for the Planning Game technique. |
Method Summary | |
void |
addCardToSelectionList(java.awt.Point p)
|
void |
deselectCard()
Deselects the selected Card. |
void |
drawDesk(java.awt.Graphics g,
javax.swing.JPanel c)
Draws all the cards and piles on the desk |
void |
drawPile(java.awt.Graphics g,
int pileType)
Draws the cards in the specified Pile. |
int |
getDx()
Gets the horizontal distance between the left edge of the card and the clicked position. |
int |
getDy()
Gets the vertical distance between the upper edge of the card and the clicked position. |
int |
getNbrOfCardsInCurrentPile()
Gets the number of cards in he currently selected Pile. |
int |
getNbrOfCardsOnDesk()
Gets the number of cards on the desk. |
java.util.LinkedList |
getPile(java.lang.String pileName)
Gets the LinkedList representing the specified Pile. |
Requirement |
getRequirement(java.lang.String pileName,
int i)
Gets the Requirement at the specified index in the specified Pile. |
Requirement |
getRequirementAt(java.awt.Point p,
int pileType)
Tries to get the Requirement on the desk or in a Pile at the specified position. |
RequirementList |
getRequirementList()
Gets the list containing all the requirements to be prioritized. |
private void |
highlight(PlanningGame.Card c)
Highlights a Card |
private void |
highlight(PlanningGame.Pile p)
Highlights a Pile. |
void |
makeCards(int deskWidth,
int deskHeight)
Create a Card for each Requirement and assign a random position, within the specified drawing area limits. |
void |
moveCardToEmptyPlace()
Moves away a card to an empty place in the pile. |
void |
moveSelectedCardsTo(int x,
int y,
java.awt.Dimension deskSize)
Moves all cards in the selection square when they are dragged. |
void |
moveSelectedInPileTo(int y,
int pileType)
Moves the selected card to a new position in the Pile when dragged & dropped. |
void |
moveSelectedTo(int x,
int y,
java.awt.Dimension dim)
Moves the selected card to a new position on the desk. |
boolean |
putCardInPile()
Removes the selected card from the desk and adds it to the highlighted pile. |
Requirement |
select(int x,
int y,
int pileType)
Tries to select a Card on the desk or in a Pile at the specified position. |
void |
selectCardsInSelectionSquare(java.awt.Point startPoint,
java.awt.Point endPoint)
Selects all the cards withing the user-drawn selection square. |
java.lang.Object[] |
selectPile(int x,
int y)
Tries to select a pile at the given position. |
void |
sendToDesk(int pileType)
Sends the selected card in the specified Pile, to the desk. |
void |
setCurrentPrioritiesAndShuffle(java.lang.String criteria,
boolean skipPriorities)
Rank the requirements by the order in the planning game lists. |
private void |
setRandomCardPosition(PlanningGame.Card c)
Sets a random position on the screen, for the Card to be drawn at |
private void |
unhighlight(PlanningGame.Card c)
Unhighlights a Card. |
private void |
unhighlight(PlanningGame.Pile p)
Unhighlists a Pile. |
void |
unhighlightAllPiles()
Unhighlights all piles. |
private void |
unhighlightAndUnselectAllCards()
Unhighlights all cards |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int CARD_WIDTH
public static final int CARD_HEIGHT
public static final int HIGH
public static final int MEDIUM
public static final int LOW
public static final int DESK
private java.util.LinkedList cardsOnDeskList
private java.util.LinkedList cardsInCurrentPile
private javax.swing.JPanel desk
private int deskWidth
private int deskHeight
private int dx
private int dy
private PlanningGame.Pile high
private PlanningGame.Pile medium
private PlanningGame.Pile low
private int oldX
private int oldY
private java.util.Random rand
private RequirementList rList
private PlanningGame.Card selectedCard
private java.util.LinkedList selectedCardsList
Constructor Detail |
public PlanningGame(RequirementList rList)
rList
- the RequirementList containing the Requirements to be
prioritizedMethod Detail |
private void highlight(PlanningGame.Card c)
c
- the Card to highlightprivate void highlight(PlanningGame.Pile p)
p
- the Pile to highlightprivate void setRandomCardPosition(PlanningGame.Card c)
c
- the Card to set the randomized position forprivate void unhighlight(PlanningGame.Card c)
c
- the Card to unhighlightprivate void unhighlightAndUnselectAllCards()
private void unhighlight(PlanningGame.Pile p)
p
- the Pile to unhighlightpublic void deselectCard()
public void drawDesk(java.awt.Graphics g, javax.swing.JPanel c)
g
- the graphics component to use for drawingc
- the panel (desk) to draw uponpublic void drawPile(java.awt.Graphics g, int pileType)
g
- the graphics component to use for drawingpileType
- the pile to be drawn, HIGH, MEDIUM or LOWpublic int getDx()
public int getDy()
public int getNbrOfCardsInCurrentPile()
public int getNbrOfCardsOnDesk()
public java.util.LinkedList getPile(java.lang.String pileName)
pileName
- the specified Pile
public Requirement getRequirement(java.lang.String pileName, int i)
pileName
- the Pile to ge the Requirement fromi
- the index of the requirement in the Pile
public RequirementList getRequirementList()
public void makeCards(int deskWidth, int deskHeight)
deskWidth
- the width of the drawing areadeskHeight
- the height of the drawing areapublic void moveCardToEmptyPlace()
public void moveSelectedInPileTo(int y, int pileType)
y
- the vertical position where the card is droppedpileType
- the pile in which the card is being movedpublic void moveSelectedTo(int x, int y, java.awt.Dimension dim)
x
- the horizontal position of the mouse pointery
- the vertical position of the mouse pointerpublic void moveSelectedCardsTo(int x, int y, java.awt.Dimension deskSize)
x
- the x-position of the mouse pointery
- the y-position of the mouse pointerdeskSize
- the size of the desk's drawing areapublic boolean putCardInPile()
public Requirement select(int x, int y, int pileType)
x
- the horizontal position of the mouse pointery
- the vertical position of the mouse pointerpileType
- HIGH, MEDIUM, LOW or DESK depending on where the card is
public void addCardToSelectionList(java.awt.Point p)
public Requirement getRequirementAt(java.awt.Point p, int pileType)
p
- the specified positionpileType
- HIGH, MEDIUM, LOW or DESK depending on where the card is
public void selectCardsInSelectionSquare(java.awt.Point startPoint, java.awt.Point endPoint)
startPoint
- upper left corner in the selection squareendPoint
- lower righti corner in the selection squarepublic java.lang.Object[] selectPile(int x, int y)
x
- the horizontal position of the mouse pointery
- the vertical position of the mouse pointer
public void sendToDesk(int pileType)
pileType
- the specified Pilepublic void setCurrentPrioritiesAndShuffle(java.lang.String criteria, boolean skipPriorities)
criteria
- the current prioritization criteriaskipPriorities
- true if priorities are set by $100 methodpublic void unhighlightAllPiles()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |