JIDE 3.5.15

com.jidesoft.plaf.basic
Class BasicGanttEntryRelationPainter

java.lang.Object
  extended by com.jidesoft.plaf.basic.BasicGanttEntryRelationPainter
All Implemented Interfaces:
GanttEntryRelationPainter
Direct Known Subclasses:
BasicGanttChartUI.BasicRelationPainter

public class BasicGanttEntryRelationPainter
extends Object
implements GanttEntryRelationPainter

The painter class to paint the relation between entries.


Constructor Summary
BasicGanttEntryRelationPainter(int width)
          The constructor.
BasicGanttEntryRelationPainter(int width, Shape startShape, Shape endShape, Insets entryPadding)
          The constructor.
 
Method Summary
protected  boolean checkValidRange(Range<?> range)
          Checks if the range is valid.
protected  Point2D getAttachPoint(Graphics2D graphics, GanttChart<Object,GanttEntry<Object>> ganttChart, Rectangle entryRect, int row, boolean start)
          Gets the attach point.
protected  Point2D getEndPoint(Graphics2D g2d, GanttChart<Object,GanttEntry<Object>> ganttChart, Point2D attachPoint, boolean fromStart, double width)
          Gets the end point.
 Shape getEndShape()
          Gets the end shape.
 Paint getEndShapeFillPaint()
          Gets the end shape fill paint.
 Paint getEndShapeOutlinePaint()
          Gets the end shape outline paint.
 Stroke getEndShapeStroke()
          Gets the end shape stroke.
 Insets getGroupOffSet()
          Gets the group offset.
protected  int getIndexOf(GanttChart<Object,GanttEntry<Object>> ganttChart, GanttEntry<Object> entry)
          Gets the index of the entry.
 Paint getInvalidLinePaint()
          Gets the invalid line paint.
 Stroke getInvalidLineStroke()
          Gets the invalid line stroke.
 Stroke getInvisibleStroke()
          Gets the invisible stroke.
 Paint getLinePaint()
          Gets the line paint.
 Stroke getLineStroke()
          Gets the line stroke.
 Insets getMilestoneOffSet()
          Gets the milestone offset.
protected  Point2D getRowBoundaryPoint(Graphics2D g2d, GanttChart<Object,GanttEntry<Object>> ganttChart, Rectangle fromEntryRect, int fromRow, Point2D fromPoint, Rectangle toEntryRect, int toRow, Point2D toPoint, int type, boolean forwards)
          Gets the boundary point for the row.
 Shape getStartShape()
          Gets the start shape.
 Paint getStartShapeFillPaint()
          Gets the start shape fill paint.
 Paint getStartShapeOutlinePaint()
          Gets the start shape outline paint.
 Stroke getStartShapeStroke()
          Gets the start shape stroke.
 int getWidth()
          Gets the width.
 boolean isConnectToParent()
          Gets the flag indicating if the relation should connect to the parent.
protected  boolean isRelationValid(GanttChart<Object,GanttEntry<Object>> ganttChart, GanttEntryRelation<GanttEntry<Object>> relation)
          Checks if the relation is valid.
protected  void paintLine(Graphics2D graphics, Shape path, boolean valid, Stroke validStroke, Paint validPaint, Stroke invalidStroke, Paint invalidPaint)
          Paints the line.
 void paintRelation(Graphics graphics, GanttChart<Object,GanttEntry<Object>> ganttChart, GanttEntryRelation<GanttEntry<Object>> relation, boolean selected, boolean focused)
           
