use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.
the class NodeHolder method getModeController.
ModeController getModeController() {
ModeController modeController = null;
final MapView mapView = getMapView();
if (mapView != null) {
modeController = mapView.getModeController();
}
return modeController;
}
use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.
the class NodeHolder method isIdentical.
boolean isIdentical(final NodeView pNode) {
if (pNode == null || pNode.getModel() == null)
return false;
final String id = pNode.getModel().createID();
final MapView mapView = pNode.getMap();
return mapView == mMapView.get() && id.equals(mNodeId);
}
use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.
the class LatexViewer method calculateSize.
private void calculateSize() {
final MapView mapView = (MapView) SwingUtilities.getAncestorOfClass(MapView.class, this);
final float mapZoom = mapView.getZoom();
if (mapZoom == zoom) {
return;
}
zoom = mapZoom;
final Icon latexIcon = teXFormula.createTeXIcon(TeXConstants.STYLE_DISPLAY, DEFAULT_FONT_SIZE * zoom);
final Insets insets = getInsets();
final Dimension dimension = new Dimension(latexIcon.getIconWidth() + insets.left + insets.right, latexIcon.getIconHeight() + insets.top + insets.bottom);
setPreferredSize(dimension);
}
use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.
the class AttributeTable method getPreferredScrollableViewportSize.
@Override
public Dimension getPreferredScrollableViewportSize() {
if (!isValid()) {
validate();
}
final Dimension dimension = super.getPreferredSize();
NodeView nodeView = (NodeView) SwingUtilities.getAncestorOfClass(NodeView.class, this);
if (nodeView != null) {
final MapView map = nodeView.getMap();
final ModeController modeController = map.getModeController();
final NodeStyleController nsc = NodeStyleController.getController(modeController);
dimension.width = Math.min(map.getZoomed(nsc.getMaxWidth(nodeView.getModel())), dimension.width);
dimension.height = Math.min(map.getZoomed(AttributeTable.MAX_HEIGTH) - getTableHeaderHeight(), dimension.height);
} else {
dimension.width = Math.min(MAX_WIDTH, dimension.width);
dimension.height = Math.min(MAX_HEIGTH, dimension.height);
}
return dimension;
}
use of org.freeplane.view.swing.map.MapView in project freeplane by freeplane.
the class EditAttributesAction method actionPerformed.
public void actionPerformed(final ActionEvent e) {
final Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();
final Controller controller = Controller.getCurrentController();
final AttributeView attributeView = (((MapView) controller.getMapViewManager().getMapViewComponent()).getSelected()).getAttributeView();
final boolean attributesClosed = null == SwingUtilities.getAncestorOfClass(AttributeTable.class, focusOwner);
if (attributesClosed) {
attributeView.startEditing();
} else {
attributeView.stopEditing();
}
}
Aggregations