Class PickMarker

java.lang.Object
  |
  +--PickMarker

public class PickMarker
extends java.lang.Object
implements java.util.Observer

Graphical representation of a Phase. PickMarker is an Observer: its update() method will be called whenever the Phase it represents is modifed.

Model = Phase Class

Controller = ZoomedWFPanel Class

View = PickMarker Class


Field Summary
 java.lang.String description
           
 
Constructor Summary
PickMarker(WFPanel wfPanel, Phase phase)
          Create a PickMarker of an existing phase
PickMarker(WFPanel wfPanel, java.awt.Point pnt)
          Create a PickMarker and create a new Phase at the given point in the WFPanel
 
Method Summary
 boolean contains(int x, int y)
           
 boolean contains(java.awt.Point pt)
           
 void draw(java.awt.Graphics g)
           
 int getX()
           
 int gety()
           
 boolean isNew()
           
 void redraw()
          Force a redraw.
 void set(Phase phase)
          Set/reset the phase for this marker
 void setActive(boolean tf)
           
 void setBackgroundColor(java.awt.Color clr)
           
 void setLocation(int x)
          Move the pick marker to this location on the x-axis and repaint to show the move.
 void setLocation(int x, int y)
          Put marker at this location in parent container coordinates (pixels).
 void setLocation(java.awt.Point pnt)
          Put marker at this location in parent container coordinates (pixels).
 void setNew(boolean tf)
          Set/unset isNew flag.
 void setTextColor(java.awt.Color clr)
           
 void translate(int x, int y)
          Translate the pick marker by this (x, y) offset and repaint to show the move.
 void undraw()
           
 void update(java.util.Observable ob, java.lang.Object arg)
          MVC support.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

description

public java.lang.String description
Constructor Detail

PickMarker

public PickMarker(WFPanel wfPanel,
                  Phase phase)
Create a PickMarker of an existing phase

PickMarker

public PickMarker(WFPanel wfPanel,
                  java.awt.Point pnt)
Create a PickMarker and create a new Phase at the given point in the WFPanel
Method Detail

set

public void set(Phase phase)
Set/reset the phase for this marker

setNew

public void setNew(boolean tf)
Set/unset isNew flag.

setLocation

public void setLocation(int x,
                        int y)
Put marker at this location in parent container coordinates (pixels). Only the x-axis matters.

setLocation

public void setLocation(java.awt.Point pnt)
Put marker at this location in parent container coordinates (pixels). Only the x-axis matters.

getX

public int getX()

gety

public int gety()

isNew

public boolean isNew()

setBackgroundColor

public void setBackgroundColor(java.awt.Color clr)

setTextColor

public void setTextColor(java.awt.Color clr)

setActive

public void setActive(boolean tf)

contains

public boolean contains(int x,
                        int y)

contains

public boolean contains(java.awt.Point pt)

redraw

public void redraw()
Force a redraw. If phase has changed reset position, color, and description.

setLocation

public void setLocation(int x)
Move the pick marker to this location on the x-axis and repaint to show the move. Note that the WFPanel.paint() method does the actual drawing.

translate

public void translate(int x,
                      int y)
Translate the pick marker by this (x, y) offset and repaint to show the move.

draw

public void draw(java.awt.Graphics g)

undraw

public void undraw()

update

public void update(java.util.Observable ob,
                   java.lang.Object arg)
MVC support. This method is called whenever the Phase this PickMarker represents declares that it has changed.
Specified by:
update in interface java.util.Observer