Search in sources :

Example 11 with NamedObject

use of org.freeplane.core.resources.NamedObject in project freeplane by freeplane.

the class AutomaticLayoutController method getStyle.

private IStyle getStyle(final NodeModel node, AutomaticLayout layout) {
    if (layout == null || node.isLeaf() && !layout.equals(AutomaticLayout.ALL))
        return null;
    final int depth = node.depth();
    final MapModel map = node.getMap();
    final MapStyleModel extension = MapStyleModel.getExtension(map);
    final String name = depth == 0 ? "AutomaticLayout.level.root" : "AutomaticLayout.level," + depth;
    final NamedObject obj = NamedObject.format(name);
    final IStyle style = StyleFactory.create(obj);
    if (extension.getStyleNode(style) != null) {
        return style;
    }
    return null;
}
Also used : NamedObject(org.freeplane.core.resources.NamedObject) MapModel(org.freeplane.features.map.MapModel)

Example 12 with NamedObject

use of org.freeplane.core.resources.NamedObject in project freeplane by freeplane.

the class PeriodPanel method getPeriodUnit.

PeriodUnit getPeriodUnit() {
    final NamedObject selectedItem = (NamedObject) periodUnitBox.getSelectedItem();
    final PeriodUnit period = (PeriodUnit) selectedItem.getObject();
    return period;
}
Also used : NamedObject(org.freeplane.core.resources.NamedObject)

Example 13 with NamedObject

use of org.freeplane.core.resources.NamedObject in project freeplane by freeplane.

the class AttributeConditionController method getValuesForProperty.

public ComboBoxModel getValuesForProperty(final Object selectedItem, NamedObject simpleCond) {
    final MapModel map = Controller.getCurrentController().getMap();
    final AttributeRegistry registry = AttributeRegistry.getRegistry(map);
    try {
        final AttributeRegistryElement element = registry.getElement(selectedItem.toString());
        final SortedComboBoxModel list = element.getValues();
        SortedComboBoxModel linkedList = new SortedComboBoxModel();
        for (int i = 0; i < list.getSize(); i++) {
            final Object value = list.getElementAt(i);
            final Object transformedValue = new LinkTransformer(Controller.getCurrentModeController(), 1).transformContent(value, map);
            linkedList.add(transformedValue);
        }
        values.setExtensionList(linkedList);
    } catch (NoSuchElementException e) {
        values.setExtensionList(null);
    }
    return values;
}
Also used : NamedObject(org.freeplane.core.resources.NamedObject) MapModel(org.freeplane.features.map.MapModel) LinkTransformer(org.freeplane.features.link.LinkTransformer) SortedComboBoxModel(org.freeplane.core.util.collection.SortedComboBoxModel) NoSuchElementException(java.util.NoSuchElementException)

Example 14 with NamedObject

use of org.freeplane.core.resources.NamedObject in project freeplane by freeplane.

the class LinkConditionController method getConditionsForProperty.

public ComboBoxModel getConditionsForProperty(final Object property) {
    final NamedObject no = (NamedObject) property;
    final Object[] linkConditionNames;
    if (no.getObject().equals(FILTER_LINK)) {
        linkConditionNames = new NamedObject[] { TextUtils.createTranslatedString(ConditionFactory.FILTER_IS_EQUAL_TO), TextUtils.createTranslatedString(ConditionFactory.FILTER_CONTAINS), TextUtils.createTranslatedString(ConditionFactory.FILTER_EXIST) };
    } else if (no.getObject().equals(CONNECTOR_LABEL)) {
        linkConditionNames = new NamedObject[] { TextUtils.createTranslatedString(ConditionFactory.FILTER_IS_EQUAL_TO), TextUtils.createTranslatedString(ConditionFactory.FILTER_CONTAINS) };
    } else {
        linkConditionNames = new NamedObject[] { TextUtils.createTranslatedString(ConditionFactory.FILTER_EXIST) };
    }
    return new DefaultComboBoxModel(linkConditionNames);
}
Also used : NamedObject(org.freeplane.core.resources.NamedObject) NamedObject(org.freeplane.core.resources.NamedObject) DefaultComboBoxModel(javax.swing.DefaultComboBoxModel)

Aggregations

NamedObject (org.freeplane.core.resources.NamedObject)14 DefaultComboBoxModel (javax.swing.DefaultComboBoxModel)4 MapModel (org.freeplane.features.map.MapModel)3 StyleNamedObject (org.freeplane.features.styles.StyleNamedObject)3 ActionEvent (java.awt.event.ActionEvent)2 ActionListener (java.awt.event.ActionListener)2 File (java.io.File)2 ComboBoxEditor (javax.swing.ComboBoxEditor)2 JComboBox (javax.swing.JComboBox)2 FixedBasicComboBoxEditor (org.freeplane.core.ui.FixedBasicComboBoxEditor)2 ModeController (org.freeplane.features.mode.ModeController)2 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 NoSuchElementException (java.util.NoSuchElementException)1 ComboBoxModel (javax.swing.ComboBoxModel)1 JCheckBox (javax.swing.JCheckBox)1 JFileChooser (javax.swing.JFileChooser)1 JLabel (javax.swing.JLabel)1