protected  void paintShape(Graphics2D graphics, GanttChart<Object,GanttEntry<Object>> entry, Point2D attachPoint, Shape shape, Stroke shapeOutlineStroke, Paint shapeOutlinePaint, Paint shapeFillPaint)
          Paints the shape.
 void setConnectToParent(boolean connectToParent)
          Sets the flag indicating if the relation should connect to the parent.
 void setEndShape(Shape endShape)
          Sets the end shape.
 void setEndShapeFillPaint(Paint endShapeFillPaint)
          Sets the end shape fill paint.
 void setEndShapeOutlinePaint(Paint endShapeOutlinePaint)
          Sets the end shape outline paint.
 void setEndShapeStroke(Stroke endShapeStroke)
          Sets the end shape stroke.
 void setGroupOffset(Insets groupOffset)
          Sets the group offset.
 void setInvalidLinePaint(Paint invalidLinePaint)
          Sets the invalid line paint.
 void setInvalidLineStroke(Stroke invalidLineStroke)
          Sets the invalid line stroke.
 void setInvisibleStroke(Stroke invisibleStroke)
          Sets the invisible stroke.
 void setLinePaint(Paint linePaint)
          Sets the line paint.
 void setLineStroke(Stroke lineStroke)
          Sets the line stroke.
 void setMilestoneOffset(Insets milestoneOffset)
          Sets the milestone offset.
 void setStartShape(Shape startShape)
          Sets the start shape.
 void setStartShapeFillPaint(Paint startShapeFillPaint)
          Sets the start shape fill paint.
 void setStartShapeOutlinePaint(Paint startShapeOutlinePaint)
          Sets the start shape outline paint.
 void setStartShapeStroke(Stroke startShapeStroke)
          Sets the start shape stroke.
 void setWidth(int width)
          Sets the width.
protected  Shape transformShape(Graphics2D g2d, GanttChart<Object,GanttEntry<Object>> entry, Shape shape, boolean forwards)
          Transforms shape.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicGanttEntryRelationPainter

public BasicGanttEntryRelationPainter(int width)
The constructor.

Parameters:
width - the width

BasicGanttEntryRelationPainter

public BasicGanttEntryRelationPainter(int width,
                                      Shape startShape,
                                      Shape endShape,
                                      Insets entryPadding)
The constructor.

Parameters:
width - the width
startShape - the start shape
endShape - the end shape
entryPadding - the entry padding
Method Detail

paintRelation

public void paintRelation(Graphics graphics,
                          GanttChart<Object,GanttEntry<Object>> ganttChart,
                          GanttEntryRelation<GanttEntry<Object>> relation,
                          boolean selected,
                          boolean focused)
Specified by:
paintRelation in interface GanttEntryRelationPainter

paintLine

protected void paintLine(Graphics2D graphics,
                         Shape path,
                         boolean valid,
                         Stroke validStroke,
                         Paint validPaint,
                         Stroke invalidStroke,
                         Paint invalidPaint)
Paints the line.

Parameters:
graphics - the Graphics2D instance
path - the shape
valid - if the line is valid
validStroke - the valid stroke
validPaint - the valid paint
invalidStroke - the invalid stroke
invalidPaint - the invalid paint

isRelationValid

protected boolean isRelationValid(GanttChart<Object,GanttEntry<Object>> ganttChart,
                                  GanttEntryRelation<GanttEntry<Object>> relation)
Checks if the relation is valid.

Parameters:
ganttChart - the gantt chart
relation - the relation
Returns:
true if the relation is valid. Otherwise false.

checkValidRange

protected boolean checkValidRange(Range<?> range)
Checks if the range is valid.

Parameters:
range - the range
Returns:
true if the range is valid. Otherwise false.

getIndexOf

protected int getIndexOf(GanttChart<Object,GanttEntry<Object>> ganttChart,
                         GanttEntry<Object> entry)
Gets the index of the entry.

Parameters:
ganttChart - the gantt chart
entry - the gantt entry
Returns:
the index.

paintShape

protected void paintShape(Graphics2D graphics,
                          GanttChart<Object,GanttEntry<Object>> entry,
                          Point2D attachPoint,
                          Shape shape,
                          Stroke shapeOutlineStroke,
                          Paint shapeOutlinePaint,
                          Paint shapeFillPaint)
