ChartCat 1.2

li.netcat.chart.util
Class BorderPart

java.lang.Object
  extended byli.netcat.chart.util.AbstractPart
      extended byli.netcat.chart.util.BorderPart
All Implemented Interfaces:
Part

public class BorderPart
extends AbstractPart

Represents a border that looks for example like this:

The gray background, the solid line and the insets between legend part and line are defined by this BorderPart. In contrast to Swing, the look of the border is defined by a Pen.

Author:
Arthur Marxer

Field Summary
 
Fields inherited from class li.netcat.chart.util.AbstractPart
BACKGROUND, FOREGROUND, PERSPECTIVE
 
Constructor Summary
BorderPart(Part part)
          Constructs a new BorderPart around the given Part using the pen Pen.getDefaultCapSquare(), no background and default insets.
BorderPart(Part part, Pen pen)
          Constructs a new BorderPart around the given Part using the given pen.
 
Method Summary
 java.awt.Paint getBackgroundPaint()
          Returns the background paint.
 int getBottom()
          Returns the bottom inset.
 Layout getLayout(java.awt.Graphics g)
          Returns an instance of a layout that is able to report the bounds of this part and is able to paint this part.
 int getLeft()
          Returns the left inset.
 Part getPart()
          Returns the wrapped Part.
 Pen getPen()
          Returns the pen that is used to paint the border and the background.
 int getRight()
          Returns the right inset.
 int getTop()
          Returns the top inset.
 void setBackgroundPaint(java.awt.Paint paint)
          Sets the background paint.
 void setChart(Chart chart)
          Sets the container of this part.
 void setInsets(int top, int left, int bottom, int right)
          Sets the insets to this border part.
 void setPart(Part part)
          Sets the wrapped Part.
 void setPen(Pen pen)
          Sets the pen that is used to paint the borderand the background.
 
Methods inherited from class li.netcat.chart.util.AbstractPart
getChart, getPerspective, invalidate, setPerspective
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BorderPart

public BorderPart(Part part)
Constructs a new BorderPart around the given Part using the pen Pen.getDefaultCapSquare(), no background and default insets.

Parameters:
part - The wrapped part, not null.

BorderPart

public BorderPart(Part part,
                  Pen pen)
Constructs a new BorderPart around the given Part using the given pen. The fill and draw colors are defined by the pen.

Parameters:
part - The wrapped part, not null.
pen - The pen that specifies the border and the background paint, not null.
Method Detail

getPart

public Part getPart()
Returns the wrapped Part.

Returns:
The wrapped Part, it's never null.

setPart

public void setPart(Part part)
Sets the wrapped Part.

Parameters:
part - The wrapped part, not null.

getBackgroundPaint

public java.awt.Paint getBackgroundPaint()
Returns the background paint. The default is null.

Returns:
The background paint, or null if no background is specified.

setBackgroundPaint

public void setBackgroundPaint(java.awt.Paint paint)
Sets the background paint.


getPen

public Pen getPen()
Returns the pen that is used to paint the border and the background.

Returns:
The pen that paints the border, never null.

setPen

public void setPen(Pen pen)
Sets the pen that is used to paint the borderand the background.

Parameters:
pen - The pen that paints the border, not null.

getTop

public int getTop()
Returns the top inset.

Returns:
The top inset.

getLeft

public int getLeft()
Returns the left inset.

Returns:
The left inset.

getBottom

public int getBottom()
Returns the bottom inset.

Returns:
The bottom inset.

getRight

public int getRight()
Returns the right inset.

Returns:
The right inset.

setInsets

public void setInsets(int top,
                      int left,
                      int bottom,
                      int right)
Sets the insets to this border part. The insets are measured from the bounds of the wrapped part to the middle of the pen.

Parameters:
top - The top inset.
left - The left inset.
bottom - The bottom inset.
right - The right inset.

setChart

public void setChart(Chart chart)
Description copied from interface: Part
Sets the container of this part. This method should not be called by custom code. It gets called when this Part is added to a chart by calling chart.setContent(part);. Implementers of parts must keep this reference and invoke for example chart.invalidate() when a property in this part changes.

Specified by:
setChart in interface Part
Overrides:
setChart in class AbstractPart

getLayout

public Layout getLayout(java.awt.Graphics g)
Description copied from interface: Part
Returns an instance of a layout that is able to report the bounds of this part and is able to paint this part.

Parameters:
g - The relevant graphics object.
Returns:
A layout that is able to report the bounds of this part and is able to paint this part. This method may also return null.

ChartCat 1.2

Copyright © 2003 - 2005 NetCat Inc.. All rights reserved. Feedback

Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print, Chart,Charting,Charts,Java,Java Chart,Java Charting,Java Charts,Chart Java,Charts Java,3D,3D Chart,3Dchart,Graph,Graphs,Chart Graph,Java Graph,Diagram,Diagrams,Java Diagram,Java Diagrams,Curve,Curves,Bar Chart,Pie Chart,Line Chart,Area Chart,Bar Graph,Pie Graph,Line Graph,Java Diagram,Chart Diagram,Package,Library,Chart Library,Chart Engine,Chart Package,Graph Package,Paint,Support,Graphic,Graphics,Print