monotone

monotone Commit Details

Date:2005-04-04 00:05:52 (14 years 2 months ago)
Author:jcrisp@s-r-s.co.uk
Branch:net.venge.monotone.contrib.monotree
Commit:5d288b39b49613b0d9dca8ece6b9a42c3773f35b
Parents: 32777a1fe21dc5f93d0900f7c5bc3f175d495c5d
Message:Cleanup of information display on node click

Changes:
Mcontrib/monotree/GXLViewer.java (3 diffs)
Mcontrib/monotree/Makefile (2 diffs)

File differences

contrib/monotree/GXLViewer.java
123123
124124
125125
126
126
127127
128128
129129
......
264264
265265
266266
267
268
269
267270
268
271
269272
270
273
271274
272275
273276
......
549552
550553
551554
555
552556
553557
554558
555559
556560
557561
558
562
563
559564
560565
561566
567
568
562569
563570
564571
565572
566573
567574
575
576
568577
569578
570579
571580
572
573
581
582
583
574584
575585
576586
577587
578
588
589
579590
580591
581592
582593
583594
584595
585
586
587
596
597
598
599
600
601
602
603
604
605
606
588607
589608
590609
System.exit(0);
}
});
f.setSize(400, 400);
f.setSize(800, 600);
f.setVisible(true);
String defaultDb=findDefaultDB(new File(".").getAbsoluteFile());
if(defaultDb!=null) {
p.add(label);
properties=new JPanel();
//properties.setMinimumSize(new Dimension(400,400));
//properties.setLayout(new BorderLayout());
tree.setModel(new DefaultTreeModel(new DefaultMutableTreeNode()));
JSplitPane splitter=new JSplitPane(JSplitPane.VERTICAL_SPLIT,new JScrollPane(tree),new JScrollPane(properties));
JSplitPane splitter=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,new JScrollPane(tree),new JScrollPane(properties));
splitter.setDividerLocation(200);
splitter=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,splitter,new JSVGScrollPane(svgCanvas));
splitter=new JSplitPane(JSplitPane.VERTICAL_SPLIT,splitter,new JSVGScrollPane(svgCanvas));
panel.add("North", p);
panel.add("Center",splitter);
splitter.setDividerLocation(200);
c.anchor=GridBagConstraints.WEST;
c.gridx=1;
c.gridwidth=GridBagConstraints.REMAINDER;
c.fill=GridBagConstraints.HORIZONTAL;
JLabel value=new JLabel(((GXLString)set.getValueAt(I)).getValue());
info.add(value,c);
}
}
public void handleEvent(Event evt) {
// System.err.println(evt);
// Extract the SVG element which was determined to the the target of the click
MouseEvent mouseEvent=(MouseEvent)evt;
EventTarget where=mouseEvent.getTarget();
Element element=(Element)where; // This seems intuitative, but doesn't appear to be documented as legal
// Recurse up the tree to the closest containing group. Should really check for class="node" here as well
while(element.getTagName()!="g") {
Node parent=element.getParentNode();
if(parent==null) return;
if(!(parent instanceof Element)) return;
element=(Element)parent;
}
// Get the title elements. Have to use a nodelist as there isn't a getSingleElementByTagName..
NodeList titles=element.getElementsByTagName("title");
if(titles.getLength()==0) return;
Element title=(Element)titles.item(0);
String id=((Text)title.getFirstChild()).getData(); // Fragile - should check node type
// System.err.println("["+id+"]");
JPanel info=new JPanel();
// Generate the info and lay it out
final JPanel info=new JPanel();
info.setLayout(new GridBagLayout());
GridBagConstraints c=new GridBagConstraints();
c.gridwidth=GridBagConstraints.REMAINDER;
c.anchor=GridBagConstraints.CENTER;
JLabel property=new JLabel(id);
JTextField property=new JTextField(id);
property.setEditable(false);
info.add(property,c);
GXLNode gxlNode=(GXLNode)database.log2gxl.gxlDocument.getElement(id);
addInfo(info,gxlNode,"Authors");
addInfo(info,gxlNode,"Branches");
addInfo(info,gxlNode,"Tags");
addInfo(info,gxlNode,"ChangeLog");
properties.removeAll();
properties.add(BorderLayout.CENTER,info);
properties.revalidate();
JPanel pad=new JPanel();
pad.setPreferredSize(Toolkit.getDefaultToolkit().getScreenSize());
info.add(pad,c);
c=new GridBagConstraints();
c.gridwidth=GridBagConstraints.REMAINDER;
c.fill=GridBagConstraints.BOTH;
SwingUtilities.invokeLater(new Runnable() { public void run() {
properties.removeAll();
properties.add(info);
properties.revalidate();
}});
}
}
}
contrib/monotree/Makefile
33
44
55
6
6
77
88
99
......
1111
1212
1313
14
14
1515
1616
1717
all: monotree.jar
monotree.jar: Log2Gxl.class Monotone.class GXLViewer.class META-INF/MANIFEST.MF gxl2dot.xsl
jar cvmf META-INF/MANIFEST.MF monotree.jar Log2Gxl.class Monotone.class GXLViewer.class GXLViewer\$$1.class GXLViewer\$$2.class GXLViewer\$$3.class GXLViewer\$$4.class GXLViewer\$$5.class GXLViewer\$$6.class Monotone\$$ErrorReader.class Monotone\$$StreamCopier.class GXLViewer\$$ReadBranches.class GXLViewer\$$MonotoneFileFilter.class GXLViewer\$$ReadBranches\$$1.class GXLViewer\$$DisplayLog.class GXLViewer\$$DisplayLog\$$1.class GXLViewer\$$GXLUserAgent.class GXLViewer\$$7.class GXLViewer\$$OnClickAction.class gxl2dot.xsl Monotone\$$1.class
jar cvmf META-INF/MANIFEST.MF monotree.jar Log2Gxl.class Monotone.class GXLViewer.class GXLViewer\$$1.class GXLViewer\$$2.class GXLViewer\$$3.class GXLViewer\$$4.class GXLViewer\$$5.class GXLViewer\$$6.class Monotone\$$ErrorReader.class Monotone\$$StreamCopier.class GXLViewer\$$ReadBranches.class GXLViewer\$$MonotoneFileFilter.class GXLViewer\$$ReadBranches\$$1.class GXLViewer\$$DisplayLog.class GXLViewer\$$DisplayLog\$$1.class GXLViewer\$$GXLUserAgent.class GXLViewer\$$7.class GXLViewer\$$OnClickAction.class gxl2dot.xsl Monotone\$$1.class GXLViewer\$$OnClickAction\$$1.class
Log2Gxl.class: Log2Gxl.java
javac -g -classpath "gxl/gxl-0.92/gxl.jar;." Log2Gxl.java
Monotone.class Monotone$$ErrorReader.class Monotone$$StreamCopier.class Monotone$$1.class : Monotone.java Log2Gxl.class
javac -g Monotone.java
GXLViewer$$OnClickAction.class GXLViewer$$ReadBranches.class GXLViewer$$2$$1.class GXLViewer$$DisplayLog.class GXLViewer$$1.class GXLViewer$$2.class GXLViewer$$3.class GXLViewer$$4.class GXLViewer$$5 GXLViewer$$6 GXLViewer.class GXLViewer$$MonotoneFileFilter.class GXLViewer$$ReadBranches$$1.class GXLViewer$$DisplayLog$$1.class GXLViewer$$GXLUserAgent.class GXLViewer$$7.class: GXLViewer.java Monotone.class
GXLViewer$$OnClickAction.class GXLViewer$$ReadBranches.class GXLViewer$$2$$1.class GXLViewer$$DisplayLog.class GXLViewer$$1.class GXLViewer$$2.class GXLViewer$$3.class GXLViewer$$4.class GXLViewer$$5 GXLViewer$$6 GXLViewer.class GXLViewer$$MonotoneFileFilter.class GXLViewer$$ReadBranches$$1.class GXLViewer$$DisplayLog$$1.class GXLViewer$$GXLUserAgent.class GXLViewer$$7.class GXLViewer$$OnClickAction$$1.class: GXLViewer.java Monotone.class
javac -g -classpath "batik/batik-1.5.1/batik.jar;gxl/gxl-0.92/gxl.jar;." GXLViewer.java
clean:

Archive Download the corresponding diff file

Branches

Tags

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status