public class GroupController extends java.util.Observable implements EomController, java.util.Observer
TechnicalSystemGroup
s
and organizes the aggregated structure of subsystems that are either TechnicalSystem
s
ScheduleList
s or TechnicalSystemGroup
s again.Modifier and Type | Class and Description |
---|---|
static class |
GroupController.GroupMemberType |
Constructor and Description |
---|
GroupController()
Instantiates a new group controller.
|
Modifier and Type | Method and Description |
---|---|
GroupMember |
addScheduleList()
Adds a new
ScheduleList to the current TechnicalSystemGroup . |
GroupMember |
addScheduleList(ScheduleList sl,
javax.swing.tree.DefaultMutableTreeNode parentGroupNode)
Adds the specified ScheduleList to the
TechnicalSystemGroup . |
GroupMember |
addTechnicalSystem()
Adds a
TechnicalSystem to the current TechnicalSystemGroup . |
GroupMember |
addTechnicalSystem(TechnicalSystem ts,
javax.swing.tree.DefaultMutableTreeNode parentGroupNode)
Adds the specified
TechnicalSystem to the current TechnicalSystemGroup . |
GroupMember |
addTechnicalSystemGroup()
Adds a
TechnicalSystemGroup to the current TechnicalSystemGroup . |
GroupMember |
addTechnicalSystemGroup(TechnicalSystemGroup tsg,
javax.swing.tree.DefaultMutableTreeNode parentGroupNode)
Adds a
TechnicalSystemGroup to the current TechnicalSystemGroup . |
void |
copyGroupMember(java.awt.Frame owner,
GroupMember groupMember2Copy)
Copies the specified
GroupMember . |
void |
copyGroupMember(GroupMember gm2Copy,
int noOfCopies)
Copies the specified GroupMember n times.
|
java.io.File |
getCurrentFile()
Has to return the file object that is currently open in the controller.
|
EomController |
getEOMControllerByNetworkID(java.lang.String networkID)
Gets the actual EomController of the specified system (that can be an
OptionModelController , a ScheduleController or a GroupController )
identified by the network ID. |
GlobalInfo |
getGlobalInfo()
Gets the global info.
|
GroupController.GroupMemberType |
getGroupMemberType(GroupMember groupMember)
Returns the
GroupController.GroupMemberType from the specified GroupMember . |
OptionModelController |
getGroupOptionModelController()
Returns OptionModelController for the current group.
|
GroupTreeModel |
getGroupTreeModel()
Returns the group tree model.
|
ObjectFactory |
getObjectFactory()
Returns the object factory for the option model.
|
GroupSelectionModel |
getSelectionModel()
Returns the current selection model.
|
TechnicalSystemGroup |
getTechnicalSystemGroup()
Returns or creates the
TechnicalSystemGroup . |
TechnicalSystemGroup |
getTechnicalSystemGroupCopy()
Returns a copied instance of the current
TechnicalSystem . |
java.awt.Container |
getVisualisation(GroupMember groupMember)
Returns the visualisation for the specified
GroupMember . |
boolean |
hasTechnicalSystemGroupChanged()
Checks if the
TechnicalSystemGroup has changed. |
boolean |
isClosable(java.awt.Component parentComponent)
Checks and return if the current controller and its open file is closable.
|
void |
loadOptionModelGroup(java.io.File fileToLoad,
java.awt.Container parentContainer)
Loads a file to the current group.
|
boolean |
removeGroupMember(GroupMember groupMember)
Removes the specified
GroupMember from the current TechnicalSystemGroup . |
void |
resetGroupModel()
Resets the group model.
|
boolean |
saveOptionModelGroup(java.awt.Component parentComponent)
Saves the current
TechnicalSystemGroup to the file specified in getCurrentFile() .. |
boolean |
saveOptionModelGroupAs(java.awt.Component parentComponent)
Save the current
TechnicalSystemGroup as new file (with user interaction for choosing the file location). |
void |
setChangedAndNotifyObservers(java.lang.Object notification)
Sets the current state to changed and notifies all observers in one step.
|
void |
setCurrentFile(java.io.File currentFile)
Sets the current file.
|
void |
setInitialSelection()
Sets the initial selection.
|
void |
setTechnicalSystemGroup(TechnicalSystemGroup newTechnicalSystemGroup)
Sets the current
TechnicalSystemGroup . |
void |
setTechnicalSystemGroupReminder()
Sets the technical system reminder in order to recognize changes in the model later on.
|
java.lang.String |
toString() |
void |
update(java.util.Observable observable,
java.lang.Object updateObject)
This update method observes changes within the single
TechnicalSystem 's. |
void |
updateTechnicalInterfacesAndStorageInformation()
Update all
EnergyInterface 's and the storage information (capacity & load). |
boolean |
updateTechnicalInterfacesAndStorageInformation(AbstractGroupEvaluationStrategy ages)
Updates all
EnergyInterface 's and the storage information (capacity & load). |
public void setChangedAndNotifyObservers(java.lang.Object notification)
EomController
setChangedAndNotifyObservers
in interface EomController
notification
- the new changed and notify observerspublic GlobalInfo getGlobalInfo()
public ObjectFactory getObjectFactory()
public GroupSelectionModel getSelectionModel()
public void setInitialSelection()
public java.lang.String toString()
toString
in class java.lang.Object
public void loadOptionModelGroup(java.io.File fileToLoad, java.awt.Container parentContainer)
fileToLoad
- the file to loadparentContainer
- the parent containerpublic boolean saveOptionModelGroup(java.awt.Component parentComponent)
TechnicalSystemGroup
to the file specified in getCurrentFile()
..parentComponent
- the parent component (may be null
)getCurrentFile()
,
setCurrentFile(File)
public boolean saveOptionModelGroupAs(java.awt.Component parentComponent)
TechnicalSystemGroup
as new file (with user interaction for choosing the file location).parentComponent
- the parent component (may be null
)public 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 hasTechnicalSystemGroupChanged()
TechnicalSystemGroup
has changed.TechnicalSystemGroup
has changedpublic void setTechnicalSystemGroupReminder()
public void resetGroupModel()
public void setTechnicalSystemGroup(TechnicalSystemGroup newTechnicalSystemGroup)
TechnicalSystemGroup
.newTechnicalSystemGroup
- the new technical system grouppublic TechnicalSystemGroup getTechnicalSystemGroup()
TechnicalSystemGroup
.public TechnicalSystemGroup getTechnicalSystemGroupCopy()
TechnicalSystem
.TechnicalSystem
copypublic void setCurrentFile(java.io.File currentFile)
currentFile
- the new current filepublic java.io.File getCurrentFile()
EomController
getCurrentFile
in interface EomController
public OptionModelController getGroupOptionModelController()
public GroupController.GroupMemberType getGroupMemberType(GroupMember groupMember)
GroupController.GroupMemberType
from the specified GroupMember
.groupMember
- the group memberpublic GroupTreeModel getGroupTreeModel()
public java.awt.Container getVisualisation(GroupMember groupMember)
GroupMember
.groupMember
- the GroupMember
public EomController getEOMControllerByNetworkID(java.lang.String networkID)
OptionModelController
, a ScheduleController
or a GroupController
)
identified by the network ID.networkID
- the network IDpublic GroupMember addScheduleList()
ScheduleList
to the current TechnicalSystemGroup
.TechnicalSystemStateEvaluation
that were addedpublic GroupMember addScheduleList(ScheduleList sl, javax.swing.tree.DefaultMutableTreeNode parentGroupNode)
TechnicalSystemGroup
.sl
- the ScheduleList to addparentGroupNode
- the parent group node to add to. Make sure that this is a node of TechnicalSystemGroup
. Let this to null
in order to use the current selection.public GroupMember addTechnicalSystem()
TechnicalSystem
to the current TechnicalSystemGroup
.GroupMember
that was addedpublic GroupMember addTechnicalSystem(TechnicalSystem ts, javax.swing.tree.DefaultMutableTreeNode parentGroupNode)
TechnicalSystem
to the current TechnicalSystemGroup
.ts
- the TechnicalSystem
to addparentGroupNode
- the parent group node to add to. Make sure that this is a node of TechnicalSystemGroup
. Let this to null
in order to use the current selection.GroupMember
that was addedpublic GroupMember addTechnicalSystemGroup()
TechnicalSystemGroup
to the current TechnicalSystemGroup
.GroupMember
that was addedpublic GroupMember addTechnicalSystemGroup(TechnicalSystemGroup tsg, javax.swing.tree.DefaultMutableTreeNode parentGroupNode)
TechnicalSystemGroup
to the current TechnicalSystemGroup
.tsg
- the TechnicalSystemGroup
to addparentGroupNode
- the parent group node to add to. Make sure that this is a node of TechnicalSystemGroup
. Let this to null
in order to use the current selection.GroupMember
that was addedpublic void copyGroupMember(java.awt.Frame owner, GroupMember groupMember2Copy)
GroupMember
. If the Frame owner is specified, the user
will be asked how many copies should be made. If not only one copy will be made.owner
- the ownergroupMember2Copy
- the group member2 copycopyGroupMember(GroupMember, int)
public void copyGroupMember(GroupMember gm2Copy, int noOfCopies)
gm2Copy
- the group member to copynoOfCopies
- the no of copiespublic boolean removeGroupMember(GroupMember groupMember)
GroupMember
from the current TechnicalSystemGroup
.groupMember
- the group memberpublic void updateTechnicalInterfacesAndStorageInformation()
EnergyInterface
's and the storage information (capacity & load).public boolean updateTechnicalInterfacesAndStorageInformation(AbstractGroupEvaluationStrategy ages)
EnergyInterface
's and the storage information (capacity & load).
In case of evaluation execution this can cause concurrent exceptions because of a multiple
request of an update within a short time range.ages
- the AbstractGroupEvaluationStrategy that is asking for the update.public void update(java.util.Observable observable, java.lang.Object updateObject)
TechnicalSystem
's.
Therefore, this GroupController
added itself to each corresponding
OptionModelController
.update
in interface java.util.Observer
observable
- the observableupdateObject
- the update object