use of org.freeplane.view.swing.map.ZoomableLabel in project freeplane by freeplane.
the class MMapViewController method createEditor.
private EditNodeBase createEditor(final NodeModel node, final EditedComponent parent, final String text, final IEditControl editControl) {
final ZoomableLabel parentComponent;
final MainView mainView = (MainView) getComponent(node);
final NodeView nodeView = mainView.getNodeView();
if (EditedComponent.TEXT.equals(parent))
parentComponent = mainView;
else if (EditedComponent.DETAIL.equals(parent)) {
final JComponent component = nodeView.getContent(NodeView.DETAIL_VIEWER_POSITION);
if (component instanceof ZoomableLabel)
parentComponent = (ZoomableLabel) component;
else
parentComponent = null;
} else
parentComponent = null;
if (parentComponent == null || !parentComponent.isVisible()) {
return null;
}
final EditNodeTextField textField = new EditNodeTextField(node, (ZoomableLabel) parentComponent, text, editControl);
if (EditedComponent.TEXT.equals(parent))
textField.setBackground(nodeView.getTextBackground());
else if (EditedComponent.DETAIL.equals(parent))
textField.setBackground(nodeView.getDetailBackground());
return textField;
}
use of org.freeplane.view.swing.map.ZoomableLabel in project freeplane by freeplane.
the class LinkNavigatorMouseListener method mouseMoved.
public void mouseMoved(final MouseEvent e) {
final ZoomableLabel node = ((ZoomableLabel) e.getComponent());
String link = node.getLink(e.getPoint());
boolean followLink = link != null;
Controller currentController = Controller.getCurrentController();
final int requiredCursor;
if (followLink) {
currentController.getViewController().out(link);
requiredCursor = Cursor.HAND_CURSOR;
} else {
requiredCursor = Cursor.DEFAULT_CURSOR;
}
if (node.getCursor().getType() != requiredCursor) {
node.setCursor(requiredCursor != Cursor.DEFAULT_CURSOR ? new Cursor(requiredCursor) : null);
}
}
Aggregations