net.sourceforge.swtlayeredgraph
Interface IGraphGridLayer

All Known Implementing Classes:
GraphGridLayer

public interface IGraphGridLayer

Author:
davija

Method Summary
 void addChangeListener(ChangeListener listener)
          Subscribes to change events.
 void draw(GCTransformer transformer)
          Draws the grid.
 org.eclipse.swt.graphics.Color getColor()
          Gets the line color for the grid.
 CoordinateType getCoordinateType()
          Gets the coordinate type for x/y increments.
 java.lang.Double getXInterval()
          Gets the X interval.
 int getXLineMultiplier()
          Gets the x line multiplier.
 int getXLineMultiplierWidth()
          Gets the with of lines that match the x multiplier.
 LineStyle getXLineStyle()
          Gets the line style for horizontal lines.
 int getXLineWidth()
          Gets the horizontal line width in pixels.
 java.lang.Double getYInterval()
          Gets the Y interval.
 int getYLineMultiplier()
          Gets the y line multiplier.
 int getYLineMultiplierWidth()
          Gets the with of lines that match the x multiplier.
 LineStyle getYLineStyle()
          Gets the line style for vertical lines.
 int getYLineWidth()
          Gets the vertical line width in pixels.
 java.lang.Boolean isVisible()
          Checks if the grid is visible.
 void removeChangeListener(ChangeListener listener)
          Removes subscription to change events.
 void setColor(org.eclipse.swt.graphics.Color color)
          Sets the line color.
 void setCoordinateType(CoordinateType type)
          Sets the coordinate type of the x/y intervals.
 void setVisible(java.lang.Boolean visible)
          Sets the visibility flag for the grid.
 void setXInterval(java.lang.Double interval)
          Sets the X interval (vertical line spacing).
 void setXLineMultiplier(int multiplier)
          Sets the new x line multiplier.
 void setXLineMultiplierWidth(int width)
          Sets the width of lines that match the y multiplier.
 void setXLineStyle(LineStyle lineStyle)
          Sets the line style for horizontal lines.
 void setXLineWidth(int width)
          Sets the width (in pixels) of horizontal lines.
 void setYInterval(java.lang.Double interval)
          Sets the Y interval (horizontal line spacing).
 void setYLineMultiplier(int multiplier)
          Sets the new y line multiplier.
 void setYLineMultiplierWidth(int width)
          Sets the width of lines that match the y multiplier.
 void setYLineStyle(LineStyle lineStyle)
          Sets the line style for vertical lines.
 void setYLineWidth(int width)
          Sets the width (in pixels) of vertical lines.
 

Method Detail

draw

void draw(GCTransformer transformer)
Draws the grid.

Parameters:
transformer - Transformer that contains the GC to draw on.
Throws:
java.lang.IllegalArgumentException - If transformer is null.

getColor

org.eclipse.swt.graphics.Color getColor()
Gets the line color for the grid.

Returns:
Returns line color.

getCoordinateType

CoordinateType getCoordinateType()
Gets the coordinate type for x/y increments.

Returns:

isVisible

java.lang.Boolean isVisible()
Checks if the grid is visible.

Returns:
Returns true if visible, false otherwise.

getXInterval

java.lang.Double getXInterval()
Gets the X interval.

Returns:
Returns the X interval.

getXLineStyle

LineStyle getXLineStyle()
Gets the line style for horizontal lines.

Returns:
Returns the line style for horizontal lines.

getXLineWidth

int getXLineWidth()
Gets the horizontal line width in pixels.

Returns:
Returns the horizontal line width in pixels.

getXLineMultiplier

int getXLineMultiplier()
Gets the x line multiplier. Lines that match this interval are drawn with the multiplier width.

Returns:
Returns the x line multiplier.

setXLineMultiplier

void setXLineMultiplier(int multiplier)
Sets the new x line multiplier. Lines that match this interval are drawn with the multiplier width. Multiplier of zero disables multiplier.

Parameters:
multiplier - New multiplier.

getXLineMultiplierWidth

int getXLineMultiplierWidth()
Gets the with of lines that match the x multiplier.

Returns:
Returns the width of lines that match the x multiplier.

