use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class SetBooleanMapPropertyAction method actionPerformed.
public void actionPerformed(ActionEvent e) {
final Controller controller = Controller.getCurrentController();
final NodeModel node = controller.getSelection().getSelected();
final ModeController modeController = controller.getModeController();
final MapStyle mapStyleController = MapStyle.getController(modeController);
final MapModel map = node.getMap();
final String value = mapStyleController.getPropertySetDefault(map, propertyName);
boolean set = !Boolean.parseBoolean(value);
mapStyleController.setProperty(map, propertyName, Boolean.toString(set));
setSelected(set);
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class FormatContentTransformer method addMajorNumbers.
private void addMajorNumbers(final NodeModel node, StringBuilder builder) {
if (SummaryNode.isSummaryNode(node)) {
final NodeModel summaryParentNode = node.getParentNode();
if (summaryParentNode == null)
return;
addMajorNumbers(summaryParentNode, builder);
} else if (textController.getNodeNumbering(node)) {
addNumbers(builder, node);
if (builder.length() > 0)
builder.append('.');
}
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class AutomaticLayoutController method isAutomaticLevelStyle.
public boolean isAutomaticLevelStyle(NodeModel styleNode) {
NodeModel parentNode = styleNode.getParentNode();
if (parentNode == null)
return false;
Object userObject = parentNode.getUserObject();
if (!(userObject instanceof StyleTranslatedObject))
return false;
return ((StyleTranslatedObject) userObject).getObject().equals(MapStyleModel.STYLES_AUTOMATIC_LAYOUT);
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class LastOpenedList method updateLastVisitedNodeId.
private void updateLastVisitedNodeId(final Component mapView) {
if (!(mapView instanceof MapView))
return;
final NodeView selected = ((MapView) mapView).getSelected();
final RecentFile recentFile = findRecentFileByMapModel(getMapModel(mapView));
if (selected != null && recentFile != null) {
NodeModel selectedNode = selected.getModel();
// if a map has never been visited restoration of the selection has not yet taken place
if (!selectedNode.isRoot())
recentFile.lastVisitedNodeId = selectedNode.getID();
}
}
use of org.freeplane.features.map.NodeModel in project freeplane by freeplane.
the class LastOpenedList method selectLastVisitedNode.
private boolean selectLastVisitedNode(RecentFile recentFile) {
if (recentFile != null && recentFile.lastVisitedNodeId != null) {
final MapModel map = Controller.getCurrentController().getMap();
final NodeModel node = map.getNodeForID(recentFile.lastVisitedNodeId);
if (node != null && node.hasVisibleContent()) {
IMapSelection selection = Controller.getCurrentController().getSelection();
// don't override node selection done by UriManager.loadURI()
if (selection.isSelected(map.getRootNode()))
selection.selectAsTheOnlyOneSelected(node);
return true;
}
}
return false;
}
Aggregations