Paints the shape.

Parameters:
graphics - the Graphics2D instance
entry - the gantt entry
attachPoint - the attach point
shape - the shape
shapeOutlineStroke - the shape outline stroke
shapeOutlinePaint - the shape outline paint
shapeFillPaint - the shape fill paint

transformShape

protected Shape transformShape(Graphics2D g2d,
                               GanttChart<Object,GanttEntry<Object>> entry,
                               Shape shape,
                               boolean forwards)
Transforms shape.

Parameters:
g2d - the Graphics2D instance
entry - the gantt entry
shape - the shape
forwards - the forward/backward flag
Returns:
the transformed shape

getEndPoint

protected Point2D getEndPoint(Graphics2D g2d,
                              GanttChart<Object,GanttEntry<Object>> ganttChart,
                              Point2D attachPoint,
                              boolean fromStart,
                              double width)
Gets the end point.

Parameters:
g2d - the Graphics2D instance
ganttChart - the gantt chart
attachPoint - the attach point
fromStart - the from start/end flag
width - the width
Returns:
the end point.

getRowBoundaryPoint

protected Point2D getRowBoundaryPoint(Graphics2D g2d,
                                      GanttChart<Object,GanttEntry<Object>> ganttChart,
                                      Rectangle fromEntryRect,
                                      int fromRow,
                                      Point2D fromPoint,
                                      Rectangle toEntryRect,
                                      int toRow,
                                      Point2D toPoint,
                                      int type,
                                      boolean forwards)
Gets the boundary point for the row.

Parameters:
g2d - the Graphics2D instance
ganttChart - the gantt chart
fromEntryRect - the from entry rectangle
fromRow - the from row
fromPoint - the end point of relation line attached to the entry
toEntryRect - the to entry rectangle
toRow - the to row
toPoint - the end point of relation line attached to the opposite entry
type - the relation type
forwards - if the row boundary point is to the right of the from attach point
Returns:
The point to which the relation line end point and opposite entry boundary point should be connected.

getAttachPoint

protected Point2D getAttachPoint(Graphics2D graphics,
                                 GanttChart<Object,GanttEntry<Object>> ganttChart,
                                 Rectangle entryRect,
                                 int row,
                                 boolean start)
Gets the attach point.

Parameters:
graphics - the Graphics2D instance
ganttChart - the gantt chart
entryRect - the gantt entry
row - the row
start - the from start/end flag
Returns:
the attach point.

setConnectToParent

public void setConnectToParent(boolean connectToParent)
Sets the flag indicating if the relation should connect to the parent.

Parameters:
connectToParent - the flag

isConnectToParent

public boolean isConnectToParent()
Gets the flag indicating if the relation should connect to the parent.

Returns:
true if should connect. Otherwise false.

getInvisibleStroke

public Stroke getInvisibleStroke()
Gets the invisible stroke.

Returns:
the invisible stroke.

setInvisibleStroke

public void setInvisibleStroke(Stroke invisibleStroke)
Sets the invisible stroke.

Parameters:
invisibleStroke - the invisible stroke

getStartShape

public Shape getStartShape()
Gets the start shape.

Returns:
the start shape.

setStartShape

public void setStartShape(Shape startShape)
Sets the start shape.

Parameters:
startShape - the start shape
Since:
3.3.7

getEndShape

public Shape getEndShape()
Gets the end shape.

Returns:
the end shape.

setEndShape

public void setEndShape(Shape endShape)
Sets the end shape.

Parameters:
endShape - the end shape
Since:
3.3.7

getWidth

public int getWidth()
Gets the width.

Returns:
the width.

setWidth

public void setWidth(int width)
Sets the width.

Parameters:
width - width
Since:
3.3.7

getLineStroke

public Stroke getLineStroke()
Gets the line stroke.

Returns:
the line stroke.

setLineStroke

