Thread: [graphl-cvs] graphl/src/org/mediavirus/graphl GraphlApplication.java
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2004-10-05 07:54:52
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13893/src/org/mediavirus/graphl Modified Files: GraphlApplication.java Log Message: * added command line option support in GraphlApplication * added "Exit" menu entry (for quitting without window decorations) * fixes for LineEdgePainter and ShapeNodePainter * minor documentation updates * more default config tweaking Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** GraphlApplication.java 4 Oct 2004 10:21:03 -0000 1.8 --- GraphlApplication.java 5 Oct 2004 07:54:20 -0000 1.9 *************** *** 57,60 **** --- 57,61 ---- JMenuItem saveItem; JMenuItem saveAsItem; + JMenuItem exitItem; private File currentFile; *************** *** 82,92 **** this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { ! quit(); } }); ! ! // TODO (3) provide own event handling (move, resize, close) to be able to remove decorations ! //this.setUndecorated(true); ! mainPanel = new GraphlPanel(); --- 83,90 ---- this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { ! doExit(); } }); ! mainPanel = new GraphlPanel(); *************** *** 130,133 **** --- 128,133 ---- fileMenu.add(openURLItem); + fileMenu.addSeparator(); + saveItem = new JMenuItem("Save"); saveItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, KeyEvent.CTRL_DOWN_MASK)); *************** *** 150,153 **** --- 150,165 ---- fileMenu.add(saveAsItem); + fileMenu.addSeparator(); + + exitItem = new JMenuItem("Exit"); + exitItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q, KeyEvent.CTRL_DOWN_MASK)); + exitItem.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + doExit(); + } + }); + exitItem.setFont(menuFont); + fileMenu.add(exitItem); + menuBar.add(fileMenu); *************** *** 169,173 **** * */ ! protected void quit() { if (mainPanel.getGraph().isDirty()) { int choice = JOptionPane.showConfirmDialog(this, "File has been changed. Do you want to save your changes?", "Save Changes?", JOptionPane.YES_NO_CANCEL_OPTION); --- 181,185 ---- * */ ! protected void doExit() { if (mainPanel.getGraph().isDirty()) { int choice = JOptionPane.showConfirmDialog(this, "File has been changed. Do you want to save your changes?", "Save Changes?", JOptionPane.YES_NO_CANCEL_OPTION); *************** *** 384,400 **** GraphlApplication app = new GraphlApplication(); ! app.setSize(1024, 768); app.show(); try { ! app.loadSettings(System.getProperty("user.dir") + "/config/config.rdf"); ! app.mainPanel.getGraph().readFromFile(System.getProperty("user.dir") + "/graphs/default.rdf"); app.setTitle("Graphl - default.rdf"); } catch (IOException ioex) { - ioex.printStackTrace(); JOptionPane.showMessageDialog(app, "Error while loading file:\n" + ioex.getMessage(), "File Error", JOptionPane.ERROR_MESSAGE); } } } --- 396,456 ---- GraphlApplication app = new GraphlApplication(); ! int[] size = {1024, 768}; ! int[] pos = {0,0}; ! boolean decorations = true; ! String filename = System.getProperty("user.dir") + "/graphs/default.rdf"; ! String configfile = System.getProperty("user.dir") + "/config/config.rdf"; ! ! for (int i = 0; i < args.length; i++) { ! if (args[i].startsWith("size=")) { ! size[0] = Integer.parseInt(args[i].substring(5,args[i].indexOf(','))); ! size[1] = Integer.parseInt(args[i].substring(args[i].indexOf(',')+1,args[i].length())); ! } ! else if (args[i].startsWith("pos=")) { ! pos[0] = Integer.parseInt(args[i].substring(4,args[i].indexOf(','))); ! pos[1] = Integer.parseInt(args[i].substring(args[i].indexOf(',')+1,args[i].length())); ! } ! else if (args[i].startsWith("decorations=")) { ! if (args[i].equals("decorations=off")) decorations = false; ! } ! else if (args[i].startsWith("config=")) { ! configfile = args[i].substring(7); ! } ! else if (i == args.length-1) { ! filename = args[i]; ! } ! else { ! usage(true); ! } ! } ! ! app.setSize(size[0], size[1]); ! app.setLocation(pos[0], pos[1]); ! // TODO (3) provide own event handling (move, resize, close) to be able to remove decorations ! app.setUndecorated(!decorations); app.show(); try { ! app.loadSettings(configfile); ! app.mainPanel.getGraph().readFromFile(filename); app.setTitle("Graphl - default.rdf"); } catch (IOException ioex) { JOptionPane.showMessageDialog(app, "Error while loading file:\n" + ioex.getMessage(), "File Error", JOptionPane.ERROR_MESSAGE); } } + public static void usage(boolean exit){ + System.out.println("-------------------------------------------------------------------"); + System.out.println("graphl V 0.0.2 (c) by Flo Ledermann <led...@im...>"); + System.out.println("update, info & download ---> http://www.mediavirus.org/graphl/"); + System.out.println("licensed under the GPL"); + System.out.println("-------------------------------------------------------------------"); + System.out.println("usage:"); + System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [decorations={on|off}]\n" + + " [settings=<filename.rdf>] [<filename.rdf>]"); + System.out.println("-------------------------------------------------------------------"); + if (exit) System.exit(0); + } + } |
From: Flo L. <fl...@us...> - 2004-10-14 19:22:02
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11936/src/org/mediavirus/graphl Modified Files: GraphlApplication.java Log Message: do not load default file at startup Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** GraphlApplication.java 14 Oct 2004 13:03:04 -0000 1.10 --- GraphlApplication.java 14 Oct 2004 19:21:51 -0000 1.11 *************** *** 410,414 **** int[] pos = {0,0}; boolean decorations = true; ! String filename = System.getProperty("user.dir") + DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; --- 410,414 ---- int[] pos = {0,0}; boolean decorations = true; ! String filename = DEFAULT_FILE; String configfile = System.getProperty("user.dir") + "/config/config.rdf"; *************** *** 438,442 **** app.setSize(size[0], size[1]); app.setLocation(pos[0], pos[1]); - // TODO (3) provide own event handling (move, resize, close) to be able to remove decorations app.setUndecorated(!decorations); app.show(); --- 438,441 ---- |
From: Flo L. <fl...@us...> - 2004-10-27 10:55:49
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18264/src/org/mediavirus/graphl Modified Files: GraphlApplication.java Log Message: - FEATURE: finally implemented sortgedNodeLayouter with proportional layout - AbstractFacet.assignedElements is now a list, to be able to sort it - BUG: block graph update events during loading - FEATURE: nodes are placed at deterministic locations initially (loading the same file twice will result in the same layout) - FEATURE: minor performance enhancements for repulsionnodelayouter - renamed "controls" command line option to "toolbar" Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** GraphlApplication.java 21 Oct 2004 16:00:47 -0000 1.13 --- GraphlApplication.java 27 Oct 2004 10:55:40 -0000 1.14 *************** *** 455,460 **** if (args[i].equals("decorations=off")) decorations = false; } ! else if (args[i].startsWith("controls=")) { ! if (args[i].equals("controls=off")) controls = false; } else if (args[i].startsWith("menubar=")) { --- 455,460 ---- if (args[i].equals("decorations=off")) decorations = false; } ! else if (args[i].startsWith("toolbar=")) { ! if (args[i].equals("toolbar=off")) controls = false; } else if (args[i].startsWith("menubar=")) { *************** *** 546,550 **** System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [config=<filename.rdf>]\n" + " [refresh=<seconds>] [decorations={on|off}]\n" + ! " [controls={on|off}] [menubar={on|off}]\n" + " [{<filename>|<url>}]"); System.out.println("-------------------------------------------------------------------"); --- 546,550 ---- System.out.println("graphl [size=<width>,<height>] [pos=<x>,<y>] [config=<filename.rdf>]\n" + " [refresh=<seconds>] [decorations={on|off}]\n" + ! " [toolbar={on|off}] [menubar={on|off}]\n" + " [{<filename>|<url>}]"); System.out.println("-------------------------------------------------------------------"); |
From: Flo L. <fl...@us...> - 2005-08-24 16:09:37
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5730/src/org/mediavirus/graphl Modified Files: GraphlApplication.java Log Message: files are now loaded in addition to existing graph Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** GraphlApplication.java 17 Aug 2005 15:52:51 -0000 1.19 --- GraphlApplication.java 24 Aug 2005 16:09:30 -0000 1.20 *************** *** 34,38 **** import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.graph.filter.FilteredGraph; ! import org.mediavirus.graphl.graph.filter.TestFilter; import org.mediavirus.graphl.graph.rdf.RDFGraph; import org.mediavirus.graphl.gui.GenericDialog; --- 34,38 ---- import org.mediavirus.graphl.graph.Node; import org.mediavirus.graphl.graph.filter.FilteredGraph; ! import org.mediavirus.graphl.graph.filter.SourceFilter; import org.mediavirus.graphl.graph.rdf.RDFGraph; import org.mediavirus.graphl.gui.GenericDialog; *************** *** 97,101 **** FilteredGraph fgraph = new FilteredGraph(new RDFGraph()); ! fgraph.addFilter(new TestFilter()); mainPanel = new GraphlPanel(fgraph); --- 97,106 ---- FilteredGraph fgraph = new FilteredGraph(new RDFGraph()); ! SourceFilter filter = new SourceFilter(); ! filter.addSource("file:/C:/data/projects/graphl/config/vocabs/foaf-owl.rdf"); ! filter.addSource("file:/C:/data/projects/graphl/config/vocabs/rdf+rdfs.rdf"); ! filter.addSource("file:/C:/data/projects/graphl/config/config.rdf"); ! filter.addSource(NS.graphl + "SYSTEM"); ! fgraph.addFilter(filter); mainPanel = new GraphlPanel(fgraph); *************** *** 402,406 **** mainPanel.getGraphPane().pauseLayouter(); ! mainPanel.getGraph().clear(); mainPanel.getGraph().readFromFile(file.getAbsolutePath()); --- 407,411 ---- mainPanel.getGraphPane().pauseLayouter(); ! //mainPanel.getGraph().clear(); mainPanel.getGraph().readFromFile(file.getAbsolutePath()); |
From: Flo L. <fl...@us...> - 2006-07-11 18:34:46
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv16361/src/org/mediavirus/graphl Modified Files: GraphlApplication.java Log Message: backup commit - first implementation of xpath-based structural filters Index: GraphlApplication.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/GraphlApplication.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** GraphlApplication.java 3 Jul 2006 15:26:33 -0000 1.26 --- GraphlApplication.java 11 Jul 2006 18:34:31 -0000 1.27 *************** *** 36,42 **** --- 36,44 ---- import org.mediavirus.graphl.graph.Graph; import org.mediavirus.graphl.graph.Node; + import org.mediavirus.graphl.graph.filter.EdgeCompressionFilter; import org.mediavirus.graphl.graph.filter.FilteredGraph; import org.mediavirus.graphl.graph.filter.NodeCompressionFilter; import org.mediavirus.graphl.graph.filter.SourceFilter; + import org.mediavirus.graphl.graph.filter.TransitiveCompressionFilter; import org.mediavirus.graphl.graph.filter.XPathFilter; import org.mediavirus.graphl.graph.rdf.RDFGraph; *************** *** 447,452 **** //mainPanel.graphPane.getFilteredGraph().addOmissionFilter(testFilter); ! NodeCompressionFilter testCompression = new NodeCompressionFilter(new GraphlXPath("foaf:Connection"),new GraphlXPath("both::foaf:connects/both::foaf:Person"),"foaf:Connection"); ! mainPanel.graphPane.getFilteredGraph().addNodeCompressionFilter(testCompression); } catch (JaxenException ijexaned) { --- 449,460 ---- //mainPanel.graphPane.getFilteredGraph().addOmissionFilter(testFilter); ! //NodeCompressionFilter testCompression = new NodeCompressionFilter(new GraphlXPath("foaf:Connection"),new GraphlXPath("both::foaf:connects/both::foaf:Person"),"foaf:Connection"); ! //mainPanel.graphPane.getFilteredGraph().addNodeCompressionFilter(testCompression); ! ! //EdgeCompressionFilter testCompression = new EdgeCompressionFilter(new GraphlXPath("*/foaf:connects|*/foaf:connectx"),new GraphlXPath("both::*"),"foaf:doubleconnected"); ! //mainPanel.graphPane.getFilteredGraph().addEdgeCompressionFilter(testCompression); ! ! TransitiveCompressionFilter testCompression = new TransitiveCompressionFilter(new GraphlXPath("*/foaf:connects/foaf:Connection/foaf:connects/*"),"foaf:connectsNew"); ! mainPanel.graphPane.getFilteredGraph().addTransitiveCompressionFilter(testCompression); } catch (JaxenException ijexaned) { |