setXLineMultiplierWidth

void setXLineMultiplierWidth(int width)
Sets the width of lines that match the y multiplier.

Parameters:
width - New multiplier.
Throws:
java.lang.IllegalArgumentException - If width <= 0.

getYLineMultiplier

int getYLineMultiplier()
Gets the y line multiplier. Lines that match this interval are drawn with the multiplier width.

Returns:
Returns the y line multiplier.

setYLineMultiplier

void setYLineMultiplier(int multiplier)
Sets the new y line multiplier. Lines that match this interval are drawn with the multiplier width. Multiplier of zero disables multiplier.

Parameters:
multiplier - New multiplier.

getYLineMultiplierWidth

int getYLineMultiplierWidth()
Gets the with of lines that match the x multiplier.

Returns:
Returns the width of lines that match the y multiplier.

setYLineMultiplierWidth

void setYLineMultiplierWidth(int width)
Sets the width of lines that match the y multiplier.

Parameters:
width - New multiplier.
Throws:
java.lang.IllegalArgumentException - If width <= 0.

getYInterval

java.lang.Double getYInterval()
Gets the Y interval.

Returns:
Returns the Y interval.

getYLineStyle

LineStyle getYLineStyle()
Gets the line style for vertical lines.

Returns:
Returns the line style for horizontal lines.

getYLineWidth

int getYLineWidth()
Gets the vertical line width in pixels.

Returns:
Returns the vertical line width in pixels.

setColor

void setColor(org.eclipse.swt.graphics.Color color)
Sets the line color. Note that grid will not assume ownership of the color object. Proper disposal is the responsibility of the caller.

Parameters:
color - New color to use for grid.
Throws:
java.lang.IllegalArgumentException - If color is null.

setCoordinateType

void setCoordinateType(CoordinateType type)
Sets the coordinate type of the x/y intervals. This will also convert the x/y intervals to the specified type.

Parameters:
type - New coordinate system type.
Throws:
java.lang.IllegalArgumentException - If type is null.

setVisible

void setVisible(java.lang.Boolean visible)
Sets the visibility flag for the grid.

Parameters:
visible - Flag to indicate if grid is visible.
Throws:
java.lang.IllegalArgumentException - If visible is null.

setXInterval

void setXInterval(java.lang.Double interval)
Sets the X interval (vertical line spacing).

Parameters:
interval - Distance between vertical lines.
Throws:
java.lang.IllegalArgumentException - If interval is null or interval <= 0.

setXLineStyle

void setXLineStyle(LineStyle lineStyle)
Sets the line style for horizontal lines.

Parameters:
lineStyle - Line style for horizontal lines.
Throws:
java.lang.IllegalArgumentException - If lineStyle is null.

setXLineWidth

void setXLineWidth(int width)
Sets the width (in pixels) of horizontal lines.

Parameters:
width - Width (in pixels) of horizontal lines.
Throws:
java.lang.IllegalArgumentException - If width <= 0.

setYInterval

void setYInterval(java.lang.Double interval)
Sets the Y interval (horizontal line spacing).

Parameters:
interval - Distance between horizontal lines.
Throws:
java.lang.IllegalArgumentException - If interval <= 0 or null.

setYLineStyle

void setYLineStyle(LineStyle lineStyle)
Sets the line style for vertical lines.

Parameters:
lineStyle - Line style for vertical lines.
Throws:
java.lang.IllegalArgumentException - If lineStyle is null.

setYLineWidth

void setYLineWidth(int width)
Sets the width (in pixels) of vertical lines.

Parameters:
width - Width (in pixels) of vertical lines.
Throws:
java.lang.IllegalArgumentException - If width <= 0.

removeChangeListener

void removeChangeListener(ChangeListener listener)
Removes subscription to change events.

Parameters:
listener - Listener to unregister.
Throws:
java.lang.IllegalArgumentException - If listener is null.

addChangeListener

void addChangeListener(ChangeListener listener)
Subscribes to change events.

Parameters:
listener - Listener to call when a change occurs.
Throws:
java.lang.IllegalArgumentException - If listener is null.


Copyright © 2009. All Rights Reserved.