Class GanttConnection
- java.lang.Object
-
- org.eclipse.nebula.widgets.ganttchart.GanttConnection
-
- All Implemented Interfaces:
java.lang.Cloneable
public class GanttConnection extends java.lang.Object implements java.lang.Cloneable
This class represents one connection between two events in one direction. You may create a connection by using this class, or do it the slightly easier way by callingGanttChart.addConnection(GanttEvent, GanttEvent)
on theGanttChart
.
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.Color
_color
private GanttComposite
_parent
private GanttEvent
_source
private GanttEvent
_target
-
Constructor Summary
Constructors Constructor Description GanttConnection()
GanttConnection(GanttChart parent, GanttEvent source, GanttEvent target)
Creates a new connection between two events.GanttConnection(GanttChart parent, GanttEvent source, GanttEvent target, org.eclipse.swt.graphics.Color lineColor)
Creates a new connection between two events and gives the connecting line a specific color.GanttConnection(GanttEvent source, GanttEvent target, org.eclipse.swt.graphics.Color color)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
clone()
Clones the GanttConnection (and adds the clone to the parent)void
dispose()
Disposes this connectionboolean
equals(java.lang.Object obj)
org.eclipse.swt.graphics.Color
getColor()
Returns the color of the line drawn in the connection.GanttEvent
getSource()
Returns the source event of this connection.GanttEvent
getTarget()
Returns the target event of this connection.void
setColor(org.eclipse.swt.graphics.Color color)
Sets the color of the line drawn in the connection.(package private) void
setParentComposite(GanttComposite _parent)
Set the parent compositevoid
setSource(GanttEvent source)
Sets the source event of this connection.void
setTarget(GanttEvent target)
Sets the target event of this connection.
-
-
-
Field Detail
-
_source
private GanttEvent _source
-
_target
private GanttEvent _target
-
_color
private org.eclipse.swt.graphics.Color _color
-
_parent
private GanttComposite _parent
-
-
Constructor Detail
-
GanttConnection
GanttConnection()
-
GanttConnection
GanttConnection(GanttEvent source, GanttEvent target, org.eclipse.swt.graphics.Color color)
-
GanttConnection
public GanttConnection(GanttChart parent, GanttEvent source, GanttEvent target)
Creates a new connection between two events.- Parameters:
parent
- Gantt Chart parentsource
- Source eventtarget
- Target event
-
GanttConnection
public GanttConnection(GanttChart parent, GanttEvent source, GanttEvent target, org.eclipse.swt.graphics.Color lineColor)
Creates a new connection between two events and gives the connecting line a specific color.- Parameters:
parent
- Gantt Chart parentsource
- Source eventtarget
- Target eventlineColor
- Color of line and arrowhead drawn between the events
-
-
Method Detail
-
getSource
public GanttEvent getSource()
Returns the source event of this connection.- Returns:
- Source event
-
setSource
public void setSource(GanttEvent source)
Sets the source event of this connection.- Parameters:
source
- Source event
-
getTarget
public GanttEvent getTarget()
Returns the target event of this connection.- Returns:
- Target event
-
setTarget
public void setTarget(GanttEvent target)
Sets the target event of this connection.- Parameters:
target
- Target event
-
getColor
public org.eclipse.swt.graphics.Color getColor()
Returns the color of the line drawn in the connection.- Returns:
- Color
-
setColor
public void setColor(org.eclipse.swt.graphics.Color color)
Sets the color of the line drawn in the connection.- Parameters:
color
- Color or null for default color.
-
dispose
public void dispose()
Disposes this connection
-
setParentComposite
void setParentComposite(GanttComposite _parent)
Set the parent composite- Parameters:
_parent
-
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
Clones the GanttConnection (and adds the clone to the parent)- Overrides:
clone
in classjava.lang.Object
- Throws:
java.lang.CloneNotSupportedException
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-