[graphl-cvs] graphl/src/org/mediavirus/graphl/gui TypeMenu.java GenericDialog.java NodeContextMenu.j
Status: Pre-Alpha
Brought to you by:
flo1
From: Flo L. <fl...@us...> - 2004-12-29 14:32:12
|
Update of /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19091/src/org/mediavirus/graphl/gui Modified Files: GenericDialog.java NodeContextMenu.java GraphContextMenu.java Added Files: TypeMenu.java Log Message: - FEATURE: updated applets parameters to match application command line options - FEATURE: GraphlPane now maintains a pointer to node+edge the mouse is currently over - FEATURE: started implementation of generic type menu - FEATURE: started implementation of node manipulator - BUG: fixed graph context menu - CODE: moved AbstractManipulator to correct package - CODE: added setHeight + setWidth in node interface - CODE: replaced zoomButton with a label - DOC: some documentation Index: NodeContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/NodeContextMenu.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** NodeContextMenu.java 30 Nov 2004 09:38:33 -0000 1.16 --- NodeContextMenu.java 29 Dec 2004 14:31:28 -0000 1.17 *************** *** 109,112 **** --- 109,114 ---- public NodeContextMenu(GraphlPane parent) { this.graphlPane = parent; + //this.setBackground(new Color(1.0f,1.0f,1.0f,0.8f)); + //this.setBorder(null); } Index: GraphContextMenu.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/GraphContextMenu.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GraphContextMenu.java 10 Dec 2004 16:13:03 -0000 1.1 --- GraphContextMenu.java 29 Dec 2004 14:31:29 -0000 1.2 *************** *** 17,22 **** import org.mediavirus.graphl.graph.Graph; import org.mediavirus.graphl.graph.Node; - import org.mediavirus.graphl.view.FacetRegistry; - import org.mediavirus.graphl.view.GraphFacetRegistry; /** --- 17,20 ---- *************** *** 40,45 **** public void actionPerformed(ActionEvent e) { ! FacetRegistry newRegistry = new GraphFacetRegistry(graphlPane.getConfigurationGraph(),node); ! graphlPane.setFacetRegistry(newRegistry); } } --- 38,42 ---- public void actionPerformed(ActionEvent e) { ! graphlPane.setConfiguration(node); } } *************** *** 49,53 **** configMenu.setText("Active Configuration"); ! JRadioButtonMenuItem defaultItem = null; ButtonGroup settingsGroup = new ButtonGroup(); --- 46,50 ---- configMenu.setText("Active Configuration"); ! JRadioButtonMenuItem selectedItem = null; ButtonGroup settingsGroup = new ButtonGroup(); *************** *** 58,67 **** configMenu.add(item); settingsGroup.add(item); ! if (node.getProperty("http://www.mediavirus.org/graphl#default","").equalsIgnoreCase("true")) { ! defaultItem = item; } } ! if (defaultItem != null) defaultItem.setSelected(true); return configMenu; --- 55,64 ---- configMenu.add(item); settingsGroup.add(item); ! if (node.getProperty("http://www.mediavirus.org/graphl#active","").equalsIgnoreCase("true")) { ! selectedItem = item; } } ! if (selectedItem != null) selectedItem.setSelected(true); return configMenu; --- NEW FILE: TypeMenu.java --- /* * Created on 28.12.2004 */ package org.mediavirus.graphl.gui; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.util.Iterator; import java.util.List; import javax.swing.JCheckBoxMenuItem; import javax.swing.JMenu; import org.mediavirus.graphl.graph.Node; /** * @author flo */ public class TypeMenu extends JMenu { public TypeMenu() { super(); } public TypeMenu(String label) { super(label); } public TypeMenu(String label, Node types) { super(label); setTypes(types); } public void setTypes(Node types){ removeAll(); List groups = types.getNeighbours("http://www.mediavirus.org/graphl#typeGroup", true); for (Iterator iter = groups.iterator(); iter.hasNext();) { Node group = (Node) iter.next(); if (group.hasType("http://www.mediavirus.org/graphl#TypeGroup")) { this.add(new TypeMenu(group.getProperty("http://www.mediavirus.org/graphl#name","<unnamed>")), group); } } List items = types.getNeighbours("http://www.mediavirus.org/graphl#containsType", true); for (Iterator iter = items.iterator(); iter.hasNext();) { Node item = (Node) iter.next(); if (item.hasType("rdf:Class")) { JCheckBoxMenuItem mItem = new JCheckBoxMenuItem(item.getProperty("http://www.mediavirus.org/graphl#name",item.getId())); mItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // TODO } }); this.add(mItem); } } } public void setCurrentType(String currentType){ // TODO } } Index: GenericDialog.java =================================================================== RCS file: /cvsroot/graphl/graphl/src/org/mediavirus/graphl/gui/GenericDialog.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GenericDialog.java 4 Oct 2004 10:21:02 -0000 1.4 --- GenericDialog.java 29 Dec 2004 14:31:28 -0000 1.5 *************** *** 40,44 **** GenericDialog d = new GenericDialog(master, content, title); d.pack(); ! d.show(); return d.getResult(); } --- 40,44 ---- GenericDialog d = new GenericDialog(master, content, title); d.pack(); ! d.setVisible(true); return d.getResult(); } *************** *** 101,105 **** result = OK_OPTION; ! hide(); } --- 101,105 ---- result = OK_OPTION; ! setVisible(false); } *************** *** 122,126 **** result = CANCEL_OPTION; ! hide(); } --- 122,126 ---- result = CANCEL_OPTION; ! setVisible(false); } |