Search in sources :

Example 11 with NodeAttributeTableModel

use of org.freeplane.features.attribute.NodeAttributeTableModel in project freeplane by freeplane.

the class AttributesProxy method set.

public void set(final int index, final Object value) {
    final NodeAttributeTableModel attributeTableModel = getAndCheckNodeAttributeTableModelForIndex(index, "set1:");
    String oldPattern = getOldValueFormatPattern(attributeTableModel, index);
    getAttributeController().performSetValueAt(attributeTableModel, ProxyUtils.transformObject(value, oldPattern), index, 1);
}
Also used : NodeAttributeTableModel(org.freeplane.features.attribute.NodeAttributeTableModel)

Example 12 with NodeAttributeTableModel

use of org.freeplane.features.attribute.NodeAttributeTableModel in project freeplane by freeplane.

the class AttributesProxy method setFormat.

public void setFormat(final int index, String pattern) {
    final NodeAttributeTableModel attributeTableModel = getAndCheckNodeAttributeTableModelForIndex(index, "set1:");
    final Object value = attributeTableModel.getAttribute(index).getValue();
    getAttributeController().performSetValueAt(attributeTableModel, ProxyUtils.transformObject(value, pattern), index, 1);
}
Also used : NodeAttributeTableModel(org.freeplane.features.attribute.NodeAttributeTableModel) IFormattedObject(org.freeplane.features.format.IFormattedObject)

Example 13 with NodeAttributeTableModel

use of org.freeplane.features.attribute.NodeAttributeTableModel in project freeplane by freeplane.

the class MAttributeController method addAttribute.

public int addAttribute(final NodeModel node, final Attribute pAttribute) {
    createAttributeTableModel(node);
    final NodeAttributeTableModel attributes = NodeAttributeTableModel.getModel(node);
    final int rowCount = attributes.getRowCount();
    performInsertRow(attributes, rowCount, pAttribute.getName(), pAttribute.getValue());
    return rowCount;
}
Also used : NodeAttributeTableModel(org.freeplane.features.attribute.NodeAttributeTableModel)

Example 14 with NodeAttributeTableModel

use of org.freeplane.features.attribute.NodeAttributeTableModel in project freeplane by freeplane.

the class MAttributeController method performRegistrySubtreeAttributes.

@Override
public void performRegistrySubtreeAttributes(final NodeModel node) {
    final NodeAttributeTableModel nodeAttributeTableModel = NodeAttributeTableModel.getModel(node);
    for (int i = 0; i < nodeAttributeTableModel.getRowCount(); i++) {
        final String name = nodeAttributeTableModel.getValueAt(i, 0).toString();
        final String value = nodeAttributeTableModel.getValueAt(i, 1).toString();
        performRegistryAttributeValue(name, value, false);
    }
    for (final NodeModel child : Controller.getCurrentModeController().getMapController().childrenUnfolded(node)) {
        performRegistrySubtreeAttributes(child);
    }
}
Also used : NodeModel(org.freeplane.features.map.NodeModel) NodeAttributeTableModel(org.freeplane.features.attribute.NodeAttributeTableModel)

Example 15 with NodeAttributeTableModel

use of org.freeplane.features.attribute.NodeAttributeTableModel in project freeplane by freeplane.

the class MAttributeController method setAttribute.

public void setAttribute(final NodeModel pNode, final int pPosition, final Attribute pAttribute) {
    createAttributeTableModel(pNode);
    final NodeAttributeTableModel model = NodeAttributeTableModel.getModel(pNode);
    performSetValueAt(model, pAttribute.getName(), pPosition, 0);
    performSetValueAt(model, pAttribute.getValue(), pPosition, 1);
}
Also used : NodeAttributeTableModel(org.freeplane.features.attribute.NodeAttributeTableModel)

Aggregations

NodeAttributeTableModel (org.freeplane.features.attribute.NodeAttributeTableModel)25 Attribute (org.freeplane.features.attribute.Attribute)12 ArrayList (java.util.ArrayList)5 IFormattedObject (org.freeplane.features.format.IFormattedObject)5 NodeModel (org.freeplane.features.map.NodeModel)3 LinkedHashMap (java.util.LinkedHashMap)2 MissingMethodException (groovy.lang.MissingMethodException)1 URI (java.net.URI)1 Iterator (java.util.Iterator)1 Map (java.util.Map)1