public class ScheduleController extends java.util.Observable implements EomController
Constructor and Description |
---|
ScheduleController()
Instantiates a new schedule controller.
|
Modifier and Type | Method and Description |
---|---|
java.io.File |
getCurrentFile()
Has to return the file object that is currently open in the controller.
|
java.lang.String |
getDomainByInterfaceID(java.lang.String interfaceID)
Gets the domain by interface ID.
|
GlobalInfo |
getGlobalInfo()
Returns the
GlobalInfo . |
TechnicalSystemStateEvaluation |
getInitialTechnicalSystemStateEvaluation(Schedule schedule)
Returns the initial TechnicalSystemStateEvaluation that is specified with the given
Schedule . |
TechnicalSystemStateEvaluation |
getInitialTechnicalSystemStateEvaluation(TechnicalSystemStateEvaluation tsseLast)
Returns the initial TechnicalSystemStateEvaluation that is specified with the parent of the given
TechnicalSystemStateEvaluation . |
static InterfaceSetting |
getInterfaceSetting(java.util.List<InterfaceSetting> interfaceSettingList,
java.lang.String interfaceID)
Returns, if available, the interface setting that is specified by the interfaceID.
|
ObjectFactory |
getObjectFactory()
Returns the object factory for the option model.
|
OptionModelController |
getOptionModelController()
Returns the option model controller.
|
ScheduleList |
getScheduleList()
Returns the current
ScheduleList . |
ScheduleList |
getScheduleListCopy()
Returns a copied instance of the current
ScheduleList and will
reset the database IDs of the instances. |
java.lang.String |
getScheduleListDescription()
Returns the ScheduleList description that consists of the network and the system ID.
|
ScheduleSelectionModel |
getSelectionModel()
Returns the current selection model.
|
static AbstractStorageCapacity |
getStorageCapacity(java.util.List<AbstractStorageCapacity> storageCapacityList,
java.lang.String domain)
Returns the storage capacity for the specified domain, if available.
|
boolean |
hasConfigurationErrors()
Returns if the
ScheduleList has configuration errors. |
boolean |
hasScheduleListChanged()
Checks if the
ScheduleList has changed. |
boolean |
isClosable(java.awt.Component parentComponent)
Checks and return if the current controller and its open file is closable.
|
boolean |
isEmptyScheduleList()
Checks if the ScheduleList is an empty one.
|
void |
loadScheduleList(java.io.File fileToLoad,
java.awt.Component parentComponnt)
Loads a
ScheduleList into the current ScheduleController. |
static void |
printScheduleTimeStamps(Schedule scheduleToPrint)
Prints all time stamps from the specified Schedule.
|
static void |
printScheduleTimeStamps(Schedule scheduleToPrint,
int maxStatesToPrint)
Prints the number of 'maxStatesToPrint' time stamps from the specified Schedule.
|
void |
resetScheduleList()
Resets the model.
|
boolean |
saveScheduleList(java.awt.Component parentComponent)
Saves the current
ScheduleList to the file specified in getCurrentFile() . |
boolean |
saveScheduleListAs(java.awt.Component parentComponent)
Save the current
ScheduleList with an user interaction for choosing a file location. |
void |
setChangedAndNotifyObservers(java.lang.Object notification)
Sets the current state to changed and notifies all observers in one step.
|
void |
setConfigurationErrors(boolean configurationErrors)
Sets that the current
ScheduleList has configuration errors or not. |
void |
setCurrentFile(java.io.File currentFile)
Sets the current file.
|
void |
setInitialSelection()
Sets the initial selection.
|
void |
setNetworkID(java.lang.String newNetworkID)
Sets the network ID of the current ScheduleList.
|
void |
setOptionModelController(OptionModelController omc2Use)
Sets the current OptionModelController.
|
void |
setScheduleList(ScheduleList schedulelist)
Sets the current
ScheduleList . |
void |
setScheduleList(ScheduleList schedulelist,
boolean setReminder)
Sets the current
ScheduleList . |
void |
setScheduleListReminder()
Sets the technical system reminder in order to recognise changes in the model later on.
|
void |
setSystemID(java.lang.String newSystemID)
Sets the system ID of the current ScheduleList.
|
java.lang.String |
toString() |
public ScheduleController()
public void setChangedAndNotifyObservers(java.lang.Object notification)
EomController
setChangedAndNotifyObservers
in interface EomController
notification
- the new changed and notify observerspublic OptionModelController getOptionModelController()
public void setOptionModelController(OptionModelController omc2Use)
omc2Use
- the new option model controllerpublic GlobalInfo getGlobalInfo()
GlobalInfo
.public ObjectFactory getObjectFactory()
public ScheduleSelectionModel getSelectionModel()
public void setInitialSelection()
public java.lang.String toString()
toString
in class java.lang.Object
public void loadScheduleList(java.io.File fileToLoad, java.awt.Component parentComponnt)
ScheduleList
into the current ScheduleController.fileToLoad
- the file to loadparentComponnt
- the parent component (may be null
)public boolean saveScheduleList(java.awt.Component parentComponent)
ScheduleList
to the file specified in getCurrentFile()
.parentComponent
- the parent component (may be null
)getCurrentFile()
,
setCurrentFile(File)
public boolean saveScheduleListAs(java.awt.Component parentComponent)
ScheduleList
with an user interaction for choosing a file location.parentContainer
- the parent componentpublic boolean isClosable(java.awt.Component parentComponent)
EomController
isClosable
in interface EomController
parentComponent
- the parent component that has the current focus (for user requests)public boolean hasScheduleListChanged()
ScheduleList
has changed.ScheduleList
has changedpublic void setScheduleListReminder()
public void resetScheduleList()
public ScheduleList getScheduleList()
ScheduleList
.public void setScheduleList(ScheduleList schedulelist)
ScheduleList
.schedulelist
- the new ScheduleListpublic void setScheduleList(ScheduleList schedulelist, boolean setReminder)
ScheduleList
.schedulelist
- the new ScheduleListsetReminder
- the set reminderpublic ScheduleList getScheduleListCopy()
ScheduleList
and will
reset the database IDs of the instances.ScheduleList
copypublic boolean isEmptyScheduleList()
public void setCurrentFile(java.io.File currentFile)
currentFile
- the new current filepublic java.io.File getCurrentFile()
EomController
getCurrentFile
in interface EomController
public boolean hasConfigurationErrors()
ScheduleList
has configuration errors.public void setConfigurationErrors(boolean configurationErrors)
ScheduleList
has configuration errors or not.configurationErrors
- the new value configuration errorspublic void setSystemID(java.lang.String newSystemID)
newSystemID
- the new system IDpublic void setNetworkID(java.lang.String newNetworkID)
newNetworkID
- the new network IDpublic java.lang.String getScheduleListDescription()
public java.lang.String getDomainByInterfaceID(java.lang.String interfaceID)
interfaceID
- the interface IDpublic TechnicalSystemStateEvaluation getInitialTechnicalSystemStateEvaluation(Schedule schedule)
Schedule
.schedule
- the schedulepublic TechnicalSystemStateEvaluation getInitialTechnicalSystemStateEvaluation(TechnicalSystemStateEvaluation tsseLast)
TechnicalSystemStateEvaluation
.tsseLast
- the last TechnicalSystemStateEvaluation
of a Schedule
public static AbstractStorageCapacity getStorageCapacity(java.util.List<AbstractStorageCapacity> storageCapacityList, java.lang.String domain)
storageCapacityList
- the storage capacity listdomain
- the domainpublic static InterfaceSetting getInterfaceSetting(java.util.List<InterfaceSetting> interfaceSettingList, java.lang.String interfaceID)
interfaceSettingList
- the interface setting listinterfaceID
- the interface idpublic static void printScheduleTimeStamps(Schedule scheduleToPrint)
scheduleToPrint
- the schedule to printpublic static void printScheduleTimeStamps(Schedule scheduleToPrint, int maxStatesToPrint)
scheduleToPrint
- the schedule to printmaxStatesToPrint
- the max states to print. Set -1 if you want to print all