public class NegotiatorTreeTableModel
extends AbstractTreeTableModel
Constructor and Description |
---|
NegotiatorTreeTableModel(Domain domain) |
NegotiatorTreeTableModel(Domain domain,
UtilitySpace utilitySpace) |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getChild(java.lang.Object parent,
int index)
Returns parent's child at the given index.
|
int |
getChildCount(java.lang.Object parent)
If parent is instanceof Objective, returns the number of children.
|
java.lang.Class |
getColumnClass(int column) |
int |
getColumnCount() |
java.lang.String |
getColumnName(int column) |
Domain |
getDomain() |
int |
getHighestObjectiveNr()
Recursively calculates the highest Objective / Issue number in the tree.
|
IssueValuePanel |
getIssueValuePanel(Objective node) |
protected javax.swing.JTextField |
getNameField(Objective node) |
protected javax.swing.JTextField |
getNumberField(Objective node) |
java.lang.Object |
getRoot() |
protected javax.swing.JTextField |
getTypeField(Objective node) |
UtilitySpace |
getUtilitySpace() |
java.lang.Object |
getValueAt(java.lang.Object node,
int column)
When node is an Objective, this method returns the object beloging in the
given column.
|
WeightSlider |
getWeightSlider(Objective node)
Returns the WeightSlider belonging to the given Objective.
|
boolean |
isCellEditable(int row,
int col) |
boolean |
isCellEditable(java.lang.Object node,
int column) |
boolean |
isLeaf(java.lang.Object node) |
protected void |
setIssueValuePanel(Objective node,
IssueValuePanel panel) |
protected void |
setNameField(Objective node,
javax.swing.JTextField field) |
protected void |
setNumberField(Objective node,
javax.swing.JTextField field) |
protected void |
setTypeField(Objective node,
javax.swing.JTextField field) |
void |
setUtilitySpace(UtilitySpace space)
Sets this model's UtilitySpace.
|
protected void |
setWeightSlider(Objective node,
WeightSlider slider)
Sets the WeightSlider object for the given Objective.
|
void |
treeNodesChanged(java.lang.Object source,
java.lang.Object[] path)
Wouter: added to handle change of values without change of tree
structure.
|
void |
treeStructureChanged(java.lang.Object source,
java.lang.Object[] path)
Notifies the listeners that the structure of the tree has changed.
|
void |
updateWeights(WeightSlider caller,
double newWeight) |
void |
valueForPathChanged(javax.swing.tree.TreePath path,
java.lang.Object newValue)
Method is empty at the moment.
|
public NegotiatorTreeTableModel(Domain domain)
public NegotiatorTreeTableModel(Domain domain, UtilitySpace utilitySpace)
public java.lang.Object getRoot()
public boolean isLeaf(java.lang.Object node)
public boolean isCellEditable(int row, int col)
row
- the row number of the cell.col
- the column number of the cell.public boolean isCellEditable(java.lang.Object node, int column)
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
public int getColumnCount()
public java.lang.String getColumnName(int column)
public java.lang.Class getColumnClass(int column)
public java.lang.Object getValueAt(java.lang.Object node, int column)
public java.lang.Object getChild(java.lang.Object parent, int index)
public int getChildCount(java.lang.Object parent)
public int getHighestObjectiveNr()
public Domain getDomain()
public UtilitySpace getUtilitySpace()
public void setUtilitySpace(UtilitySpace space)
space
- a UtilitySpace object.public void updateWeights(WeightSlider caller, double newWeight)
protected javax.swing.JTextField getNameField(Objective node)
protected javax.swing.JTextField getTypeField(Objective node)
protected javax.swing.JTextField getNumberField(Objective node)
public WeightSlider getWeightSlider(Objective node)
node
- an Objective.protected void setWeightSlider(Objective node, WeightSlider slider)
node
- Objective to attach the slider to.slider
- the WeightSlider to be attached to node.protected void setNameField(Objective node, javax.swing.JTextField field)
protected void setTypeField(Objective node, javax.swing.JTextField field)
protected void setNumberField(Objective node, javax.swing.JTextField field)
public IssueValuePanel getIssueValuePanel(Objective node)
protected void setIssueValuePanel(Objective node, IssueValuePanel panel)
public void treeStructureChanged(java.lang.Object source, java.lang.Object[] path)
source
- the source that triggered the change.path
- a TreePath object that identifies the path to the parent of
the modified item(s)public void treeNodesChanged(java.lang.Object source, java.lang.Object[] path)
source
- the source that triggered the change.path
- path a TreePath object that identifies the path to the parent
of the modified item(s)