2
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3
* Copyright (C) 2010 - DIGITEO - Clément DAVID
5
* This file must be used under the terms of the CeCILL.
6
* This source file is licensed as described in the file COPYING, which
7
* you should have received as part of this distribution. The terms
8
* are also available at
9
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
13
package org.scilab.modules.xcos.link.actions;
15
import java.awt.event.ActionEvent;
16
import java.awt.event.KeyEvent;
18
import org.scilab.modules.graph.ScilabGraph;
19
import org.scilab.modules.gui.menuitem.MenuItem;
20
import org.scilab.modules.xcos.link.BasicLink;
21
import org.scilab.modules.xcos.utils.XcosMessages;
23
import com.mxgraph.util.mxConstants;
26
* Implement the set link horizontal action
28
public class StyleHorizontalAction extends StyleAction {
29
/** Name of the action */
30
public static final String NAME = XcosMessages.LINK_STYLE_HORIZONTAL;
31
/** Icon name of the action */
32
public static final String SMALL_ICON = "";
33
/** Mnemonic key of the action */
34
public static final int MNEMONIC_KEY = KeyEvent.VK_H;
37
* Default constructor the associated graph
40
* the graph to associate
42
public StyleHorizontalAction(ScilabGraph scilabGraph) {
51
public static MenuItem createMenu(ScilabGraph scilabGraph) {
52
return createMenu(scilabGraph, StyleHorizontalAction.class);
60
* @see org.scilab.modules.xcos.link.actions.StyleAction#actionPerformed(java.awt.event.ActionEvent)
63
public void actionPerformed(ActionEvent e) {
64
BasicLink[] links = getLinks();
65
getGraph(e).setCellStyles(mxConstants.STYLE_EDGE,
66
mxConstants.EDGESTYLE_ELBOW, links);
67
getGraph(e).setCellStyles(mxConstants.STYLE_ELBOW,
68
mxConstants.ELBOW_HORIZONTAL, links);
70
removePointsOnLinks(links);