org.tigris.gef.base
Class LayerPageBreaks

java.lang.Object
  extended by org.tigris.gef.base.Layer
      extended by org.tigris.gef.base.LayerPageBreaks
All Implemented Interfaces:
java.io.Serializable

public class LayerPageBreaks
extends Layer

Paint horizontal and vertical lines showing page braks for printing. This feature is common to many drawing applications (e.g., MacDraw). LayerPageBreaks is a Layer, just like any other so it can be composed, hidden, and reordered.

See Also:
Serialized Form

Field Summary
protected  java.awt.Color _color
          The color of the grid lines or dots.
protected  java.awt.Dimension _pageSize
          The size of the page in pixels.
 int DASH_LENGTH
          The size of the dashes drawn when the Fig is dashed.
 int GAP_LENGTH
           
 
Fields inherited from class org.tigris.gef.base.Layer
_editors, _onMenu
 
Constructor Summary
LayerPageBreaks()
           
 
Method Summary
 void adjust()
          Toggle whether page break lines are drawn on the screen.
protected  int drawDashedLine(java.awt.Graphics g, int phase, int x1, int y1, int x2, int y2)
           
 java.util.Collection getContents(java.util.Collection c)
          Get the figs that make up this layer.
 void paintContents(java.awt.Graphics g)
          Paint the PageBreaks lines or dots by repeatedly bitblting a precomputed 'stamp' onto the given Graphics
 Fig presentationFor(java.lang.Object obj)
          Given an object from the net-level model (e.g., NetNode or NetPort), reply the graphical depiction of that object in this layer, if there is one.
 void setPageSize(java.awt.Dimension d)
          Set the size of the page in pixels.
 
Methods inherited from class org.tigris.gef.base.Layer
add, addEditor, bringForward, bringInFrontOf, bringToFront, calcDrawingArea, clone, damageAll, deleted, elements, elementsIn, getContents, getContentsEdgesOnly, getContentsNoEdges, getEditors, getGrayed, getHidden, getLocked, getName, getOnMenu, getPerspectiveType, getScale, hit, isAlwaysOnTop, nodesIn, paint, paint, paintContents, paintGrayContents, postLoad, postSave, preSave, print, refreshEditors, remove, removeAll, removeEditor, reorder, sendBackward, sendToBack, setAlwaysOnTop, setGrayed, setHidden, setLocked, setName, setOnMenu, setPerspectiveType, setScale, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DASH_LENGTH

public final int DASH_LENGTH
The size of the dashes drawn when the Fig is dashed.

See Also:
Constant Field Values

GAP_LENGTH

public final int GAP_LENGTH
See Also:
Constant Field Values

_color

protected java.awt.Color _color
The color of the grid lines or dots.


_pageSize

protected java.awt.Dimension _pageSize
The size of the page in pixels. Needs-More-Work: this is a hack. To get the true page size I need to start a print job!

Constructor Detail

LayerPageBreaks

public LayerPageBreaks()
Method Detail

setPageSize

public void setPageSize(java.awt.Dimension d)
Set the size of the page in pixels.


getContents

public java.util.Collection getContents(java.util.Collection c)
Description copied from class: Layer
Get the figs that make up this layer.

Specified by:
getContents in class Layer
Parameters:
c - the collection in which to place the edges or null if a new collection should be created
Returns:
the figs

presentationFor

public Fig presentationFor(java.lang.Object obj)
Description copied from class: Layer
Given an object from the net-level model (e.g., NetNode or NetPort), reply the graphical depiction of that object in this layer, if there is one. Otherwise reply null.

Specified by:
presentationFor in class Layer

paintContents

public void paintContents(java.awt.Graphics g)
Paint the PageBreaks lines or dots by repeatedly bitblting a precomputed 'stamp' onto the given Graphics

Specified by:
paintContents in class Layer

drawDashedLine

protected int drawDashedLine(java.awt.Graphics g,
                             int phase,
                             int x1,
                             int y1,
                             int x2,
                             int y2)

adjust

public void adjust()
Toggle whether page break lines are drawn on the screen. Needs-More-Work: Eventually this will open a dialog box to set all parameters.

Overrides:
adjust in class Layer
See Also:
LayerGrid