Package org.freeplane.features.attribute

Examples of org.freeplane.features.attribute.AttributeRegistry


  }

  @Override
  public void performSetVisibility(final int index, final boolean isVisible) {
    final MapModel map = Controller.getCurrentModeController().getController().getMap();
    final AttributeRegistry attributeRegistry = AttributeRegistry.getRegistry(map);
    if (attributeRegistry.getElement(index).isVisible() == isVisible) {
      return;
    }
    final IActor actor = new SetAttributeVisibleActor(attributeRegistry, index, isVisible);
    Controller.getCurrentModeController().execute(actor, map);
  }
View Full Code Here


    Controller.getCurrentController().getMapViewManager().addMapSelectionListener(this);
  }

  public void afterMapChange(final MapModel oldMap, final MapModel newMap) {
    if (oldMap != null) {
      final AttributeRegistry attributes = AttributeRegistry.getRegistry(oldMap);
      if (attributes != null) {
        attributes.removeAttributesListener(this);
      }
    }
    if (newMap == null) {
      setVisible(false);
      return;
    }
    mapSelection = Controller.getCurrentController().getSelection();
    final AttributeRegistry attributes = AttributeRegistry.getRegistry(newMap);
    if (attributes == null) {
      setVisible(false);
      return;
    }
    attributes.addAttributesListener(this);
    attributesChanged();
  }
View Full Code Here

    attributesChanged();
  }

  private void attributesChanged() {
    final MapModel map = Controller.getCurrentController().getMap();
    final AttributeRegistry attributes = AttributeRegistry.getRegistry(map);
    final ComboBoxModel names = attributes.getComboBoxModel();
    attributeNames.setModel(new ClonedComboBoxModel(names));
    attributeNames.setEditable(!attributes.isRestricted());
    replacingAttributeNames.setModel(new ClonedComboBoxModel(names));
    replacingAttributeNames.setEditable(!attributes.isRestricted());
    if (attributes.size() > 0) {
      final Object first = names.getElementAt(0);
      attributeNames.setSelectedItem(first);
      replacingAttributeNames.setSelectedItem(first);
      selectedAttributeChanged(attributeNames.getSelectedItem(), attributeValues);
      selectedAttributeChanged(replacingAttributeNames.getSelectedItem(), replacingAttributeValues);
View Full Code Here

  public void beforeMapChange(final MapModel oldMap, final MapModel newMap) {
  }

  private void selectedAttributeChanged(final Object selectedAttributeName, final JComboBox values) {
    final MapModel map = Controller.getCurrentController().getMap();
    final AttributeRegistry attributes = AttributeRegistry.getRegistry(map);
    try {
      final AttributeRegistryElement element = attributes.getElement(selectedAttributeName.toString());
      final ComboBoxModel selectedValues = element.getValues();
      values.setModel(new ClonedComboBoxModel(selectedValues));
      try {
        final Object firstValue = selectedValues.getElementAt(0);
        values.setSelectedItem(firstValue);
View Full Code Here

    gridBagConstraints.gridy++;
    //Attribute name combo-box
    gridBagConstraints.insets = new Insets(2, 10, 20, 10);
    attributeNames = new JComboBox();
    final MapModel map = Controller.getCurrentController().getMap();
    final AttributeRegistry attributes = AttributeRegistry.getRegistry(map);
    final ComboBoxModel names = attributes.getComboBoxModel();
    attributeNames.setModel(new ClonedComboBoxModel(names));
    attributeNames.setEditable(true);
    attributeNames.setMaximumSize(comboBoxMaximumSize);
    attributeNames.setPreferredSize(comboBoxMaximumSize);
    attributeNames.addItemListener(new ItemListener() {
View Full Code Here

    return panel;
  }

  protected void selectedAttributeChanged(final Object selectedAttributeName, final JComboBox values) {
    final MapModel map = Controller.getCurrentController().getMap();
    final AttributeRegistry attributes = AttributeRegistry.getRegistry(map);
    try {
      final AttributeRegistryElement element = attributes.getElement(selectedAttributeName.toString());
      final ComboBoxModel selectedValues = element.getValues();
      values.setModel(new ClonedComboBoxModel(selectedValues));
      try {
        final Object firstValue = selectedValues.getElementAt(0);
        values.setSelectedItem(firstValue);
View Full Code Here

    if(tce instanceof DialogTableCellEditor){
      return super.prepareEditor(tce, row, col);
    }
    final JComboBox comboBox = (JComboBox) ((DefaultCellEditor) tce).getComponent();
    final NodeModel node = getAttributeTableModel().getNode();
    final AttributeRegistry attributes = AttributeRegistry.getRegistry(node.getMap());
    final ComboBoxModel model;
    switch (col) {
      case 0:
        model = attributes.getComboBoxModel();
        comboBox.setEditable(!attributes.isRestricted());
        break;
      case 1:
        final String attrName = getAttributeTableModel().getValueAt(row, 0).toString();
        model = attributes.getDefaultComboBoxModel(attrName);
        comboBox.setEditable(!attributes.isRestricted(attrName));
        break;
      default:
        model = AttributeTable.getDefaultComboBoxModel();
    }
    final Object[] items = new Object[model.getSize()];
View Full Code Here

TOP

Related Classes of org.freeplane.features.attribute.AttributeRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.