├── ChangeLog-Ui.txt
├── src
├── main
│ ├── scripts
│ │ ├── GrandUI.app
│ │ │ └── Contents
│ │ │ │ ├── PkgInfo
│ │ │ │ ├── Resources
│ │ │ │ ├── Grand.icns
│ │ │ │ └── en.lproj
│ │ │ │ │ └── Localizable.strings
│ │ │ │ └── Info.plist
│ │ ├── grand-ui.bat
│ │ └── grand-ui.sh
│ ├── config
│ │ ├── icons.xcf
│ │ ├── splash.xcf
│ │ ├── icons-64.xcf
│ │ └── Grand.svg
│ ├── resources
│ │ ├── net
│ │ │ └── ggtools
│ │ │ │ └── grand
│ │ │ │ └── ui
│ │ │ │ ├── resource
│ │ │ │ ├── about.png
│ │ │ │ ├── splash.png
│ │ │ │ ├── link-icon.png
│ │ │ │ ├── node-icon.png
│ │ │ │ ├── application.png
│ │ │ │ └── fonts.properties
│ │ │ │ ├── log
│ │ │ │ └── resource
│ │ │ │ │ ├── level_info.gif
│ │ │ │ │ ├── level_debug.gif
│ │ │ │ │ ├── level_error.gif
│ │ │ │ │ ├── level_fatal.gif
│ │ │ │ │ ├── level_trace.gif
│ │ │ │ │ └── level_warning.gif
│ │ │ │ └── buildnum.properties
│ │ ├── commons-logging.properties
│ │ └── log4j.xml
│ └── java
│ │ └── net
│ │ └── ggtools
│ │ └── grand
│ │ └── ui
│ │ ├── log
│ │ ├── LogEventListener.java
│ │ ├── UILogFactory.java
│ │ ├── LogEventBuffer.java
│ │ └── CommonsLoggingLoggerFactory.java
│ │ ├── RecentFilesListener.java
│ │ ├── graph
│ │ ├── FilterChainModelListener.java
│ │ ├── GraphEvent.java
│ │ ├── GraphModelListener.java
│ │ ├── GraphControllerListener.java
│ │ ├── GraphListener.java
│ │ ├── GraphControllerProvider.java
│ │ ├── draw2d
│ │ │ ├── ConstrainedPageFlowLayout.java
│ │ │ └── XYRelativeAnchor.java
│ │ ├── GraphDisplayer.java
│ │ └── SelectionManager.java
│ │ ├── actions
│ │ ├── ClearRecentFilesAction.java
│ │ ├── QuitAction.java
│ │ ├── ZoomInAction.java
│ │ ├── ZoomOutAction.java
│ │ ├── ZoomResetAction.java
│ │ ├── ClearFiltersAction.java
│ │ ├── AboutAction.java
│ │ ├── PageSetupAction.java
│ │ ├── FilterFromNodeAction.java
│ │ ├── ShowSourcePanelAction.java
│ │ ├── ShowOutlinePanelAction.java
│ │ ├── FilterConnectedToNodeAction.java
│ │ ├── FilterIsolatedNodesAction.java
│ │ ├── FilterMissingNodesAction.java
│ │ ├── FilterPrefixedNodesAction.java
│ │ ├── FilterToNodeAction.java
│ │ ├── ReloadGraphAction.java
│ │ ├── PreferenceAction.java
│ │ ├── EditGraphPropertiesAction.java
│ │ ├── OpenFileAction.java
│ │ ├── UseBusRoutingAction.java
│ │ ├── PrintAction.java
│ │ ├── FilterSelectedNodesAction.java
│ │ └── QuickOpenFileAction.java
│ │ ├── event
│ │ ├── Dispatcher.java
│ │ ├── SimpleDispatcherFactory.java
│ │ ├── DispatcherFactory.java
│ │ ├── DispatcherAdapter.java
│ │ └── SimpleDispatcher.java
│ │ ├── menu
│ │ ├── HelpMenu.java
│ │ ├── FileMenuManager.java
│ │ ├── ViewMenu.java
│ │ └── GraphMenu.java
│ │ ├── prefs
│ │ ├── GeneralPreferencePage.java
│ │ ├── GrandUiPreferenceManager.java
│ │ ├── GraphPreferencePage.java
│ │ └── PreferenceKeys.java
│ │ └── widgets
│ │ ├── property
│ │ ├── PropertyChangedListener.java
│ │ ├── PropertyPair.java
│ │ └── PropertyListLabelProvider.java
│ │ ├── LogWindow.java
│ │ ├── ExceptionDialog.java
│ │ ├── CanvasScroller.java
│ │ └── Splash.java
└── test
│ ├── resources
│ ├── bug-79.xml
│ ├── bug-79-2.xml
│ ├── missing-node-filter.xml
│ ├── bug-101.xml
│ ├── ant-project-test.xml
│ ├── seq-build.xml
│ └── build-ticket-9.xml
│ └── java
│ └── net
│ └── ggtools
│ └── grand
│ └── ui
│ └── widgets
│ └── property
│ └── PropertyEditorTestApp.java
├── README.txt
├── LICENSE-Graphviz.txt
├── attic
├── jnlp
│ ├── splash.jpg
│ ├── grand-icon.gif
│ └── grand-ui.jnlp
├── Dependencies.launch
└── grand-ui-launcher.xml
├── .gitignore
├── .checkstyle
├── .settings
└── org.eclipse.jdt.ui.prefs
├── .project
├── ivy.settings.xml
├── .classpath
├── .externalToolBuilders
└── Dependencies.launch
└── ivy.xml
/ChangeLog-Ui.txt:
--------------------------------------------------------------------------------
1 | Please see site/changes.xml in Grand
--------------------------------------------------------------------------------
/src/main/scripts/GrandUI.app/Contents/PkgInfo:
--------------------------------------------------------------------------------
1 | APPL????
--------------------------------------------------------------------------------
/README.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/README.txt
--------------------------------------------------------------------------------
/LICENSE-Graphviz.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/LICENSE-Graphviz.txt
--------------------------------------------------------------------------------
/attic/jnlp/splash.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/attic/jnlp/splash.jpg
--------------------------------------------------------------------------------
/attic/jnlp/grand-icon.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/attic/jnlp/grand-icon.gif
--------------------------------------------------------------------------------
/src/main/config/icons.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/config/icons.xcf
--------------------------------------------------------------------------------
/src/main/config/splash.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/config/splash.xcf
--------------------------------------------------------------------------------
/src/main/config/icons-64.xcf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/config/icons-64.xcf
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | bin/
2 | deps/
3 | dist/
4 | lib/
5 | tmp/
6 | .settings/
7 | .idea/
8 | *.iml
9 | .DS_Store
10 |
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/resource/about.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/resource/about.png
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/resource/splash.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/resource/splash.png
--------------------------------------------------------------------------------
/src/main/scripts/GrandUI.app/Contents/Resources/Grand.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/scripts/GrandUI.app/Contents/Resources/Grand.icns
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/resource/link-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/resource/link-icon.png
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/resource/node-icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/resource/node-icon.png
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/resource/application.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/resource/application.png
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/log/resource/level_info.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/log/resource/level_info.gif
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/log/resource/level_debug.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/log/resource/level_debug.gif
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/log/resource/level_error.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/log/resource/level_error.gif
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/log/resource/level_fatal.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/log/resource/level_fatal.gif
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/log/resource/level_trace.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/log/resource/level_trace.gif
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/log/resource/level_warning.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Ant-Grand/GrandUI/HEAD/src/main/resources/net/ggtools/grand/ui/log/resource/level_warning.gif
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/buildnum.properties:
--------------------------------------------------------------------------------
1 | #Tue, 31 Dec 2019 21:20:37 +0100
2 | build.time=21\:20\:37
3 | build.number=312
4 | build.version.string=0.9
5 | build.date=2019-12-31
6 |
--------------------------------------------------------------------------------
/src/main/resources/commons-logging.properties:
--------------------------------------------------------------------------------
1 | # Configuration for apache commons logging
2 | # Use a specific factory.
3 | org.apache.commons.logging.LogFactory=net.ggtools.grand.ui.log.UILogFactory
4 |
--------------------------------------------------------------------------------
/src/main/scripts/GrandUI.app/Contents/Resources/en.lproj/Localizable.strings:
--------------------------------------------------------------------------------
1 | "JRELoadError" = "Unable to load Java Runtime Environment.";
2 | "MainClassNameRequired" = "Main class name is required.";
3 | "JavaDirectoryNotFound" = "Unable to enumerate Java directory contents.";
4 |
--------------------------------------------------------------------------------
/.checkstyle:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/test/resources/bug-79.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
9 |
10 | Init done
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/main/scripts/grand-ui.bat:
--------------------------------------------------------------------------------
1 | @set BASEDIR=%~dp0
2 |
3 | @java -version 2>&1 | findstr 64 >nul
4 | @if ERRORLEVEL 1 (echo "SWT 4.10+ requires 64-bit Java" & exit /b 1)
5 |
6 | @for /f tokens^=2^ delims^=.-+_^" %%j in ('java -fullversion 2^>^&1') do set "java.major=%%j"
7 | if %java.major%==1 (
8 | start javaw -Djava.ext.dirs=%BASEDIR%lib;%BASEDIR%lib\win32 -jar %BASEDIR%lib\grand-ui.jar
9 | ) else (
10 | start javaw -p %BASEDIR%lib;%BASEDIR%lib\win32 -m grand.ui
11 | )
12 | @exit
13 |
--------------------------------------------------------------------------------
/src/test/resources/bug-79-2.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
10 |
11 | Init done
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/test/resources/missing-node-filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ant build file for running the MissingNodeFilterTest JUnit tests.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/main/scripts/grand-ui.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | ## resolve links - $0 may be a link
4 | PRG="$0"
5 |
6 | # need this for relative symlinks
7 | while [ -h "$PRG" ]; do
8 | ls=`ls -ld "$PRG"`
9 | link=`expr "$ls" : '.*-> \(.*\)$'`
10 | if expr "$link" : '/.*' > /dev/null; then
11 | PRG="$link"
12 | else
13 | PRG=`dirname "$PRG"`"/$link"
14 | fi
15 | done
16 |
17 | BASEDIR=`dirname "$PRG"`
18 |
19 | if [ `java -version 2>&1 | grep -c 64` -eq 0 ]; then
20 | echo "SWT 4.10+ requires 64-bit Java"
21 | exit 1
22 | fi
23 |
24 | if [ `java -version 2>&1 | sed -n 's/.* version "\([^.]*\)\..*".*/\1/p'` -eq 1 ]; then
25 | java -Djava.ext.dirs=$BASEDIR/lib:$BASEDIR/lib/gtk -jar $BASEDIR/lib/grand-ui.jar
26 | else
27 | java -p $BASEDIR/lib:$BASEDIR/lib/gtk -m grand.ui
28 | fi
29 |
--------------------------------------------------------------------------------
/src/main/resources/net/ggtools/grand/ui/resource/fonts.properties:
--------------------------------------------------------------------------------
1 | # $Id$
2 | # Font definitions for Grand.
3 |
4 | net.ggtools.grand.ui.graphfont.0=Sans-regular-11
5 | net.ggtools.grand.ui.graphfont.1=Trebuchet-regular-11
6 | net.ggtools.grand.ui.monospacefont.0=Monospace-regular-10
7 | net.ggtools.grand.ui.monospacefont.1=Andale Mono-regular-10
8 |
9 | net.ggtools.grand.ui.nodefont.0=Sans-regular-11
10 | net.ggtools.grand.ui.nodefont.1=Trebuchet MS-regular-11
11 |
12 | net.ggtools.grand.ui.linkfont.0=Serif-regular-11
13 | net.ggtools.grand.ui.linkfont.1=Georgia-regular-11
14 |
15 | net.ggtools.grand.ui.tooltipfont.0=Serif-regular-10
16 | net.ggtools.grand.ui.tooltipfont.1=Trebuchet MS-regular-10
17 | net.ggtools.grand.ui.tooltipmonospacefont.0=Monospace-regular-9
18 | net.ggtools.grand.ui.tooltipmonospacefont.1=Andale Mono-regular-9
19 |
--------------------------------------------------------------------------------
/.settings/org.eclipse.jdt.ui.prefs:
--------------------------------------------------------------------------------
1 | comment_clear_blank_lines=false
2 | comment_format_comments=true
3 | comment_format_header=true
4 | comment_format_html=true
5 | comment_format_source_code=true
6 | comment_indent_parameter_description=true
7 | comment_indent_root_tags=true
8 | comment_line_length=80
9 | comment_new_line_for_parameter=true
10 | comment_separate_root_tags=false
11 | eclipse.preferences.version=1
12 | formatter_settings_version=10
13 | internal.default.compliance=default
14 | org.eclipse.jdt.ui.exception.name=e
15 | org.eclipse.jdt.ui.gettersetter.use.is=true
16 | org.eclipse.jdt.ui.ignorelowercasenames=true
17 | org.eclipse.jdt.ui.importorder=java;javax;org;com;
18 | org.eclipse.jdt.ui.javadoc=false
19 | org.eclipse.jdt.ui.keywordthis=false
20 | org.eclipse.jdt.ui.ondemandthreshold=99
21 | org.eclipse.jdt.ui.overrideannotation=true
22 | org.eclipse.jdt.ui.text.custom_code_templates=
23 |
--------------------------------------------------------------------------------
/src/test/resources/bug-101.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Building UNIX COE Bundle
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | GrandUi
4 | Ant build graph analyser GUI
5 |
6 | Grand
7 |
8 |
9 |
10 | org.eclipse.ui.externaltools.ExternalToolBuilder
11 | auto,clean,incremental,
12 |
13 |
14 | LaunchConfigHandle
15 | <project>/.externalToolBuilders/Dependencies.launch
16 |
17 |
18 |
19 |
20 | org.eclipse.jdt.core.javabuilder
21 |
22 |
23 |
24 |
25 | net.sf.eclipsecs.core.CheckstyleBuilder
26 |
27 |
28 |
29 |
30 |
31 | org.eclipse.jdt.core.javanature
32 | net.sf.eclipsecs.core.CheckstyleNature
33 | org.apache.ivyde.eclipse.ivynature
34 |
35 |
36 |
--------------------------------------------------------------------------------
/ivy.settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
8 |
9 |
10 |
11 |
12 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/test/resources/ant-project-test.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Ant build file for running the AntProjectTest JUnit tests.
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/main/scripts/GrandUI.app/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | English
7 | CFBundleExecutable
8 | JavaAppLauncher
9 | CFBundleIconFile
10 | Grand.icns
11 | CFBundleGetInfoString
12 | Grand UI @VERSION@ for Mac OS X
13 | CFBundleIdentifier
14 | net.ggtools.grand.ui
15 | CFBundleDisplayName
16 | GrandUI
17 | CFBundleInfoDictionaryVersion
18 | 6.0
19 | CFBundleName
20 | GrandUI
21 | CFBundlePackageType
22 | APPL
23 | CFBundleShortVersionString
24 | @VERSION@
25 | CFBundleSignature
26 | ????
27 | CFBundleVersion
28 | 1
29 | NSHumanReadableCopyright
30 | © @YEARS@ Christophe Labouisse/@VENDOR@
31 | LSApplicationCategoryType
32 | public.app-category.developer-tools
33 | NSHighResolutionCapable
34 |
35 | JVMMainClassName
36 | net/ggtools/grand/ui/Application
37 | JVMOptions
38 |
39 | -XstartOnFirstThread
40 |
41 | JVMArguments
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/.classpath:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/attic/jnlp/grand-ui.jnlp:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | @TITLE@
6 | ggTools
7 |
8 | GUI for Grand
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/log/LogEventListener.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.log;
29 |
30 |
31 | /**
32 | * @author Christophe Labouisse
33 | */
34 | public interface LogEventListener {
35 | /**
36 | * Method logEventReceived.
37 | * @param event LogEvent
38 | */
39 | void logEventReceived(LogEvent event);
40 | }
41 |
--------------------------------------------------------------------------------
/attic/Dependencies.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/.externalToolBuilders/Dependencies.launch:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/attic/grand-ui-launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
20 |
21 |
22 | Launcher for GrandUI. The following properties can be set:
23 | libdir: location of the pure java jars (${libdir}),
24 | swtlibdir: location of the swt jar/libraries (${swtlibdir}),
25 | background: run GrandUI in background.
26 |
27 |
28 |
29 |
30 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/RecentFilesListener.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui;
29 |
30 | import java.util.Collection;
31 |
32 | /**
33 | * Interface for classes listening to the changes in the recent files.
34 | *
35 | * @author Christophe Labouisse
36 | */
37 | public interface RecentFilesListener {
38 | /**
39 | * Tell the listener to update the recent files list.
40 | * @param fileList Collection<String>
41 | */
42 | void refreshRecentFiles(Collection fileList);
43 | }
44 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/graph/FilterChainModelListener.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2004, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.graph;
33 |
34 | import net.ggtools.grand.graph.Graph;
35 |
36 | /**
37 | * Interface to be implemented by classes listening to FilterChainModel changes.
38 | *
39 | * @author Christophe Labouisse
40 | */
41 | public interface FilterChainModelListener {
42 |
43 | /**
44 | * Method filteredGraphAvailable.
45 | * @param filteredGraph Graph
46 | */
47 | void filteredGraphAvailable(final Graph filteredGraph);
48 | }
49 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/graph/GraphEvent.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.graph;
33 |
34 | /**
35 | * Event send by the model to the controller.
36 | *
37 | * @author Christophe Labouisse
38 | */
39 | public class GraphEvent {
40 | /**
41 | * Field model.
42 | */
43 | @SuppressWarnings("unused")
44 | private final GraphModel model;
45 |
46 | /**
47 | * Constructor for GraphEvent.
48 | * @param model GraphModel
49 | */
50 | public GraphEvent(final GraphModel model) {
51 | this.model = model;
52 | }
53 | }
54 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/graph/GraphModelListener.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.graph;
30 |
31 | /**
32 | * Interface to be implemented by classes listening to a graph model.
33 | *
34 | * @author Christophe Labouisse
35 | */
36 | public interface GraphModelListener {
37 |
38 | /**
39 | * Called when a new graph has been made ready by the model. It can also be
40 | * send when the graph has undergone enough changes to need a
41 | * full reload on the listener side.
42 | *
43 | * @param event event.
44 | */
45 | void newGraphLoaded(GraphEvent event);
46 | }
47 |
--------------------------------------------------------------------------------
/ivy.xml:
--------------------------------------------------------------------------------
1 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/ClearRecentFilesAction.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.actions;
29 |
30 | import net.ggtools.grand.ui.RecentFilesManager;
31 |
32 | import org.eclipse.jface.action.Action;
33 |
34 | /**
35 | * @author Christophe Labouisse
36 | */
37 | public class ClearRecentFilesAction extends Action {
38 | /**
39 | * Constructor for ClearRecentFilesAction.
40 | */
41 | public ClearRecentFilesAction() {
42 | super("Remove recent files");
43 | }
44 |
45 | /**
46 | * Method run.
47 | * @see org.eclipse.jface.action.IAction#run()
48 | */
49 | @Override
50 | public final void run() {
51 | RecentFilesManager.getInstance().clear();
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/event/Dispatcher.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.event;
30 |
31 | /**
32 | * Interface for class implementing event dispatching on the client side.
33 | *
34 | * @author Christophe Labouisse
35 | */
36 | public interface Dispatcher {
37 | /**
38 | * Client method use to dispatch the current subscribers.
39 | *
40 | * @param eventData Object
41 | */
42 | void dispatch(final Object eventData);
43 |
44 | /**
45 | * Method used by the manager to send one event to one subscriber.
46 | *
47 | * @param subscriber Object
48 | * @param eventData Object
49 | */
50 | void sendEventToSubscriber(final Object subscriber, final Object eventData);
51 |
52 | }
53 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/menu/HelpMenu.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.menu;
33 |
34 | import net.ggtools.grand.ui.actions.AboutAction;
35 | import net.ggtools.grand.ui.widgets.GraphWindow;
36 |
37 | import org.eclipse.jface.action.MenuManager;
38 | import org.eclipse.swt.SWT;
39 |
40 | /**
41 | *
42 | *
43 | * @author Christophe Labouisse
44 | */
45 | public class HelpMenu extends MenuManager {
46 |
47 | /**
48 | * Constructor for HelpMenu.
49 | * @param window GraphWindow
50 | */
51 | public HelpMenu(final GraphWindow window) {
52 | super("Help");
53 | if (!SWT.getPlatform().equals("cocoa")) {
54 | add(new AboutAction(window));
55 | }
56 | }
57 | }
58 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/graph/GraphControllerListener.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.graph;
29 |
30 | /**
31 | * Interface to be implemented by classes listener
32 | * to GraphController availability events.
33 | *
34 | * @author Christophe Labouisse
35 | */
36 | public interface GraphControllerListener {
37 | /**
38 | * Notify the listener that the controller has been removed and should
39 | * no longer be used.
40 | *
41 | * @param controller GraphController
42 | */
43 | void controllerRemoved(GraphController controller);
44 |
45 | /**
46 | * Notify the listener of the new available controller.
47 | *
48 | * @param controller GraphController
49 | */
50 | void controllerAvailable(GraphController controller);
51 | }
52 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/log/UILogFactory.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.log;
29 |
30 | import org.apache.commons.logging.Log;
31 | import org.apache.commons.logging.impl.LogFactoryImpl;
32 |
33 | /**
34 | * @author Christophe Labouisse
35 | */
36 | public class UILogFactory extends LogFactoryImpl {
37 |
38 | /**
39 | *
40 | */
41 | public UILogFactory() {
42 | super();
43 | }
44 |
45 | /**
46 | * Method newInstance.
47 | * @param name String
48 | * @return Log
49 | * @see org.apache.commons.logging.impl.LogFactoryImpl#newInstance(java.lang.String)
50 | */
51 | @Override
52 | protected final Log newInstance(final String name) {
53 | final Log log = super.newInstance(name);
54 | return new UILogger(name, log);
55 | }
56 | }
57 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/graph/GraphListener.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.graph;
30 |
31 | import java.util.Collection;
32 |
33 | import net.ggtools.grand.ui.graph.draw2d.Draw2dNode;
34 |
35 | /**
36 | * Interface to be implemented by class watch state of graph objects.
37 | *
38 | * @author Christophe Labouisse
39 | */
40 | public interface GraphListener {
41 | /**
42 | * Method called when a graph's selection has changed.
43 | *
44 | * @param selectedNodes a read-only collection of the selected nodes.
45 | */
46 | void selectionChanged(Collection selectedNodes);
47 |
48 | /**
49 | * Method called when a graph parameter
50 | * such as the layout algorithm has changed.
51 | *
52 | * @param controller GraphController
53 | */
54 | void parameterChanged(GraphController controller);
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/event/SimpleDispatcherFactory.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.event;
30 |
31 | import java.lang.reflect.Method;
32 |
33 | /**
34 | * Ye old 'n faithful factory creating
35 | * {@link net.ggtools.grand.ui.event.SimpleDispatcher}.
36 | *
37 | * @author Christophe Labouisse
38 | */
39 | class SimpleDispatcherFactory extends DispatcherFactory {
40 |
41 | /**
42 | * Method createDispatcher.
43 | * @param eventManager EventManager
44 | * @param method Method
45 | * @return Dispatcher
46 | * @see net.ggtools.grand.ui.event.DispatcherFactory#createDispatcher(net.ggtools.grand.ui.event.EventManager,
47 | * java.lang.reflect.Method)
48 | */
49 | @Override
50 | Dispatcher createDispatcher(final EventManager eventManager,
51 | final Method method) {
52 | return new SimpleDispatcher(eventManager, method);
53 | }
54 |
55 | }
56 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/log/LogEventBuffer.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.log;
29 |
30 | import java.io.Serializable;
31 | import java.util.List;
32 |
33 | /**
34 | * @author Christophe Labouisse
35 | */
36 | public interface LogEventBuffer extends Serializable {
37 |
38 | /**
39 | * Add a new listener.
40 | *
41 | * @param newListener LogEventListener
42 | */
43 | void addListener(final LogEventListener newListener);
44 |
45 | /**
46 | * Removed all events from the current buffer.
47 | *
48 | */
49 | void clearLogEvents();
50 |
51 | /**
52 | * Return an unmodifiable list of events.
53 | *
54 | * @return the list of events.
55 | */
56 | List getEventList();
57 |
58 | /**
59 | * Remove a specific listener.
60 | *
61 | * @param toRemove LogEventListener
62 | */
63 | void removeListener(final LogEventListener toRemove);
64 |
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/QuitAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.actions;
33 |
34 | import org.eclipse.jface.action.Action;
35 | import org.eclipse.swt.SWT;
36 |
37 | /**
38 | *
39 | *
40 | * @author Christophe Labouisse
41 | */
42 | public class QuitAction extends Action {
43 |
44 | /**
45 | * Field DEFAULT_ACTION_NAME.
46 | * (value is {@value #DEFAULT_ACTION_NAME})
47 | */
48 | private static final String DEFAULT_ACTION_NAME = "Quit";
49 |
50 | /**
51 | * Constructor for QuitAction.
52 | */
53 | public QuitAction() {
54 | super(DEFAULT_ACTION_NAME);
55 | setAccelerator((SWT.getPlatform().equals("cocoa") ? SWT.MOD1 : SWT.CONTROL) | 'Q');
56 | }
57 |
58 | /**
59 | * Method run.
60 | * @see org.eclipse.jface.action.IAction#run()
61 | */
62 | @Override
63 | public final void run() {
64 | System.exit(0);
65 | }
66 | }
67 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/ZoomInAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.actions;
29 |
30 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
31 |
32 | import org.eclipse.swt.SWT;
33 |
34 | /**
35 | * @author Christophe Labouisse
36 | */
37 | public class ZoomInAction extends GraphControllerAction {
38 |
39 | /**
40 | * Field DEFAULT_ACTION_NAME.
41 | * (value is {@value #DEFAULT_ACTION_NAME})
42 | */
43 | private static final String DEFAULT_ACTION_NAME = "Zoom In";
44 |
45 | /**
46 | * @param provider GraphControllerProvider
47 | */
48 | public ZoomInAction(final GraphControllerProvider provider) {
49 | super(provider, DEFAULT_ACTION_NAME);
50 | setAccelerator(SWT.PAGE_UP);
51 | }
52 |
53 | /**
54 | * Method run.
55 | * @see org.eclipse.jface.action.IAction#run()
56 | */
57 | @Override
58 | public final void run() {
59 | getGraphController().getDisplayer().zoomIn();
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/ZoomOutAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.actions;
29 |
30 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
31 |
32 | import org.eclipse.swt.SWT;
33 |
34 | /**
35 | * @author Christophe Labouisse
36 | */
37 | public class ZoomOutAction extends GraphControllerAction {
38 |
39 | /**
40 | * Field DEFAULT_ACTION_NAME.
41 | * (value is {@value #DEFAULT_ACTION_NAME})
42 | */
43 | private static final String DEFAULT_ACTION_NAME = "Zoom Out";
44 |
45 | /**
46 | * @param provider GraphControllerProvider
47 | */
48 | public ZoomOutAction(final GraphControllerProvider provider) {
49 | super(provider, DEFAULT_ACTION_NAME);
50 | setAccelerator(SWT.PAGE_DOWN);
51 | }
52 |
53 | /**
54 | * Method run.
55 | * @see org.eclipse.jface.action.IAction#run()
56 | */
57 | @Override
58 | public final void run() {
59 | getGraphController().getDisplayer().zoomOut();
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/ZoomResetAction.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.actions;
29 |
30 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
31 |
32 | import org.eclipse.swt.SWT;
33 |
34 | /**
35 | * @author Christophe Labouisse
36 | */
37 | public class ZoomResetAction extends GraphControllerAction {
38 |
39 | /**
40 | * Field DEFAULT_ACTION_NAME.
41 | * (value is {@value #DEFAULT_ACTION_NAME})
42 | */
43 | private static final String DEFAULT_ACTION_NAME = "Reset Zoom";
44 |
45 | /**
46 | * @param provider GraphControllerProvider
47 | */
48 | public ZoomResetAction(final GraphControllerProvider provider) {
49 | super(provider, DEFAULT_ACTION_NAME);
50 | setAccelerator(SWT.HOME);
51 | }
52 |
53 | /**
54 | * Method run.
55 | * @see org.eclipse.jface.action.IAction#run()
56 | */
57 | @Override
58 | public final void run() {
59 | getGraphController().getDisplayer().zoomReset();
60 | }
61 | }
62 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/prefs/GeneralPreferencePage.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.prefs;
29 |
30 | import org.eclipse.jface.preference.FieldEditorPreferencePage;
31 | import org.eclipse.swt.widgets.Composite;
32 |
33 | /**
34 | * @author Christophe Labouisse
35 | */
36 | public class GeneralPreferencePage extends FieldEditorPreferencePage
37 | implements PreferenceKeys {
38 | /**
39 | *
40 | */
41 | GeneralPreferencePage() {
42 | super("General", GRID);
43 | }
44 |
45 | /**
46 | * Method createFieldEditors.
47 | * @see org.eclipse.jface.preference.FieldEditorPreferencePage#createFieldEditors()
48 | */
49 | @Override
50 | protected final void createFieldEditors() {
51 | final Composite parent = getFieldEditorParent();
52 | final SpinnerFieldEditor maxFiles = new SpinnerFieldEditor(MAX_RECENT_FILES_PREFS_KEY,
53 | "Max Recent Files", parent);
54 | maxFiles.setValidRange(1, 9);
55 | addField(maxFiles);
56 | }
57 |
58 | }
59 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/graph/GraphControllerProvider.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.graph;
29 |
30 | /**
31 | * Interface to be implemented by classes providing GraphController instances. A
32 | * provider's goal is to inform the GraphController user whether or not
33 | * a controller is currently available. This can happen either
34 | * through a simple getGraphController method of through a listener mechanism.
35 | *
36 | * @author Christophe Labouisse
37 | */
38 | public interface GraphControllerProvider {
39 |
40 | /**
41 | * Get the current controller.
42 | *
43 | * @return the current controller or null if none is available.
44 | */
45 | GraphController getController();
46 |
47 | /**
48 | * Add a new listener to the provider.
49 | * @param listener GraphControllerListener
50 | * @see GraphControllerListener
51 | */
52 | void addControllerListener(GraphControllerListener listener);
53 |
54 | /**
55 | * Remove a listener.
56 | * @param listener GraphControllerListener
57 | */
58 | void removeControllerListener(GraphControllerListener listener);
59 | }
60 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/widgets/property/PropertyChangedListener.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.widgets.property;
29 |
30 | /**
31 | * @author Christophe Labouisse
32 | */
33 | public interface PropertyChangedListener {
34 |
35 | /**
36 | * This method will be call when a significant number of properties are
37 | * changed. Listeners should reparse the complete property list.
38 | * @param fillerParameter Object
39 | */
40 | void allPropertiesChanged(Object fillerParameter);
41 |
42 | /**
43 | * Method clearedProperties.
44 | * @param fillerParameter Object
45 | */
46 | void clearedProperties(Object fillerParameter);
47 |
48 | /**
49 | * Method propertyAdded.
50 | * @param propertyPair PropertyPair
51 | */
52 | void propertyAdded(PropertyPair propertyPair);
53 |
54 | /**
55 | * Method propertyChanged.
56 | * @param propertyPair PropertyPair
57 | */
58 | void propertyChanged(PropertyPair propertyPair);
59 |
60 | /**
61 | * Method propertyRemoved.
62 | * @param propertyPair PropertyPair
63 | */
64 | void propertyRemoved(PropertyPair propertyPair);
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/event/DispatcherFactory.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.event;
30 |
31 | import java.lang.reflect.Method;
32 |
33 | /**
34 | * Factory for Dispatcher.
35 | *
36 | * @author Christophe Labouisse
37 | */
38 | abstract class DispatcherFactory {
39 | /**
40 | * Field instance.
41 | */
42 | private static DispatcherFactory instance = null;
43 |
44 | /**
45 | * Constructor for DispatcherFactory.
46 | */
47 | protected DispatcherFactory() {
48 | }
49 |
50 | /**
51 | * Get the instance of the factory.
52 | *
53 | * @return DispatcherFactory
54 | */
55 | static final DispatcherFactory getInstance() {
56 | if (instance == null) {
57 | instance = new SimpleDispatcherFactory();
58 | }
59 |
60 | return instance;
61 | }
62 |
63 | /**
64 | * Creates a new Dispatcher for a specific method.
65 | *
66 | * @param eventManager EventManager
67 | * @param method Method
68 | * @return Dispatcher
69 | */
70 | abstract Dispatcher createDispatcher(final EventManager eventManager,
71 | final Method method);
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/ClearFiltersAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
32 |
33 | import org.eclipse.swt.SWT;
34 |
35 | /**
36 | * An action to remove all filters currently enabled.
37 | *
38 | * @author Christophe Labouisse
39 | */
40 | public class ClearFiltersAction extends GraphControllerAction {
41 |
42 | /**
43 | * Field DEFAULT_ACTION_NAME.
44 | * (value is {@value #DEFAULT_ACTION_NAME})
45 | */
46 | private static final String DEFAULT_ACTION_NAME = "Remove filters";
47 |
48 | /**
49 | * Method run.
50 | * @see org.eclipse.jface.action.IAction#run()
51 | */
52 | @Override
53 | public final void run() {
54 | getGraphController().clearFilters();
55 | }
56 |
57 | /**
58 | * Constructor for ClearFiltersAction.
59 | * @param parent GraphControllerProvider
60 | */
61 | public ClearFiltersAction(final GraphControllerProvider parent) {
62 | super(parent, DEFAULT_ACTION_NAME);
63 | setAccelerator((SWT.getPlatform().equals("cocoa") ? SWT.MOD1 : SWT.CONTROL) | SWT.ALT | 'C');
64 | }
65 | }
66 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/log/CommonsLoggingLoggerFactory.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.log;
29 |
30 | import net.ggtools.grand.log.LoggerFactory;
31 |
32 | import org.apache.commons.logging.Log;
33 | import org.apache.commons.logging.LogFactory;
34 |
35 | /**
36 | * Logger factory used to make Grand's core log using the same mechanism than
37 | * the UI.
38 | *
39 | * @author Christophe Labouisse
40 | */
41 | public class CommonsLoggingLoggerFactory implements LoggerFactory {
42 |
43 | /**
44 | * Package instantiation only.
45 | */
46 | public CommonsLoggingLoggerFactory() {
47 | }
48 |
49 | /**
50 | * Method getLog.
51 | * @param clazz Class<?>
52 | * @return Log
53 | * @see net.ggtools.grand.log.LoggerFactory#getLog(java.lang.Class)
54 | */
55 | public final Log getLog(final Class> clazz) {
56 | return LogFactory.getLog(clazz);
57 | }
58 |
59 | /**
60 | * Method getLog.
61 | * @param name String
62 | * @return Log
63 | * @see net.ggtools.grand.log.LoggerFactory#getLog(java.lang.String)
64 | */
65 | public final Log getLog(final String name) {
66 | return LogFactory.getLog(name);
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/AboutAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.actions;
33 |
34 | import net.ggtools.grand.ui.widgets.AboutDialog;
35 | import net.ggtools.grand.ui.widgets.GraphWindow;
36 |
37 | import org.eclipse.jface.action.Action;
38 |
39 | /**
40 | *
41 | *
42 | * @author Christophe Labouisse
43 | */
44 | public class AboutAction extends Action {
45 |
46 | /**
47 | * Field DEFAULT_ACTION_NAME.
48 | * (value is {@value #DEFAULT_ACTION_NAME})
49 | */
50 | private static final String DEFAULT_ACTION_NAME = "About Grand";
51 |
52 | /**
53 | * Field window.
54 | */
55 | private final GraphWindow window;
56 |
57 | /**
58 | * Constructor for AboutAction.
59 | * @param parent GraphWindow
60 | */
61 | public AboutAction(final GraphWindow parent) {
62 | super(DEFAULT_ACTION_NAME);
63 | window = parent;
64 | }
65 |
66 | /**
67 | * Method run.
68 | * @see org.eclipse.jface.action.IAction#run()
69 | */
70 | @Override
71 | public final void run() {
72 | final AboutDialog dialog = new AboutDialog(window.getShell());
73 | dialog.open();
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/PageSetupAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.actions;
33 |
34 | import net.ggtools.grand.ui.widgets.GraphWindow;
35 | import net.ggtools.grand.ui.widgets.PageSetupDialog;
36 |
37 | import org.eclipse.jface.action.Action;
38 |
39 | /**
40 | *
41 | *
42 | * @author Christophe Labouisse
43 | */
44 | public class PageSetupAction extends Action {
45 |
46 | /**
47 | * Field DEFAULT_ACTION_NAME.
48 | * (value is {@value #DEFAULT_ACTION_NAME})
49 | */
50 | private static final String DEFAULT_ACTION_NAME = "Page Setup";
51 |
52 | /**
53 | * Field window.
54 | */
55 | private final GraphWindow window;
56 |
57 | /**
58 | * Constructor for PageSetupAction.
59 | * @param parent GraphWindow
60 | */
61 | public PageSetupAction(final GraphWindow parent) {
62 | super(DEFAULT_ACTION_NAME);
63 | window = parent;
64 | }
65 |
66 | /**
67 | * Method run.
68 | * @see org.eclipse.jface.action.IAction#run()
69 | */
70 | @Override
71 | public final void run() {
72 | final PageSetupDialog dialog = new PageSetupDialog(window.getShell());
73 | dialog.open();
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/event/DispatcherAdapter.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.event;
30 |
31 | /**
32 | * Adapter class providing a straightforward implementation of dispatch. This
33 | * class is meant to be subclassed by defining the
34 | * {@link net.ggtools.grand.ui.event.Dispatcher#sendEventToSubscriber(Object, Object)}
35 | * method.
36 | *
37 | * @author Christophe Labouisse
38 | */
39 | abstract class DispatcherAdapter implements Dispatcher {
40 |
41 | /**
42 | * Field eventManager.
43 | */
44 | private final EventManager eventManager;
45 |
46 | /**
47 | * @param manager EventManager
48 | */
49 | protected DispatcherAdapter(final EventManager manager) {
50 | eventManager = manager;
51 | }
52 |
53 | /**
54 | * Ask the EventManager to dispatch an event to the subscribers.
55 | * @param eventData Object
56 | * @see net.ggtools.grand.ui.event.Dispatcher#dispatch(Object)
57 | */
58 | public final void dispatch(final Object eventData) {
59 | eventManager.dispatchEvent(eventData, this);
60 | }
61 |
62 | /**
63 | * @return Returns the eventManager.
64 | */
65 | protected final EventManager getEventManager() {
66 | return eventManager;
67 | }
68 |
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/config/Grand.svg:
--------------------------------------------------------------------------------
1 |
2 |
5 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/FilterFromNodeAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.filters.FromNodeFilter;
32 | import net.ggtools.grand.filters.GraphFilter;
33 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
34 | import net.ggtools.grand.ui.graph.GraphListener;
35 |
36 | /**
37 | * Action to select only node on which the current node depend.
38 | *
39 | * @author Christophe Labouisse
40 | */
41 | public class FilterFromNodeAction extends GraphSelectionAction
42 | implements GraphListener {
43 |
44 | /**
45 | * Field DEFAULT_ACTION_NAME.
46 | * (value is {@value #DEFAULT_ACTION_NAME})
47 | */
48 | private static final String DEFAULT_ACTION_NAME =
49 | "Filter from selected node";
50 |
51 | /**
52 | * Constructor for FilterFromNodeAction.
53 | * @param parent GraphControllerProvider
54 | */
55 | public FilterFromNodeAction(final GraphControllerProvider parent) {
56 | super(parent, DEFAULT_ACTION_NAME);
57 | }
58 |
59 | /**
60 | * Method run.
61 | * @see org.eclipse.jface.action.IAction#run()
62 | */
63 | @Override
64 | public final void run() {
65 | final GraphFilter filter = new FromNodeFilter(getCurrentNode());
66 | getGraphController().addFilter(filter);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/ShowSourcePanelAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.actions;
33 |
34 | import net.ggtools.grand.ui.widgets.GraphWindow;
35 |
36 | import org.eclipse.jface.action.Action;
37 | import org.eclipse.swt.SWT;
38 |
39 | /**
40 | *
41 | *
42 | * @author Christophe Labouisse
43 | */
44 | public class ShowSourcePanelAction extends Action {
45 |
46 | /**
47 | * Field DEFAULT_ACTION_NAME.
48 | * (value is {@value #DEFAULT_ACTION_NAME})
49 | */
50 | private static final String DEFAULT_ACTION_NAME = "Show source panel";
51 |
52 | /**
53 | * Field window.
54 | */
55 | private final GraphWindow window;
56 |
57 | /**
58 | * Constructor for ShowSourcePanelAction.
59 | * @param parent GraphWindow
60 | */
61 | public ShowSourcePanelAction(final GraphWindow parent) {
62 | super(DEFAULT_ACTION_NAME);
63 | window = parent;
64 | setChecked(parent.isSourcePanelVisible());
65 | setAccelerator((SWT.getPlatform().equals("cocoa") ? SWT.MOD1 : SWT.CONTROL) | SWT.ALT | 'S');
66 | }
67 |
68 | /**
69 | * Method run.
70 | * @see org.eclipse.jface.action.IAction#run()
71 | */
72 | @Override
73 | public final void run() {
74 | window.setSourcePanelVisible(isChecked());
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/ShowOutlinePanelAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.actions;
33 |
34 | import net.ggtools.grand.ui.widgets.GraphWindow;
35 |
36 | import org.eclipse.jface.action.Action;
37 | import org.eclipse.swt.SWT;
38 |
39 | /**
40 | *
41 | *
42 | * @author Christophe Labouisse
43 | */
44 | public class ShowOutlinePanelAction extends Action {
45 |
46 | /**
47 | * Field DEFAULT_ACTION_NAME.
48 | * (value is {@value #DEFAULT_ACTION_NAME})
49 | */
50 | private static final String DEFAULT_ACTION_NAME = "Show outline panel";
51 |
52 | /**
53 | * Field window.
54 | */
55 | private final GraphWindow window;
56 |
57 | /**
58 | * Constructor for ShowOutlinePanelAction.
59 | * @param parent GraphWindow
60 | */
61 | public ShowOutlinePanelAction(final GraphWindow parent) {
62 | super(DEFAULT_ACTION_NAME);
63 | window = parent;
64 | setChecked(parent.isOutlinePanelVisible());
65 | setAccelerator((SWT.getPlatform().equals("cocoa") ? SWT.MOD1 : SWT.CONTROL) | SWT.ALT | 'O');
66 | }
67 |
68 | /**
69 | * Method run.
70 | * @see org.eclipse.jface.action.IAction#run()
71 | */
72 | @Override
73 | public final void run() {
74 | window.setOutlinePanelVisible(isChecked());
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/FilterConnectedToNodeAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.filters.ConnectedToNodeFilter;
32 | import net.ggtools.grand.filters.GraphFilter;
33 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
34 | import net.ggtools.grand.ui.graph.GraphListener;
35 |
36 | /**
37 | * An action to add a filter to the currently selected node.
38 | *
39 | * @author Christophe Labouisse
40 | */
41 | public class FilterConnectedToNodeAction extends GraphSelectionAction
42 | implements GraphListener {
43 |
44 | /**
45 | * Field DEFAULT_ACTION_NAME.
46 | * (value is {@value #DEFAULT_ACTION_NAME})
47 | */
48 | private static final String DEFAULT_ACTION_NAME =
49 | "Filter connected to selected node";
50 |
51 | /**
52 | * Method run.
53 | * @see org.eclipse.jface.action.IAction#run()
54 | */
55 | @Override
56 | public final void run() {
57 | final GraphFilter filter = new ConnectedToNodeFilter(getCurrentNode());
58 | getGraphController().addFilter(filter);
59 | }
60 |
61 | /**
62 | * Constructor for FilterConnectedToNodeAction.
63 | * @param parent GraphControllerProvider
64 | */
65 | public FilterConnectedToNodeAction(final GraphControllerProvider parent) {
66 | super(parent, DEFAULT_ACTION_NAME);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/FilterIsolatedNodesAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.filters.GraphFilter;
32 | import net.ggtools.grand.filters.IsolatedNodeFilter;
33 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
34 |
35 | import org.eclipse.swt.SWT;
36 |
37 | /**
38 | * An action to filter the isolated nodes.
39 | *
40 | * @author Christophe Labouisse
41 | */
42 | public class FilterIsolatedNodesAction extends GraphControllerAction {
43 |
44 | /**
45 | * Field DEFAULT_ACTION_NAME.
46 | * (value is {@value #DEFAULT_ACTION_NAME})
47 | */
48 | private static final String DEFAULT_ACTION_NAME =
49 | "Filter out isolated nodes";
50 |
51 | /**
52 | * Method run.
53 | * @see org.eclipse.jface.action.IAction#run()
54 | */
55 | @Override
56 | public final void run() {
57 | final GraphFilter filter = new IsolatedNodeFilter();
58 | getGraphController().addFilter(filter);
59 | }
60 |
61 | /**
62 | * Constructor for FilterIsolatedNodesAction.
63 | * @param parent GraphControllerProvider
64 | */
65 | public FilterIsolatedNodesAction(final GraphControllerProvider parent) {
66 | super(parent, DEFAULT_ACTION_NAME);
67 | setAccelerator((SWT.getPlatform().equals("cocoa") ? SWT.MOD1 : SWT.CONTROL) | SWT.ALT | 'I');
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/FilterMissingNodesAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.filters.GraphFilter;
32 | import net.ggtools.grand.filters.MissingNodeFilter;
33 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
34 |
35 | import org.eclipse.swt.SWT;
36 |
37 | /**
38 | * An action to filter the missing nodes.
39 | *
40 | * @author Christophe Labouisse
41 | */
42 | public class FilterMissingNodesAction extends GraphControllerAction {
43 |
44 | /**
45 | * Field DEFAULT_ACTION_NAME.
46 | * (value is {@value #DEFAULT_ACTION_NAME})
47 | */
48 | private static final String DEFAULT_ACTION_NAME =
49 | "Filter out missing nodes";
50 |
51 | /**
52 | * Method run.
53 | * @see org.eclipse.jface.action.IAction#run()
54 | */
55 | @Override
56 | public final void run() {
57 | final GraphFilter filter = new MissingNodeFilter();
58 | getGraphController().addFilter(filter);
59 | }
60 |
61 | /**
62 | * Constructor for FilterMissingNodesAction.
63 | * @param parent GraphControllerProvider
64 | */
65 | public FilterMissingNodesAction(final GraphControllerProvider parent) {
66 | super(parent, DEFAULT_ACTION_NAME);
67 | setAccelerator((SWT.getPlatform().equals("cocoa") ? SWT.MOD1 : SWT.CONTROL) | SWT.ALT | 'M');
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/FilterPrefixedNodesAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.filters.GraphFilter;
32 | import net.ggtools.grand.filters.PrefixedNodeFilter;
33 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
34 |
35 | import org.eclipse.swt.SWT;
36 |
37 | /**
38 | * An action to filter the prefixed nodes.
39 | *
40 | * @author Christophe Labouisse
41 | */
42 | public class FilterPrefixedNodesAction extends GraphControllerAction {
43 |
44 | /**
45 | * Field DEFAULT_ACTION_NAME.
46 | * (value is {@value #DEFAULT_ACTION_NAME})
47 | */
48 | private static final String DEFAULT_ACTION_NAME =
49 | "Filter out prefixed nodes";
50 |
51 | /**
52 | * Method run.
53 | * @see org.eclipse.jface.action.IAction#run()
54 | */
55 | @Override
56 | public final void run() {
57 | final GraphFilter filter = new PrefixedNodeFilter();
58 | getGraphController().addFilter(filter);
59 | }
60 |
61 | /**
62 | * Constructor for FilterPrefixedNodesAction.
63 | * @param parent GraphControllerProvider
64 | */
65 | public FilterPrefixedNodesAction(final GraphControllerProvider parent) {
66 | super(parent, DEFAULT_ACTION_NAME);
67 | setAccelerator((SWT.getPlatform().equals("cocoa") ? SWT.MOD1 : SWT.CONTROL) | SWT.ALT | 'P');
68 | }
69 | }
70 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/FilterToNodeAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.filters.GraphFilter;
32 | import net.ggtools.grand.filters.ToNodeFilter;
33 | import net.ggtools.grand.ui.graph.GraphControllerListener;
34 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
35 | import net.ggtools.grand.ui.graph.GraphListener;
36 |
37 | /**
38 | * Action to select only node depending on the selected node.
39 | *
40 | * @author Christophe Labouisse
41 | */
42 | public class FilterToNodeAction extends GraphSelectionAction
43 | implements GraphControllerListener, GraphListener {
44 |
45 | /**
46 | * Field DEFAULT_ACTION_NAME.
47 | * (value is {@value #DEFAULT_ACTION_NAME})
48 | */
49 | private static final String DEFAULT_ACTION_NAME = "Filter to selected node";
50 |
51 | /**
52 | * Constructor for FilterToNodeAction.
53 | * @param parent GraphControllerProvider
54 | */
55 | public FilterToNodeAction(final GraphControllerProvider parent) {
56 | super(parent, DEFAULT_ACTION_NAME);
57 | }
58 |
59 | /**
60 | * Method run.
61 | * @see org.eclipse.jface.action.IAction#run()
62 | */
63 | @Override
64 | public final void run() {
65 | final GraphFilter filter = new ToNodeFilter(getCurrentNode());
66 | getGraphController().addFilter(filter);
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/ReloadGraphAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
32 |
33 | import org.eclipse.swt.SWT;
34 |
35 | /**
36 | * @author Christophe Labouisse
37 | * @see org.eclipse.jface.action.Action
38 | */
39 | public class ReloadGraphAction extends GraphControllerAction {
40 |
41 | /**
42 | * Field DEFAULT_ACTION_NAME.
43 | * (value is {@value #DEFAULT_ACTION_NAME})
44 | */
45 | private static final String DEFAULT_ACTION_NAME = "Reload Graph";
46 |
47 | /**
48 | * Method run.
49 | * @see org.eclipse.jface.action.IAction#run()
50 | */
51 | @Override
52 | public final void run() {
53 | getGraphController().reloadGraph();
54 | }
55 |
56 | /**
57 | * Creates a new ReloadGraphAction object.
58 | *
59 | * @param parent GraphWindow
60 | */
61 | public ReloadGraphAction(final GraphControllerProvider parent) {
62 | this(parent, DEFAULT_ACTION_NAME);
63 | }
64 |
65 | /**
66 | * Creates a new QuickOpenFileAction object with specific name.
67 | *
68 | * @param parent GraphWindow
69 | * @param name String
70 | */
71 | public ReloadGraphAction(final GraphControllerProvider parent,
72 | final String name) {
73 | super(parent, name);
74 | setAccelerator(SWT.F5);
75 | }
76 | }
77 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/PreferenceAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.ui.prefs.GrandUiPreferenceManager;
32 | import net.ggtools.grand.ui.widgets.GraphWindow;
33 |
34 | import org.eclipse.jface.action.Action;
35 | import org.eclipse.jface.preference.PreferenceDialog;
36 |
37 | /**
38 | * @author Christophe Labouisse
39 | * @see org.eclipse.jface.action.Action
40 | */
41 | public class PreferenceAction extends Action {
42 |
43 | /**
44 | * Field DEFAULT_ACTION_NAME.
45 | * (value is {@value #DEFAULT_ACTION_NAME})
46 | */
47 | private static final String DEFAULT_ACTION_NAME = "Preferences";
48 |
49 | /**
50 | * Field window.
51 | */
52 | private final GraphWindow window;
53 |
54 | /**
55 | * Method run.
56 | * @see org.eclipse.jface.action.IAction#run()
57 | */
58 | @Override
59 | public final void run() {
60 | final GrandUiPreferenceManager pm = new GrandUiPreferenceManager();
61 | final PreferenceDialog dialog =
62 | new PreferenceDialog(window.getShell(), pm);
63 | dialog.open();
64 | }
65 |
66 | /**
67 | * Creates a new PreferenceAction object.
68 | *
69 | * @param parent GraphWindow
70 | */
71 | public PreferenceAction(final GraphWindow parent) {
72 | super(DEFAULT_ACTION_NAME);
73 | window = parent;
74 | }
75 | }
76 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/graph/draw2d/ConstrainedPageFlowLayout.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.graph.draw2d;
29 |
30 | import org.eclipse.draw2d.text.FlowPage;
31 | import org.eclipse.draw2d.text.PageFlowLayout;
32 |
33 | /**
34 | * A layout for {@link org.eclipse.draw2d.text.FlowPage}object with a maximum
35 | * width.
36 | *
37 | * @author Christophe Labouisse
38 | */
39 | public class ConstrainedPageFlowLayout extends PageFlowLayout {
40 |
41 | /**
42 | * Field maxFlowWidth.
43 | */
44 | private int maxFlowWidth = -1; // Default is not to bound lines.
45 |
46 | /**
47 | * Creates a new instance without any constrained width.
48 | * @param page FlowPage
49 | */
50 | public ConstrainedPageFlowLayout(final FlowPage page) {
51 | super(page);
52 | }
53 |
54 | /**
55 | * @return Returns the maximum flow width or -1 if not set.
56 | */
57 | public final int getMaxFlowWidth() {
58 | return maxFlowWidth;
59 | }
60 |
61 | /**
62 | * Sets the maximum with of the flow. When set to a positive value, the
63 | * layout will ensure that the flow lines won't be wider than this value.
64 | *
65 | * @param maxFlowWidth
66 | * The maxFlowWidth to set or -1 not to bound the
67 | * flow width.
68 | */
69 | public final void setMaxFlowWidth(final int maxFlowWidth) {
70 | this.maxFlowWidth = maxFlowWidth;
71 | invalidate();
72 | }
73 | }
74 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/menu/FileMenuManager.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.menu;
33 |
34 | import net.ggtools.grand.ui.actions.OpenFileAction;
35 | import net.ggtools.grand.ui.actions.PageSetupAction;
36 | import net.ggtools.grand.ui.actions.PreferenceAction;
37 | import net.ggtools.grand.ui.actions.PrintAction;
38 | import net.ggtools.grand.ui.actions.QuickOpenFileAction;
39 | import net.ggtools.grand.ui.actions.QuitAction;
40 | import net.ggtools.grand.ui.widgets.GraphWindow;
41 |
42 | import org.eclipse.jface.action.MenuManager;
43 | import org.eclipse.jface.action.Separator;
44 | import org.eclipse.swt.SWT;
45 |
46 | /**
47 | *
48 | *
49 | * @author Christophe Labouisse
50 | */
51 | public class FileMenuManager extends MenuManager {
52 | /**
53 | * Constructor for FileMenuManager.
54 | * @param window GraphWindow
55 | */
56 | public FileMenuManager(final GraphWindow window) {
57 | super("File");
58 | add(new QuickOpenFileAction(window));
59 | add(new OpenFileAction(window));
60 | add(new Separator("recent files"));
61 | add(new RecentFilesMenu(window));
62 | add(new Separator("print"));
63 | add(new PageSetupAction(window));
64 | add(new PrintAction(window));
65 | if (!SWT.getPlatform().equals("cocoa")) {
66 | add(new PreferenceAction(window));
67 | add(new Separator("quit"));
68 | add(new QuitAction());
69 | }
70 | }
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/menu/ViewMenu.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /* ====================================================================
3 | * Copyright (c) 2002-2003, Christophe Labouisse
4 | * All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions
8 | * are met:
9 | *
10 | * 1. Redistributions of source code must retain the above copyright
11 | * notice, this list of conditions and the following disclaimer.
12 | *
13 | * 2. Redistributions in binary form must reproduce the above
14 | * copyright notice, this list of conditions and the following
15 | * disclaimer in the documentation and/or other materials provided
16 | * with the distribution.
17 | *
18 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
21 | * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
22 | * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
23 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
26 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
27 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
29 | * OF THE POSSIBILITY OF SUCH DAMAGE.
30 | */
31 |
32 | package net.ggtools.grand.ui.menu;
33 |
34 | import net.ggtools.grand.ui.actions.ShowLogAction;
35 | import net.ggtools.grand.ui.actions.ShowOutlinePanelAction;
36 | import net.ggtools.grand.ui.actions.ShowSourcePanelAction;
37 | import net.ggtools.grand.ui.actions.UseBusRoutingAction;
38 | import net.ggtools.grand.ui.actions.ZoomInAction;
39 | import net.ggtools.grand.ui.actions.ZoomOutAction;
40 | import net.ggtools.grand.ui.actions.ZoomResetAction;
41 | import net.ggtools.grand.ui.widgets.GraphWindow;
42 |
43 | import org.eclipse.jface.action.MenuManager;
44 | import org.eclipse.jface.action.Separator;
45 |
46 | /**
47 | *
48 | *
49 | * @author Christophe Labouisse
50 | */
51 | public class ViewMenu extends MenuManager {
52 |
53 | /**
54 | * Constructor for ViewMenu.
55 | * @param window GraphWindow
56 | */
57 | public ViewMenu(final GraphWindow window) {
58 | super("View");
59 | add(new Separator("panels"));
60 | add(new ShowSourcePanelAction(window));
61 | add(new ShowOutlinePanelAction(window));
62 | add(new Separator("display"));
63 | add(new UseBusRoutingAction(window));
64 | add(new Separator("zoom"));
65 | add(new ZoomInAction(window));
66 | add(new ZoomOutAction(window));
67 | add(new ZoomResetAction(window));
68 | // Zoom menu
69 | add(new Separator("misc"));
70 | add(new ShowLogAction(window));
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/actions/EditGraphPropertiesAction.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.actions;
30 |
31 | import net.ggtools.grand.ui.graph.GraphControllerProvider;
32 | import net.ggtools.grand.ui.widgets.PropertyEditionDialog;
33 |
34 | import org.eclipse.jface.window.Window;
35 | import org.eclipse.swt.SWT;
36 |
37 | /**
38 | * An action to remove all filters currently enabled.
39 | *
40 | * @author Christophe Labouisse
41 | */
42 | public class EditGraphPropertiesAction extends GraphControllerAction {
43 |
44 | /**
45 | * Field DEFAULT_ACTION_NAME.
46 | * (value is {@value #DEFAULT_ACTION_NAME})
47 | */
48 | private static final String DEFAULT_ACTION_NAME = "Edit Properties";
49 |
50 | /**
51 | * Method run.
52 | * @see org.eclipse.jface.action.IAction#run()
53 | */
54 | @Override
55 | public final void run() {
56 | final PropertyEditionDialog dialog =
57 | new PropertyEditionDialog(getGraphController().getWindow().getShell());
58 | dialog.setProperties(getGraphController().getGraphProperties());
59 | if (dialog.open() == Window.OK) {
60 | getGraphController().reloadGraph(dialog.getProperties());
61 | }
62 | }
63 |
64 | /**
65 | * Constructor for EditGraphPropertiesAction.
66 | * @param parent GraphControllerProvider
67 | */
68 | public EditGraphPropertiesAction(final GraphControllerProvider parent) {
69 | super(parent, DEFAULT_ACTION_NAME);
70 | setAccelerator((SWT.getPlatform().equals("cocoa") ? SWT.MOD1 : SWT.CONTROL) | 'E');
71 | }
72 | }
73 |
--------------------------------------------------------------------------------
/src/test/java/net/ggtools/grand/ui/widgets/property/PropertyEditorTestApp.java:
--------------------------------------------------------------------------------
1 | //$Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.widgets.property;
29 |
30 | import java.util.Properties;
31 |
32 | import org.eclipse.swt.SWT;
33 | import org.eclipse.swt.layout.FillLayout;
34 | import org.eclipse.swt.widgets.Composite;
35 | import org.eclipse.swt.widgets.Display;
36 | import org.eclipse.swt.widgets.Shell;
37 |
38 | /**
39 | * @author Christophe Labouisse
40 | */
41 | public class PropertyEditorTestApp {
42 | /**
43 | * Main method to launch the window.
44 | * @param args String[]
45 | */
46 | public static void main(final String[] args) {
47 | final Shell shell = new Shell();
48 | shell.setText("Property List - TableViewer Example");
49 | shell.setLayout(new FillLayout());
50 | final Composite composite = new Composite(shell, SWT.NONE);
51 | composite.setLayout(new FillLayout());
52 | final PropertyEditor propertyViewer = new PropertyEditor(composite, SWT.NONE);
53 | final Properties props = new Properties();
54 | props.setProperty("ga", "azerty");
55 | props.setProperty("bu", "aqsdfzerty");
56 | props.setProperty("zo", "12345");
57 | propertyViewer.setInput(props);
58 |
59 | // Ask the shell to display its content
60 | shell.open();
61 | final Display display = shell.getDisplay();
62 | while (!shell.isDisposed()) {
63 | if (!display.readAndDispatch()) {
64 | display.sleep();
65 | }
66 | }
67 | System.err.println(propertyViewer.getPropertyList());
68 | System.exit(0);
69 | }
70 |
71 | }
72 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/graph/GraphDisplayer.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2003, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 |
29 | package net.ggtools.grand.ui.graph;
30 |
31 | import net.ggtools.grand.ant.AntTargetNode.SourceElement;
32 | import net.ggtools.grand.ui.graph.draw2d.Draw2dGraph;
33 |
34 | import org.eclipse.swt.widgets.Menu;
35 |
36 | /**
37 | * Interface to be implemented by classes displaying graphs.
38 | *
39 | * @author Christophe Labouisse
40 | */
41 | public interface GraphDisplayer extends GraphControllerProvider {
42 |
43 | /**
44 | * Get the widget context menu.
45 | * @return Menu
46 | */
47 | Menu getContextMenu();
48 |
49 | /**
50 | * Scroll the canvas to display a specific node.
51 | *
52 | * @param nodeName
53 | * Node to be shown.
54 | */
55 | void jumpToNode(final String nodeName);
56 |
57 | /**
58 | * Ask to display the supplied figure.
59 | * @param graph Draw2dGraph
60 | * @param name String
61 | * @param toolTip String
62 | */
63 | void setGraph(Draw2dGraph graph, String name, String toolTip);
64 |
65 | /**
66 | * @param richSource SourceElement[]
67 | */
68 | void setRichSource(SourceElement[] richSource);
69 |
70 | /**
71 | * Sets a text to display.
72 | * @param text String
73 | */
74 | void setSourceText(String text);
75 |
76 | /**
77 | * Zoom in the displayed graph by one step.
78 | *
79 | */
80 | void zoomIn();
81 |
82 | /**
83 | * Zoom out the displayed graph by one step.
84 | *
85 | */
86 | void zoomOut();
87 |
88 | /**
89 | * Reset the zoom factor to 1:1.
90 | *
91 | */
92 | void zoomReset();
93 | }
94 |
--------------------------------------------------------------------------------
/src/main/java/net/ggtools/grand/ui/widgets/property/PropertyPair.java:
--------------------------------------------------------------------------------
1 | // $Id$
2 | /*
3 | * ====================================================================
4 | * Copyright (c) 2002-2004, Christophe Labouisse All rights reserved.
5 | *
6 | * Redistribution and use in source and binary forms, with or without
7 | * modification, are permitted provided that the following conditions are met:
8 | *
9 | * 1. Redistributions of source code must retain the above copyright notice,
10 | * this list of conditions and the following disclaimer.
11 | *
12 | * 2. Redistributions in binary form must reproduce the above copyright notice,
13 | * this list of conditions and the following disclaimer in the documentation
14 | * and/or other materials provided with the distribution.
15 | *
16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
20 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 | * POSSIBILITY OF SUCH DAMAGE.
27 | */
28 | package net.ggtools.grand.ui.widgets.property;
29 |
30 | import java.util.Map.Entry;
31 |
32 | /**
33 | * @author Christophe Labouisse
34 | */
35 | class PropertyPair {
36 | /**
37 | * Field name.
38 | */
39 | private String name;
40 |
41 | /**
42 | * Field value.
43 | */
44 | private String value;
45 |
46 | /**
47 | * Constructor for PropertyPair.
48 | * @param name Object
49 | * @param value Object
50 | */
51 | public PropertyPair(final Object name, final Object value) {
52 | this.name = (name instanceof String) ? (String) name : name.toString();
53 | this.value = (value instanceof String) ? (String) value : value.toString();
54 | }
55 |
56 | /**
57 | * Creates a new PropertyPair from a Map.Entry. The entry key & value should
58 | * be both instance of String.
59 | *
60 | * @param entry Entry<Object, Object>
61 | */
62 | public PropertyPair(final Entry