public class NegotiatorTreeTableModel extends AbstractTreeTableModel implements TreeTableModel
AdditiveUtilitySpace
.listenerList
Constructor and Description |
---|
NegotiatorTreeTableModel(DomainImpl domain)
Create new profile for domain
|
NegotiatorTreeTableModel(DomainImpl domain,
AdditiveUtilitySpace utilitySpace)
Edit existing profile in domain
|
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)
Returns the type for column number
column . |
int |
getColumnCount()
Returns the number ofs availible column.
|
java.lang.String |
getColumnName(int column)
Returns the name for column number
column . |
DomainImpl |
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) |
AdditiveUtilitySpace |
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)
By default, make the column with the Tree in it the only editable one.
|
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(AdditiveUtilitySpace 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.
|
addTreeModelListener, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getIndexOfChild, removeTreeModelListener, setValueAt
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setValueAt
public NegotiatorTreeTableModel(DomainImpl domain)
domain
- the domain to editpublic NegotiatorTreeTableModel(DomainImpl domain, AdditiveUtilitySpace utilitySpace)
domain
- the domain of the profileutilitySpace
- the profile to editpublic java.lang.Object getRoot()
getRoot
in interface javax.swing.tree.TreeModel
getRoot
in class AbstractTreeTableModel
public boolean isLeaf(java.lang.Object node)
isLeaf
in interface javax.swing.tree.TreeModel
isLeaf
in class AbstractTreeTableModel
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)
AbstractTreeTableModel
isCellEditable
in interface TreeTableModel
isCellEditable
in class AbstractTreeTableModel
public void valueForPathChanged(javax.swing.tree.TreePath path, java.lang.Object newValue)
valueForPathChanged
in interface javax.swing.tree.TreeModel
valueForPathChanged
in class AbstractTreeTableModel
public int getColumnCount()
TreeTableModel
getColumnCount
in interface TreeTableModel
public java.lang.String getColumnName(int column)
TreeTableModel
column
.getColumnName
in interface TreeTableModel
public java.lang.Class getColumnClass(int column)
TreeTableModel
column
.getColumnClass
in interface TreeTableModel
getColumnClass
in class AbstractTreeTableModel
public java.lang.Object getValueAt(java.lang.Object node, int column)
getValueAt
in interface TreeTableModel
public java.lang.Object getChild(java.lang.Object parent, int index)
getChild
in interface javax.swing.tree.TreeModel
public int getChildCount(java.lang.Object parent)
getChildCount
in interface javax.swing.tree.TreeModel
public int getHighestObjectiveNr()
public DomainImpl getDomain()
public AdditiveUtilitySpace getUtilitySpace()
public void setUtilitySpace(AdditiveUtilitySpace 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)