uci.gef
Class LayerPolar

java.lang.Object
  |
  +--uci.gef.Layer
        |
        +--uci.gef.LayerPolar

public class LayerPolar
extends Layer

This class is an example of the power of the Layer-based approach. This is a kind of background drawing guide (like LayerGrid) that emphasizes polar coordinates (instead of rectangular coordinates).

See Also:
Serialized Form

Field Summary
protected  Color _bgColor
          The color of the space between the lines.
protected  Color _lineColor
          The color of the grid lines
 
Fields inherited from class uci.gef.Layer
_editors, _onMenu
 
Constructor Summary
LayerPolar()
          Construct a new LayerPolar and name it "Grid".
LayerPolar(int x, int y, int s)
          Make a new LayerPolar with the given origin and spacing
 
Method Summary
 void adjust()
          Change the appearance of this layer: vary the spacing and origin.
 Color bgColor()
           
 void bgColor(Color c)
           
 int dist(int x, int y)
          return the integer distance between a given point and the origin
 Vector getContents()
           
 Color lineColor()
           
 void lineColor(Color c)
           
 void origin(int x, int y)
          Set the origin
 void paintContents(Graphics g)
          Paint concentric circles around the origin with each circle a certain spacing from the previous one
 Fig presentationFor(Object obj)
           
 void spacing(int s)
          Set the spacing between lines
 
Methods inherited from class uci.gef.Layer
add, addEditor, bringForward, bringInFrontOf, bringToFront, damaged, deleted, elements, elementsIn, fetHidden, findLayerNamed, getContentsEdgesOnly, getContentsNoEdges, getEditors, getGrayed, getLocked, getName, getOnMenu, getPerspectiveType, hit, nodesIn, paint, paintGrayContents, postLoad, postSave, preSave, print, refreshEditors, remove, removeAll, removeEditor, reorder, sendBackward, sendToBack, setGrayed, setHidden, setLocked, setName, setOnMenu, setPerspectiveType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_lineColor

protected Color _lineColor
The color of the grid lines

_bgColor

protected Color _bgColor
The color of the space between the lines.

Needs-More-Work: null should mean the space between the lines is transparent. But that does not work with image stamps.

Constructor Detail

LayerPolar

public LayerPolar()
Construct a new LayerPolar and name it "Grid". Needs-More-Work: maybe the 'grid' should be named 'drawing guide' instead of 'grid' since 'grid' implies rectilinearity.

LayerPolar

public LayerPolar(int x,
                  int y,
                  int s)
Make a new LayerPolar with the given origin and spacing
Method Detail

origin

public void origin(int x,
                   int y)
Set the origin

spacing

public void spacing(int s)
Set the spacing between lines

dist

public int dist(int x,
                int y)
return the integer distance between a given point and the origin

lineColor

public void lineColor(Color c)

lineColor

public Color lineColor()

bgColor

public void bgColor(Color c)

bgColor

public Color bgColor()

getContents

public Vector getContents()
Overrides:
getContents in class Layer

presentationFor

public Fig presentationFor(Object obj)
Overrides:
presentationFor in class Layer

paintContents

public void paintContents(Graphics g)
Paint concentric circles around the origin with each circle a certain spacing from the previous one
Overrides:
paintContents in class Layer

adjust

public void adjust()
Change the appearance of this layer: vary the spacing and origin. Needs-More-Work: should put up a dialog to ask the user to specify some parameters
Overrides:
adjust in class Layer