Menu

#66 Object Duplicate in Siena Panel breaks Many-valued context e

open
nobody
None
5
2014-06-26
2006-09-02
Anonymous
No

Hello,

I am using v1.6 (note I could not put the info in Group
since it goes only to v1.5 ) and there is a problem
when editing a many valued context ( adding objects).
If you add twice an object with the same name...
the sienna does not do any thing afterwards ( I mean no
objects can be added unless killing and starting again).

Here is the traceback:

at
net.sourceforge.toscanaj.model.manyvaluedcontext.ManyValuedContextImplementation.update(Unknown
Source)
at
net.sourceforge.toscanaj.gui.SienaMainPanel.editObject(Unknown
Source)
at
net.sourceforge.toscanaj.gui.SienaMainPanel.access$300(Unknown
Source)
at
net.sourceforge.toscanaj.gui.SienaMainPanel$3.actionPerformed(Unknown
Source)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)

===================

code for the button in method:
private JToolBar createContextToolbar() {

is :

final JButton addObjectButton = new JButton("Add
object...");
addObjectButton.addActionListener(new
ActionListener() {
public void actionPerformed(ActionEvent e) {
WritableManyValuedContext
manyValuedContext =
SienaMainPanel.this.conceptualSchema.getManyValuedContext();
manyValuedContext.add(new
FCAElementImplementation(""));

editObject(manyValuedContext.getObjects().size() - 1);
}

==========================

the following method takes care of the edition of the
object: but since the

private void editObject(int row) {
Frame tFrame =
JOptionPane.getFrameForComponent(this.tableView);
List objectList =
this.conceptualSchema.getManyValuedContext().getObjects();
WritableFCAElement object =
(WritableFCAElement) objectList.get(row);
new ObjectDialog(tFrame, object);

this.conceptualSchema.getManyValuedContext().update();
this.tableView.updateModel();
this.rowHeader.updateModel();
}
============================
From many valued context update():

Hashtable newRelation = new Hashtable();
Set entries = this.relation.entrySet();
Set checkObjectNames = new HashSet();
for (Iterator iter = entries.iterator();
iter.hasNext();) {
Entry entry = (Entry) iter.next();
FCAElement object =
(FCAElement) entry.getKey();
if
(checkObjectNames.contains(object.getData())) {
throw new
IllegalStateException("Object appears twice in object
set of many-valued context.");
}

I don't really know what's the problem...
I'll take a look later on perhaps...

J

Discussion


Log in to post a comment.