Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

some forgotten earlier refactorings; tweaked to support (minimal) text

editing/save/load; removed classes
from repo
  • Loading branch information...
commit 5640354c0733308ab408a849ecb8b09046e2e2ea 1 parent 83117f7
Danny Ayers authored

Showing 35 changed files with 154 additions and 106 deletions. Show diff stats Hide diff stats

  1. BIN  .cache
  2. +4 3 .gitignore
  3. +3 3 Scute.theme
  4. BIN  classes/org/hyperdata/scute/demos/JEdwards.class
  5. BIN  classes/org/hyperdata/scute/demos/SourceDemo.class
  6. BIN  classes/org/hyperdata/scute/filemanager/FileComparator.class
  7. BIN  classes/org/hyperdata/scute/filemanager/FileExplorerCard.class
  8. BIN  classes/org/hyperdata/scute/filemanager/FilesTreeModel.class
  9. BIN  classes/org/hyperdata/scute/filemanager/FilesTreePanel$1.class
  10. BIN  classes/org/hyperdata/scute/filemanager/FilesTreePanel.class
  11. BIN  classes/org/hyperdata/scute/help/HelpUI$1.class
  12. BIN  classes/org/hyperdata/scute/help/HelpUI.class
  13. BIN  classes/org/hyperdata/scute/rdf/ModelContainer.class
  14. BIN  classes/org/hyperdata/scute/syntax/TurtleView.class
  15. BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$1.class
  16. BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$2.class
  17. BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$3.class
  18. BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$4.class
  19. BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$5.class
  20. BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$6.class
  21. BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$7.class
  22. BIN  classes/org/hyperdata/scute/toolbars/file/FileUI.class
  23. BIN  classes/org/hyperdata/scute/toolbars/file/FilesInterface.class
  24. BIN  classes/org/hyperdata/scute/toolbars/file/IO.class
  25. +3 3 data/config.ttl
  26. +4 4 data/default.ttl
  27. +5 0 data/temp.txt
  28. +40 22 src/org/hyperdata/scute/demos/ExploreEditDemo.java
  29. +1 0  src/org/hyperdata/scute/help/HelpUI.java
  30. +2 1  src/org/hyperdata/scute/rdf/ModelContainer.java
  31. +1 1  src/org/hyperdata/scute/syntax/TurtleView.java
  32. +5 4 src/org/hyperdata/scute/toolbars/file/FileUI.java
  33. +59 64 src/org/hyperdata/scute/toolbars/file/FilesInterface.java
  34. +18 0 src/org/hyperdata/scute/toolbars/file/FilesModelInterface.java
  35. +9 1 src/org/hyperdata/scute/toolbars/file/IO.java
BIN  .cache
Binary file not shown
7 .gitignore
... ... @@ -1,4 +1,5 @@
1   -/dist
2   -/temp
3   -/build.num
  1 +dist
  2 +temp
  3 +build.num
  4 +classes
4 5 *.class
6 Scute.theme
... ... @@ -1,10 +1,10 @@
1 1 nimrodlf.p1=#0085EB
2   -nimrodlf.p2=#008FF5
  2 +nimrodlf.p2=#008FEE
3 3 nimrodlf.p3=#0066CC
4 4 nimrodlf.s1=#DCDCDC
5 5 nimrodlf.s2=#E6E6E6
6 6 nimrodlf.s3=#F0F0F0
7 7 nimrodlf.w=#FAFAFA
8 8 nimrodlf.b=#000000
9   -nimrodlf.menuOpacity=195
10   -nimrodlf.frameOpacity=180
  9 +nimrodlf.menuOpacity=220
  10 +nimrodlf.frameOpacity=220
