You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
9
+
10
+
Copyright 2011 Gephi Consortium. All rights reserved.
11
+
12
+
The contents of this file are subject to the terms of either the GNU
13
+
General Public License Version 3 only ("GPL") or the Common
14
+
Development and Distribution License("CDDL") (collectively, the
15
+
"License"). You may not use this file except in compliance with the
16
+
License. You can obtain a copy of the License at
17
+
http://gephi.org/about/legal/license-notice/
18
+
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
19
+
specific language governing permissions and limitations under the
20
+
License. When distributing the software, include this License Header
21
+
Notice in each file and include the License files at
22
+
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
23
+
License Header, with the fields enclosed by brackets [] replaced by
24
+
your own identifying information:
25
+
"Portions Copyrighted [year] [name of copyright owner]"
26
+
27
+
If you wish your version of this file to be governed by only the CDDL
28
+
or only the GPL Version 3, indicate your decision by adding
29
+
"[Contributor] elects to include this software in this distribution
30
+
under the [CDDL or GPL Version 3] license." If you do not indicate a
31
+
single choice of license, a recipient has the option to distribute
32
+
your version of this file under either the CDDL, the GPL Version 3 or
33
+
to extend the choice of license to its licensees as provided above.
34
+
However, if you add GPL Version 3 code and therefore, elected the GPL
35
+
Version 3 license, then the option applies only if the new code is
36
+
made subject to such option by the copyright holder.
37
+
38
+
Contributor(s):
39
+
40
+
Portions Copyrighted 2011 Gephi Consortium.
41
41
*/
42
42
packageorg.gephi.preview.api;
43
43
@@ -47,19 +47,15 @@ Development and Distribution License("CDDL") (collectively, the
47
47
importorg.gephi.graph.api.Graph;
48
48
importorg.gephi.graph.api.Node;
49
49
importorg.gephi.preview.spi.ItemBuilder;
50
+
importorg.gephi.preview.spi.PreviewMouseListener;
50
51
importorg.gephi.preview.spi.Renderer;
51
52
52
53
/**
53
-
* The Preview Model contains all items and all preview properties.
54
-
* <p>
55
-
* Items are the visual elements built from the {@link Graph} by {@link ItemBuilder}
56
-
* implementations and can be retrieved from this class. Each item has a type and
57
-
* default types are {@link Item#NODE}, {@link Item#EDGE}, {@link Item#NODE_LABEL}
58
-
* and {@link Item#EDGE_LABEL}.
59
-
* <p>
60
-
* A preview model is attached to it's workspace and can be retrieved from the
54
+
* The Preview Model contains all items and all preview properties. <p> Items are the visual elements built from the {@link Graph} by {@link ItemBuilder} implementations and can be retrieved from this
55
+
* class. Each item has a type and default types are {@link Item#NODE}, {@link Item#EDGE}, {@link Item#NODE_LABEL} and {@link Item#EDGE_LABEL}. <p> A preview model is attached to it's workspace and
56
+
* can be retrieved from the
61
57
* {@link PreviewController}.
62
-
*
58
+
*
63
59
* @author Yudi Xue, Mathieu Bastian
64
60
* @see Item
65
61
* @see Renderer
@@ -68,78 +64,88 @@ public interface PreviewModel {
68
64
69
65
/**
70
66
* Returns the preview properties attached to this model.
67
+
*
71
68
* @return the preview properties
72
69
*/
73
70
publicPreviewPropertiesgetProperties();
74
71
75
72
/**
76
-
* Returns all items with <code>type</code> as type.
77
-
* <p>
78
-
* Default types are {@link Item#NODE}, {@link Item#EDGE}, {@link Item#NODE_LABEL}
79
-
* and {@link Item#EDGE_LABEL}.
73
+
* Returns all items with
74
+
* <code>type</code> as type. <p> Default types are {@link Item#NODE}, {@link Item#EDGE}, {@link Item#NODE_LABEL} and {@link Item#EDGE_LABEL}.
75
+
*
80
76
* @param type the item's type
81
77
* @return all items from this type
82
78
*/
83
79
publicItem[] getItems(Stringtype);
84
80
85
81
/**
86
-
* Returns all items attached to <code>source</code>.
87
-
* <p>
88
-
* The source is the graph object behind the item (e.g.
89
-
* {@link Node} or {@link Edge}). Multiple items can be created from the same
90
-
* source object. For instance both <code>Item.NODE</code> and
82
+
* Returns all items attached to
83
+
* <code>source</code>. <p> The source is the graph object behind the item (e.g.
84
+
* {@link Node} or {@link Edge}). Multiple items can be created from the same source object. For instance both
85
+
* <code>Item.NODE</code> and
91
86
* <code>Item.NODE_LABEL</code> have the node object as source.
87
+
*
92
88
* @param source the item's source
93
-
* @return all items with <code>source</code> as source
89
+
* @return all items with
90
+
* <code>source</code> as source
94
91
*/
95
92
publicItem[] getItems(Objectsource);
96
93
97
94
/**
98
-
* Returns the item attached to <code>source</code> and with the type
99
-
* <code>type</code>.
100
-
* <p>
101
-
* The source is the graph object behind the item (e.g.
102
-
* {@link Node} or {@link Edge}) and the type a default or a custom type.
103
-
* <p>
104
-
* Default types are {@link Item#NODE}, {@link Item#EDGE}, {@link Item#NODE_LABEL}
105
-
* and {@link Item#EDGE_LABEL}.
95
+
* Returns the item attached to
96
+
* <code>source</code> and with the type
97
+
* <code>type</code>. <p> The source is the graph object behind the item (e.g.
98
+
* {@link Node} or {@link Edge}) and the type a default or a custom type. <p> Default types are {@link Item#NODE}, {@link Item#EDGE}, {@link Item#NODE_LABEL} and {@link Item#EDGE_LABEL}.
99
+
*
106
100
* @param type the item's type
107
101
* @param source the item's source object
108
-
* @return the item or <code>null</code> if not found
102
+
* @return the item or
103
+
* <code>null</code> if not found
109
104
*/
110
105
publicItemgetItem(Stringtype, Objectsource);
111
-
106
+
112
107
/**
113
-
* <p>Returns currently managed renderers, or null.</p>
114
-
* <p>If <code>managedRenderers</code> is set to null, all renderers will be executed when rendering, in default implementation order.</p>
108
+
* <p>Returns currently managed renderers, or null.</p> <p>If
109
+
* <code>managedRenderers</code> is set to null, all renderers will be executed when rendering, in default implementation order.</p>
110
+
*
115
111
* @return Enabled renderers or null
116
112
*/
117
113
publicManagedRenderer[] getManagedRenderers();
118
114
119
115
/**
120
-
* <p>Sets an user-defined array of managed renderers to use when rendering.</p>
121
-
* <p><b>Only</b> the renderers marked as enabled will be executed when rendering, and <b>respecting the array order</b></p>
122
-
* <p>If the input array does not contain a managed renderer for some renderer existing implementation, a new not enabled managed renderer will be added to the end of the input array</p>
123
-
* <p>If <code>managedRenderers</code> is set to null, all renderers will be executed when rendering, in default implementation order.</p>
116
+
* <p>Sets an user-defined array of managed renderers to use when rendering.</p> <p><b>Only</b> the renderers marked as enabled will be executed when rendering, and <b>respecting the array
117
+
* order</b></p> <p>If the input array does not contain a managed renderer for some renderer existing implementation, a new not enabled managed renderer will be added to the end of the input
118
+
* array</p> <p>If
119
+
* <code>managedRenderers</code> is set to null, all renderers will be executed when rendering, in default implementation order.</p>
120
+
*
124
121
* @param managedRenderers Managed renderers for future renderings
* Returns <code>managedRenderers</code> Renderers that are enabled, or null if <code>managedRenderers</code> is null.
126
+
* Returns
127
+
* <code>managedRenderers</code> Renderers that are enabled, or null if
128
+
* <code>managedRenderers</code> is null.
129
+
*
130
130
* @return Enabled renderers or null
131
131
*/
132
132
publicRenderer[] getManagedEnabledRenderers();
133
133
134
+
/*
135
+
* Returns <code>managedPreviewMouseListeners</code> containing the <code>PreviewMouseListeners</code> that are declared by the current enabled managed renderers.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
9
+
10
+
Copyright 2011 Gephi Consortium. All rights reserved.
11
+
12
+
The contents of this file are subject to the terms of either the GNU
13
+
General Public License Version 3 only ("GPL") or the Common
14
+
Development and Distribution License("CDDL") (collectively, the
15
+
"License"). You may not use this file except in compliance with the
16
+
License. You can obtain a copy of the License at
17
+
http://gephi.org/about/legal/license-notice/
18
+
or /cddl-1.0.txt and /gpl-3.0.txt. See the License for the
19
+
specific language governing permissions and limitations under the
20
+
License. When distributing the software, include this License Header
21
+
Notice in each file and include the License files at
22
+
/cddl-1.0.txt and /gpl-3.0.txt. If applicable, add the following below the
23
+
License Header, with the fields enclosed by brackets [] replaced by
24
+
your own identifying information:
25
+
"Portions Copyrighted [year] [name of copyright owner]"
26
+
27
+
If you wish your version of this file to be governed by only the CDDL
28
+
or only the GPL Version 3, indicate your decision by adding
29
+
"[Contributor] elects to include this software in this distribution
30
+
under the [CDDL or GPL Version 3] license." If you do not indicate a
31
+
single choice of license, a recipient has the option to distribute
32
+
your version of this file under either the CDDL, the GPL Version 3 or
33
+
to extend the choice of license to its licensees as provided above.
34
+
However, if you add GPL Version 3 code and therefore, elected the GPL
35
+
Version 3 license, then the option applies only if the new code is
36
+
made subject to such option by the copyright holder.
37
+
38
+
Contributor(s):
39
+
40
+
Portions Copyrighted 2012 Gephi Consortium.
41
+
*/
42
+
packageorg.gephi.preview.spi;
43
+
44
+
importorg.gephi.preview.api.PreviewMouseEvent;
45
+
importorg.gephi.preview.api.PreviewProperties;
46
+
importorg.gephi.project.api.Workspace;
47
+
48
+
/**
49
+
* <p>Listener for mouse events in Preview.</p>
50
+
* <p>Listeners will <b>always</b> receive left mouse button events. Right button is reserved for zooming and moving the canvas</p>
51
+
*
52
+
* <p>In order to enable a <code>PreviewMouseListener</code>, annotate it with <code>ServiceProvider</code> annotation and implement <code>MouseResponsiveRenderer</code>
53
+
* in a <code>Renderer</code> and return true for the listener in the <code>needsPreviewMouseListener</code> method.</p>
54
+
* @author Eduardo Ramos<eduramiba@gmail.com>
55
+
*/
56
+
publicinterfacePreviewMouseListener {
57
+
58
+
/**
59
+
* A single click event.
60
+
* @param event Mouse event
61
+
* @param properties Preview properties for the workspace
Copy file name to clipboardexpand all lines: src/main/javadoc/overview.html
+2
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,8 @@
19
19
<h2>API Changes</h2>
20
20
<p>
21
21
<ul>
22
+
<li>(December 07 2012) Add support for mouse listeners in Preview plugins. Create a <code>PreviewMouseListener</code> and implement <code>MouseResponsiveRenderer</code> interface in the renderers that use the listener.
23
+
</li>
22
24
<li>(April 10 2012) Add a <code>getShortDescription()</code> method to the <code>StatisticsUI</code> API. It enables to get a short description of statistics (used to display tooltips).
23
25
</li>
24
26
<li>(March 26 2012) Add a <code>needsItemBuilder</code> method to <code>Renderer</code> in Preview API.
0 commit comments