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;
}
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;
}
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;
}
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);
}
Aggregations