[Freemind-developer] Problems with Attributes api
A premier mind-mapping software written in Java
Brought to you by:
christianfoltin,
danielpolansky
From: Christian F. (GMX) <chr...@gm...> - 2007-02-14 20:43:46
|
Hi Dimitri, the problem with the attribute api is that it is too big and not like to others: * too big: your interface in MindMapNode is: NodeAttributeTableModel getAttributes(); but a table model contains a lot of methods (like setTableWidth) which have nothing to do with the interface here but with the layout of the table. This is bad. Better would be an interface like: /** * @return an unmodifiable list of all attribute keys as String. * There can be double entries. */ List getAttributeKeyList(); /** * @return the amount of attributes. */ int getAttributeTableLength(); /** * @param pPosition the null based position. * @return a copy of the node's attribute. */ Attribute getAttribute(int pPosition); boolean isAttributeExisting(String key); /** * Sets the attribute to the given value. */ void setAttribute(int pPosition, Attribute pAttribute); which I started to implement. Moreover, normally all change methods are contained in MindMapActions and those are undoable. In your case, you introduced a new controller AttributeController with strange methods like setcolumnwidth (again layout!). A normal programmer would search the change methods in MindMapActions and will be upset. I started to introduce some methods: void setAttribute(MindMapNode node, int pPosition, Attribute pAttribute); Let's make the interface clearer. Best regards, Chris |