BIN  classes/org/hyperdata/scute/demos/JEdwards.class
Binary file not shown
BIN  classes/org/hyperdata/scute/demos/SourceDemo.class
Binary file not shown
BIN  classes/org/hyperdata/scute/filemanager/FileComparator.class
Binary file not shown
BIN  classes/org/hyperdata/scute/filemanager/FileExplorerCard.class
Binary file not shown
BIN  classes/org/hyperdata/scute/filemanager/FilesTreeModel.class
Binary file not shown
BIN  classes/org/hyperdata/scute/filemanager/FilesTreePanel$1.class
Binary file not shown
BIN  classes/org/hyperdata/scute/filemanager/FilesTreePanel.class
Binary file not shown
BIN  classes/org/hyperdata/scute/help/HelpUI$1.class
Binary file not shown
BIN  classes/org/hyperdata/scute/help/HelpUI.class
Binary file not shown
BIN  classes/org/hyperdata/scute/rdf/ModelContainer.class
Binary file not shown
BIN  classes/org/hyperdata/scute/syntax/TurtleView.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$1.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$2.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$3.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$4.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$5.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$6.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FileUI$7.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FileUI.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/FilesInterface.class
Binary file not shown
BIN  classes/org/hyperdata/scute/toolbars/file/IO.class
Binary file not shown
6 data/config.ttl
@@ -2,14 +2,14 @@
2 2 @prefix rev: <http://purl.org/stuff/rev#> .
3 3 @prefix mo: <http://purl.org/ontology/mo/> .
4 4 @prefix foaf: <http://xmlns.com/foaf/0.1/> .
5   -@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
6 5 @prefix wo: <http://purl.org/ontology/wo/> .
  6 +@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
7 7 @prefix void: <http://rdfs.org/ns/void#> .
8 8 @prefix yagop: <http://dbpedia.org/property/yago/> .
9 9 @prefix dcterms: <http://purl.org/dc/terms/> .
10 10 @prefix dbpr: <http://dbpedia.org/resource/> .
11   -@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
12 11 @prefix dbpo: <http://dbpedia.org/ontology/> .
  12 +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
13 13 @prefix dbpp: <http://dbpedia.org/property/> .
14 14 @prefix yagoc: <http://dbpedia.org/class/yago/> .
15 15 @prefix owl: <http://www.w3.org/2002/07/owl#> .
@@ -27,7 +27,7 @@
27 27 <http://purl.org/stuff/scute/modelSaveDelay>
28 28 "20000" ;
29 29 <http://purl.org/stuff/scute/selectedView>
30   - "Files" ;
  30 + "Turtle" ;
31 31 <http://purl.org/stuff/scute/sync>
32 32 "true" ;
33 33 <http://purl.org/stuff/scute/textSaveDelay>
8 data/default.ttl
@@ -8,18 +8,18 @@
8 8 @prefix yagop: <http://dbpedia.org/property/yago/> .
9 9 @prefix dcterms: <http://purl.org/dc/terms/> .
10 10 @prefix dbpr: <http://dbpedia.org/resource/> .
11   -@prefix dbpo: <http://dbpedia.org/ontology/> .
12 11 @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
  12 +@prefix dbpo: <http://dbpedia.org/ontology/> .
13 13 @prefix dbpp: <http://dbpedia.org/property/> .
14 14 @prefix yagoc: <http://dbpedia.org/class/yago/> .
15 15 @prefix owl: <http://www.w3.org/2002/07/owl#> .
16 16 @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
17 17 @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
18   -@prefix po: <http://purl.org/ontology/po/> .
19 18 @prefix rel: <http://purl.org/vocab/relationship/> .
  19 +@prefix po: <http://purl.org/ontology/po/> .
20 20 @prefix skos: <http://www.w3.org/2004/02/skos/core#> .
21 21 @prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .
22 22 @prefix x: <http://purl.org/stuff/> .
23 23
24   -<http://purl.org/stuff/scute/danny>
25   - foaf:name "danny" .
  24 +
  25 +x:Test dc:title "Test" .
5 data/temp.txt
@@ -20,3 +20,8 @@ SELECT DISTINCT * WHERE {
20 20 # ?pc ?p ?district .
21 21 }
22 22
  23 +
  24 +x:Test rdfs:label "Test" .
  25 +
  26 +<http://hyperdata.org/projects/Seki> a :Project ;
  27 +foaf:maker <http://danny.ayers.name/index.rdf#me> .
62 src/org/hyperdata/scute/demos/ExploreEditDemo.java
@@ -3,18 +3,13 @@
3 3 */
4 4 package org.hyperdata.scute.demos;
5 5
  6 +import java.awt.BorderLayout;
