/** * @return */ public MapModel getMap() { return getMapViewManager().getModel(); }
/** * @param create_image */ private String getAreaCode(final boolean create_image) { String areaCode = ""; if (create_image) { areaCode = Controller.getCurrentController().getMapViewManager().createHtmlMap(); } return areaCode; }
private void selectMap(final MapModel map) { if (map.equals(Controller.getCurrentController().getMap())) { return; } final IMapViewManager mapViewManager = Controller.getCurrentController().getMapViewManager(); final Map<String, MapModel> maps = mapViewManager.getMaps(MModeController.MODENAME); for (final Map.Entry<String, MapModel> entry : maps.entrySet()) { if (map.equals(entry.getValue())) { mapViewManager.tryToChangeToMapView(entry.getKey()); } } }
public void actionPerformed(final ActionEvent e) { view = (MapView) Controller.getCurrentController().getMapViewManager().getMapViewComponent(); if (view == null) { return; } zoom(); EventQueue.invokeLater(new Runnable() { public void run() { scroll(); } }); }
public static String showInputDialog( final NodeModel node, final String message, final String initialValue) { if (node == null) { return null; } final Controller controller = Controller.getCurrentController(); final IMapViewManager viewController = controller.getMapViewManager(); viewController.scrollNodeToVisible(node); final Component parentComponent = viewController.getComponent(node); return JOptionPane.showInputDialog(parentComponent, message, initialValue); }
public static String showInputDialog( final NodeModel node, final String text, final String title, final int type) { if (node == null) { return null; } final Controller controller = Controller.getCurrentController(); final IMapViewManager viewController = controller.getMapViewManager(); viewController.scrollNodeToVisible(node); final Component parentComponent = viewController.getComponent(node); return JOptionPane.showInputDialog(parentComponent, text, title, type); }
public RenderedImage createBufferedImage(MapModel map, final Dimension slideSize, NodeModel placedNode, NodePosition placedNodePosition) { final Controller controller = Controller.getCurrentController(); if(! map.equals(controller.getMap())) { return null; } return controller.getMapViewManager().createImage(slideSize, placedNode, placedNodePosition, imageResolutionInDpi); }
@Override public void windowClosing(DockingWindow window) throws OperationAbortedException { for(Component mapViewComponent : mapViews.toArray(new Component[]{})) if(SwingUtilities.isDescendingFrom(mapViewComponent, window)) if (!Controller.getCurrentController().getMapViewManager().close(mapViewComponent)) throw new OperationAbortedException("can not close view"); }
/** */ private int getNodeShiftYChange(final Point dragNextPoint, final NodeModel node) { final Controller controller = Controller.getCurrentController(); final MapView mapView = ((MapView) controller.getMapViewManager().getMapViewComponent()); final int shiftYChange = (int) ((dragNextPoint.y - dragStartingPoint.y) / mapView.getZoom()); return shiftYChange; }
private boolean tryToChangeToMapView(URL url) { try { return Controller.getCurrentController().getMapViewManager().tryToChangeToMapView(url); } catch (MalformedURLException e) { LogUtils.warn(e); return false; } }
private void repaintMap() { final Component mapViewComponent = Controller.getCurrentController().getMapViewManager().getMapViewComponent(); if(mapViewComponent != null) mapViewComponent.repaint(); } }
public static void setDialogLocationUnder(final JDialog dialog, final NodeModel node) { final Controller controller = Controller.getCurrentController(); final IMapViewManager viewController = controller.getMapViewManager(); final JComponent c = (JComponent) viewController.getComponent(node); final int x = 0; final int y = c.getHeight(); final Point location = new Point(x, y); SwingUtilities.convertPointToScreen(location, c); UITools.setBounds(dialog, location.x, location.y, dialog.getWidth(), dialog.getHeight()); }
@Override public void ancestorRemoved(final AncestorEvent event) { final Component selectedComponent = Controller.getCurrentController().getMapViewManager().getSelectedComponent(); if(selectedComponent != null) selectedComponent.requestFocusInWindow(); quickEditor.removeAncestorListener(this); } });
public void stopPresentation() { if (currentSlide != null) { currentSlide = null; firePresentationStateChangedEvent(PLAYING_STATE_CHANGED); Slide.ALL_NODES.apply(1f); if(usesMapZoom()) Controller.getCurrentController().getMapViewManager().setZoom(zoomFactor); zoomFactor = 1f; } }
public void select(final NodeModel node) { final MapModel map = node.getMap(); final Controller controller = Controller.getCurrentController(); if (! map.equals(controller.getMap())){ controller.getMapViewManager().changeToMap(map); } displayNode(node); controller.getSelection().selectAsTheOnlyOneSelected(node); }
private AFilterComposerDialog getFilterDialog() { if (filterDialog == null) { filterDialog = new FilterComposerDialog(); getFilterDialog().setLocationRelativeTo(filterController.getFilterToolbar()); Controller.getCurrentController().getMapViewManager().addMapSelectionListener(filterDialog); } return filterDialog; } }
@Override void setStyleOnExternalChange(NodeModel node) { final NodeStyleController styleController = NodeStyleController.getController(); final Color color = NodeStyleModel.getBackgroundColor(node); final Color viewColor = styleController.getBackgroundColor(node); mSetNodeBackgroundColor.setValue(color != null); mNodeBackgroundColor.setColorValue(viewColor != null ? viewColor : Controller.getCurrentController() .getMapViewManager().getBackgroundColor(node)); } }
@Override public void startup() { final Controller controller = getController(); controller.getMapViewManager().changeToMode(MODENAME); if (controller.getMap() == null) { ((FMapController) getMapController()).newMap(File.listRoots()); } super.startup(); } }
@Override public void actionPerformed(final ActionEvent e) { setShortened = !isShortened(); final Controller controller = Controller.getCurrentController(); final IMapSelection selection = controller.getSelection(); final NodeModel node = selection.getSelected(); controller.getMapViewManager().getComponent(node).requestFocusInWindow(); selection.keepNodePosition(node, 0.0f, 0.0f); super.actionPerformed(e); }
@Override public void setSaved(final MapModel mapModel, final boolean saved) { final boolean setTitle = saved != mapModel.isSaved() || mapModel.isReadOnly(); mapModel.setSaved(saved); if (setTitle) { final Controller controller = Controller.getCurrentController(); controller.getMapViewManager().setMapTitles(); final AFreeplaneAction saveAction = controller.getModeController().getAction("SaveAction"); if(saveAction != null) saveAction.setEnabled(); } }