public void setLineStroke(Stroke lineStroke)
Sets the line stroke.

Parameters:
lineStroke - line stroke
Since:
3.3.7

getLinePaint

public Paint getLinePaint()
Gets the line paint.

Returns:
the line paint.

setLinePaint

public void setLinePaint(Paint linePaint)
Sets the line paint.

Parameters:
linePaint - the line paint
Since:
3.3.7

getInvalidLinePaint

public Paint getInvalidLinePaint()
Gets the invalid line paint.

Returns:
the invalid line paint.

setInvalidLinePaint

public void setInvalidLinePaint(Paint invalidLinePaint)
Sets the invalid line paint.

Parameters:
invalidLinePaint - the invalid line paint
Since:
3.3.7

getInvalidLineStroke

public Stroke getInvalidLineStroke()
Gets the invalid line stroke.

Returns:
the invalid line stroke.

setInvalidLineStroke

public void setInvalidLineStroke(Stroke invalidLineStroke)
Sets the invalid line stroke.

Parameters:
invalidLineStroke - the invalid line stroke
Since:
3.3.7

getStartShapeStroke

public Stroke getStartShapeStroke()
Gets the start shape stroke.

Returns:
the start shape stroke.

setStartShapeStroke

public void setStartShapeStroke(Stroke startShapeStroke)
Sets the start shape stroke.

Parameters:
startShapeStroke - the start shape stroke
Since:
3.3.7

getStartShapeOutlinePaint

public Paint getStartShapeOutlinePaint()
Gets the start shape outline paint.

Returns:
the start shape outline paint.

setStartShapeOutlinePaint

public void setStartShapeOutlinePaint(Paint startShapeOutlinePaint)
Sets the start shape outline paint.

Parameters:
startShapeOutlinePaint - the start shape outline paint
Since:
3.3.7

getStartShapeFillPaint

public Paint getStartShapeFillPaint()
Gets the start shape fill paint.

Returns:
the start shape fill paint.

setStartShapeFillPaint

public void setStartShapeFillPaint(Paint startShapeFillPaint)
Sets the start shape fill paint.

Parameters:
startShapeFillPaint - the start shape fill paint
Since:
3.3.7

getEndShapeStroke

public Stroke getEndShapeStroke()
Gets the end shape stroke.

Returns:
the end shape stroke.

setEndShapeStroke

public void setEndShapeStroke(Stroke endShapeStroke)
Sets the end shape stroke.

Parameters:
endShapeStroke - end shape stroke
Since:
3.3.7

getEndShapeOutlinePaint

public Paint getEndShapeOutlinePaint()
Gets the end shape outline paint.

Returns:
the end shape outline paint.

setEndShapeOutlinePaint

public void setEndShapeOutlinePaint(Paint endShapeOutlinePaint)
Sets the end shape outline paint.

Parameters:
endShapeOutlinePaint - the end shape outline paint
Since:
3.3.7

getEndShapeFillPaint

public Paint getEndShapeFillPaint()
Gets the end shape fill paint.

Returns:
the end shape fill paint.

setEndShapeFillPaint

public void setEndShapeFillPaint(Paint endShapeFillPaint)
Sets the end shape fill paint.

Parameters:
endShapeFillPaint - the end shape fill paint
Since:
3.3.7

getGroupOffSet

public Insets getGroupOffSet()
Gets the group offset.

Returns:
the group offset.

setGroupOffset

public void setGroupOffset(Insets groupOffset)
Sets the group offset.

Parameters:
groupOffset - the group offset
Since:
3.3.7

getMilestoneOffSet

public Insets getMilestoneOffSet()
Gets the milestone offset.

Returns:
the milestone offset.

setMilestoneOffset

public void setMilestoneOffset(Insets milestoneOffset)
Sets the milestone offset.

Parameters:
milestoneOffset - the milestone offset
Since:
3.3.7

JIDE 3.5.15