├── RelationFinder2.as3proj
├── assets
├── css
│ └── styles.css
└── img
│ ├── 16-globe.png
│ ├── 16-info.png
│ ├── 16-tool.png
│ ├── 16-url.png
│ ├── Clear.png
│ ├── Help_16.png
│ ├── Help_32.png
│ ├── RelFinder-Logo-About.png
│ ├── RelFinder-Logo-gr.png
│ ├── RelFinder-Logo-kl.png
│ ├── Settings.png
│ ├── closeButton.png
│ ├── dei-logo.png
│ ├── hide.gif
│ ├── hide_inactive.gif
│ ├── is-logo.png
│ ├── loading._png
│ ├── loading.png
│ ├── noImage.png
│ ├── pin3.png
│ ├── show.gif
│ ├── show_inactive.gif
│ ├── unpin1.png
│ ├── unpinhighlight1.png
│ └── vis-logo.png
├── bin
├── RelFinder.swf
├── config
│ ├── Config.xml
│ ├── ConfigExtended.xml
│ ├── config.relfinder.dbpedia.org.xml
│ ├── config.relfinder.semanticweb.org.xml
│ └── examples.xml
├── crossdomain.xml
└── proxy.php
├── compileInfo.txt
├── lib
├── AutoComplete2
│ ├── bin
│ │ ├── AutoComplete-0.98.1.swc
│ │ ├── AutoComplete-0.98.2.swc
│ │ └── AutoComplete.swc
│ ├── doc
│ │ ├── AdvancedAutoComplete.html
│ │ ├── AutoComplete.html
│ │ ├── print.css
│ │ └── style.css
│ ├── examples
│ │ ├── AdvancedDemo.mxml
│ │ ├── ColorDemo.mxml
│ │ ├── ColorItemRenderer.mxml
│ │ ├── CustomSkin.as
│ │ ├── CustomSkin.mxml
│ │ ├── DataGridDemo.mxml
│ │ ├── Demo.mxml
│ │ ├── DynamicData.mxml
│ │ ├── EmailDemo.mxml
│ │ └── simpsons.txt
│ └── src
│ │ ├── Consts.as
│ │ ├── com
│ │ ├── Color.as
│ │ └── hillelcoren
│ │ │ ├── assets
│ │ │ ├── bottom.png
│ │ │ ├── clear.png
│ │ │ ├── down.png
│ │ │ ├── icons
│ │ │ │ ├── actionsDown.png
│ │ │ │ ├── actionsOver.png
│ │ │ │ ├── actionsUp.png
│ │ │ │ ├── bottom.png
│ │ │ │ ├── clear.png
│ │ │ │ ├── down.png
│ │ │ │ ├── left.png
│ │ │ │ ├── remove.png
│ │ │ │ ├── right.png
│ │ │ │ ├── top.png
│ │ │ │ └── up.png
│ │ │ ├── left.png
│ │ │ ├── remove.png
│ │ │ ├── right.png
│ │ │ ├── skins
│ │ │ │ ├── BlankSkin.as
│ │ │ │ ├── FacebookSkin.as
│ │ │ │ └── MacMailSkin.as
│ │ │ ├── top.png
│ │ │ └── up.png
│ │ │ ├── components
│ │ │ ├── AdvancedAutoComplete.mxml
│ │ │ ├── AutoComplete.mxml
│ │ │ ├── CloseableTitleWindow.mxml
│ │ │ ├── PromptTextInput.mxml
│ │ │ ├── autoComplete
│ │ │ │ ├── classes
│ │ │ │ │ ├── ActionsMenu.mxml
│ │ │ │ │ ├── Browser.mxml
│ │ │ │ │ ├── BrowserItemRenderer.mxml
│ │ │ │ │ ├── Combo.mxml
│ │ │ │ │ ├── ComboTextInput.mxml
│ │ │ │ │ ├── DropDownItemRenderer.mxml
│ │ │ │ │ ├── EditableItem.mxml
│ │ │ │ │ ├── FlowBox.mxml
│ │ │ │ │ ├── IconButton.mxml
│ │ │ │ │ ├── ListBuilder.mxml
│ │ │ │ │ ├── MultiSelect.mxml
│ │ │ │ │ ├── SelectedItem.mxml
│ │ │ │ │ └── ShorterTextInput.mxml
│ │ │ │ └── interfaces
│ │ │ │ │ ├── IBrowser.as
│ │ │ │ │ └── iComboItem.as
│ │ │ └── icon.png
│ │ │ └── utils
│ │ │ ├── ArrayCollectionUtils.as
│ │ │ ├── KeyboardUtil.as
│ │ │ └── StringUtils.as
│ │ └── defaults.css
├── Base64
│ └── build
│ │ └── as3base64.swc
├── ButtonBarPanel
│ ├── ButtonBarPanelTest.mxml
│ ├── components
│ │ └── ButtonBarPanel.as
│ ├── contact.gif
│ ├── info_icon.png
│ ├── next.gif
│ └── previous.gif
├── SpringGraph
│ ├── .FlashDevelop_AS3_cache
│ ├── .actionScriptProperties
│ ├── .project
│ ├── .settings
│ │ └── org.eclipse.core.resources.prefs
│ ├── SpringGraphDemo.mxml
│ ├── SpringGraphDemo.swf
│ ├── bin
│ │ └── SpringGraph.swc
│ ├── buildAsdoc.bat
│ ├── com
│ │ └── adobe
│ │ │ └── flex
│ │ │ └── extras
│ │ │ └── controls
│ │ │ ├── forcelayout
│ │ │ ├── AbstractEdge.as
│ │ │ ├── ForceDirectedLayout.as
│ │ │ ├── IDataProvider.as
│ │ │ ├── IEdge.as
│ │ │ ├── IForEachEdge.as
│ │ │ ├── IForEachNode.as
│ │ │ ├── IForEachNodePair.as
│ │ │ └── Node.as
│ │ │ └── springgraph
│ │ │ ├── DefaultItemView.as
│ │ │ ├── Graph.as
│ │ │ ├── GraphDataProvider.as
│ │ │ ├── GraphEdge.as
│ │ │ ├── GraphNode.as
│ │ │ ├── HistorySeed.as
│ │ │ ├── HistorySeedView.as
│ │ │ ├── IEdgeRenderer.as
│ │ │ ├── IViewFactory.as
│ │ │ ├── Item.as
│ │ │ ├── Roamer.as
│ │ │ └── SpringGraph.as
│ └── manifest.xml
├── dataStructures
│ └── as3ds.swc
└── flexlib-.2.4
│ └── bin
│ └── flexlib.swc
└── src
├── AutoCompleteDDRenderer.mxml
├── DirectedEdge.as
├── ExampleBox.mxml
├── ExampleListRenderer.mxml
├── FilterTab.as
├── IconComboBox.as
├── ImageView.as
├── InfoBox.mxml
├── InfoLinkBox.mxml
├── InputFieldBox.mxml
├── LoadingAnimation.as
├── Main.mxml
├── SortableDataGrid.as
├── Source.as
├── ViewFactory.as
├── connection
├── ILookUp.as
├── ISPARQLResultParser.as
├── LookUp.as
├── LookUpAutoCompleteTest.as
├── LookUpKeywordSearch.as
├── LookUpSPARQL.as
├── SPARQLConnection.as
├── SPARQLQuery.as
├── SPARQLQueryBuilder.as
├── SPARQLResultEvent.as
├── SPARQLResultParser.as
├── SPARQLResultTracer.as
├── SPARQLService.as
├── config
│ ├── CIAWorldFactBookConfig.as
│ ├── Config.as
│ ├── DBLPConfig.as
│ ├── DBTuneConfig.as
│ ├── DBpediaConfig.as
│ ├── IConfig.as
│ ├── LODConfig.as
│ └── LinkedMDBConfig.as
└── model
│ ├── ConnectionModel.as
│ └── LookUpCache.as
├── global
├── GlobalString.as
├── Languages.as
├── LoggedError.as
├── StatusModel.as
└── ToolTipModel.as
├── graphElements
├── AggregatableElement.as
├── AggregatedRelationNode.as
├── AggregatedRelationNodeView.mxml
├── Chain.as
├── Concept.as
├── ConnectivityLevel.as
├── Element.as
├── FoundNode.as
├── FoundNodeView.mxml
├── GivenNode.as
├── GivenNodeView.mxml
├── MyNode.as
├── Path.as
├── PathLength.as
├── RelType.as
├── Relation.as
├── RelationNode.as
├── RelationNodeView.mxml
├── VisibilityRenderer.mxml
├── controller
│ └── GraphController.as
├── events
│ └── PropertyChangedEvent.as
└── model
│ └── Graphmodel.as
├── php
├── RelationFinder.as
├── RelationFinder.php
├── index.php
├── queryVirtuoso.php
├── queryVirtuosoCount.php
└── test.php
├── popup
├── AddURI.mxml
├── DirectInput.mxml
├── EditEndpointConfig.mxml
├── EndpointListRenderer.mxml
├── ErrorLog.mxml
├── ErrorLogCompleteMSG.mxml
├── ErrorLogRenderer.mxml
├── ExpertSettings.mxml
├── Infos.mxml
├── InputDisambiguation.mxml
├── InputSelection.mxml
├── InputSelectionEvent.as
├── InputSelectionListRenderer.mxml
├── OpenResources.mxml
├── SPARQLQueryTool.mxml
└── StableAbout.mxml
├── positionedTabNavigator
├── ButtonTab.as
├── PositionedTab.as
├── PositionedTabBar.as
├── PositionedTabNavigator.as
├── events
│ └── CloseTabEvent.as
└── skins
│ ├── BorderlessButtonSkin.as
│ ├── FilterTabSkin.as
│ └── PositionedTabSkin.as
├── preloader
├── CustomPreloader.as
└── WelcomeScreen.as
├── skin
├── CloseButtonSkin.as
├── EmptyButtonSkin.as
├── ToggleSizeButtonSkinDown.as
├── ToggleSizeButtonSkinNone.as
└── ToggleSizeButtonSkinUp.as
├── toolTip
├── SelectedItemToolTipRenderer.as
└── ToolTipInfoBox.mxml
└── utils
├── ArrayCollectionUtil.as
├── ConfigUtil.as
├── DynamicTextArea.as
├── Example.as
├── ExampleUtil.as
└── SimilaritySort.as
/RelationFinder2.as3proj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
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 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
--------------------------------------------------------------------------------
/assets/css/styles.css:
--------------------------------------------------------------------------------
1 | .myTabStyle {
2 | color: #3f3f3f;
3 | fontSize: 9;
4 | fontWeight: middle;
5 | text-align: center;
6 | }
7 |
8 | .myButtonStyle3 {
9 | color: #3f3f3f;
10 | fontSize: 9;
11 | fontWeight: middle;
12 | }
13 |
14 | .myHeader {
15 | fontWeight: middle;
16 | }
17 |
18 | .closeBtn {
19 | upSkin: Embed('../img/closeButton.png');
20 | overSkin: Embed('../img/closeButton.png');
21 | downSkin: Embed('../img/closeButton.png');
22 | disabledSkin: Embed('../img/closeButton.png');
23 | }
24 |
25 | .pinBtn {
26 | upSkin: Embed('../img/pin3.png');
27 | overSkin: Embed('../img/pin3.png');
28 | downSkin: Embed('../img/pin3.png');
29 | disabledSkin: Embed('../img/pin3.png');
30 | }
31 |
32 | .unpinBtn {
33 | upSkin: Embed('../img/unpin1.png');
34 | overSkin: Embed('../img/unpinhighlight1.png');
35 | downSkin: Embed('../img/unpinhighlight1.png');
36 | disabledSkin: Embed('../img/unpin1.png');
37 | }
--------------------------------------------------------------------------------
/assets/img/16-globe.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/16-globe.png
--------------------------------------------------------------------------------
/assets/img/16-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/16-info.png
--------------------------------------------------------------------------------
/assets/img/16-tool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/16-tool.png
--------------------------------------------------------------------------------
/assets/img/16-url.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/16-url.png
--------------------------------------------------------------------------------
/assets/img/Clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/Clear.png
--------------------------------------------------------------------------------
/assets/img/Help_16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/Help_16.png
--------------------------------------------------------------------------------
/assets/img/Help_32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/Help_32.png
--------------------------------------------------------------------------------
/assets/img/RelFinder-Logo-About.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/RelFinder-Logo-About.png
--------------------------------------------------------------------------------
/assets/img/RelFinder-Logo-gr.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/RelFinder-Logo-gr.png
--------------------------------------------------------------------------------
/assets/img/RelFinder-Logo-kl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/RelFinder-Logo-kl.png
--------------------------------------------------------------------------------
/assets/img/Settings.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/Settings.png
--------------------------------------------------------------------------------
/assets/img/closeButton.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/closeButton.png
--------------------------------------------------------------------------------
/assets/img/dei-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/dei-logo.png
--------------------------------------------------------------------------------
/assets/img/hide.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/hide.gif
--------------------------------------------------------------------------------
/assets/img/hide_inactive.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/hide_inactive.gif
--------------------------------------------------------------------------------
/assets/img/is-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/is-logo.png
--------------------------------------------------------------------------------
/assets/img/loading._png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/loading._png
--------------------------------------------------------------------------------
/assets/img/loading.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/loading.png
--------------------------------------------------------------------------------
/assets/img/noImage.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/noImage.png
--------------------------------------------------------------------------------
/assets/img/pin3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/pin3.png
--------------------------------------------------------------------------------
/assets/img/show.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/show.gif
--------------------------------------------------------------------------------
/assets/img/show_inactive.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/show_inactive.gif
--------------------------------------------------------------------------------
/assets/img/unpin1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/unpin1.png
--------------------------------------------------------------------------------
/assets/img/unpinhighlight1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/unpinhighlight1.png
--------------------------------------------------------------------------------
/assets/img/vis-logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/assets/img/vis-logo.png
--------------------------------------------------------------------------------
/bin/RelFinder.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/bin/RelFinder.swf
--------------------------------------------------------------------------------
/bin/config/examples.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | dbp
6 |
10 |
14 |
15 |
16 | dbp
17 |
21 |
25 |
26 |
27 | dbp
28 |
32 |
36 |
37 |
38 | dbp
39 |
43 |
47 |
48 |
49 | dbp
50 |
54 |
58 |
62 |
63 |
64 | dbp
65 |
69 |
73 |
77 |
81 |
82 |
83 | lmdb
84 |
88 |
92 |
93 |
--------------------------------------------------------------------------------
/bin/crossdomain.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/bin/proxy.php:
--------------------------------------------------------------------------------
1 | \n", $k, $v);
30 | // }
31 | // }
32 |
33 | //curl_setopt($session, CURLOPT_URL, $HTTP_SERVER_VARS['QUERY_STRING']);
34 | curl_setopt($session, CURLOPT_URL, $_SERVER['QUERY_STRING']);
35 |
36 | curl_setopt($session, CURLOPT_FOLLOWLOCATION, true);
37 | curl_setopt($session, CURLOPT_RETURNTRANSFER, true);
38 | curl_setopt($session, CURLOPT_CONNECTTIMEOUT, $timeout);
39 | curl_setopt($session, CURLOPT_USERAGENT, $userAgent);
40 |
41 | $response = curl_exec($session);
42 |
43 | echo $response;
44 |
45 | curl_close($session);
46 |
47 | ?>
--------------------------------------------------------------------------------
/compileInfo.txt:
--------------------------------------------------------------------------------
1 | Required Flex/Flash versions for compilation of the RelFinder code:
2 | - Flex SDK 3.5
3 | - Flash Player 10
--------------------------------------------------------------------------------
/lib/AutoComplete2/bin/AutoComplete-0.98.1.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/bin/AutoComplete-0.98.1.swc
--------------------------------------------------------------------------------
/lib/AutoComplete2/bin/AutoComplete-0.98.2.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/bin/AutoComplete-0.98.2.swc
--------------------------------------------------------------------------------
/lib/AutoComplete2/bin/AutoComplete.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/bin/AutoComplete.swc
--------------------------------------------------------------------------------
/lib/AutoComplete2/doc/print.css:
--------------------------------------------------------------------------------
1 | /*
2 | ////////////////////////////////////////////////////////////////////////////////
3 | //
4 | // ADOBE SYSTEMS INCORPORATED
5 | // Copyright 2005-2007 Adobe Systems Incorporated
6 | // All Rights Reserved.
7 | //
8 | // NOTICE: Adobe permits you to use, modify, and distribute this file
9 | // in accordance with the terms of the license agreement accompanying it.
10 | //
11 | ////////////////////////////////////////////////////////////////////////////////
12 | */
13 |
14 | body {
15 | color: #000000;
16 | background: #ffffff;
17 | font-family: "Times New Roman", Times, serif;
18 | font-size: 12pt;
19 | }
20 | a {
21 | text-decoration: none;
22 | color: #000000;
23 | }
24 | pre {
25 | white-space: -moz-pre-wrap; /* Mozilla */
26 | white-space: -pre-wrap; /* Opera 4-6 */
27 | white-space: -o-pre-wrap; /* Opera 7 */
28 | word-wrap: break-word; /* IE */
29 | }
30 | .titleTableTopNav, .titleTableSubNav, .logoImage {
31 | display: none;
32 | }
33 | .packageFrame {
34 | display: none;
35 | }
36 | .titleTableSubTitle {
37 | font-weight: bold;
38 | }
39 | .classHeaderTableLabel {
40 | padding-right: 10px;
41 | vertical-align: top;
42 | }
43 | .showHideLinks {
44 | display: none;
45 | }
46 | html>body code {
47 | font-size: 10pt;
48 | }
49 | .summaryTableTitle, .detailSectionHeader {
50 | font-size: 14pt;
51 | font-weight: bold;
52 | padding-top: 15px;
53 | padding-bottom: 5px;
54 | }
55 | .summaryTable {
56 | border: 1px solid #000000;
57 | border-collapse: collapse;
58 | width: 100%;
59 | }
60 | .summaryTableDescription {
61 | padding-bottom: 20px;
62 | }
63 | .summaryTableSignatureCol, .summaryTableOwnerCol, .summaryTableLastCol, .summaryTableCol {
64 | border: 1px solid #000000;
65 | }
66 | .summaryTablePaddingCol {
67 | border: 1px solid #000000;
68 | border-right: 0px;
69 | }
70 | .summaryTableInheritanceCol, .summaryTableOperatorCol, .summaryTableStatementCol, .summaryTableSecondCol {
71 | border: 1px solid #000000;
72 | border-left: 0px;
73 | }
74 | .summaryTableLastCol {
75 | vertical-align: top;
76 | }
77 | .detailHeader {
78 | font-size: 13pt;
79 | padding-top: 100px;
80 | }
81 | .detailHeaderName {
82 | font-weight: bold;
83 | }
84 | .detailHeaderType {
85 | padding-left: 5px;
86 | }
87 | .detailHeaderRule {
88 | background: #FF0000;
89 | }
90 | .seeAlso {
91 | padding-bottom: 20px;
92 | margin-top: -20px;
93 | }
94 | .innertable {
95 | border-collapse: collapse;
96 | }
97 | .innertable td,.innertable th {
98 | border: 1px solid #000000;
99 | padding-left: 5px;
100 | padding-right: 5px;
101 | }
102 | .listing {
103 | font-size: 10pt;
104 | }
105 | .feedbackLink {
106 | display: none;
107 | }
108 | .copyright {
109 | font-size: 10pt;
110 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/examples/ColorItemRenderer.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 | = 0)
42 | {
43 | this.setStyle( "color", Consts.COLOR_TEXT_DISABLED );
44 | }
45 | else
46 | {
47 | this.clearStyle( "color" );
48 | }
49 | }
50 |
51 | private function handleUpdate():void
52 | {
53 | // There must be a better way to draw a line between each
54 | // of the items in the list
55 | graphics.clear();
56 | graphics.lineStyle( 1, 0x858585, 0.5 );
57 | graphics.moveTo( -2, height + 2);
58 | graphics.lineTo( width, height + 2 );
59 | }
60 |
61 | ]]>
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/examples/CustomSkin.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | import flash.display.Graphics;
4 | import mx.skins.ProgrammaticSkin;
5 |
6 | public class CustomSkin extends ProgrammaticSkin
7 | {
8 | private static const RADIUS:int = 20;
9 |
10 | override protected function updateDisplayList( w:Number, h:Number ):void
11 | {
12 | var color:uint;
13 |
14 | switch (name)
15 | {
16 | case "upSkin":
17 | color = 0xFFFFFF;
18 | break;
19 | case "overSkin":
20 | color = 0xEEEEEE;
21 | break;
22 | case "downSkin":
23 | case "selectedUpSkin":
24 | case "selectedOverSkin":
25 | case "selectedDownSkin":
26 | color = 0xCCCCCC;
27 | }
28 |
29 | var g:Graphics = graphics;
30 | g.clear();
31 | g.beginFill( color );
32 | g.lineStyle( 2, 0x999999 );
33 | g.drawRoundRect( 1, 1, w-2, h-2, RADIUS );
34 | g.endFill();
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/examples/CustomSkin.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
7 | .customSkin
8 | {
9 | over-skin: ClassReference("CustomSkin");
10 | up-skin: ClassReference("CustomSkin");
11 | down-skin: ClassReference("CustomSkin");
12 | selected-over-skin : ClassReference("CustomSkin");
13 | selected-up-skin : ClassReference("CustomSkin");
14 | selected-down-skin : ClassReference("CustomSkin");
15 | padding-top: 0;
16 | padding-bottom: 0;
17 | padding-left: 10;
18 | padding-right: 10;
19 | font-weight: normal;
20 | }
21 |
22 |
23 |
24 |
32 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/examples/DataGridDemo.mxml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
76 |
77 |
78 |
79 |
82 |
83 |
84 |
85 |
86 |
87 |
89 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/examples/Demo.mxml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/examples/DynamicData.mxml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 | 2 && colors.length == 0)
32 | {
33 | // if you remove below line then it kind of works
34 | // but it is more correct to remove all data
35 | // before repopulate. Really it is just holding
36 | // on to stale data
37 | colors.removeAll();
38 | delayTimer = new Timer( 500, 1 );
39 | delayTimer.addEventListener(TimerEvent.TIMER, showComboAll);
40 | delayTimer.start();
41 | }
42 | }
43 |
44 | private function showComboAll( event:TimerEvent ):void
45 | {
46 | colors.addItem( { "name":"Almond", "hex":0xEED9C4 } );
47 |
48 | autoComplete.search();
49 | }
50 |
51 | ]]>
52 |
53 |
54 |
55 |
56 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/examples/EmailDemo.mxml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 | " + label.substr(start, searchStr.length) + "";
53 | str = str + label.substr(start + searchStr.length, label.length);
54 |
55 | if (autocomplete.isItemSelected( item ))
56 | {
57 | str = "" + str + "";
58 | }
59 |
60 | return str;
61 | }
62 |
63 | private function filterFunction( item:Object, searchStr:String ):Boolean
64 | {
65 | if (StringUtils.anyWordBeginsWith( item.name, searchStr ))
66 | {
67 | return true;
68 | }
69 | else if (StringUtils.beginsWith( item.email, searchStr ))
70 | {
71 | return true;
72 | }
73 |
74 | return false;
75 | }
76 |
77 | ]]>
78 |
79 |
80 |
81 |
82 |
83 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/Consts.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | public class Consts
4 | {
5 | private static const COLOR_GRAY:String = "#999999";
6 |
7 | public static const COLOR_TEXT_DISABLED:String = COLOR_GRAY;
8 | public static const BUTTON_WIDTH:uint = 90;
9 | }
10 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/Color.as:
--------------------------------------------------------------------------------
1 | package com
2 | {
3 | [Bindable]
4 | public class Color
5 | {
6 | private var _name:String;
7 | private var _hex:uint;
8 |
9 | public function Color( name:String, color:uint )
10 | {
11 | _name = name;
12 | _hex = color;
13 | }
14 |
15 | public function set name( value:String ):void
16 | {
17 | _name = value;
18 | }
19 |
20 | public function get name():String
21 | {
22 | return _name;
23 | }
24 |
25 | public function set hex( value:uint ):void
26 | {
27 | _hex = value;
28 | }
29 |
30 | public function get hex():uint
31 | {
32 | return _hex;
33 | }
34 | }
35 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/bottom.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/clear.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/down.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/actionsDown.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/actionsDown.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/actionsOver.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/actionsOver.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/actionsUp.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/actionsUp.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/bottom.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/bottom.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/clear.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/down.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/down.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/left.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/remove.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/right.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/top.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/icons/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/icons/up.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/left.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/left.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/remove.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/remove.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/right.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/right.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/skins/BlankSkin.as:
--------------------------------------------------------------------------------
1 | package com.hillelcoren.assets.skins
2 | {
3 | import flash.display.Graphics;
4 | import mx.skins.ProgrammaticSkin;
5 |
6 | public class BlankSkin extends ProgrammaticSkin
7 | {
8 |
9 | }
10 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/skins/FacebookSkin.as:
--------------------------------------------------------------------------------
1 | package com.hillelcoren.assets.skins
2 | {
3 | import flash.display.Graphics;
4 | import mx.skins.ProgrammaticSkin;
5 |
6 | public class FacebookSkin extends ProgrammaticSkin
7 | {
8 | private static const RADIUS:int = 10;
9 |
10 | override protected function updateDisplayList( w:Number, h:Number ):void
11 | {
12 | var color:uint;
13 | var borderColor:uint;
14 |
15 | switch (name)
16 | {
17 | case "upSkin":
18 | color = 0xEFF2F7;
19 | borderColor = 0xCCD5E4;
20 | break;
21 | case "overSkin":
22 | color = 0xD8DFEA;
23 | borderColor = 0xCCD5E4;
24 | break;
25 | case "downSkin":
26 | case "selectedUpSkin":
27 | case "selectedOverSkin":
28 | case "selectedDownSkin":
29 | color = 0x5670A6;
30 | borderColor = 0x3B5998;
31 | }
32 |
33 | var g:Graphics = graphics;
34 | g.clear();
35 | g.beginFill( color );
36 | g.lineStyle( 1, borderColor );
37 | g.drawRoundRect( 0, 1, w, h-2, RADIUS );
38 | g.endFill();
39 | }
40 | }
41 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/skins/MacMailSkin.as:
--------------------------------------------------------------------------------
1 | package com.hillelcoren.assets.skins
2 | {
3 | import flash.display.Graphics;
4 |
5 | import mx.skins.ProgrammaticSkin;
6 |
7 | public class MacMailSkin extends ProgrammaticSkin
8 | {
9 | private static const RADIUS:int = 20;
10 |
11 | override protected function updateDisplayList( w:Number, h:Number ):void
12 | {
13 | var color:uint;
14 |
15 | switch (name)
16 | {
17 | case "upSkin":
18 | color = 0xDEE7FB;
19 | break;
20 | case "overSkin":
21 | color = 0xBBCEF1;
22 | break;
23 | case "downSkin":
24 | case "selectedUpSkin":
25 | case "selectedOverSkin":
26 | case "selectedDownSkin":
27 | color = 0x598BEC;
28 | }
29 |
30 | var g:Graphics = graphics;
31 | g.clear();
32 | g.beginFill( color );
33 | g.lineStyle( 1, 0xA4BDEC );
34 | g.drawRoundRect( 0, 1, w, h-2, RADIUS );
35 | g.endFill();
36 | }
37 | }
38 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/top.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/assets/up.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/assets/up.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/CloseableTitleWindow.mxml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/autoComplete/classes/BrowserItemRenderer.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | = 0)
20 | {
21 | this.setStyle( "color", Consts.COLOR_TEXT_DISABLED );
22 | }
23 | else
24 | {
25 | this.clearStyle( "color" );
26 | }
27 | }
28 |
29 | ]]>
30 |
31 |
32 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/autoComplete/classes/ComboTextInput.mxml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
93 |
94 |
95 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/autoComplete/classes/DropDownItemRenderer.mxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/autoComplete/classes/EditableItem.mxml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/autoComplete/classes/ShorterTextInput.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | = FlexVersion.VERSION_3_0)
38 | h += getStyle("paddingTop") + getStyle("paddingBottom");
39 | }
40 | else
41 | {
42 | var lineMetrics:TextLineMetrics;
43 | lineMetrics = measureText(text);
44 |
45 | h = lineMetrics.height + bm.top + bm.bottom + UITextField.TEXT_HEIGHT_PADDING;
46 |
47 | if (FlexVersion.compatibilityVersion >= FlexVersion.VERSION_3_0)
48 | {
49 | h += getStyle("paddingTop") + getStyle("paddingBottom");
50 | }
51 | }
52 |
53 | measuredHeight = Math.max(h, DEFAULT_MEASURED_MIN_HEIGHT);
54 | measuredMinHeight = DEFAULT_MEASURED_MIN_HEIGHT;
55 | }
56 |
57 | ]]>
58 |
59 |
60 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/autoComplete/interfaces/IBrowser.as:
--------------------------------------------------------------------------------
1 | package com.hillelcoren.components.autoComplete.interfaces
2 | {
3 | import flash.events.IEventDispatcher;
4 |
5 | import mx.collections.ArrayCollection;
6 |
7 | public interface IBrowser extends IEventDispatcher
8 | {
9 | function init():void
10 | function get selectedItems():Array;
11 | function set filterFunction( value:Function ):void
12 | function set title( value:String ):void;
13 | function set dataProvider( value:ArrayCollection ):void
14 | function set labelFunction( value:Function ):void
15 | function set originalSelectedItems( value:ArrayCollection ):void
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/autoComplete/interfaces/iComboItem.as:
--------------------------------------------------------------------------------
1 | package com.hillelcoren.components.autoComplete.interfaces
2 | {
3 | import flash.display.DisplayObject;
4 |
5 | public interface iComboItem
6 | {
7 | function setTextFocus():void
8 | function contains( x:DisplayObject ):Boolean
9 | function isCursorAtBeginning():Boolean
10 | function isCursorAtEnd():Boolean
11 | function isEditable():Boolean
12 | function get text():String
13 | function get item():Object
14 | }
15 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/components/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/AutoComplete2/src/com/hillelcoren/components/icon.png
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/utils/ArrayCollectionUtils.as:
--------------------------------------------------------------------------------
1 | package com.hillelcoren.utils
2 | {
3 | import flash.utils.Dictionary;
4 |
5 | import mx.collections.ArrayCollection;
6 |
7 | public class ArrayCollectionUtils
8 | {
9 | public static const MOVE_TOP:String = "MOVE_TOP";
10 | public static const MOVE_UP:String = "MOVE_UP";
11 | public static const MOVE_DOWN:String = "MOVE_DOWN";
12 | public static const MOVE_BOTTOM:String = "MOVE_BOTTOM";
13 |
14 | public static function moveItems( arrayCollection:ArrayCollection, selectedIndices:Array, moveTo:String ):void
15 | {
16 | var item:Object;
17 | var currentIndex:uint;
18 | var newIndex:uint;
19 | var count:uint = 0;
20 |
21 | var newIndicesArr:Array = [];
22 | var newIndicesDict:Dictionary = new Dictionary();
23 |
24 | // first thing we'll do is figure out the new indices
25 | // for the selected items
26 | for each (currentIndex in selectedIndices)
27 | {
28 | item = arrayCollection.getItemAt( currentIndex );
29 |
30 | switch (moveTo)
31 | {
32 | case MOVE_TOP:
33 | newIndex = count;
34 | break;
35 | case MOVE_UP:
36 | newIndex = getNewIndex( arrayCollection, item, MOVE_UP );
37 | break;
38 | case MOVE_DOWN:
39 | newIndex = getNewIndex( arrayCollection, item, MOVE_DOWN );
40 | break;
41 | case MOVE_BOTTOM:
42 | newIndex = arrayCollection.length - (selectedIndices.length - count);
43 | break;
44 | }
45 |
46 | newIndicesArr.push( newIndex );
47 | newIndicesDict[newIndex] = item;
48 |
49 | count++;
50 | }
51 |
52 | // since rearanging some items causes other items to move
53 | // we'll sort the order based on the direction we're going
54 | if (moveTo == MOVE_DOWN || moveTo == MOVE_BOTTOM)
55 | {
56 | newIndicesArr.sort( Array.DESCENDING | Array.NUMERIC );
57 | }
58 |
59 | // then we'll move the items to their new spots
60 | for (var x:uint = 0; x < newIndicesArr.length; x++)
61 | {
62 | newIndex = Number(newIndicesArr[x]);
63 | item = newIndicesDict[newIndex];
64 | currentIndex = arrayCollection.getItemIndex( item );
65 |
66 | arrayCollection.removeItemAt( currentIndex );
67 | arrayCollection.addItemAt( item, newIndex );
68 | }
69 | }
70 |
71 | private static function getNewIndex( arrayCollection:ArrayCollection, item:Object, moveTo:String ):uint
72 | {
73 | var index:uint = arrayCollection.getItemIndex( item );
74 |
75 | if (moveTo == MOVE_UP)
76 | {
77 | if (index == 0)
78 | {
79 | return 0;
80 | }
81 | else
82 | {
83 | return --index;
84 | }
85 | }
86 | else
87 | {
88 | if (index == arrayCollection.length - 1)
89 | {
90 | return arrayCollection.length - 1;
91 | }
92 | else
93 | {
94 | return ++index;
95 | }
96 | }
97 | }
98 |
99 | public static function areTheSame( ac1:ArrayCollection, ac2:ArrayCollection ):Boolean
100 | {
101 | if (ac1 == null || ac2 == null)
102 | {
103 | return false;
104 | }
105 |
106 | if (ac1.length != ac2.length)
107 | {
108 | return false;
109 | }
110 |
111 | for (var index:uint = 0; index < ac1.length; index++)
112 | {
113 | var obj1:Object = ac1.getItemAt( index );
114 | var obj2:Object = ac2.getItemAt( index );
115 |
116 | if (obj1.id != obj2.id)
117 | {
118 | return false;
119 | }
120 | }
121 |
122 | return true;
123 | }
124 |
125 | public static function inArray( needle:*, haystack:Array ):Boolean
126 | {
127 | var itemIndex:int = haystack.indexOf( needle );
128 | return ( itemIndex < 0 ) ? false : true;
129 | }
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/utils/KeyboardUtil.as:
--------------------------------------------------------------------------------
1 | package com.hillelcoren.utils
2 | {
3 | public class KeyboardUtil
4 | {
5 | public static function charCodeToChar( num:int ):String
6 | {
7 | if (num >= 0 && num <= 26)
8 | {
9 | var letters:String = "abcdefghijklmnopqrstuvwxyz";
10 | return letters.charAt(num - 1);
11 | }
12 | else if (num >= 49 && num <= 59)
13 | {
14 | return String( num - 48 );
15 | }
16 | else
17 | {
18 | return num.toString();
19 | }
20 | }
21 | }
22 | }
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/com/hillelcoren/utils/StringUtils.as:
--------------------------------------------------------------------------------
1 | package com.hillelcoren.utils
2 | {
3 | import mx.utils.StringUtil;
4 |
5 | public class StringUtils
6 | {
7 | /**
8 | * Check if the string begins with the pattern
9 | */
10 | public static function beginsWith( string:String, pattern:String):Boolean
11 | {
12 | if (!string)
13 | {
14 | return false;
15 | }
16 |
17 | string = string.toLowerCase();
18 | pattern = pattern.toLowerCase();
19 |
20 | return pattern == string.substr( 0, pattern.length );
21 | }
22 |
23 | public static function anyWordBeginsWith( string:String, pattern:String ):Boolean
24 | {
25 | if (!string)
26 | {
27 | return false;
28 | }
29 |
30 | if (beginsWith( string, pattern ))
31 | {
32 | return true;
33 | }
34 |
35 | // check to see if one of the words in the string is a match
36 | var words:Array = string.split( " " );
37 |
38 | for each (var word:String in words)
39 | {
40 | if (beginsWith( word, pattern ))
41 | {
42 | return true;
43 | }
44 | }
45 |
46 | return false;
47 | }
48 |
49 | public static function capitalize( string:String ):String
50 | {
51 | return string.charAt(0).toUpperCase() + string.substring( 1, string.length );
52 | }
53 |
54 | public static function capitalizeWords( string:String ):String
55 | {
56 | var origWords:Array = string.split( " " );
57 | var newWords:Array = [];
58 |
59 | for each (var word:String in origWords)
60 | {
61 | newWords.push( StringUtils.capitalize( word ) );
62 | }
63 |
64 | return newWords.join( " " );
65 | }
66 |
67 | public static function unCapitalize( string:String ):String
68 | {
69 | return string.charAt(0).toLowerCase() + string.substring( 1, string.length );
70 | }
71 |
72 |
73 | /**
74 | * This will convert a string to const upper case (ie, ringGroup becomes RING_GROUP)
75 | */
76 | public static function toConstUpperCase( string:String ):String
77 | {
78 | var newString:String = "";
79 |
80 | for (var x:uint = 0; x < string.length; x++)
81 | {
82 | var char:String = string.charAt( x );
83 |
84 | // is letter upper case
85 | if (char.charCodeAt() <= 90 && newString.length > 0)
86 | {
87 | newString += "_";
88 | }
89 |
90 | newString += char;
91 |
92 | }
93 |
94 | return newString.toUpperCase();
95 | }
96 |
97 | public static function toCamelCaps( string:String ):String
98 | {
99 | var returnStr:String = "";
100 | var words:Array = string.split( "_" );
101 |
102 | for (var index:uint = 0; index < words.length; index++)
103 | {
104 | var word:String = words[index];
105 | word = word.toLowerCase();
106 |
107 | if (index > 0)
108 | {
109 | word = capitalize( word );
110 | }
111 |
112 | returnStr += word;
113 | }
114 |
115 | return returnStr;
116 | }
117 |
118 | /* given a string it will return true, iff it is "true", everything else will be false */
119 | public static function toBoolean( value:String ):Boolean
120 | {
121 | if ( value == "true" || value == "Yes" )
122 | {
123 | return true;
124 | }
125 | return false;
126 |
127 | }
128 |
129 | public static function trimCommas( value:String ):String
130 | {
131 | value = StringUtil.trim( value );
132 |
133 | while (value.length > 0 && value.charAt(0) == ",")
134 | {
135 | value = value.substring( 1, value.length );
136 | }
137 |
138 | while (value.length > 0 && value.charAt( value.length - 1 ) == ",")
139 | {
140 | value = value.substring( 0, value.length - 1);
141 | }
142 |
143 | return value;
144 | }
145 | }
146 | }
147 |
--------------------------------------------------------------------------------
/lib/AutoComplete2/src/defaults.css:
--------------------------------------------------------------------------------
1 | AutoComplete
2 | {
3 | selected-item-style-name: macMail;
4 | }
5 |
6 | .none
7 | {
8 | over-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
9 | up-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
10 | down-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
11 | selected-over-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
12 | selected-up-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
13 | selected-down-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
14 | padding-top: 0;
15 | padding-bottom: 0;
16 | padding-left: 0;
17 | padding-right: 0;
18 | font-weight: normal;
19 | selected-font-weight: bold;
20 | show-comma: yes;
21 | }
22 |
23 | .underline
24 | {
25 | over-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
26 | up-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
27 | down-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
28 | selected-over-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
29 | selected-up-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
30 | selected-down-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
31 | padding-top: 0;
32 | padding-bottom: 0;
33 | padding-left: 0;
34 | padding-right: 0;
35 | text-decoration: underline;
36 | font-weight: normal;
37 | selected-font-weight: bold;
38 | show-comma: yes;
39 | }
40 |
41 | .macMail
42 | {
43 | over-skin: ClassReference("com.hillelcoren.assets.skins.MacMailSkin");
44 | up-skin: ClassReference("com.hillelcoren.assets.skins.MacMailSkin");
45 | down-skin: ClassReference("com.hillelcoren.assets.skins.MacMailSkin");
46 | selected-over-skin : ClassReference("com.hillelcoren.assets.skins.MacMailSkin");
47 | selected-up-skin: ClassReference("com.hillelcoren.assets.skins.MacMailSkin");
48 | selected-down-skin : ClassReference("com.hillelcoren.assets.skins.MacMailSkin");
49 | padding-top: 0;
50 | padding-bottom: 0;
51 | text-selected-color: #FFFFFF;
52 | padding-left: 8;
53 | padding-right: 8;
54 | font-weight: normal;
55 | }
56 |
57 | .facebook
58 | {
59 | over-skin: ClassReference("com.hillelcoren.assets.skins.FacebookSkin");
60 | up-skin: ClassReference("com.hillelcoren.assets.skins.FacebookSkin");
61 | down-skin: ClassReference("com.hillelcoren.assets.skins.FacebookSkin");
62 | selected-over-skin : ClassReference("com.hillelcoren.assets.skins.FacebookSkin");
63 | selected-up-skin : ClassReference("com.hillelcoren.assets.skins.FacebookSkin");
64 | selected-down-skin : ClassReference("com.hillelcoren.assets.skins.FacebookSkin");
65 | padding-top: 0;
66 | padding-bottom: 0;
67 | text-selected-color: #FFFFFF;
68 | padding-left: 2;
69 | padding-right: 5;
70 | font-weight: normal;
71 | }
72 |
73 | .actionsMenuButton
74 | {
75 | over-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
76 | up-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
77 | down-skin: ClassReference("com.hillelcoren.assets.skins.BlankSkin");
78 | selected-over-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
79 | selected-up-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
80 | selected-down-skin : ClassReference("com.hillelcoren.assets.skins.BlankSkin");
81 | padding-top: 0;
82 | padding-bottom: 0;
83 | padding-left: 0;
84 | padding-right: 4;
85 | }
--------------------------------------------------------------------------------
/lib/Base64/build/as3base64.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/Base64/build/as3base64.swc
--------------------------------------------------------------------------------
/lib/ButtonBarPanel/ButtonBarPanelTest.mxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
52 |
53 |
54 |
56 |
57 |
58 |
60 |
61 |
62 |
63 |
--------------------------------------------------------------------------------
/lib/ButtonBarPanel/components/ButtonBarPanel.as:
--------------------------------------------------------------------------------
1 | package components
2 | {
3 | import mx.containers.Panel;
4 | import mx.controls.Button;
5 | import flash.display.DisplayObject;
6 | import mx.controls.Alert;
7 | import mx.controls.LinkButton;
8 | import flash.events.Event;
9 | import flash.events.MouseEvent;
10 | import mx.events.CloseEvent;
11 | import mx.containers.ControlBar;
12 | import mx.binding.utils.BindingUtils;
13 | import mx.core.UIComponent;
14 | import mx.core.Container;
15 | import mx.managers.SystemManager;
16 | import flash.system.System;
17 | import mx.collections.ArrayCollection;
18 |
19 | public class ButtonBarPanel extends Panel
20 | {
21 | private static const cMargin:int = 6;
22 | private static const cPixelsFromTop:int = 5;
23 | private static const cPixelsFromRight:int = 15;
24 | private static const cIconSize : int = 16;
25 | public var _buttons : ArrayCollection;
26 | public var btnAtBottom:Boolean = false;
27 |
28 | public function get buttons():ArrayCollection
29 | {
30 | return _buttons;
31 | }
32 |
33 | public function set buttons(btns:ArrayCollection): void
34 | {
35 | _buttons = btns;
36 | createChildren();
37 | }
38 |
39 | protected override function createChildren():void
40 | {
41 | super.createChildren();
42 | if(buttons == null)
43 | return;
44 |
45 | for(var i:int = 0; i<_buttons.length; i++)
46 | {
47 | var btnObj : Object = buttons.getItemAt(i);
48 | var btn : LinkButton = new LinkButton();
49 | btn.toolTip = btnObj.toolTip;
50 | var btnIcon : Object = btnObj.icon;
51 | btn.setStyle("overIcon",btnIcon);
52 | btn.setStyle("downIcon",btnIcon);
53 | btn.setStyle("upIcon",btnIcon);
54 | btn.name = btnObj.name;
55 |
56 | btn.addEventListener(MouseEvent.MOUSE_OVER,onMouseEvent);
57 | btn.addEventListener(MouseEvent.MOUSE_OUT,onMouseEvent);
58 | if(btnObj.clickHandler != null)
59 | btn.addEventListener(MouseEvent.CLICK,btnObj.clickHandler);
60 | btn.visible=true;
61 | btn.includeInLayout = true;
62 | rawChildren.addChild(btn);
63 | }
64 | if(btnAtBottom)
65 | {
66 | this.setStyle("borderThicknessBottom",25);
67 | }
68 | }
69 |
70 | protected override function updateDisplayList(unscaledWidth: Number, unscaledHeight:Number):void
71 | {
72 | super.updateDisplayList(unscaledWidth, unscaledHeight);
73 |
74 | if(unscaledWidth > 0)
75 | {
76 | var y:Number = 0;
77 | if(btnAtBottom)
78 | y = unscaledHeight - 20;
79 | else
80 | y = cPixelsFromTop;
81 | for(var i:int = 0; i
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/lib/SpringGraph/.project:
--------------------------------------------------------------------------------
1 |
2 |
3 | SpringGraph
4 |
5 |
6 |
7 |
8 |
9 | com.adobe.flexbuilder.project.flexbuilder
10 |
11 |
12 |
13 |
14 |
15 | com.adobe.flexbuilder.project.flexlibnature
16 | com.adobe.flexbuilder.project.actionscriptnature
17 |
18 |
19 |
--------------------------------------------------------------------------------
/lib/SpringGraph/.settings/org.eclipse.core.resources.prefs:
--------------------------------------------------------------------------------
1 | #Wed Dec 19 09:47:44 CET 2007
2 | eclipse.preferences.version=1
3 | encoding/=utf-8
4 |
--------------------------------------------------------------------------------
/lib/SpringGraph/SpringGraphDemo.mxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
15 |
16 |
17 |
18 |
19 |
50 |
51 |
52 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
71 |
72 |
73 |
75 |
77 |
78 |
79 |
80 |
81 |
82 |
--------------------------------------------------------------------------------
/lib/SpringGraph/SpringGraphDemo.swf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/SpringGraph/SpringGraphDemo.swf
--------------------------------------------------------------------------------
/lib/SpringGraph/bin/SpringGraph.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/SpringGraph/bin/SpringGraph.swc
--------------------------------------------------------------------------------
/lib/SpringGraph/buildAsdoc.bat:
--------------------------------------------------------------------------------
1 | asdoc -source-path . -doc-classes com.adobe.flex.extras.controls.springgraph.IEdgeRenderer com.adobe.flex.extras.controls.springgraph.IViewFactory com.adobe.flex.extras.controls.springgraph.SpringGraph com.adobe.flex.extras.controls.springgraph.Graph com.adobe.flex.extras.controls.springgraph.Item com.adobe.flex.extras.controls.springgraph.Roamer -window-title "SpringGraph API Documentation" -output springgraph-asdoc
2 |
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/forcelayout/AbstractEdge.as:
--------------------------------------------------------------------------------
1 | /*
2 | * TouchGraph LLC. Apache-Style Software License
3 | *
4 | * Copyright (c) 2001-2002 Alexander Shapiro. 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 copyright
14 | * notice, this list of conditions and the following disclaimer in
15 | * the documentation and/or other materials provided with the
16 | * distribution.
17 | *
18 | * 3. The end-user documentation included with the redistribution,
19 | * if any, must include the following acknowledgment:
20 | * "This product includes software developed by
21 | * TouchGraph LLC (http://www.touchgraph.com/)."
22 | * Alternately, this acknowledgment may appear in the software itself,
23 | * if and wherever such third-party acknowledgments normally appear.
24 | *
25 | * 4. The names "TouchGraph" or "TouchGraph LLC" must not be used to endorse
26 | * or promote products derived from this software without prior written
27 | * permission. For written permission, please contact
28 | * alex@touchgraph.com
29 | *
30 | * 5. Products derived from this software may not be called "TouchGraph",
31 | * nor may "TouchGraph" appear in their name, without prior written
32 | * permission of alex@touchgraph.com.
33 | *
34 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
35 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
36 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
37 | * DISCLAIMED. IN NO EVENT SHALL TOUCHGRAPH OR ITS CONTRIBUTORS BE
38 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
39 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
40 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
41 | * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
42 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
43 | * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
44 | * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
45 | * ====================================================================
46 | *
47 | */
48 |
49 | package com.adobe.flex.extras.controls.forcelayout {
50 |
51 | /** Translated and adapted to Flex/ActionScript
52 | * from TouchGraph's original java code
53 | * by Mark Shepherd, Adobe FlexBuilder Engineering, 2006.
54 | *
55 | * @author Alexander Shapiro
56 | * @version 1.21 $Id: Edge.java,v 1.28 2002/04/01 05:52:15 x_ander Exp $
57 | * @private
58 | */
59 | public class AbstractEdge implements IEdge {
60 |
61 | public function AbstractEdge(f: Node, t: Node, len: int) {
62 | from = f;
63 | to = t;
64 | length = len;
65 | }
66 |
67 | // from
68 | public var from: Node;
69 | public function getFrom(): Node {
70 | return from;
71 | }
72 |
73 | // to
74 | public var to: Node;
75 | public function getTo(): Node {
76 | return to;
77 | }
78 |
79 | // length
80 | public var length: int;
81 | public function getLength(): int {
82 | return length;
83 | }
84 | }
85 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/forcelayout/IDataProvider.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.forcelayout {
11 |
12 | /**
13 | * @private
14 | */
15 | public interface IDataProvider {
16 | function forAllNodes(fen: IForEachNode): void;
17 | function forAllEdges(fee: IForEachEdge): void;
18 | function forAllNodePairs(fenp: IForEachNodePair): void;
19 | }
20 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/forcelayout/IEdge.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.forcelayout {
11 |
12 | /**
13 | * @private
14 | */
15 | public interface IEdge {
16 |
17 | function getLength(): int;
18 |
19 | function getFrom(): Node;
20 |
21 | function getTo(): Node;
22 | }
23 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/forcelayout/IForEachEdge.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.forcelayout {
11 |
12 | /**
13 | * @private
14 | */
15 | public interface IForEachEdge {
16 |
17 | function forEachEdge( e: IEdge ): void;
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/forcelayout/IForEachNode.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.forcelayout {
11 |
12 | /**
13 | * @private
14 | */
15 | public interface IForEachNode {
16 |
17 | function forEachNode( n: Node ): void;
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/forcelayout/IForEachNodePair.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.forcelayout {
11 |
12 | /**
13 | * @private
14 | */
15 | public interface IForEachNodePair {
16 |
17 | function forEachNodePair( n1: Node, n2: Node ): void;
18 |
19 | }
20 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/springgraph/DefaultItemView.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.springgraph
11 | {
12 | import mx.core.UIComponent;
13 | import mx.core.IDataRenderer;
14 | import flash.events.Event;
15 |
16 | /** @private */
17 | public class DefaultItemView extends UIComponent implements IDataRenderer
18 | {
19 | [Bindable("dataChange")]
20 | public function get data(): Object {
21 | return _data;
22 | }
23 |
24 | public function set data(d: Object): void {
25 | _data = d;
26 | dispatchEvent(new Event("dataChange"));
27 | }
28 |
29 | private var _data: Object = null;
30 | }
31 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/springgraph/GraphEdge.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.springgraph
11 | {
12 | import com.adobe.flex.extras.controls.forcelayout.AbstractEdge;
13 |
14 | /** Represents one edge of a SpringGraph
15 | *
16 | * @author Mark Shepherd
17 | * @private
18 | */
19 | public class GraphEdge extends AbstractEdge
20 | {
21 | public static var traversedMap: Object = new Object();
22 |
23 | public function get traversed(): Boolean {
24 | var fromId: String = GraphNode(getFrom()).item.id;
25 | var toId: String = GraphNode(getTo()).item.id;
26 | var key: String = fromId + "--" + toId;
27 | var result: Boolean = traversedMap.hasOwnProperty(key);
28 | if(result)
29 | result = result;
30 | return result;
31 | }
32 |
33 | public function GraphEdge(f: GraphNode, t: GraphNode, len: int) {
34 | super(f, t, len);
35 | }
36 |
37 | public override function getLength(): int {
38 | var result: int = (GraphNode(to).view.width + GraphNode(to).view.height +
39 | GraphNode(from).view.width + GraphNode(from).view.height) / 4;
40 | if(result > 0)
41 | return result;
42 | else
43 | return 50; // !!@
44 | }
45 | }
46 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/springgraph/GraphNode.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.springgraph {
11 |
12 | import mx.core.UIComponent;
13 | import mx.core.Application;
14 | import mx.controls.Alert;
15 | import com.adobe.flex.extras.controls.forcelayout.Node;
16 | import flash.geom.Rectangle;
17 |
18 | /** Represents one node of a SpringGraph
19 | *
20 | * @author Mark Shepherd
21 | * @private
22 | */
23 | public class GraphNode extends Node {
24 |
25 | public var view: UIComponent;
26 | public var item: Item;
27 |
28 | public override function refresh(): void {
29 | this.x = getX();
30 | this.y = getY();
31 | this.repulsion = getRepulsion();
32 | }
33 |
34 | public override function commit(): void {
35 | setX(this.x);
36 | setY(this.y);
37 | }
38 |
39 | public function GraphNode(view: UIComponent, context: GraphDataProvider, item: Item) {
40 | super();
41 | this.view = view;
42 | this.context = context;
43 | this.item = item;
44 | }
45 |
46 | // -------------------------------------------------
47 | // Private stuff
48 | // -------------------------------------------------
49 |
50 | private function getX(): Number {
51 |
52 | return view.x + (view.width / 2); // we use the center point
53 | }
54 |
55 | private function setX(x: Number): void {
56 |
57 | /*
58 | if(context.boundary != null) {
59 | if((x < context.boundary.left) || ((x + view.width) > context.boundary.right))
60 | return;
61 | }
62 | */
63 | if ((x != (view.x + (view.width / 2))) && item.okToMove()) {
64 | //trace("setX : " + this.view.x);
65 | context.layoutChanged = true;
66 | view.x = x - (view.width / 2);
67 | }
68 | }
69 |
70 | private function getY(): Number {
71 | return view.y + (view.height / 2); // we use the center point
72 | }
73 |
74 | private function setY(y: Number): void {
75 | /*
76 | if(context.boundary != null) {
77 | if((y < context.boundary.top) || ((y + view.height) > context.boundary.bottom))
78 | return;
79 | }
80 | */
81 | if((y != (view.y + (view.height / 2))) && item.okToMove()) {
82 | context.layoutChanged = true;
83 | view.y = y - (view.height / 2);
84 | }
85 | }
86 |
87 | private function getRepulsion(): int {
88 | var result: int = (view.width + view.height) * context.repulsionFactor;
89 | if(result == 0)
90 | return context.defaultRepulsion;
91 | return result;
92 | }
93 |
94 | private var context: GraphDataProvider;
95 | }
96 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/springgraph/HistorySeed.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.springgraph
11 | {
12 | /** @private */
13 | public class HistorySeed extends Item
14 | {
15 | /*
16 | public function HistorySeed() {
17 | super();
18 | }
19 | override public function okToMove(): Boolean {
20 | return false;
21 | }
22 | */
23 | }
24 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/springgraph/HistorySeedView.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.springgraph
11 | {
12 | import flash.events.Event;
13 |
14 | /** @private */
15 | public class HistorySeedView extends DefaultItemView
16 | {
17 | // We happen to know that the first x/y values we
18 | // are given are the center x and center y of the springgraph.
19 | // We lock the Y value to this number, and never allow it to be
20 | // chnaged again. We don't lock the X value, but we insist it is always
21 | // on the left side of the screen. These rules ensure that, when autoFit
22 | // and showHistory and tidyHistory are all enabled, the history
23 | // forms a cluster on the middle left side of the screen.
24 | private var gotY: Boolean = false;
25 | private var gotX: Boolean = false;
26 | private var firstX: Number;
27 |
28 | // todo: only lock these x/y values if we are in autoFit mode
29 | override public function set x(value:Number):void
30 | {
31 | if(!gotX) {
32 | firstX = value / 3;
33 | gotX = true;
34 | }
35 |
36 | if(value > firstX) {
37 | value = firstX;
38 | }
39 |
40 | super.x = value;
41 | }
42 |
43 | override public function set y(value:Number):void
44 | {
45 | if(!gotY) {
46 | super.y = value;
47 | gotY = true;
48 | }
49 | }
50 | }
51 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/springgraph/IEdgeRenderer.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.springgraph
11 | {
12 | import flash.display.Graphics;
13 | import com.adobe.flex.extras.controls.springgraph.Item;
14 | import mx.core.UIComponent;
15 |
16 | /** Defines an object that knows how to draw the edges between 2 items in
17 | * a SpringGraph. */
18 | public interface IEdgeRenderer
19 | {
20 | /** SpringGraph will call this function each time it needs to draw
21 | * a link connecting two itemRenderer.
22 | * Note that fromView.data is the 'from' Item and toView.data is the 'to' Item.
23 | * @param g a Flash graphics object, representing the entire screen area of the
24 | * SpringGraph component. You can use various Flash drawing commands to draw
25 | * onto this drawing surface
26 | * @param fromView the itemRenderer instance for the 'from' Item of this linik
27 | * @param toView the itemRenderer instance for the 'to' Item of this link
28 | * @param fromX the x-coordinate of fromView
29 | * @param fromY the y-coordinate of fromView
30 | * @param toX the x-coordinate of toView
31 | * @param toY the y-coordinate of toView
32 | * @param graph the Graph that we are drawing
33 | * @return true if we successfully drew the edge, false if we want the SpringGraph
34 | * to draw the edge.
35 | */
36 | function draw(g: Graphics, fromView: UIComponent, toView: UIComponent,
37 | fromX: int, fromY: int, toX: int, toY: int, graph: Graph): Boolean;
38 | }
39 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/springgraph/IViewFactory.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 | package com.adobe.flex.extras.controls.springgraph
11 | {
12 | import mx.core.UIComponent;
13 |
14 | /** Defines an object that knows how to create views for Items. */
15 | public interface IViewFactory
16 | {
17 | /**
18 | * Create a UIComponent to represent a given Item in a SpringGraph. The returned UIComponent should
19 | * be a unique instance dedicated to that Item. This function might return a unique view component
20 | * on each call, or it might cache views and return the same view if called repeatedly
21 | * for the same item. This function may return different classes of object based on the type
22 | * or data of the Item.
23 | * @param item an item for which y
24 | * @return a unique UIComponent to represent the Item. This component must also implement the IDataRenderer interface.
25 | * It's OK to return null.
26 | *
27 | */
28 | function getView(item: Item): UIComponent;
29 | }
30 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/com/adobe/flex/extras/controls/springgraph/Item.as:
--------------------------------------------------------------------------------
1 | ////////////////////////////////////////////////////////////////////////////////
2 | //
3 | // Copyright (C) 2006 Adobe Macromedia Software LLC and its licensors.
4 | // All Rights Reserved. The following is Source Code and is subject to all
5 | // restrictions on such code as contained in the End User License Agreement
6 | // accompanying this product.
7 | //
8 | ////////////////////////////////////////////////////////////////////////////////
9 |
10 |
11 | package com.adobe.flex.extras.controls.springgraph
12 | {
13 | /** The base class for all Graph items.
14 | * @author Mark Shepherd
15 | *
16 | */
17 | public class Item
18 | {
19 | /**
20 | * Constructor for Item.
21 | *
22 | * @param id if non-null, this becomes the unique id for this item. WARNING: every item
23 | * must have an id that is different from the id of all other items. If you do not provide
24 | * an id, we create one for you.
25 | */
26 | public function Item(id: String = null) {
27 | if(id != null)
28 | _id = id;
29 | else
30 | _id = "$$__item" + ++counter;
31 | }
32 |
33 | /**
34 | * This item's unique id. Every item has a unique id.
35 | */
36 | [Bindable]
37 | public function get id(): String {
38 | return _id;
39 | }
40 | public function set id(s: String): void {
41 | }
42 |
43 | private var _id: String;
44 |
45 | /**
46 | * This item's data, if any.
47 | */
48 | [Bindable]
49 | public function get data(): Object {
50 | return _data;
51 | }
52 | public function set data(o: Object): void {
53 | _data = o;
54 | }
55 |
56 | private var _data: Object;
57 |
58 | /**
59 | * Find out if it's ok for the user to move this item with the mouse.
60 | *
61 | * @return true if it is currently permitted for the user to move this item. By default, this is true,
62 | * but subclasses of Item can override this as desired.
63 | */
64 | public function okToMove(): Boolean {
65 | return true;
66 | }
67 |
68 | private static var counter: int = 0;
69 | }
70 | }
--------------------------------------------------------------------------------
/lib/SpringGraph/manifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lib/dataStructures/as3ds.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/dataStructures/as3ds.swc
--------------------------------------------------------------------------------
/lib/flexlib-.2.4/bin/flexlib.swc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/VisualDataWeb/RelFinder/529ee8e161992ae5803613884bc25edaced9e6af/lib/flexlib-.2.4/bin/flexlib.swc
--------------------------------------------------------------------------------
/src/ExampleBox.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | [Event(name="loadExample")]
6 |
7 |
8 |
9 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
37 |
38 |
--------------------------------------------------------------------------------
/src/FilterTab.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package
12 | {
13 | import flash.events.MouseEvent;
14 | import mx.collections.ArrayCollection;
15 | import mx.containers.VBox;
16 | import mx.controls.Button;
17 | import mx.controls.Image;
18 | import mx.controls.tabBarClasses.Tab;
19 | import mx.core.Application;
20 |
21 | public class FilterTab extends VBox {
22 |
23 | public static const LABEL_TYPES:String = "types";
24 | public static const LABEL_CONCEPTS:String = "concepts";
25 | public static const LABEL_LENGTHS:String = "lengths";
26 |
27 |
28 | [Bindable]
29 | [Embed(source="../assets/img/hide.gif")]
30 | private var Hide:Class;
31 |
32 | [Bindable]
33 | [Embed(source="../assets/img/hide_inactive.gif")]
34 | private var HideInactive:Class;
35 |
36 | [Bindable]
37 | [Embed(source="../assets/img/show.gif")]
38 | private var Show:Class;
39 |
40 | [Bindable]
41 | [Embed(source="../assets/img/show_inactive.gif")]
42 | private var ShowInactive:Class;
43 |
44 | //private var _img:Image = new Image();
45 | private var _isVisible:Boolean = true;
46 | private var _list:ArrayCollection;
47 |
48 | public function FilterTab() {
49 | super();
50 | //_img.buttonMode = true;
51 | //_img.useHandCursor = true;
52 | //_img.source = Hide;
53 | //_img.addEventListener(MouseEvent.CLICK, handleImageClick);
54 | }
55 |
56 | private var _button:Button;
57 |
58 | public function set filterButton(value:Button):void {
59 | _button = value;
60 | _button.setStyle("icon", Hide);
61 | _button.toolTip = "Hide all";
62 | _button.addEventListener(MouseEvent.CLICK, buttonClickHandler);
63 | _button.addEventListener(MouseEvent.ROLL_OVER, buttonRollOver);
64 | }
65 |
66 | private function buttonRollOver(event:MouseEvent):void {
67 |
68 | }
69 |
70 | private function buttonClickHandler(event:MouseEvent):void {
71 |
72 | var value:Boolean = (!_isVisible);
73 | for each(var o:Object in _list) {
74 | o.isVisible = value;
75 | }
76 | }
77 |
78 | //override protected function createChildren():void {
79 | //super.createChildren();
80 | //icon = _img;
81 | //addChild(_img);
82 | //}
83 |
84 | public function set list(l:ArrayCollection):void {
85 | _list = l;
86 | }
87 |
88 | public function set isVisible(b:Boolean):void {
89 | _isVisible = b;
90 | if (_isVisible) {
91 | //_img.source = Hide;
92 | _button.setStyle("icon", Hide);
93 | _button.toolTip = "Hide all";
94 | }else {
95 | //_img.source = Show;
96 | _button.setStyle("icon", Show);
97 | _button.toolTip = "Show all";
98 | }
99 | }
100 |
101 | public function get isVisible():Boolean {
102 | return _isVisible;
103 | }
104 |
105 | //private function handleImageClick(event:Event):void {
106 | //var value:Boolean = (!_isVisible);
107 | //for each(var o:Object in _list) {
108 | //o.isVisible = value;
109 | //}
110 | //}
111 |
112 | private function app(): Main {
113 | return Application.application as Main;
114 | }
115 | }
116 |
117 | }
--------------------------------------------------------------------------------
/src/IconComboBox.as:
--------------------------------------------------------------------------------
1 | package
2 | {
3 | import mx.controls.ComboBox;
4 | import mx.core.Application;
5 |
6 | public class IconComboBox extends ComboBox {
7 |
8 | public function IconComboBox()
9 | {
10 | super();
11 | }
12 |
13 | override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void {
14 | super.updateDisplayList(unscaledWidth, unscaledHeight);
15 |
16 | drawRestricted();
17 |
18 | }
19 |
20 | public function drawRestricted():void{
21 | graphics.clear();
22 |
23 | var col:uint = 0xFF6A00;
24 |
25 | graphics.beginFill(col)
26 | graphics.drawCircle(15, 11, 9);
27 | graphics.drawCircle(15, 11, 7);
28 |
29 | graphics.lineStyle(2, col);
30 | graphics.moveTo(15 - 5, 11 - 5);
31 | graphics.lineTo(15 + 5, 11 + 5);
32 | graphics.endFill();
33 | }
34 |
35 | private function app():Main {
36 | return Application.application as Main;
37 | }
38 |
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/src/InfoLinkBox.mxml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 | " + URLUtil.getServerName(url) + "";
69 | }
70 |
71 | private function openWebsite(evt:TextEvent):void {
72 | if (evt.text..search("http://") == 0) {
73 | var newLink:URLRequest = new URLRequest(evt.text);
74 | navigateToURL(newLink,"_blank");
75 | }
76 | }
77 |
78 |
79 |
80 |
81 | ]]>
82 |
83 |
84 |
--------------------------------------------------------------------------------
/src/SortableDataGrid.as:
--------------------------------------------------------------------------------
1 | package {
2 |
3 | import flash.events.Event;
4 | import mx.controls.DataGrid;
5 | import mx.controls.dataGridClasses.*;
6 | import mx.collections.*;
7 | import mx.events.FlexEvent;
8 |
9 | public class SortableDataGrid extends DataGrid {
10 |
11 | public function SortableDataGrid() {
12 | super();
13 | addEventListener(FlexEvent.CREATION_COMPLETE, creationCompleteHandler);
14 | }
15 |
16 | private function creationCompleteHandler(event:FlexEvent):void {
17 | _creationComplete = true;
18 | sortByColumn(_sortIndexPreInitTemp);
19 | dispatchEvent(new Event("SortIndexChange"));
20 | }
21 |
22 | private var _creationComplete:Boolean = false;
23 | private var _sortIndexPreInitTemp:int = -1;
24 |
25 | private var _sortIndex:int = -1;
26 |
27 | [Bindable(event="SortIndexChange")]
28 | public function get sortIndex():int {
29 | return _sortIndex;
30 | }
31 |
32 | public function set sortIndex(value:int):void {
33 | if (!_creationComplete) {
34 | _sortIndexPreInitTemp = value;
35 | }else {
36 | _sortIndex = value;
37 | sortByColumn(value);
38 | dispatchEvent(new Event("SortIndexChange"));
39 | }
40 | }
41 |
42 | public var sortColumn:DataGridColumn;
43 |
44 | public var sortDirection:String;
45 |
46 | public var lastSortIndex:int = -1;
47 |
48 | [Inspectable(category="General", enumeration="ASC,DESC,DONTCHANGE", defaultValue="DONTCHANGE")]
49 | public function sortByColumn(index:int = -1, direction:String = "DONTCHANGE"):void {
50 |
51 | if (!_creationComplete) {
52 | _sortIndexPreInitTemp = index;
53 | return;
54 | }
55 |
56 |
57 | var c:DataGridColumn = columns[index];
58 | if (c != null) {
59 | var desc:Boolean = c.sortDescending;
60 | }else {
61 | return;
62 | }
63 | var dir:String = "";
64 |
65 | if (direction.toUpperCase() == "DESC" || direction.toUpperCase() == "ASC") {
66 | dir = direction.toUpperCase();
67 | }else {
68 | dir = (desc) ? "DESC" : "ASC";
69 | }
70 |
71 | if (c.sortable) {
72 |
73 | var s:Sort = collection.sort;
74 | var f:SortField;
75 |
76 | if (s) {
77 |
78 | s.compareFunction = null;
79 | var sf:Array = s.fields;
80 |
81 | if (sf) {
82 |
83 | for (var i:int = 0; i < sf.length; i++) {
84 | if (sf[i].name == c.dataField) {
85 | f = sf[i]
86 | if (direction.toUpperCase() != "DONTCHANGE") {
87 | desc = !f.descending;
88 | }
89 | break;
90 | }
91 | }
92 | }
93 |
94 | }else {
95 | s = new Sort();
96 | }
97 |
98 | if (!f) {
99 | f = new SortField(c.dataField);
100 | }
101 |
102 | c.sortDescending = desc;
103 |
104 | sortDirection = dir;
105 |
106 | lastSortIndex = _sortIndex;
107 | _sortIndex = index;
108 | dispatchEvent(new Event("SortIndexChange"));
109 |
110 | sortColumn = c;
111 |
112 | placeSortArrow();
113 |
114 | f.name = c.dataField;
115 | if (c.sortCompareFunction != null) {
116 | f.compareFunction = c.sortCompareFunction;
117 | }else {
118 | f.compareFunction = null;
119 | }
120 | f.descending = desc;
121 | s.fields = [f];
122 | }
123 |
124 | collection.sort = s;
125 | collection.refresh();
126 | }
127 | }
128 | }
--------------------------------------------------------------------------------
/src/ViewFactory.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package {
12 |
13 | import com.adobe.flex.extras.controls.springgraph.Graph;
14 | import graphElements.*;
15 | import mx.core.UIComponent;
16 | import com.adobe.flex.extras.controls.springgraph.IViewFactory;
17 | import com.adobe.flex.extras.controls.springgraph.Item;
18 |
19 | /** The object that knows how to create views that correspond to a given Item.
20 | * We recognize these types:
21 | * - for Items of type Word, we create a WordView
22 | * - for Items of type Meaning, we create a MeaningView
23 | */
24 | public class ViewFactory implements IViewFactory {
25 |
26 | public function ViewFactory() {
27 |
28 | }
29 |
30 | public function getView(item:Item):UIComponent
31 | {
32 | //trace("getView from the viewFactory for item: "+item.id);
33 | if (item is RelationNode) {
34 | return new graphElements.RelationNodeView();
35 | }else if (item is AggregatedRelationNode) {
36 | return new graphElements.AggregatedRelationNodeView();
37 | //}else if (item is ElementNode) {
38 | //return new graphElements.ElementNodeView();
39 | }else if (item is GivenNode) {
40 | return new graphElements.GivenNodeView();
41 | }else if (item is FoundNode) {
42 | return new graphElements.FoundNodeView();
43 | }
44 | trace("return null");
45 | return null;
46 | }
47 |
48 | }
49 |
50 | }
51 |
--------------------------------------------------------------------------------
/src/connection/ILookUp.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package connection
12 | {
13 |
14 | public interface ILookUp
15 | {
16 | function run(input:String, targetWithDataProvider:Object, limit:int = 20, offset:int = 0):void;
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/src/connection/ISPARQLResultParser.as:
--------------------------------------------------------------------------------
1 | package connection
2 | {
3 |
4 | /**
5 | * ...
6 | * @author Timo Stegemann
7 | */
8 | public interface ISPARQLResultParser
9 | {
10 | function handleSPARQLResultEvent(event:SPARQLResultEvent):void;
11 | }
12 |
13 | }
--------------------------------------------------------------------------------
/src/connection/LookUp.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package connection
12 | {
13 | import mx.rpc.http.HTTPService;
14 | import mx.rpc.events.ResultEvent;
15 | import mx.rpc.events.FaultEvent;
16 | import mx.core.Application;
17 | import flash.system.Security;
18 |
19 |
20 | public class LookUp
21 | {
22 | private var host:String;
23 | public function LookUp(_host:String) {
24 | Security.allowDomain("http://lookup.dbpedia.org");
25 | //http://lookup.dbpedia.org/api/search.asmx?op=PrefixSearch
26 | this.host = _host;
27 | }
28 |
29 | public function run(_input:String):void {
30 | var httpService:HTTPService = new HTTPService(this.host);
31 |
32 | httpService.addEventListener(ResultEvent.RESULT, lookUp_Result);
33 | httpService.addEventListener(FaultEvent.FAULT, lookUp_Fault);
34 |
35 | httpService.url = this.host;
36 | httpService.method = "GET";
37 |
38 | var params:Object = new Object();
39 | params["q"] = _input;
40 | httpService.send(params);
41 | }
42 |
43 | public function lookUp_Result(e:ResultEvent):void {
44 | //TODO: parse xml
45 | app().setAutoCompleteList(null);
46 | }
47 |
48 | public function lookUp_Fault(e:FaultEvent):void {
49 | trace("lookUp_Fault: " + e.message.toString());
50 | }
51 |
52 | private function app():Main {
53 | return Application.application as Main;
54 | }
55 |
56 | }
57 |
58 | }
--------------------------------------------------------------------------------
/src/connection/LookUpAutoCompleteTest.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package connection
12 | {
13 | import mx.collections.ArrayCollection;
14 | import mx.rpc.http.HTTPService;
15 | import mx.rpc.events.ResultEvent;
16 | import mx.rpc.events.FaultEvent;
17 | import mx.core.Application;
18 |
19 | public class LookUpAutoCompleteTest implements ILookUp
20 | {
21 | private var host:String = "http://lookup.dbpedia.org/api/autocompletetest.asmx/GetCompletionList";
22 |
23 | private var target:Object;
24 |
25 | public function run(_input:String, target:Object, limit:int = 20):void {
26 |
27 | this.target = target;
28 |
29 | var httpService:HTTPService = new HTTPService(this.host);
30 |
31 | httpService.addEventListener(ResultEvent.RESULT, lookUp_Result);
32 | httpService.addEventListener(FaultEvent.FAULT, lookUp_Fault);
33 |
34 | httpService.url = this.host;
35 | httpService.method = "GET";
36 |
37 |
38 | var params:Object = new Object();
39 | params["count"] = limit;
40 | params["prefixText"] = _input;
41 |
42 | trace("lookup (autocompletetest): " + _input);
43 | httpService.send(params);
44 | }
45 |
46 | public function lookUp_Result(e:ResultEvent):void {
47 | var results:ArrayCollection = new ArrayCollection();
48 |
49 | trace("LookUpAutoCompleteTest results:");
50 |
51 | var result:XML = new XML(e.message.body);
52 | var ns:Namespace = new Namespace("http://tempuri.org/");
53 | for each (var str:String in result..ns::string) {
54 | trace(str);
55 | results.addItem(str);
56 | }
57 |
58 | target.dataProvider = results;
59 | //app().setAutoCompleteList(results);
60 | }
61 |
62 | public function lookUp_Fault(e:FaultEvent):void {
63 | trace("lookUp_Fault: " + e.message.toString());
64 | }
65 |
66 | private function app():Main {
67 | return Application.application as Main;
68 | }
69 |
70 | }
71 |
72 | }
--------------------------------------------------------------------------------
/src/connection/LookUpKeywordSearch.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package connection
12 | {
13 | import connection.model.LookUpCache;
14 |
15 | import mx.collections.ArrayCollection;
16 | import mx.rpc.events.FaultEvent;
17 |
18 | public class LookUpKeywordSearch implements ILookUp
19 | {
20 |
21 | private var host:String = "http://lookup.dbpedia.org/api/search.asmx/KeywordSearch";
22 |
23 | private var target:Object;
24 |
25 |
26 |
27 | private var currentInput:String = "";
28 |
29 | public function LookUpKeywordSearch(){
30 |
31 | }
32 |
33 | public function run(_input:String, target:Object, limit:int = 40):void {
34 | var httpService:SPARQLService = new SPARQLService(host);
35 | httpService.addEventListener(SPARQLResultEvent.SPARQL_RESULT, lookUp_Result);
36 | httpService.addEventListener(FaultEvent.FAULT, lookUp_Fault);
37 |
38 | httpService.url = this.host;
39 | httpService.method = "POST";
40 |
41 | currentInput = _input;
42 |
43 | this.target = target;
44 |
45 | var params:Object = new Object();
46 | params["MaxHits"] = limit;
47 | params["QueryClass"] = "http://dbpedia.org/ontology/Resource";
48 | params["QueryString"] = _input;
49 |
50 | var inputArrayCollection:ArrayCollection = new ArrayCollection();
51 | inputArrayCollection.addItem(_input);
52 |
53 | httpService.sources = inputArrayCollection;
54 |
55 | httpService.send(params);
56 |
57 | }
58 |
59 | public function lookUp_Result(e:SPARQLResultEvent):void {
60 | var lastSend:Date = LookUpCache.getInstance().getLastSend(target);
61 | var resultSend:Date = e.executenTime;
62 |
63 | if (lastSend == null) {
64 | lastSend = resultSend;
65 | }
66 |
67 | LookUpCache.getInstance().setLastSend(target, resultSend);
68 |
69 | var lastInput:String = e.sources.getItemAt(0).toString();
70 |
71 | trace(lastInput, currentInput);
72 |
73 | if (resultSend.time >= lastSend.time && lastInput && currentInput && lastInput == currentInput) {
74 |
75 | var results:ArrayCollection = new ArrayCollection();
76 | var result:XML = new XML(e.message.body);
77 | var ns:Namespace = new Namespace("http://lookup.dbpedia.org/");
78 | for each (var res:XML in result..ns::Result) {
79 | var labelStr:String = res.ns::Label;
80 | var uriStr:String = res.ns::URI;
81 | if (labelStr.toLowerCase().search(currentInput.toLowerCase()) >= 0){
82 | results.addItem( { label:labelStr, uris: new Array(uriStr) } );
83 | }
84 | }
85 |
86 | if (results.length == 0) {
87 | var empty:Object = new Object();
88 | empty.label = "No results found";
89 | results.addItem(empty);
90 | }
91 |
92 | target.dataProvider = results;
93 | }
94 | }
95 |
96 | public function lookUp_Fault(e:FaultEvent):void {
97 | trace("lookUp_Fault: " + e.message.toString());
98 | }
99 | }
100 |
101 | }
--------------------------------------------------------------------------------
/src/connection/SPARQLQuery.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package connection
12 | {
13 | import mx.rpc.http.HTTPService;
14 |
15 | public class SPARQLQuery extends HTTPService
16 | {
17 | public var query:String;
18 | public var defaultGraphURI:String;
19 | public var phpSessionId:String;
20 | public var obj:Object = null;
21 |
22 | public function SPARQLQuery(_host:String)
23 | {
24 | super(_host);
25 | super.url = _host;
26 | }
27 |
28 | public function execute():void{
29 | var params:Object = new Object();
30 | params.query = this.query;
31 | params.output = super.resultFormat;
32 | if (this.defaultGraphURI != "") {
33 | params["default-graph-uri"] = this.defaultGraphURI;
34 | }
35 |
36 |
37 | //super.addEventListener(ResultEvent.RESULT, responseListener);
38 | super.cancel();
39 | super.send(params);
40 | }
41 | }
42 |
43 | }
--------------------------------------------------------------------------------
/src/connection/SPARQLResultEvent.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package connection
12 | {
13 | import mx.collections.ArrayCollection;
14 | import mx.messaging.messages.IMessage;
15 | import mx.rpc.AsyncToken;
16 | import mx.rpc.events.ResultEvent;
17 |
18 | public class SPARQLResultEvent extends ResultEvent
19 | {
20 | public static const SPARQL_RESULT:String = "SPARQLResult";
21 |
22 | private var _sources:ArrayCollection;
23 |
24 | private var _executenTime:Date;
25 |
26 | private var _parsingInformations:Object;
27 |
28 | public function SPARQLResultEvent(type:String, sources:ArrayCollection, executenTime:Date, parsingInformations:Object = null, bubbles:Boolean = false, cancelable:Boolean = true,
29 | result:Object = null, token:AsyncToken = null, message:IMessage = null)
30 | {
31 | super(type, bubbles, cancelable, result, token, message);
32 | _sources = sources;
33 | _executenTime = executenTime;
34 | _parsingInformations = parsingInformations;
35 | }
36 |
37 | public function get executenTime():Date {
38 | return _executenTime;
39 | }
40 |
41 | public function get sources():ArrayCollection {
42 | return _sources;
43 | }
44 |
45 | public function get parsingInformations():Object {
46 | return _parsingInformations;
47 | }
48 |
49 | public static function createEvent(result:Object = null, sources:ArrayCollection = null, executenTime:Date = null, parsingInformations:Object = null, token:AsyncToken = null, message:IMessage = null):SPARQLResultEvent
50 | {
51 | // (added by Florian Dürr, Toni Feuchert, Mathias Schraps)
52 | // add URI for SPARQL namespace if no URI is given by the endpoint
53 |
54 | var resultstring:String = new String(result);
55 | resultstring = resultstring.replace("", "");
56 |
57 | return new SPARQLResultEvent(SPARQLResultEvent.SPARQL_RESULT, sources, executenTime, parsingInformations, false, true, resultstring, token, message);
58 |
59 | // OLD code:
60 | // return new SPARQLResultEvent(SPARQLResultEvent.SPARQL_RESULT, sources, executenTime, parsingInformations, false, true, result, token, message);
61 | }
62 |
63 | }
64 |
65 | }
--------------------------------------------------------------------------------
/src/connection/SPARQLResultTracer.as:
--------------------------------------------------------------------------------
1 | package connection
2 | {
3 |
4 | /**
5 | * ...
6 | * @author Timo Stegemann
7 | */
8 | public class SPARQLResultTracer implements ISPARQLResultParser
9 | {
10 |
11 | public function SPARQLResultTracer()
12 | {
13 |
14 | }
15 |
16 | public function handleSPARQLResultEvent(event:SPARQLResultEvent):void {
17 | trace(event.result);
18 | }
19 |
20 | }
21 |
22 | }
--------------------------------------------------------------------------------
/src/connection/SPARQLService.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package connection
12 | {
13 | import flash.events.Event;
14 | import mx.collections.ArrayCollection;
15 | import mx.core.mx_internal;
16 | import mx.messaging.events.MessageEvent;
17 | import mx.rpc.AsyncToken;
18 | import mx.rpc.events.ResultEvent;
19 | import mx.rpc.http.HTTPService;
20 |
21 | use namespace mx_internal;
22 |
23 | /**
24 | * ...
25 | * @author Timo Stegemann
26 | */
27 | public class SPARQLService extends HTTPService
28 | {
29 | private var _sources:ArrayCollection = null;
30 |
31 | private var _executenTime:Date;
32 |
33 | private var _parsingInformations:Object = null;
34 |
35 | public function SPARQLService(rootURL:String = null, destination:String = null)
36 | {
37 | super(rootURL, destination);
38 | addEventListener("result", eventWrapper);
39 | }
40 |
41 | private function eventWrapper(event:ResultEvent):void {
42 | var resultEvent:SPARQLResultEvent = SPARQLResultEvent.createEvent(event.result, sources, executenTime, parsingInformations, null, event.message);
43 | resultEvent.headers = _responseHeaders;
44 | dispatchEvent(resultEvent);
45 | }
46 |
47 |
48 |
49 | public function get sources():ArrayCollection {
50 | return _sources;
51 | }
52 |
53 | public function set sources(sources:ArrayCollection):void {
54 | _sources = sources;
55 | }
56 |
57 | public function get parsingInformations():Object {
58 | return _parsingInformations;
59 | }
60 |
61 | public function set parsingInformations(value:Object):void {
62 | _parsingInformations = value;
63 | }
64 |
65 | override public function send(parameters:Object = null):AsyncToken
66 | {
67 | _executenTime = new Date();
68 | return super.send(parameters);
69 | }
70 |
71 | public function get executenTime():Date {
72 | if (_executenTime == null) {
73 | _executenTime = new Date();
74 | }
75 | return _executenTime;
76 | }
77 |
78 | /**
79 | * Take the MessageAckEvent and take the result, store it, and broadcast out
80 | * appropriately.
81 | *
82 | * @private
83 | */
84 | //mx_internal override function resultHandler(event:MessageEvent):void
85 | //{
86 | //trace(event.message);
87 | //
88 | //var token:AsyncToken = preHandle(event);
89 | //
90 | //if the handler didn't give us something just bail
91 | //if (token == null)
92 | //return;
93 | //
94 | //if (processResult(event.message, token))
95 | //{
96 | //dispatchEvent(new Event(BINDING_RESULT));
97 | //var resultEvent:SPARQLResultEvent = SPARQLResultEvent.createEvent(_result, _sources, executenTime, _parsingInformations, token, event.message);
98 | //resultEvent.headers = _responseHeaders;
99 | //dispatchRpcEvent(resultEvent);
100 | //}
101 | //no else, we assume process would have dispatched the faults if necessary
102 | //}
103 |
104 | }
105 |
106 | }
--------------------------------------------------------------------------------
/src/connection/config/CIAWorldFactBookConfig.as:
--------------------------------------------------------------------------------
1 | package connection.config
2 | {
3 |
4 | /**
5 | * ...
6 | * @author Timo Stegemann
7 | */
8 | public class CIAWorldFactBookConfig extends Config
9 | {
10 | override public function get endpointURI():String {
11 | return "http://www4.wiwiss.fu-berlin.de/factbook";
12 | }
13 |
14 | override public function get defaultGraphURI():String {
15 | return "";
16 | }
17 |
18 | override public function get isVirtuoso():Boolean {
19 | return false;
20 | }
21 |
22 | override public function get abbreviation():String {
23 | return "ciawfb";
24 | }
25 |
26 | override public function get name():String {
27 | return "CIA World Fact Book";
28 | }
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/connection/config/DBLPConfig.as:
--------------------------------------------------------------------------------
1 | package connection.config
2 | {
3 |
4 | /**
5 | * ...
6 | * @author Timo Stegemann
7 | */
8 | public class DBLPConfig extends Config
9 | {
10 | override public function get endpointURI():String {
11 | return "http://www4.wiwiss.fu-berlin.de/dblp";
12 | }
13 |
14 | override public function get defaultGraphURI():String {
15 | return "";
16 | }
17 |
18 | override public function get isVirtuoso():Boolean {
19 | return false;
20 | }
21 |
22 | override public function get abbreviation():String {
23 | return "dblp";
24 | }
25 |
26 | override public function get name():String {
27 | return "DBLP Bibliography Database (Berlin)";
28 | }
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/connection/config/DBTuneConfig.as:
--------------------------------------------------------------------------------
1 | package connection.config
2 | {
3 | import mx.collections.ArrayCollection;
4 | import connection.ILookUp;
5 |
6 |
7 | /**
8 | * ...
9 | * @author Timo Stegemann
10 | */
11 | public class DBTuneConfig extends Config
12 | {
13 |
14 | override public function get endpointURI():String {
15 | return "http://api.talis.com/stores/bbc-backstage/services"
16 | return "http://dbtune.org/bbc/playcount/sparql";
17 | }
18 |
19 | override public function get defaultGraphURI():String {
20 | return "";
21 | }
22 |
23 | override public function get isVirtuoso():Boolean {
24 | return false;
25 | }
26 |
27 | override public function get abbreviation():String {
28 | return "dbtune";
29 | }
30 |
31 | override public function get name():String {
32 | return "DBTune";
33 | }
34 |
35 | }
36 | }
--------------------------------------------------------------------------------
/src/connection/config/DBpediaConfig.as:
--------------------------------------------------------------------------------
1 | package connection.config
2 | {
3 | import connection.ILookUp;
4 | import connection.LookUpKeywordSearch;
5 | import connection.LookUpSPARQL;
6 |
7 | import mx.collections.ArrayCollection;
8 |
9 | /**
10 | * ...
11 | * @author Timo Stegemann
12 | */
13 | public class DBpediaConfig extends Config
14 | {
15 | override public function get endpointURI():String {
16 | return "http://dbpedia.org/sparql";
17 | }
18 |
19 | override public function get defaultGraphURI():String {
20 | return "http://dbpedia.org";
21 | }
22 |
23 | override public function get isVirtuoso():Boolean {
24 | return true;
25 | }
26 |
27 | override public function get description():String {
28 | return "dbp";
29 | }
30 |
31 | override public function get name():String {
32 | return "DBpedia";
33 | }
34 |
35 | override public function get ignoredProperties():ArrayCollection {
36 | var ignoredProperties:ArrayCollection = new ArrayCollection();
37 | ignoredProperties.addItem("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
38 | ignoredProperties.addItem("http://www.w3.org/2004/02/skos/core#subject");
39 | ignoredProperties.addItem("http://dbpedia.org/property/wikiPageUsesTemplate");
40 | ignoredProperties.addItem("http://dbpedia.org/property/wordnet_type");
41 | return ignoredProperties;
42 | }
43 |
44 | //protected var _lookUp:ILookUp = new LookUpKeywordSearch();
45 | protected var _lookUp:ILookUp = new LookUpSPARQL();
46 |
47 | override public function get lookUp():ILookUp{
48 | if (_lookUp == null){
49 | _lookUp = new LookUpSPARQL();
50 | }
51 | return _lookUp;
52 | }
53 |
54 | override public function set lookUp(lookUp:ILookUp):void{
55 | _lookUp = lookUp;
56 | }
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/connection/config/IConfig.as:
--------------------------------------------------------------------------------
1 | package connection.config
2 | {
3 | import connection.ILookUp;
4 |
5 | import mx.collections.ArrayCollection;
6 |
7 | /**
8 | * ...
9 | * @author Timo Stegemann
10 | */
11 | public interface IConfig
12 | {
13 | [Bindable(event="endpointURIChange")]
14 | function get endpointURI():String;
15 |
16 | function set endpointURI(value:String):void;
17 |
18 | [Bindable(event="abbreviationURIChange")]
19 | function get abbreviation():String;
20 |
21 | function set abbreviation(value:String):void;
22 |
23 | [Bindable(event="defaultGraphURIChange")]
24 | function get defaultGraphURI():String;
25 |
26 | function set defaultGraphURI(value:String):void;
27 |
28 | [Bindable(event="isVirtuosoChange")]
29 | function get isVirtuoso():Boolean;
30 |
31 | function set isVirtuoso(value:Boolean):void;
32 |
33 | [Bindable(event="nameChange")]
34 | function get name():String;
35 |
36 | function set name(value:String):void;
37 |
38 | [Bindable(event="descriptionChange")]
39 | function get description():String;
40 |
41 | function set description(value:String):void;
42 |
43 | [Bindable(event="autocompleteURIsChange")]
44 | function get autocompleteURIs():ArrayCollection;
45 |
46 | function set autocompleteURIs(value:ArrayCollection):void;
47 |
48 | [Bindable(event="ignoredPropertiesChange")]
49 | function get ignoredProperties():ArrayCollection;
50 |
51 | function set ignoredProperties(value:ArrayCollection):void;
52 |
53 | [Bindable(event="lookUpChange")]
54 | function get lookUp():ILookUp;
55 |
56 | function set lookUp(value:ILookUp):void;
57 |
58 | [Bindable(event="useProxyChange")]
59 | function get useProxy():Boolean;
60 |
61 | function set useProxy(value:Boolean):void;
62 |
63 | [Bindable(event="abstractURIsChange")]
64 | function get abstractURIs():ArrayCollection;
65 |
66 | function set abstractURIs(value:ArrayCollection):void;
67 |
68 | [Bindable(event="imageURIsChange")]
69 | function get imageURIs():ArrayCollection;
70 |
71 | function set imageURIs(value:ArrayCollection):void;
72 |
73 | [Bindable(event="linkURIsChange")]
74 | function get linkURIs():ArrayCollection;
75 |
76 | function set linkURIs(value:ArrayCollection):void;
77 |
78 | //[Bindable(event="minRelationLengthChange")]
79 | //function get minRelationLength():int;
80 | //
81 | //function set minRelationLength(value:int):void
82 |
83 | [Bindable(event="maxRelationLengthChange")]
84 | function get maxRelationLength():int;
85 |
86 | function set maxRelationLength(value:int):void
87 |
88 | [Bindable(event="dontAppendSPARQLChange")]
89 | function get dontAppendSPARQL():Boolean;
90 |
91 | function set dontAppendSPARQL(value:Boolean):void;
92 |
93 | [Bindable(event="methodChange")]
94 | function get method():String;
95 |
96 | function set method(value:String):void;
97 |
98 | [Bindable(event="autocompleteLanguageChange")]
99 | function get autocompleteLanguage():String;
100 |
101 | function set autocompleteLanguage(value:String):void;
102 |
103 | function equals(value:IConfig):Boolean
104 | }
105 |
106 | }
--------------------------------------------------------------------------------
/src/connection/config/LODConfig.as:
--------------------------------------------------------------------------------
1 | package connection.config
2 | {
3 | import mx.collections.ArrayCollection;
4 |
5 | /**
6 | * ...
7 | * @author Timo Stegemann
8 | */
9 | public class LODConfig extends DBpediaConfig
10 | {
11 | override public function get endpointURI():String {
12 | return "http://lod.openlinksw.com/sparql";
13 | }
14 |
15 | override public function get defaultGraphURI():String {
16 | return "";
17 | }
18 |
19 | override public function get isVirtuoso():Boolean {
20 | return true;
21 | }
22 |
23 | override public function get description():String {
24 | return "lod";
25 | }
26 |
27 | override public function get name():String {
28 | return "Linking Open Data (LOD)";
29 | }
30 |
31 | override public function get ignoredProperties():ArrayCollection {
32 | var ignoredProperties:ArrayCollection = super.ignoredProperties;
33 | ignoredProperties.addItem("http://dbpedia.org/property/wikilink");
34 | return ignoredProperties;
35 | }
36 |
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/src/connection/config/LinkedMDBConfig.as:
--------------------------------------------------------------------------------
1 | package connection.config
2 | {
3 |
4 | /**
5 | * ...
6 | * @author Timo Stegemann
7 | */
8 | public class LinkedMDBConfig extends Config
9 | {
10 | override public function get endpointURI():String {
11 | return "http://data.linkedmdb.org";
12 | }
13 |
14 | override public function get defaultGraphURI():String {
15 | return "";
16 | }
17 |
18 | override public function get isVirtuoso():Boolean {
19 | return false;
20 | }
21 |
22 | override public function get abbreviation():String {
23 | return "lmdb";
24 | }
25 |
26 | override public function get name():String {
27 | return "Linked Movie Data Base";
28 | }
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/src/connection/model/LookUpCache.as:
--------------------------------------------------------------------------------
1 | package connection.model
2 | {
3 | import flash.events.Event;
4 | import flash.events.EventDispatcher;
5 | import flash.events.IEventDispatcher;
6 | import flash.utils.Dictionary;
7 |
8 | /**
9 | * ...
10 | * @author Timo Stegemann
11 | */
12 | public class LookUpCache implements IEventDispatcher
13 | {
14 | //*** Singleton **********************************************************
15 | private static var instance:LookUpCache;
16 |
17 | private var eventDispatcher:EventDispatcher;
18 |
19 | public function LookUpCache(singleton:SingletonEnforcer)
20 | {
21 | eventDispatcher = new EventDispatcher();
22 | }
23 |
24 | public static function getInstance():LookUpCache{
25 | if (LookUpCache.instance == null){
26 | LookUpCache.instance = new LookUpCache(new SingletonEnforcer());
27 |
28 | }
29 | return LookUpCache.instance;
30 | }
31 | //************************************************************************
32 |
33 | private var _lastSend:Dictionary = new Dictionary();
34 |
35 | public function setLastSend(target:Object, lastSend:Date):void {
36 | _lastSend[target] = lastSend;
37 | }
38 |
39 | public function getLastSend(target:Object):Date {
40 | return _lastSend[target];
41 | }
42 |
43 |
44 | //*** IEventDispatcher ***************************************************
45 | public function addEventListener(type:String, listener:Function,
46 | useCapture:Boolean = false, priority:int = 0, weakRef:Boolean = false):void{
47 | eventDispatcher.addEventListener(type, listener, useCapture, priority, weakRef);
48 | }
49 |
50 | public function dispatchEvent(event:Event):Boolean{
51 | return eventDispatcher.dispatchEvent(event);
52 | }
53 |
54 | public function hasEventListener(type:String):Boolean{
55 | return eventDispatcher.hasEventListener(type);
56 | }
57 |
58 | public function removeEventListener(type:String, listener:Function,
59 | useCapture:Boolean = false):void{
60 | eventDispatcher.removeEventListener(type, listener, useCapture);
61 | }
62 |
63 | public function willTrigger(type:String):Boolean {
64 | return eventDispatcher.willTrigger(type);
65 | }
66 | //************************************************************************
67 | }
68 | }
69 | class SingletonEnforcer{}
--------------------------------------------------------------------------------
/src/global/GlobalString.as:
--------------------------------------------------------------------------------
1 | package global
2 | {
3 | /**
4 | * ...
5 | * @author ...
6 | */
7 | public class GlobalString
8 | {
9 | // LookUp
10 | public static const SEPARATOR:String = "-----------------------------------------";
11 | public static const SEARCHING:String = "Searching...";
12 | public static const NORESULTS:String = "No results found";
13 | public static const SEARCHMORE:String = "Search for more";
14 | public static const ERROR:String = "Error. Please check SPARQL configuration.";
15 |
16 | // Status Model
17 | public static const STATUS:String = "Status";
18 | public static const IDLE:String = "Idle";
19 | public static const NOCONNECTION:String = "Database not available. Check network connection.";
20 | public static const SOMEERRORS:String = "Some Errors occured.";
21 | public static const NORELATION:String = "No Relation found";
22 | public static const SEARCHINGRELATION:String = "Searching for relations";
23 | public static const LOOKUP:String = "Searching for resources";
24 | public static const BUILDING:String = "Building graph";
25 |
26 | // Error Log
27 | public static const FINE:String = "Everything seems to be fine. No Errors were received";
28 |
29 | public static function getStrings():Array {
30 | var strings:Array = new Array();
31 | strings.push(SEPARATOR);
32 | strings.push(SEARCHING);
33 | strings.push(NORESULTS);
34 | strings.push(SEARCHMORE);
35 | strings.push(ERROR);
36 | return strings;
37 | }
38 |
39 | }
40 |
41 | }
--------------------------------------------------------------------------------
/src/global/LoggedError.as:
--------------------------------------------------------------------------------
1 | package global
2 | {
3 | import mx.messaging.messages.HTTPRequestMessage;
4 | import mx.rpc.events.FaultEvent;
5 | import mx.utils.ObjectUtil;
6 | /**
7 | * ...
8 | * @author Timo Stegemann
9 | */
10 | public class LoggedError
11 | {
12 |
13 | public function LoggedError(error:Object)
14 | {
15 | this.error = error
16 | }
17 |
18 | private var _error:Object;
19 |
20 | public function set error(value:Object):void {
21 | _error = value;
22 | time = new Date();
23 | }
24 |
25 | [Bindable]
26 | public function get error():Object {
27 | return _error;
28 | }
29 |
30 | private var _time:Date = null;
31 |
32 | private function set time(value:Date):void {
33 | _time = value;
34 | }
35 |
36 | [Bindable]
37 | public function get time():Date {
38 | return _time;
39 | }
40 |
41 | public function toString():String
42 | {
43 | if (_error is FaultEvent) {
44 | try {
45 | var e:FaultEvent = error as FaultEvent;
46 | var faultString:String = e.fault.faultString;
47 | var message:HTTPRequestMessage = e.token.message as HTTPRequestMessage;
48 |
49 | var returnMsg:String = faultString + "\n" + "\turl: " + message.url + "\n";
50 | for (var key:Object in message.body) {
51 | returnMsg += "\t" + key.toString() + ": " + message.body[key] + "\n";
52 | }
53 | return returnMsg;
54 |
55 | }catch (err:Error) {
56 | return ObjectUtil.toString(_error);
57 | }
58 |
59 | }
60 | return ObjectUtil.toString(_error);
61 | }
62 |
63 | }
64 |
65 | }
--------------------------------------------------------------------------------
/src/global/ToolTipModel.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package global
12 | {
13 |
14 | import flash.events.Event;
15 | import flash.events.EventDispatcher;
16 | import flash.events.IEventDispatcher;
17 |
18 | /**
19 | * ...
20 | * @author Timo Stegemann
21 | */
22 | public class ToolTipModel implements IEventDispatcher
23 | {
24 | //*** Singleton **********************************************************
25 | private static var instance:ToolTipModel;
26 |
27 | private var eventDispatcher:EventDispatcher;
28 |
29 | public function ToolTipModel(singleton:SingletonEnforcer)
30 | {
31 | eventDispatcher = new EventDispatcher();
32 | }
33 |
34 | public static function getInstance():ToolTipModel{
35 | if (ToolTipModel.instance == null){
36 | ToolTipModel.instance = new ToolTipModel(new SingletonEnforcer());
37 |
38 | }
39 | return ToolTipModel.instance;
40 | }
41 | //************************************************************************
42 |
43 | public var preventToolTipHide:Boolean = true;
44 |
45 |
46 | //*** IEventDispatcher ***************************************************
47 | public function addEventListener(type:String, listener:Function,
48 | useCapture:Boolean = false, priority:int = 0, weakRef:Boolean = false):void{
49 | eventDispatcher.addEventListener(type, listener, useCapture, priority, weakRef);
50 | }
51 |
52 | public function dispatchEvent(event:Event):Boolean{
53 | return eventDispatcher.dispatchEvent(event);
54 | }
55 |
56 | public function hasEventListener(type:String):Boolean{
57 | return eventDispatcher.hasEventListener(type);
58 | }
59 |
60 | public function removeEventListener(type:String, listener:Function,
61 | useCapture:Boolean = false):void{
62 | eventDispatcher.removeEventListener(type, listener, useCapture);
63 | }
64 |
65 | public function willTrigger(type:String):Boolean {
66 | return eventDispatcher.willTrigger(type);
67 | }
68 | //************************************************************************
69 | }
70 | }
71 | class SingletonEnforcer{}
--------------------------------------------------------------------------------
/src/graphElements/AggregatableElement.as:
--------------------------------------------------------------------------------
1 | package graphElements
2 | {
3 | import flash.events.Event;
4 | import flash.events.EventDispatcher;
5 | import mx.collections.ArrayCollection;
6 | import mx.events.FlexEvent;
7 |
8 | /**
9 | * Element extands AggregatableElement not reverse, which could be implied by the name.
10 | *
11 | * @author Timo Stegemann
12 | */
13 | public class AggregatableElement extends EventDispatcher
14 | {
15 | public var leefsAggregatedInThis:Boolean = false;
16 |
17 | public var aggregationRoot:AggregatableElement = null;
18 |
19 | public var aggregationLeefs:ArrayCollection = null;
20 |
21 | public function addAggregationLeef(leef:AggregatableElement):void {
22 | if (aggregationLeefs == null) {
23 | aggregationLeefs = new ArrayCollection();
24 | }
25 |
26 | aggregationLeefs.addItem(leef);
27 |
28 | // If "leef" is a leef of "this", then "this" must be root of "leef" (of cause our aggregation structure is not a real tree!)
29 | leef.aggregationRoot = this;
30 | }
31 |
32 | private var _isAggregatedInRoot:Boolean = false;
33 |
34 | [Bindable(event="isAggregatedInRootChange")]
35 | public function get isAggregatedInRoot():Boolean {
36 | return _isAggregatedInRoot;
37 | }
38 |
39 | public function set isAggregatedInRoot(value:Boolean):void {
40 | _isAggregatedInRoot = value;
41 | dispatchEvent(new Event("isAggregatedInRootChange"));
42 | aggregationRoot.dispatchEvent(new Event("isAggregatedInRootChange"));
43 | }
44 |
45 | }
46 |
47 | }
--------------------------------------------------------------------------------
/src/graphElements/AggregatedRelationNode.as:
--------------------------------------------------------------------------------
1 | package graphElements
2 | {
3 | import graphElements.RelationNode;
4 | import graphElements.Relation;
5 | import mx.collections.ArrayCollection;
6 |
7 | /**
8 | * ...
9 | * @author Timo Stegemann
10 | */
11 | public class AggregatedRelationNode extends RelationNode
12 | {
13 |
14 | public function AggregatedRelationNode(id:String, relation:Relation)
15 | {
16 | super(id, relation);
17 |
18 | }
19 |
20 | public var aggregatedNodes:ArrayCollection = new ArrayCollection();
21 |
22 | }
23 |
24 | }
--------------------------------------------------------------------------------
/src/graphElements/AggregatedRelationNodeView.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
17 |
18 |
19 |
20 |
21 | .myToggleButtonStyle {
22 | fontSize: 9;
23 | fontWeight: middle;
24 | padding-top:0;
25 | padding-bottom:0;
26 | padding-right:0;
27 | padding-left:0;
28 | }
29 |
30 | .chainItemStyle {
31 | fontWeight: middle;
32 | color: #3f3f3f;
33 | fontSize: 9;
34 | }
35 |
36 |
37 |
39 |
40 |
41 |
42 |
45 |
46 |
47 |
97 |
98 |
--------------------------------------------------------------------------------
/src/graphElements/Chain.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package graphElements
12 | {
13 | public class Chain
14 | {
15 | public var id:String;
16 | public var nodes:Array = new Array();
17 |
18 | public function Chain(_id:String) {
19 | this.id = _id;
20 | }
21 |
22 | public function addNode(_o:Object):void {
23 | this.nodes.push(_o);
24 | }
25 |
26 | }
27 |
28 | }
--------------------------------------------------------------------------------
/src/graphElements/FoundNode.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package graphElements
12 | {
13 | public class FoundNode extends MyNode {
14 |
15 | public function FoundNode(_id:String, _element:Element) {
16 | super(_id, _element);
17 | element.isGiven = false;
18 | element.loadClass();
19 | }
20 |
21 | }
22 |
23 | }
--------------------------------------------------------------------------------
/src/graphElements/GivenNode.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package graphElements
12 | {
13 | import flash.events.TimerEvent;
14 | import flash.utils.Timer;
15 |
16 | public class GivenNode extends MyNode {
17 |
18 | public function GivenNode(_id:String, _element:Element) {
19 | super(_id, _element);
20 | element.isGiven = true;
21 | timer = new Timer(100);
22 | timer.addEventListener(TimerEvent.TIMER, timerMove);
23 | }
24 |
25 | private var timer:Timer = new Timer(5);
26 |
27 | private var xTo:Number;
28 | private var yTo:Number;
29 |
30 | private var stepX:Number;
31 | private var stepY:Number;
32 | private var steps:int;
33 | private var stepsDone:int;
34 |
35 | private var stepLength:Number = 20;
36 |
37 | public function moveToPosition(x:Number, y:Number):void {
38 |
39 | timer.stop();
40 |
41 | xTo = x;
42 | yTo = y;
43 |
44 | stepsDone = 0;
45 |
46 | var length:Number = Math.sqrt(Math.pow(getX() - xTo , 2) + Math.pow(getY() - yTo , 2));
47 |
48 | steps = length / stepLength;
49 | stepX = (xTo - getX()) / steps;
50 | stepY = (yTo - getY()) / steps;
51 |
52 | timer.start();
53 | }
54 |
55 | private function timerMove(event:TimerEvent):void {
56 | stepsDone++;
57 |
58 | if (stepsDone >= steps) {
59 | timer.stop();
60 | setPosition(xTo, yTo);
61 | }else {
62 | setPosition(getX() + stepX, getY() + stepY);
63 | }
64 | }
65 |
66 | }
67 |
68 | }
--------------------------------------------------------------------------------
/src/graphElements/RelationNode.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package graphElements
12 | {
13 | import flash.events.Event;
14 | import mx.core.Application;
15 |
16 | public class RelationNode extends MyNode
17 | {
18 | //[Bindable]
19 | //public var rLabel:String = "";
20 | private var _relation:Relation = null;
21 |
22 | public function RelationNode(id:String, relation:Relation) {
23 | super(id, relation.predicate); //the predicate represents the RelationNode!
24 | this._relation = relation;
25 | }
26 |
27 | public function get relation():Relation {
28 | return _relation;
29 | }
30 | }
31 |
32 | }
--------------------------------------------------------------------------------
/src/graphElements/VisibilityRenderer.mxml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
88 |
89 |
90 |
91 |
--------------------------------------------------------------------------------
/src/graphElements/events/PropertyChangedEvent.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 |
11 | package graphElements.events {
12 |
13 | import flash.events.Event;
14 |
15 | public class PropertyChangedEvent extends Event {
16 |
17 | private var _origin:Object = null;
18 | private var _property:String = "";
19 |
20 | // Define static constant.
21 | public static const PROPERTY_CHANGED:String = "propertyChanged";
22 |
23 | // Public constructor.
24 | public function PropertyChangedEvent(type:String, origin:Object, property:String) {
25 | // Call the constructor of the superclass.
26 | super(type);
27 | //this._id = id;
28 | this._origin = origin;
29 | this._property = property;
30 | }
31 |
32 | public function get origin():Object {
33 | return _origin;
34 | }
35 |
36 | public function get propery():String {
37 | return _property;
38 | }
39 |
40 | // Override the inherited clone() method.
41 | override public function clone():Event {
42 | return new PropertyChangedEvent(type, _origin, _property);
43 | }
44 |
45 | }
46 |
47 | }
--------------------------------------------------------------------------------
/src/php/index.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Angie und Hillary
4 | Angie und ihr Mann
5 | Angie und Dagmar_Krause
6 |
12 |
13 |
14 |
15 | if(isset($_REQUEST['first']) && isset($_REQUEST['second'])) {
16 |
17 | include('RelationFinder.php');
18 | $first = 'http://dbpedia.org/resource/'.$_REQUEST['first'];
19 | $second = 'http://dbpedia.org/resource/'.$_REQUEST['second'];
20 |
21 | $rf = new RelationFinder();
22 |
23 | $maxDistance = 4;
24 | // get all queries we are interested in
25 | $queries = $rf->getQueries($first, $second, $maxDistance, 10, array(), array('http://www.w3.org/1999/02/22-rdf-syntax-ns#type','http://www.w3.org/2004/02/skos/core#subject'), true);
26 | // execute queries one by one
27 | for($distance = 1; $distance <= $maxDistance; $distance++) {
28 | echo 'Executing queries for distance '.$distance.'
';
29 | foreach($queries[$distance] as $query) {
30 | echo 'Running following query:
'.htmlentities($query).'
';
31 | $startTime = microtime(true);
32 | $table = $rf->executeSparqlQuery($query, "HTML");
33 | $runTime = microtime(true) - $startTime;
34 | echo $table.'
';
35 | echo 'runtime: '.$runTime.' seconds
';
36 | }
37 | }
38 |
39 | }
40 |
41 | ?>
42 |
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/php/test.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | require_once('RelationFinder.php');
4 |
5 |
6 | $r = new RelationFinder();
7 | $object1 = "db:Angela_Merkel";
8 | $object2 = "db:Joachim_Sauer";
9 | $object2 = "db:Hillary_Rodham_Clinton";
10 | //$object1 = "a";
11 | //$object2 = "b";
12 | $maxDistance = 3;
13 | $limit = 10;
14 | $ignoredObjects;
15 | $ignoredProperties = array(
16 | 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type',
17 | 'http://www.w3.org/2004/02/skos/core#subject',
18 | 'http://dbpedia.org/property/wikiPageUsesTemplate',
19 | 'http://dbpedia.org/property/wordnet_type'
20 |
21 | );
22 | $avoidCycles = 2;
23 |
24 | $arr = $r->getQueries($object1, $object2, $maxDistance, $limit, $ignoredObjects, $ignoredProperties, $avoidCycles);
25 | //print_r($arr);
26 |
27 | foreach ($arr as $distance){
28 | foreach ($distance as $query){
29 | $now = microtime(true);
30 | echo "".$query."";
31 | echo $r->executeSparqlQuery($query, "HTML");
32 | echo "
needed ".(microtime(true)-$now)." seconds
";
33 | }
34 | }
35 |
36 |
--------------------------------------------------------------------------------
/src/popup/AddURI.mxml:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/src/popup/DirectInput.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
18 |
19 |
20 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
--------------------------------------------------------------------------------
/src/popup/ErrorLog.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
17 |
18 |
19 |
57 |
58 |
59 |
60 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
--------------------------------------------------------------------------------
/src/popup/ErrorLogCompleteMSG.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
16 |
17 |
66 |
67 |
68 |
69 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
--------------------------------------------------------------------------------
/src/popup/ErrorLogRenderer.mxml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
10 |
104 |
105 |
106 |
107 |
108 |
109 |
111 |
112 |
114 |
115 |
116 |
117 |
--------------------------------------------------------------------------------
/src/popup/Infos.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
15 |
27 |
28 |
29 |
30 |
31 |
32 | RelFinder
34 | RelFinder is a tool based on Adobe Flex that automatically reveals relationships within a set of known objects via arbitrary SPARQL endpoints and displays them as graph visualization. The relationships are found by an algorithm that can be applied to large RDF knowledge bases, such as DBpedia or the whole LOD-Cloud. Since the graph that visualizes the relationships can still become large, we added interactive features and filtering options to the user interface that enable a reduction of displayed nodes and facilitate understanding.
35 | The source code is published under the GNU General Public License and hosted on Google Code under http://code.google.com/p/relfinder/.
36 | The current version of RelFinder is accessible at http://relfinder.semanticweb.org/.
37 | Related Publications:
38 | Heim, P.; Hellmann, S.; Lehmann, J.; Lohmann, S.; Stegemann, T.: RelFinder: Revealing Relationships in RDF Knowledge Bases (to appear). In: Proceedings of the 4th International Conference on Semantic and Digital Media Technologies (SAMT 2009), Springer.
[Download]
39 | Contact and Copyright (C) 2009:
40 | Philipp Heim (philipp.heim@vis.uni-stuttgart.de),
41 | Sebastian Hellmann (hellmann@informatik.uni-leipzig.de),
42 | Jens Lehmann (lehmann@informatik.uni-leipzig.de),
43 | Steffen Lohmann (steffen.lohmann@uni-due.de),
44 | Timo Stegemann (timo.stegemann@uni-due.de).
45 |
46 | ]]>
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/src/popup/InputSelectionEvent.as:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (C) 2009 Philipp Heim, Sebastian Hellmann, Jens Lehmann, Steffen Lohmann and Timo Stegemann
3 | *
4 | * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
5 | *
6 | * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
7 | *
8 | * You should have received a copy of the GNU General Public License along with this program; if not, see .
9 | */
10 | package popup
11 | {
12 | import flash.events.Event;
13 |
14 | /**
15 | * ...
16 | * @author Timo Stegemann
17 | */
18 | public class InputSelectionEvent extends Event
19 | {
20 |
21 | public static const INPUTSELECTION:String = "InputSelectionEvent";
22 |
23 | public var autoCompleteIndex:int;
24 | public var selectedItem:Object;
25 |
26 | public function InputSelectionEvent(type:String, autoCompleteIndex:int, selectedItem:Object, bubbles:Boolean=false, cancelable:Boolean=false)
27 | {
28 | this.autoCompleteIndex = autoCompleteIndex;
29 | this.selectedItem = selectedItem;
30 |
31 | super(type, bubbles, cancelable);
32 | }
33 |
34 | public override function clone():Event
35 | {
36 | return new InputSelectionEvent(type, autoCompleteIndex, selectedItem, bubbles, cancelable);
37 | }
38 |
39 | public override function toString():String
40 | {
41 | return formatToString("InputSelectionEvent", "type", "bubbles", "cancelable", "eventPhase");
42 | }
43 |
44 | }
45 |
46 | }
--------------------------------------------------------------------------------
/src/popup/OpenResources.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
15 | 0) {
78 | var newLink:URLRequest = new URLRequest(uri);
79 | navigateToURL(newLink,"_blank");
80 | }
81 |
82 | }
83 |
84 |
85 | ]]>
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
--------------------------------------------------------------------------------
/src/popup/SPARQLQueryTool.mxml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
12 |
13 |
14 |
15 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
--------------------------------------------------------------------------------
/src/positionedTabNavigator/events/CloseTabEvent.as:
--------------------------------------------------------------------------------
1 | package positionedTabNavigator.events
2 | {
3 | import flash.events.Event;
4 |
5 | /**
6 | * ...
7 | * @author Timo Stegemann
8 | */
9 | public class CloseTabEvent extends Event
10 | {
11 | public var tabLabel:String = "";
12 |
13 | public static const CLOSE_TAB_EVENT:String = "cte";
14 |
15 | public function CloseTabEvent(tabLabel:String, bubbles:Boolean=false, cancelable:Boolean=false)
16 | {
17 | super(CLOSE_TAB_EVENT, bubbles, cancelable);
18 | this.tabLabel = tabLabel;
19 | }
20 |
21 | public override function clone():Event
22 | {
23 | return new CloseTabEvent(type, bubbles, cancelable);
24 | }
25 |
26 | public override function toString():String
27 | {
28 | return formatToString("CloseTabEvent", "type", "bubbles", "cancelable", "eventPhase");
29 | }
30 |
31 | }
32 |
33 | }
--------------------------------------------------------------------------------
/src/preloader/CustomPreloader.as:
--------------------------------------------------------------------------------
1 | package preloader
2 | {
3 | import flash.display.Sprite;
4 | import flash.events.Event;
5 | import flash.events.ProgressEvent;
6 | import flash.utils.Timer;
7 | import flash.events.TimerEvent;
8 | import mx.events.*;
9 | import mx.preloaders.Preloader;
10 | import mx.preloaders.DownloadProgressBar;
11 | import preloader.WelcomeScreen;
12 |
13 | public class CustomPreloader extends DownloadProgressBar {
14 |
15 | public var wcs:WelcomeScreen;
16 |
17 | public function CustomPreloader()
18 | {
19 | super();
20 | wcs = new WelcomeScreen();
21 | this.addChild(wcs);
22 | }
23 |
24 | override public function set preloader( myPreloader:Sprite ):void
25 | {
26 | myPreloader.addEventListener( ProgressEvent.PROGRESS , SWFDownloadProgress );
27 | myPreloader.addEventListener( Event.COMPLETE , SWFDownloadComplete );
28 | myPreloader.addEventListener( FlexEvent.INIT_PROGRESS , FlexInitProgress );
29 | myPreloader.addEventListener( FlexEvent.INIT_COMPLETE , FlexInitComplete );
30 | }
31 |
32 | private function SWFDownloadProgress( event:ProgressEvent ):void {}
33 |
34 | private function SWFDownloadComplete( event:Event ):void {}
35 |
36 | private function FlexInitProgress( event:Event ):void {}
37 |
38 | private function FlexInitComplete( event:Event ):void
39 | {
40 | wcs.ready = true;
41 | dispatchEvent( new Event( Event.COMPLETE ) );
42 | }
43 |
44 | }
45 |
46 | }
--------------------------------------------------------------------------------
/src/preloader/WelcomeScreen.as:
--------------------------------------------------------------------------------
1 | package preloader
2 | {
3 | import flash.display.Loader;
4 | import flash.utils.ByteArray;
5 | import flash.events.MouseEvent;
6 | import flash.events.TimerEvent;
7 | import flash.utils.Timer;
8 |
9 | public class WelcomeScreen extends Loader
10 | {
11 |
12 | [ Embed(source="../../assets/img/RelFinder-Logo-gr.png", mimeType="application/octet-stream") ]
13 | public var WelcomeScreenGraphic:Class;
14 | public var timer:Timer;
15 | private var fadeInRate:Number = .012;
16 | private var fadeOutRate:Number = .012;
17 | private var timeAutoClose:int = 250;
18 | public var ready:Boolean = false;
19 |
20 | public function WelcomeScreen()
21 | {
22 | this.visible = false;
23 | this.alpha = 0;
24 | timer = new Timer( 1 );
25 | timer.addEventListener( TimerEvent.TIMER, updateView );
26 | timer.start();
27 |
28 | this.loadBytes( new WelcomeScreenGraphic() as ByteArray );
29 | this.addEventListener( MouseEvent.MOUSE_DOWN, mouseDown );
30 | }
31 |
32 | public function updateView( event:TimerEvent ):void
33 | {
34 | if( this.alpha < 1) this.alpha = this.alpha + this.fadeInRate;
35 | this.stage.addChild(this);
36 | this.x = this.stage.stageWidth / 2 - this.width / 2;
37 | this.y = this.stage.stageHeight / 2 - this.height / 2;
38 | this.visible=true;
39 | if ( this.ready && timer.currentCount > this.timeAutoClose ) closeScreen();
40 | }
41 |
42 | public function closeScreen():void
43 | {
44 | timer.removeEventListener( TimerEvent.TIMER, updateView );
45 | timer.removeEventListener( MouseEvent.MOUSE_DOWN, mouseDown);
46 | timer.addEventListener( TimerEvent.TIMER, closeScreenFade );
47 | }
48 |
49 | public function closeScreenFade( event:TimerEvent ):void
50 | {
51 | if( this.alpha > 0){
52 | this.alpha = this.alpha - fadeOutRate;
53 | } else {
54 | timer.stop();
55 | this.parent.removeChild(this);
56 | }
57 | }
58 |
59 | public function mouseDown( event:MouseEvent ):void
60 | {
61 | closeScreen();
62 | }
63 |
64 | }
65 | }
--------------------------------------------------------------------------------
/src/skin/ToggleSizeButtonSkinNone.as:
--------------------------------------------------------------------------------
1 | package skin
2 | {
3 | import mx.skins.halo.ButtonSkin;
4 | import flash.display.GradientType;
5 | import mx.core.IButton;
6 | import mx.core.UIComponent;
7 | import mx.skins.Border;
8 | import mx.skins.halo.HaloColors;
9 | import mx.styles.StyleManager;
10 | import mx.utils.ColorUtil;
11 |
12 | /**
13 | * ...
14 | * @author Timo Stegemann
15 | */
16 | public class ToggleSizeButtonSkinNone extends Border
17 | {
18 |
19 | public function ToggleSizeButtonSkinNone()
20 | {
21 | super();
22 | }
23 |
24 | private static var cache:Object = {};
25 |
26 | private static function calcDerivedStyles(themeColor:uint,
27 | fillColor0:uint,
28 | fillColor1:uint):Object
29 | {
30 | var key:String = HaloColors.getCacheKey(themeColor,
31 | fillColor0, fillColor1);
32 |
33 | if (!cache[key])
34 | {
35 | var o:Object = cache[key] = {};
36 |
37 | // Cross-component styles.
38 | HaloColors.addHaloColors(o, themeColor, fillColor0, fillColor1);
39 | }
40 |
41 | return cache[key];
42 | }
43 |
44 | override public function get measuredWidth():Number
45 | {
46 | return 20;
47 | }
48 |
49 | override public function get measuredHeight():Number
50 | {
51 | return 20;
52 | }
53 |
54 | override protected function updateDisplayList(w:Number, h:Number):void
55 | {
56 | super.updateDisplayList(w, h);
57 |
58 | // User-defined styles.
59 | var borderColor:uint = getStyle("borderColor");
60 | var cornerRadius:Number = getStyle("cornerRadius");
61 | var fillAlphas:Array = getStyle("fillAlphas");
62 | var fillColors:Array = getStyle("fillColors");
63 | StyleManager.getColorNames(fillColors);
64 | var highlightAlphas:Array = getStyle("highlightAlphas");
65 | var themeColor:uint = getStyle("themeColor");
66 |
67 | // Derivative styles.
68 | var derStyles:Object = calcDerivedStyles(themeColor, fillColors[0],
69 | fillColors[1]);
70 |
71 | var borderColorDrk1:Number =
72 | ColorUtil.adjustBrightness2(borderColor, -50);
73 |
74 | var themeColorDrk1:Number =
75 | ColorUtil.adjustBrightness2(themeColor, -25);
76 |
77 | var emph:Boolean = false;
78 |
79 | var lineColor:uint = getStyle("iconColor");
80 | var lineAlpha:Number = 0.3;
81 |
82 | if (parent is IButton)
83 | emph = IButton(parent).emphasized;
84 |
85 |
86 | var tmp:Number;
87 |
88 | graphics.clear();
89 |
90 | var xMid:Number = w / 2;
91 | var yMid:Number = h / 2;
92 |
93 | graphics.beginFill(0x000000, 0);
94 | graphics.drawRect(0, 0, width, height);
95 | graphics.endFill();
96 |
97 |
98 | graphics.lineStyle(1, borderColor, 0.9);
99 | graphics.moveTo(0, yMid);
100 | graphics.lineTo(w, yMid);
101 |
102 | }
103 |
104 | }
105 | }
--------------------------------------------------------------------------------
/src/utils/ArrayCollectionUtil.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import mx.collections.ArrayCollection;
4 | /**
5 | * ...
6 | * @author Timo Stegemann
7 | */
8 | public class ArrayCollectionUtil
9 | {
10 |
11 | // 0: equal
12 | // Number.MIN_VALUE: both null
13 | // Number.MAX_VALUE: one null
14 | // <0: different lenght
15 | // >0: different entries
16 | public static function compare(ac1:ArrayCollection, ac2:ArrayCollection):Number {
17 |
18 | if (ac1 == null && ac2 == null) {
19 | return Number.MIN_VALUE;
20 | }
21 |
22 | if (ac1 == null || ac2 == null) {
23 | return Number.MAX_VALUE;
24 | }
25 |
26 | var a1:Array = ac1.source;
27 | var a2:Array = ac2.source;
28 |
29 | if (a1.length != a2.length) {
30 | return -Math.abs(a1.length - a2.length);
31 | }
32 |
33 | a1.sort();
34 | a2.sort();
35 |
36 | var compare:Number = 0;
37 |
38 | for (var i:int = 0; i < a1.length; i++) {
39 | if (a1[i].toString() != a2[i].toString()) {
40 | compare++;
41 | }
42 | }
43 |
44 | return compare;
45 |
46 | }
47 |
48 | }
49 |
50 | }
--------------------------------------------------------------------------------
/src/utils/DynamicTextArea.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import flash.events.Event;
4 | import flash.events.IOErrorEvent;
5 | import flash.events.MouseEvent;
6 | import flash.events.TextEvent;
7 | import flash.text.TextFieldAutoSize;
8 | import mx.controls.TextArea;
9 | import mx.core.IUITextField;
10 | import mx.events.FlexEvent;
11 | import mx.core.mx_internal;
12 |
13 | public class DynamicTextArea extends TextArea{
14 |
15 | public function DynamicTextArea(){
16 | super();
17 | super.horizontalScrollPolicy = "off";
18 | super.verticalScrollPolicy = "off";
19 |
20 | }
21 |
22 | override protected function createChildren():void {
23 | super.createChildren();
24 |
25 | this.addEventListener(FlexEvent.CREATION_COMPLETE, creationComplete );
26 | this.addEventListener(FlexEvent.UPDATE_COMPLETE, updateComplete );
27 | this.addEventListener(Event.CHANGE, adjustHeightHandler );
28 |
29 | this.removeEventListener(MouseEvent.MOUSE_WHEEL, mouseWheelHandler);
30 |
31 | }
32 |
33 | protected function creationComplete( event : FlexEvent ) : void {
34 | textField.autoSize = TextFieldAutoSize.LEFT;
35 | textField.wordWrap = true;
36 | textField.mouseWheelEnabled = false;
37 | }
38 |
39 | protected function updateComplete( event : FlexEvent ) : void {
40 | if ( super.height != Math.floor( textField.height ) )
41 | super.height = textField.height;
42 | }
43 |
44 | protected function adjustHeightHandler(event:Event):void{
45 | super.dispatchEvent( new FlexEvent( FlexEvent.UPDATE_COMPLETE ) );
46 | }
47 |
48 | }
49 | }
--------------------------------------------------------------------------------
/src/utils/Example.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import connection.config.IConfig;
4 | import mx.collections.ArrayCollection;
5 | import mx.utils.ObjectUtil;
6 | /**
7 | * ...
8 | * @author Timo Stegemann
9 | */
10 | public class Example
11 | {
12 |
13 | [Bindable]
14 | public var objects:ArrayCollection = new ArrayCollection();
15 |
16 | public var endpointConfig:IConfig = null;
17 |
18 | public function toString():String
19 | {
20 | return endpointConfig.name + " - " + ObjectUtil.toString(objects.toArray());
21 | }
22 |
23 | }
24 |
25 | }
--------------------------------------------------------------------------------
/src/utils/ExampleUtil.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import connection.model.ConnectionModel;
4 | import mx.collections.ArrayCollection;
5 | import mx.core.Application;
6 | import mx.utils.ObjectUtil;
7 | /**
8 | * ...
9 | * @author Timo Stegemann
10 | */
11 | public class ExampleUtil
12 | {
13 |
14 | public static function setExamplesFromXML(xml:Object):void {
15 |
16 | if (xml.example is ArrayCollection) {
17 |
18 | for each (var example:Object in xml.example) {
19 | var ex:Example = new Example();
20 |
21 | for each(var obj:Object in (example.object as ArrayCollection)) {
22 |
23 | obj.uris = new Array(obj.uri);
24 |
25 | ex.objects.addItem(obj);
26 | }
27 |
28 | ex.endpointConfig = ConnectionModel.getInstance().getSPARQLByAbbreviation(example.endpoint.toString());
29 |
30 | ((Application.application as Main).tabExamples as ExampleBox).examples.addItem(ex);
31 | }
32 |
33 | }else {
34 |
35 | var ex2:Example = new Example();
36 |
37 | ex2.endpointConfig = ConnectionModel.getInstance().getSPARQLByAbbreviation(xml.example.endpoint.toString());
38 |
39 | for each(var obj2:Object in (xml.example.object as ArrayCollection)) {
40 |
41 | obj2.uris = new Array(obj2.uri);
42 |
43 | ex2.objects.addItem(obj2);
44 | }
45 |
46 | ((Application.application as Main).tabExamples as ExampleBox).examples.addItem(ex2);
47 |
48 | }
49 |
50 |
51 | }
52 |
53 | }
54 |
55 | }
--------------------------------------------------------------------------------
/src/utils/SimilaritySort.as:
--------------------------------------------------------------------------------
1 | package utils
2 | {
3 | import mx.collections.ArrayCollection;
4 | import mx.collections.Sort;
5 | import mx.collections.SortField;
6 |
7 | /**
8 | * ...
9 | * @author Timo Stegemann
10 | */
11 | public class SimilaritySort
12 | {
13 | private static var mWeightThreshold:Number = 0.7;
14 | private static var mNumChars:int = 4;
15 |
16 | public static function sort(data:ArrayCollection, comparator:String):void {
17 |
18 | if (data.length > 1) {
19 |
20 | var helperCollection:ArrayCollection = new ArrayCollection();
21 |
22 | for each(var ob:Object in data) {
23 | var newOb:Object = new Object();
24 | newOb.similarity = similarity(ob.label.toString().toLowerCase(), comparator.toLowerCase());
25 | newOb.object = ob;
26 | helperCollection.addItem(newOb);
27 | }
28 | var dataSortField:SortField = new SortField();
29 | dataSortField.name = "similarity";
30 | dataSortField.numeric = true;
31 | dataSortField.descending = true;
32 |
33 | var numericDataSort:Sort = new Sort();
34 | numericDataSort.fields = [dataSortField];
35 |
36 | helperCollection.sort = numericDataSort;
37 | helperCollection.refresh();
38 |
39 | data.removeAll();
40 | for each(var ob2:Object in helperCollection) {
41 | data.addItem(ob2.object);
42 | }
43 | }
44 | }
45 |
46 | /**
47 | * Calculating similarity with Jaro-Winkler-Distance
48 | *
49 | * @param str1 - 1st String
50 | * @param str2 - 2nd String
51 | * @return Similarity
52 | */
53 | public static function similarity(str1:String, str2:String):Number {
54 |
55 | var sim:Number;
56 |
57 | var len1:int = str1.length;
58 | var len2:int = str2.length;
59 |
60 | if (len1 == 0) {
61 | if (len2 == 0) {
62 | return 1.0;
63 | }else {
64 | return 0.0;
65 | }
66 | }
67 |
68 | var searchRange:int = Math.max(0, Math.max(len1, len2) / 2 - 1);
69 |
70 | var matched1:Array = new Array(len1);
71 | for (var m1:int = 0; m1 < len1; m1++) {
72 | matched1[m1] = false;
73 | }
74 |
75 | var matched2:Array = new Array(len2);
76 | for (var m2:int = 0; m2 < len2; m2++) {
77 | matched2[m2] = false;
78 | }
79 |
80 | var numCommon:int = 0;
81 | var i:int;
82 | var j:int;
83 | for (i = 0; i < len1; ++i) {
84 | var start:int = Math.max(0, i - searchRange);
85 | var end:int = Math.min(i + searchRange + 1, len2);
86 |
87 | for (j = start; j < end; ++j) {
88 | if ((matched2[j] as Boolean) == true) {
89 | continue;
90 | }
91 | if (str1.charAt(i) != str2.charAt(j)) {
92 | continue;
93 | }
94 | matched1[i] = true;
95 | matched2[j] = true;
96 | ++numCommon;
97 | break;
98 | }
99 | }
100 |
101 | if (numCommon == 0) {
102 | return 0.0;
103 | }
104 |
105 | var numHalfTransposed:int = 0;
106 | j = 0;
107 |
108 | for (i = 0; i < len1; ++i) {
109 | if ((matched1[i] as Boolean) == false) {
110 | continue;
111 | }
112 | while ((matched2[j] as Boolean) == false) {
113 | ++j;
114 | }
115 | if (str1.charAt(i) != str2.charAt(j)) {
116 | ++numHalfTransposed;
117 | }
118 | ++j;
119 | }
120 |
121 | var numTransposed:int = numHalfTransposed / 2;
122 |
123 | var numCommonD:Number = new Number(numCommon);
124 | var weight:Number = (numCommonD / len1 + numCommonD / len2 + (numCommon - numTransposed) / numCommonD) / 3.0;
125 |
126 | if (weight <= mWeightThreshold) {
127 | return weight;
128 | }
129 |
130 | var max:int = Math.min(mNumChars, Math.min(len1, len2));
131 | var pos:int = 0;
132 | while (pos < max && str1.charAt(pos) == str2.charAt(pos)) {
133 | ++pos;
134 | }
135 |
136 | if (pos == 0) {
137 | return weight;
138 | }
139 |
140 | return weight + 0.1 * pos * (1.0 - weight);
141 |
142 | }
143 |
144 | }
145 |
146 | }
--------------------------------------------------------------------------------