View Javadoc

1   /**********************************************
2    * Copyright (C) 2009 Lukas Laag
3    * This file is part of Vectomatic.
4    * 
5    * Vectomatic is free software: you can redistribute it and/or modify
6    * it under the terms of the GNU General Public License as published by
7    * the Free Software Foundation, either version 3 of the License, or
8    * (at your option) any later version.
9    * 
10   * Vectomatic is distributed in the hope that it will be useful,
11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   * GNU General Public License for more details.
14   * 
15   * You should have received a copy of the GNU General Public License
16   * along with Vectomatic.  If not, see http://www.gnu.org/licenses/
17   **********************************************/
18  package org.vectomatic.client.rep.controller;
19  
20  import org.vectomatic.client.rep.RepApplication;
21  
22  // Commands
23  //
24  // Associate tangents
25  // Dissociate tangents
26  // Make tangents associated and symetric
27  // Insert control point
28  // Remove control point
29  // 
30  // Add a segment between two endpoints
31  // Join two endpoints to create a continuous path
32  // Remove a segment
33  // Cut a path at the selected point
34  //
35  // Turn segment to line
36  // Turn segment to spline
37  
38  public class EditPathController extends ControllerBase {
39  
40  	private MouseControllerButton _button;
41  	public EditPathController(RepApplication app) {
42  		super(app);
43  		_button = new MouseControllerButton(_app.getIcons().editPathIcon().createImage(), _app.getConstants().editPathCommand(), this);
44  	}
45  	// 0/ Single click on segment + mousemove: change control points so that the spline segment goes through the mouse point
46  	// 1/ Double-click on segment: insert control point
47  	// 2/ Delete with selected vertices: remove selected control points
48  	// 3/ mouseMove point + CTRL + ALT: constrain point movement in the direction of tangent
49  	// 4/ mouseMove handle + CTRL: rotate by increments
50  	// 5/ mouseMove handle + ALT: preserve tangent length
51  	// 6/ mouseMove handle + CTRL: rotate by increments
52  	// 7/ mouseMove handle + MAJ: rotate both handles (done automatically if the two tangents are aligned)
53  	// 8/ mouseDown + CTRL: toggle node type
54  	// 9/ mouseDown + SHIFT: add to selection
55  
56  	public MouseControllerButton getButton() {
57  		return _button;
58  	}
59  }