org.eclipse.emf.emfstore.internal.client.ui.views.historybrowserview.graph
Class PlotCommit

java.lang.Object
  extended by org.eclipse.emf.emfstore.internal.client.ui.views.historybrowserview.graph.PlotCommit
All Implemented Interfaces:
IPlotCommit

public class PlotCommit
extends Object
implements IPlotCommit

Author:
Aumann, Faltermeier

Constructor Summary
PlotCommit(HistoryInfo historyInfo)
          A PlotCommit object holds graphical information for a certain history object which is used for drawing in the HistoryBrowserView, or rather the SWTPlotRenderer used by this view.
PlotCommit(int dummyId, String branch)
          Creates a hollow dummy commit with the given id and branch name.
 
Method Summary
 void addChild(IPlotCommit child)
          Adds a child to this commit.
 void addPassingLane(PlotLane c)
          Adds a passing lane to this commit.
 void dispose()
          Disposes this commit and all aquired resources.
 String getBranch()
          
 IPlotCommit getChild(int child)
          
 int getChildCount()
          
 org.eclipse.swt.graphics.Color getColor()
          
 int getId()
          
 PlotLane getLane()
          
 org.eclipse.swt.graphics.Color getLightColor()
          
 IPlotCommit getParent(int i)
          
 int getParentCount()
          
 PlotLane[] getPassingLanes()
          
 boolean isChild(IPlotCommit commit)
          Tests whether a given commit is child of this commit.
 boolean isLocalHistoryOnly()
          Checks whether this commit is a real (i.e.
 boolean isRealCommit()
          
 void setColor(org.eclipse.swt.graphics.Color color)
          Sets the color of this commit.
 void setIsRealCommit(boolean isReal)
          Sets the 'real' status of this commit.
 void setLane(PlotLane lane)
          Sets the lane of the commit.
 void setLightColor(org.eclipse.swt.graphics.Color color)
          Sets the light color of this commit.
 void setParents(List<IPlotCommit> parents)
          Sets the parent's of this commit.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PlotCommit

public PlotCommit(HistoryInfo historyInfo)
A PlotCommit object holds graphical information for a certain history object which is used for drawing in the HistoryBrowserView, or rather the SWTPlotRenderer used by this view.

Parameters:
historyInfo - The historyInfo that is represented by this PlotCommit

PlotCommit

public PlotCommit(int dummyId,
                  String branch)
Creates a hollow dummy commit with the given id and branch name.

Parameters:
dummyId - The id of the dummy.
branch - The branch name of the dummy.
Method Detail

setLane

public void setLane(PlotLane lane)
Sets the lane of the commit.

Specified by:
setLane in interface IPlotCommit
Parameters:
lane - The lane to set as lane for this commit.
See Also:
IPlotCommit.setLane(org.eclipse.emf.emfstore.internal.client.ui.views.historybrowserview.graph.PlotLane)

getLane

public PlotLane getLane()

Specified by:
getLane in interface IPlotCommit
Returns:
The lane of the commit in the graph.
See Also:
IPlotCommit.getLane()

addPassingLane

public void addPassingLane(PlotLane c)
Adds a passing lane to this commit.

Specified by:
addPassingLane in interface IPlotCommit
Parameters:
c - The lane to add.
See Also:
IPlotCommit.addPassingLane(org.eclipse.emf.emfstore.internal.client.ui.views.historybrowserview.graph.PlotLane)

getPassingLanes

public PlotLane[] getPassingLanes()

Specified by:
getPassingLanes in interface IPlotCommit
Returns:
All passing lanes of this commit.
See Also:
IPlotCommit.getPassingLanes()

setParents

public void setParents(List<IPlotCommit> parents)
Sets the parent's of this commit. Parents are commits this commit is based upon, i.e. normally parent commits came before this commit.

Specified by:
setParents in interface IPlotCommit
Parameters:
parents - A list of this commit's parents.
See Also:
IPlotCommit.setParents(java.util.List)

getParentCount

public int getParentCount()

Specified by:
getParentCount in interface IPlotCommit
Returns:
The number of parents of this commit.
See Also:
IPlotCommit.getParentCount()

getParent

public IPlotCommit getParent(int i)

Specified by:
getParent in interface IPlotCommit
Parameters:
i - The index of the parent to retrieve.
Returns:
The parent of this commit at the specified index.
See Also:
IPlotCommit.getParent(int)

addChild

public void addChild(IPlotCommit child)
Adds a child to this commit. A child of a commit is a commit that is based on this commit (but may be based on others, too). See also IPlotCommit.setParents(List)

Specified by:
addChild in interface IPlotCommit
Parameters:
child - The child to add.
See Also:
IPlotCommit.addChild(org.eclipse.emf.emfstore.internal.client.ui.views.historybrowserview.graph.IPlotCommit)

getChild

public IPlotCommit getChild(int child)

Specified by:
getChild in interface IPlotCommit
Parameters:
child - The index of the child to retrieve.
Returns:
The child of this commit at the specified index.
See Also:
IPlotCommit.getChild(int)

getChildCount

public int getChildCount()

Specified by:
getChildCount in interface IPlotCommit
Returns:
The number of children of this commit.
See Also:
IPlotCommit.getChildCount()

isChild

public boolean isChild(IPlotCommit commit)
Tests whether a given commit is child of this commit.

Specified by:
isChild in interface IPlotCommit
Parameters:
commit - The potential child commit.
Returns:
true if the given commit is a child of this commit, false otherwise.
See Also:
IPlotCommit.isChild(org.eclipse.emf.emfstore.internal.client.ui.views.historybrowserview.graph.IPlotCommit)

setIsRealCommit

public void setIsRealCommit(boolean isReal)
Sets the 'real' status of this commit. This commit is 'real' if e.g. in a tree this commit is on the very level where its node will be painted. Unreal commits just hold the necessary information (lanes etc.) but do not have to be completely drawn (the lanes might be in a lighter color, no commit dot etc.)

Specified by:
setIsRealCommit in interface IPlotCommit
Parameters:
isReal - The new status.
See Also:
IPlotCommit.setIsRealCommit(boolean)

isRealCommit

public boolean isRealCommit()

Specified by:
isRealCommit in interface IPlotCommit
Returns:
The 'real' status of this commit. See IPlotCommit.setIsRealCommit(boolean).
See Also:
IPlotCommit.isRealCommit()

getBranch

public String getBranch()

Specified by:
getBranch in interface IPlotCommit
Returns:
The name of the branch this commit belongs to.
See Also:
IPlotCommit.getBranch()

getId

public int getId()

Specified by:
getId in interface IPlotCommit
Returns:
The unique identifier of this commit, usually a number.
See Also:
IPlotCommit.getId()

dispose

public void dispose()
Disposes this commit and all aquired resources.

Specified by:
dispose in interface IPlotCommit
See Also:
IPlotCommit.dispose()

isLocalHistoryOnly

public boolean isLocalHistoryOnly()
Checks whether this commit is a real (i.e. committed to the server) commit, or just a wrapper around local change sets.

Specified by:
isLocalHistoryOnly in interface IPlotCommit
Returns:
true if this commit is only a wrapper for local change sets, false otherwise.
See Also:
IPlotCommit.isLocalHistoryOnly()

setColor

public void setColor(org.eclipse.swt.graphics.Color color)
Sets the color of this commit. The color determines the color of the branch label next to the commit as well as associated lane colors.

Specified by:
setColor in interface IPlotCommit
Parameters:
color - The new color.
See Also:
IPlotCommit.setColor(org.eclipse.swt.graphics.Color)

getColor

public org.eclipse.swt.graphics.Color getColor()

Specified by:
getColor in interface IPlotCommit
Returns:
The color of this commit. See IPlotCommit.setColor(Color).
See Also:
IPlotCommit.getColor()

setLightColor

public void setLightColor(org.eclipse.swt.graphics.Color color)
Sets the light color of this commit. It is usually a brighter version of this commit's color (see IPlotCommit.setColor(Color)). The light color is used whenever a more faded color representation for this commit is needed (e.g. label backgrounds, lane colors for expanded commit nodes).

Specified by:
setLightColor in interface IPlotCommit
Parameters:
color - The new light color of this commit.
See Also:
IPlotCommit.setLightColor(org.eclipse.swt.graphics.Color)

getLightColor

public org.eclipse.swt.graphics.Color getLightColor()

Specified by:
getLightColor in interface IPlotCommit
Returns:
The light color of this commit. See IPlotCommit.setLightColor(Color).
See Also:
IPlotCommit.getLightColor()


Copyright © 2015. All Rights Reserved.