01: /*
02: * $Id: JGraphpadL2FLibraryPane.java,v 1.4 2006/01/11 10:35:31 gaudenz Exp $
03: * Copyright (c) 2001-2005, Gaudenz Alder
04: *
05: * All rights reserved.
06: *
07: * See LICENSE file for license details. If you are unable to locate
08: * this file please contact info (at) jgraph (dot) com.
09: */
10: package com.jgraph.l2fplugin;
11:
12: import java.awt.Component;
13:
14: import org.w3c.dom.Node;
15:
16: import com.jgraph.JGraphEditor;
17: import com.jgraph.pad.factory.JGraphpadLibraryPane;
18: import com.jgraph.pad.factory.JGraphpadPane;
19: import com.jgraph.pad.factory.JGraphpadLibraryPane.LibraryTracker;
20: import com.jgraph.pad.util.JGraphpadMouseAdapter;
21: import com.l2fprod.common.swing.JOutlookBar;
22:
23: /**
24: * Factory method to replace the tabbed pane with a {@link JOutlookBar} in the
25: * default factory method of {@link com.jgraph.pad.factory.JGraphpadLibraryPane}.
26: */
27: public class JGraphpadL2FLibraryPane extends
28: JGraphpadLibraryPane.FactoryMethod {
29:
30: /**
31: * Constructs a new factory method for the specified enclosing editor using
32: * JGraphpadLibraryPane.FactoryMethod.NAME.
33: *
34: * @param editor
35: * The editor that contains the factory method.
36: */
37: public JGraphpadL2FLibraryPane(JGraphEditor editor) {
38: super (editor);
39: }
40:
41: /*
42: * (non-Javadoc)
43: */
44: public Component createInstance(Node configuration) {
45: JOutlookBar tabPane = new JOutlookBar();
46: tabPane.addMouseListener(new JGraphpadMouseAdapter(editor,
47: JGraphpadPane.NODENAME_DESKTOPPOPUPMENU));
48: LibraryTracker tracker = new LibraryTracker(tabPane, editor);
49: editor.getModel().addTreeModelListener(tracker);
50: return tabPane;
51: }
52:
53: }
|