6 7 import java.awt.Dimension;
7 8 import java.awt.Font;
8 9 import java.awt.event.WindowAdapter;
9 10 import java.awt.event.WindowEvent;
10 11
11   -import javax.swing.JButton;
12   -import javax.swing.JEditorPane;
13   -import javax.swing.JFrame;
14   -import javax.swing.JPanel;
15   -import javax.swing.JScrollPane;
16   -import javax.swing.UIManager;
17   -import javax.swing.WindowConstants;
  12 +import javax.swing.*;
18 13
19 14 import com.nilo.plaf.nimrod.NimRODLookAndFeel;
20 15 import com.nilo.plaf.nimrod.NimRODTheme;
@@ -28,6 +23,8 @@
28 23 import org.hyperdata.scute.demos.temp.SourceEditor;
29 24 import org.hyperdata.scute.demos.temp.FileTreeSelectionListener;
30 25 import org.hyperdata.scute.filemanager.FileExplorerCard;
  26 +import org.hyperdata.scute.toolbars.file.FileUI;
  27 +import org.hyperdata.scute.toolbars.file.IO;
31 28
32 29 /**
33 30 * @author danny
@@ -35,30 +32,50 @@
35 32 */
36 33 public class ExploreEditDemo {
37 34
38   - JPanel contentPanel;
  35 + private JPanel outerPanel;
  36 + private FileExplorerCard fileExplorerPane; // left-hand panel
  37 +
  38 + private JPanel editorPanel; // right-hand panel
  39 + private JToolBar fileToolBar;
  40 + private JScrollPane editorScrollPane;
  41 + private SourceEditor editor;
  42 +
39 43 private Leaf left;
40 44 private Leaf right;
41   - private SourceEditor editorPane;
42   - private FileExplorerCard fileExplorerPane;
43   - private JScrollPane editorScrollPane;
  45 +
  46 + private IO io;
  47 + private FileUI fileUI;
44 48
45 49 public ExploreEditDemo() {
46 50 initLayout();
47 51 initFileExplorer();
48 52 initEditor();
49   -
50   - contentPanel.add(fileExplorerPane, "left");
51   - contentPanel.add(editorPane.getScrollPane(), "right");
  53 + initToolBar();
  54 +
  55 + outerPanel.add(fileExplorerPane, "left");
  56 +
  57 + editorPanel = new JPanel(new BorderLayout());
  58 + editorPanel.add(editor.getScrollPane(), BorderLayout.CENTER);
  59 + editorPanel.add(fileToolBar, BorderLayout.NORTH);
  60 + outerPanel.add(editorPanel, "right");
52 61 centerSplit();
53 62
54 63 FileTreeSelectionListener treeMouseListener = new FileTreeSelectionListener();
55   - treeMouseListener.attach(fileExplorerPane.getTree(), editorPane);
  64 + treeMouseListener.attach(fileExplorerPane.getTree(), editor);
56 65 }
57 66
58 67 private void initEditor() {
59   - editorPane = new SourceEditor();
  68 + editor = new SourceEditor();
60 69 jsyntaxpane.DefaultSyntaxKit.initKit();
61   - editorPane.setContentType("text/sparql");
  70 + editor.setContentType("text/sparql");
  71 + }
  72 +
  73 + private void initToolBar(){
  74 + io = new IO(this);
  75 + fileUI = new FileUI(io);
  76 +// toolsPanel.add(fileUI.getToolBar());
  77 + fileToolBar = new JToolBar();
  78 + fileToolBar.add(fileUI.getToolBar());
62 79 }
63 80
64 81 /**
@@ -75,6 +92,7 @@ public void centerSplit() {
75 92 }
76 93
77 94 private void initLayout() {
  95 +
78 96 Split outer = new Split();
79 97 outer.setRowLayout(true);
80 98
@@ -83,16 +101,16 @@ private void initLayout() {
83 101
84 102 outer.setChildren(left, new Divider(), right);
85 103
86   - contentPanel = new JXMultiSplitPane();
  104 + outerPanel = new JXMultiSplitPane();
87 105 MultiSplitLayout layout = new MultiSplitLayout(outer);
88   - contentPanel.setLayout(layout);
  106 + outerPanel.setLayout(layout);
89 107 }
90 108
91 109 /**
92 110 * @return the contentPanel
93 111 */
94   - public JPanel getContentPanel() {
95   - return this.contentPanel;
  112 + public JPanel getOuterPanel() {
  113 + return this.outerPanel;
96 114 }
97 115
98 116 // ///////////////////////////////////////////////////////////////
@@ -109,7 +127,7 @@ public static void main(String[] argv) {
109 127 JFrame frame = new JFrame("File Explorer");
110 128
111 129 ExploreEditDemo eed = new ExploreEditDemo();
112   - frame.getContentPane().add(eed.getContentPanel());
  130 + frame.getContentPane().add(eed.getOuterPanel());
113 131 frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
114 132 frame.setSize(600, 600);
115 133 // frame.pack();
1  src/org/hyperdata/scute/help/HelpUI.java
@@ -13,6 +13,7 @@
13 13 import javax.swing.JOptionPane;
14 14 import org.hyperdata.scute.main.Config;
15 15 import org.hyperdata.scute.toolbars.file.FilesInterface;
  16 +import org.hyperdata.scute.toolbars.file.FilesModelInterface;
16 17
17 18 /**
18 19 * @author danny
3  src/org/hyperdata/scute/rdf/ModelContainer.java
@@ -109,7 +109,8 @@ public void setSaved(boolean saved) {
109 109 }
110 110
111 111 public void storeNamedModel() {
112   - System.out.println("STORE MODEL - implement me!");
  112 + System.out.println("STORE MODEL (only file bit in use) - implement me!");
  113 + saveModelToFile();
113 114 }
114 115
115 116 public void loadNamedModel() {
2  src/org/hyperdata/scute/syntax/TurtleView.java
@@ -63,7 +63,7 @@
63 63 commonPatternMap.put(Pattern.compile(LITERAL_PATTERN), Color.GRAY);
64 64 commonPatternMap.put(Pattern.compile(LONG_LITERAL_PATTERN), Color.GRAY);
65 65 commonPatternMap.put(Pattern.compile(BNODE_PATTERN), Color.CYAN);
66   - commonPatternMap.put(Pattern.compile(NODE_PATTERN), Color.BLUE);
  66 + commonPatternMap.put(Pattern.compile(NODE_PATTERN), Color.RED);
67 67 commonPatternMap.put(Pattern.compile(SQUARE_BRACKETS_PATTERN), Color.BLUE);
68 68 commonPatternMap.put(Pattern.compile(CURLY_BRACKETS_PATTERN), Color.BLUE);
69 69
9 src/org/hyperdata/scute/toolbars/file/FileUI.java
@@ -36,7 +36,7 @@
36 36 private Action closeAction;
37 37
38 38 /** The editor. */
39   - private final FilesInterface editor;
  39 + private final FilesInterface editor; // FilesModelInterface
40 40
41 41 /** The exit action. */
42 42 private Action exitAction;
@@ -65,7 +65,7 @@
65 65 * @param editor
66 66 * the editor
67 67 */
68   - public FileUI(FilesInterface editor) {
  68 + public FileUI(FilesInterface editor) { // FilesModelInterface
69 69 this.editor = editor;
70 70 createActions();
71 71
@@ -131,7 +131,8 @@ public void createActions() {
131 131
132 132 @Override
133 133 public void actionPerformed(ActionEvent event) {
134   - editor.newModel();
  134 + // editor.newModel();
  135 + editor.newFile();
135 136 }
136 137 };
137 138 openAction = new AbstractAction("Open", GeneralIcons.openIcon) {
@@ -280,7 +281,7 @@ public void keyPressed(KeyEvent event) {
280 281 return;
281 282 switch (event.getKeyCode()) {
282 283 case KeyEvent.VK_N:
283   - editor.newModel();
  284 + editor.newFile();
284 285 break;
285 286 case KeyEvent.VK_S:
286 287 editor.save();
123 src/org/hyperdata/scute/toolbars/file/FilesInterface.java 100755 → 100644
... ... @@ -1,64 +1,59 @@
1   -/*
2   - * Scute
3   - *
4   - * Homepage: http://hyperdata.org/scute
5   - *
6   - * License : http://www.apache.org/licenses/LICENSE-2.0
7   - * See also license.txt or http://hyperdata.org/wiki/Scute:License
8   - *
9   - * Danny Ayers 2011
10   - */
11   -package org.hyperdata.scute.toolbars.file;
12   -
13   -import java.awt.Frame;
14   -
15   -/**
16   - * The Interface ToolsInterface.
17   - */
18   -public interface FilesInterface {
19   -
20   - /**
21   - * Clone file.
22   - */
23   - public void cloneFile();
24   -
25   - /**
26   - * Close file.
27   - */
28   - public void closeFile();
29   -
30   - /**
31   - * Exit.
32   - */
33   - public void exit();
34   -
35   - /**
36   - * New file.
37   - */
38   - public void newModel();
39   -
40   - /**
41   - * Open file.
42   - */
43   - public void open();
44   -
45   - /**
46   - * Save as file.
47   - */
48   - public void saveAs();
49   -
50   - /**
51   - * Save file.
52   - */
53   - public void save();
54   -
55   - /**
56   - * Check text.
57   - */
58   - // public void checkText();
59   -
60   - /**
61   - * @return
62   - */
63   - public Frame getFrame();
64   -}
  1 +/**
  2 + *
  3 + */
  4 +package org.hyperdata.scute.toolbars.file;
  5 +
  6 +import java.awt.Frame;
  7 +
  8 +/**
  9 + * @author danny
  10 + *
  11 + */
  12 +public interface FilesInterface {
  13 +
  14 + public void newFile();
  15 + /**
  16 + * Clone file.
  17 + */
  18 + public void cloneFile();
  19 +
  20 + /**
  21 + * Close file.
  22 + */
  23 + public void closeFile();
  24 +
  25 + /**
  26 + * Exit.
  27 + */
  28 + public void exit();
  29 +
  30 + /**
  31 + * New file.
  32 + */
  33 +
  34 +
  35 + /**
  36 + * Open file.
  37 + */
  38 + public void open();
  39 +
  40 + /**
  41 + * Save as file.
  42 + */
  43 + public void saveAs();
  44 +
  45 + /**
  46 + * Save file.
  47 + */
  48 + public void save();
  49 +
  50 + /**
  51 + * Check text.
  52 + */
  53 + // public void checkText();
  54 +
  55 + /**
  56 + * @return
  57 + */
  58 + public Frame getFrame();
  59 +}
18 src/org/hyperdata/scute/toolbars/file/FilesModelInterface.java
... ... @@ -0,0 +1,18 @@
  1 +/*
  2 + * Scute
  3 + *
  4 + * Homepage: http://hyperdata.org/scute
  5 + *
  6 + * License : http://www.apache.org/licenses/LICENSE-2.0
  7 + * See also license.txt or http://hyperdata.org/wiki/Scute:License
  8 + *
  9 + * Danny Ayers 2011
  10 + */
  11 +package org.hyperdata.scute.toolbars.file;
  12 +
  13 +import java.awt.Frame;
  14 +
  15 +
  16 +public interface FilesModelInterface extends FilesInterface{
  17 + public void newModel();
  18 +}
10 src/org/hyperdata/scute/toolbars/file/IO.java
@@ -9,6 +9,7 @@
9 9
10 10 import org.hyperdata.scute.cards.Card;
11 11 import org.hyperdata.scute.cards.CardsPanel;
  12 +import org.hyperdata.scute.demos.ExploreEditDemo;
12 13 import org.hyperdata.scute.rdf.ModelContainer;
13 14 import org.hyperdata.scute.source.TextContainer;
14 15 import org.hyperdata.scute.system.panels.LogPane;
@@ -38,6 +39,13 @@ public IO(ModelContainer modelContainer, CardsPanel cardsPanel) { // don't
38 39 this.cardsPanel = cardsPanel;
39 40 }
40 41
  42 + /**
  43 + * @param exploreEditDemo
  44 + */
  45 + public IO(ExploreEditDemo exploreEditDemo) {
  46 + // TODO Auto-generated constructor stub
  47 + }
  48 +
41 49 @Override
42 50 public void open() {
43 51 if (modelContainer.getModelURI() == null
@@ -186,7 +194,7 @@ public void exit() {
186 194 * @see org.hyperdata.scute.swing.ToolsInterface#newModel()
187 195 */
188 196 @Override
189   - public void newModel() {
  197 + public void newFile() {
190 198 // TODO Auto-generated method stub
191 199
192 200 }

0 comments on commit 5640354

Please sign in to comment.
Something went wrong with that request. Please try again.