|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.sas.graphics.components.ganttchart.GanttChartModel
public class GanttChartModel
A GanttChartModel encapsulates most of a GanttChart's visual display properties. This contrasts with the GanttChart's data model, which determines the number and organization of data elements (bars) and the use of axes and a legend.
A GanttChartModel contains GanttChart-specific properties, common graph properties, and a collection of models that control the appearance of the graph's peripheral elements, such as its axes and legends.
A GanttChartModel does not allow null values for properties in its contained models. Passing a null parameter to the set method for a contained model property results in an IllegalArgumentException. Guaranteeing non-null properties for a contained model simplifies access to the display properties and ensures that the GanttChart's display state is unambiguous.
Graph
,
GraphStyle
,
GanttChart
Constructor Summary | |
---|---|
GanttChartModel()
|
Method Summary | |
---|---|
void |
apply(GanttChartModel theOtherModel)
Properties contained in "theOtherModel" to this object. |
boolean |
equals(java.lang.Object obj)
Determines whether another object is equal to this GanttChartModel . |
TextStyle |
getAnnotationLabelTextStyle()
Returns the text appearance model that is applied to the anno text defined with the GanttChartTableDataModel.setAnnotationLabelVariable(). |
com.sas.measures.BaseLength |
getAnnotationSymbolSize()
Returns the size that is applied to the annotation symbols defined with the GanttChartTableDataModel.setAnnotationSymbolVariable() and GanttChartAnnotationTableDataModel.setAnnotationSymbolVariable(). |
AxisWallModel |
getAxisWallModel()
Returns the attributes associated with the axis walls. |
java.lang.String |
getCustomSchedule1Label()
|
java.lang.String |
getCustomSchedule2Label()
Returns the label that needs to be applied to the Custom Schedule 2. |
com.sas.graphics.components.CompoundTimeAxisModel |
getDateAxisModel()
Returns the GanttChart's date axis model. |
double |
getInformatValue(java.lang.String informatValue,
java.lang.String informatName)
Deprecated. use SASFormat fmt = SASFormat.getInstance("DATE7."); double d = ((SASDateTimeFormat)fmt).informat("25dec05")); |
LegendModel |
getLegendModel()
Returns the GanttChart's legend model, a repository for bar color legend appearance preferences. |
TableAxisModel |
getTableAxisModel()
Returns the GanttChart's TableAxisModel model, which is used to set the list of tasks or activities in a project. |
ReferenceLineModel |
getTimeNowReferenceLineModel()
|
double |
getViewStart()
Returns the start position of the data axis from where the chart can be viewed. |
int |
hashCode()
Computes the hash code for this GanttChartModel . |
boolean |
isActualBarEnabled()
Returns whether the acutal bar is to be drawn. |
boolean |
isActualBarOverlaid()
Returns whether the acutal bar is to be overlaid with the gantt bar. |
boolean |
isBaselineBarEnabled()
Returns whether baseline dates are represented in the chart. |
boolean |
isCustomBar1Enabled()
Returns whether the acutal bar is to be drawn. |
boolean |
isCustomBar2Enabled()
Returns whether the acutal bar is to be drawn. |
boolean |
isGanttBarEnabled()
Returns whether the Gantt bar is to be drawn. |
boolean |
isResourceBarEnabled()
Returns whether the resource bar is to be drawn. |
boolean |
isSlackTimeEnabled()
Returns whether the slack time entry need to be shown in the bar. |
boolean |
isTimeNowEnabled()
This method is for internal use only |
void |
setActualBarEnabled(boolean newBoolean)
Sets whether the actual bar is to be drawn. |
void |
setActualBarOverlaid(boolean newOverlaid)
Sets whether the actual bar is to be overlaid with the gantt bar. |
void |
setAnnotationLabelTextStyle(TextStyle newTextStyle)
Sets the text appearance model that is applied to the annotation labels specified in the GanttChartTableDataModel.setAnnotationLabelVariable() and GanttChartAnnotationTableDataModel.setAnnotationSymbolVariable(). |
void |
setAnnotationSymbolSize(com.sas.measures.BaseLength newSize)
Sets the size of annotation symbols (markers) specified in the GanttChartTableDataModel.setAnnotationSymbolVariable() and GanttChartAnnotationTableDataModel.setAnnotationSymbolVariable(). |
void |
setAxisWallModel(AxisWallModel newAxisWallModel)
Sets the attributes associated with the axis walls. |
void |
setBaselineBarEnabled(boolean newBoolean)
Sets whether baseline dates are represented in the chart. |
void |
setCustom1BarEnabled(boolean newBoolean)
Sets whether the actual bar is to be drawn. |
void |
setCustom2BarEnabled(boolean newBoolean)
Sets whether the actual bar is to be drawn. |
void |
setCustomSchedule1Label(java.lang.String newCustom1Label)
Sets the label to the custom schedule 1. |
void |
setCustomSchedule2Label(java.lang.String newCustom2Label)
Sets the label to the custom schedule 2. |
void |
setDateAxisModel(com.sas.graphics.components.CompoundTimeAxisModel newAxisModel)
Sets the GanttChart's date axis model containing axis appearance preferences. |
void |
setGanttBarEnabled(boolean newBoolean)
Sets whether the Gantt bar is to be drawn. |
void |
setLegendModel(LegendModel newLegendModel)
Sets the GanttChart's legend model, a repository for bar color legend appearance preferences. |
void |
setResourceBarEnabled(boolean newBoolean)
Sets whether the resource bar is to be drawn. |
void |
setSlackTimeEnabled(boolean newBoolean)
Sets whether to show the Slack Time or not. |
void |
setTableAxisModel(TableAxisModel newTableAxisModel)
Sets the GanttChart's table Axis model containing table appearance preferences. |
void |
setTimeNowEnabled(boolean newTimeNow)
This method is for internal use only |
void |
setTimeNowReferenceLineModel(ReferenceLineModel newModel)
The timenow line specification. |
void |
setViewStart(double newViewStart)
Usage :- SASFormat fmt = SASFormat.getInstance("DATE7."); this.setViewStart(((SASDateTimeFormat)fmt).informat("25dec05")); Sets the starting position of the date axis from which the chart can be viewed. |
Methods inherited from class com.sas.graphics.components.GraphModel |
---|
apply, getBackgroundFillStyle, getBrushModel, getDataElementStyles, getDataTipModel, getFrameLineStyle, getLogo, getLogoJustification, isAntialiasedGraphics, isAntialiasedText, setAntialiasedGraphics, setAntialiasedText, setBackgroundFillStyle, setBrushModel, setDataElementStyles, setDataTipModel, setFrameLineStyle, setLogo, setLogoJustification |
Methods inherited from class com.sas.graphics.components.ModelBase |
---|
addPropertyChangeListener, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, removePropertyChangeListener, setContainedModel |
Constructor Detail |
---|
public GanttChartModel()
Method Detail |
---|
public void apply(GanttChartModel theOtherModel)
theOtherModel
- properties applied to this instancepublic boolean equals(java.lang.Object obj)
GanttChartModel
.
The result is true
if and only if the argument is not
null
and is a GanttChartModel
object that has the same
properties as this object.
equals
in class GraphModel
obj
- the object to test for equality with this
GanttChartModel
true
if the objects are the same;
false
otherwise.public int hashCode()
GanttChartModel
.
hashCode
in class GraphModel
public void setDateAxisModel(com.sas.graphics.components.CompoundTimeAxisModel newAxisModel) throws java.lang.IllegalArgumentException
newAxisModel
- the new axis display attributes for date time axis.
java.lang.IllegalArgumentException
- if newAxisModel is null.getDateAxisModel()
,
AxisModel.apply(com.sas.graphics.components.AxisModel)
public com.sas.graphics.components.CompoundTimeAxisModel getDateAxisModel()
GanttChartModel ganttChartModel = ganttChart.getGraphModel();
CompoundTimeAxisModel dateAxis = ganttChartModel.getDateAxisModel();
TimePeriodModel period1 = dateAxis.getTimePeriodModel1();
period1.setTimeLength(new TimeLength(1, GraphConstants.TIME_INTERVAL_DAY));
dateAxis.getTimePeriodModel2().setVisible(false);
dateAxis.getTimePeriodModel3().setVisible(false);
setDateAxisModel(com.sas.graphics.components.CompoundTimeAxisModel)
public void setTableAxisModel(TableAxisModel newTableAxisModel) throws java.lang.IllegalArgumentException
newTableAxisModel
- the new table display attributes
java.lang.IllegalArgumentException
- if newTableAxisModel is null.getTableAxisModel()
,
TableAxisModel.apply(com.sas.graphics.components.TableAxisModel)
public TableAxisModel getTableAxisModel()
// Get the task axis and change its characteristics
GanttChartModel ganttChartModel = ganttChart.getGraphModel();
TableAxisModel tableAxisModel = ganttChartModel.getTableAxisModel();
TableAxisColumn tac[] = new TableAxisColumn[3];
tac[0] = new TableAxisColumn(new Variable("Task"));
tac[0].setWidth(new BaseLength(1.5, "in"));
tac[1] = new TableAxisColumn(new Variable("EarlyStart"));
tac[2] = new TableAxisColumn(new Variable("LateStart"));
tableAxisModel.setColumns(tac);
setTableAxisModel(com.sas.graphics.components.TableAxisModel)
public void setAxisWallModel(AxisWallModel newAxisWallModel) throws java.lang.IllegalArgumentException
newAxisWallModel
- the new repository for the axis wall display attributes
java.lang.IllegalArgumentException
- if newAxisWallModel is null.getAxisWallModel()
,
AxisWallModel.apply(com.sas.graphics.components.AxisWallModel)
public AxisWallModel getAxisWallModel()
setAxisWallModel(com.sas.graphics.components.AxisWallModel)
public void setCustomSchedule1Label(java.lang.String newCustom1Label)
newCustom1Label
- used to apply the label to the Custom Schedule 1.getCustomSchedule1Label()
public java.lang.String getCustomSchedule1Label()
setCustomSchedule1Label(java.lang.String)
public void setCustomSchedule2Label(java.lang.String newCustom2Label)
newCustom2Label
- used to apply the label to the Custom Schedule 2.getCustomSchedule2Label()
public java.lang.String getCustomSchedule2Label()
setCustomSchedule2Label(java.lang.String)
public void setAnnotationLabelTextStyle(TextStyle newTextStyle) throws java.lang.IllegalArgumentException
By default it gets graphStyle.getDataLabelTextStyle() and changes when the graphstyle changes.
newTextStyle
- the new repository for the text anno marker display attributes
java.lang.IllegalArgumentException
- if newTextStyle is null.getAnnotationLabelTextStyle()
,
TextStyle.apply(com.sas.graphics.components.TextStyle)
public TextStyle getAnnotationLabelTextStyle()
setAnnotationLabelTextStyle(com.sas.graphics.components.TextStyle)
public void setAnnotationSymbolSize(com.sas.measures.BaseLength newSize) throws java.lang.IllegalArgumentException
newSize
- marker size
java.lang.IllegalArgumentException
- if newSize is null.getAnnotationSymbolSize()
public com.sas.measures.BaseLength getAnnotationSymbolSize()
setAnnotationSymbolSize(com.sas.measures.BaseLength)
public void setLegendModel(LegendModel newLegendModel) throws java.lang.IllegalArgumentException
newLegendModel
- the new repository for the legend display attributes
java.lang.IllegalArgumentException
- if newLegendModel is null.getLegendModel()
,
LegendModel.apply(com.sas.graphics.components.LegendModel)
public LegendModel getLegendModel()
setLegendModel(com.sas.graphics.components.LegendModel)
public void setActualBarOverlaid(boolean newOverlaid)
newOverlaid
- used to determine if overlay is desired.isActualBarOverlaid()
public boolean isActualBarOverlaid()
setActualBarOverlaid(boolean)
public void setActualBarEnabled(boolean newBoolean)
newBoolean
- used to determine if actual bar is shown.isActualBarEnabled()
public boolean isActualBarEnabled()
setActualBarEnabled(boolean)
public void setCustom1BarEnabled(boolean newBoolean)
newBoolean
- used to determine if actual bar is shown.isActualBarEnabled()
public boolean isCustomBar1Enabled()
setActualBarEnabled(boolean)
public void setCustom2BarEnabled(boolean newBoolean)
newBoolean
- used to determine if actual bar is shown.isActualBarEnabled()
public boolean isCustomBar2Enabled()
setActualBarEnabled(boolean)
public void setGanttBarEnabled(boolean newBoolean)
newBoolean
- used to determine if gantt bar is shown.isGanttBarEnabled()
public boolean isGanttBarEnabled()
setGanttBarEnabled(boolean)
public void setSlackTimeEnabled(boolean newBoolean)
newBoolean
- used to determine if slack time needs to show in the bar.isSlackTimeEnabled()
public boolean isSlackTimeEnabled()
setSlackTimeEnabled(boolean)
public void setBaselineBarEnabled(boolean newBoolean)
newBoolean
- used to determine if baseline bar is shown.isBaselineBarEnabled()
public boolean isBaselineBarEnabled()
setBaselineBarEnabled(boolean)
public void setResourceBarEnabled(boolean newBoolean)
newBoolean
- used to determine if resource bar is shown.isResourceBarEnabled()
public boolean isResourceBarEnabled()
setResourceBarEnabled(boolean)
public void setTimeNowReferenceLineModel(ReferenceLineModel newModel)
SASFormat fmt = SASFormat.getInstance("DATE7."); double timenow = ((SASDateTimeFormat)fmt).informat("25dec05")); Or java.util.Date currentTime = new java.util.Date(); double javaDateValue = currentTime.getTime(); SASFormat fmtInst = SASFormat.getInstance("DATE7."); double timenow = fmtInst.convertFromJavaDate( (long)javaDateValue ); // Create the reference line at a specific time ReferenceLineModel myTimeNowRefLine = new ReferenceLineModel(); myTimeNowRefLine.setPosition(timeNow); StrokeLineStyle redLine = new StrokeLineStyle(); redLine.setColor(java.awt.Color.red); myTimeNowRefLine.setLineStyle(redLine); myTimeNowRefLine.setInFront(true); gcm.setTimeNowReferenceLineModel(myTimeNowRefLine); Or java.util.Date currentTime = new java.util.Date(); myTimeNowRefLine.setPositionAsObject(currentTime);
newModel
- reference line model to usepublic ReferenceLineModel getTimeNowReferenceLineModel()
public void setViewStart(double newViewStart)
getViewStart()
public double getViewStart()
setViewStart(double)
public void setTimeNowEnabled(boolean newTimeNow)
public boolean isTimeNowEnabled()
public double getInformatValue(java.lang.String informatValue, java.lang.String informatName) throws java.lang.IllegalStateException
SASFormat fmt = SASFormat.getInstance("DATE7."); double d = ((SASDateTimeFormat)fmt).informat("25dec05"));
java.lang.IllegalStateException
|
Components |
|
| |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |