From: <de...@us...> - 2008-08-06 21:59:00
|
Revision: 3722 http://fudaa.svn.sourceforge.net/fudaa/?rev=3722&view=rev Author: deniger Date: 2008-08-06 21:59:10 +0000 (Wed, 06 Aug 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-06 21:58:30 UTC (rev 3721) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-06 21:59:10 UTC (rev 3722) @@ -207,7 +207,7 @@ //-- ajout du rectangle --// node = new EbliNodeDefault(); node.setCreator(new EbliWidgetCreatorRectangle("Test recangle")); - node.setD(new Dimension(100, 100)); +// node.setD(new Dimension(100, 100)); node.setP(new Point(350,125)); scene.addNode(node); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-08-07 21:44:31
|
Revision: 3736 http://fudaa.svn.sourceforge.net/fudaa/?rev=3736&view=rev Author: deniger Date: 2008-08-07 21:44:40 +0000 (Thu, 07 Aug 2008) Log Message: ----------- maj vue 2d Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-07 21:44:21 UTC (rev 3735) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-07 21:44:40 UTC (rev 3736) @@ -7,19 +7,11 @@ */ package org.fudaa.ebli.all; -import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; -import java.awt.Font; -import java.awt.Graphics2D; import java.awt.Point; -import java.awt.Rectangle; -import java.awt.geom.AffineTransform; -import java.awt.image.BufferedImage; -import java.util.Collections; import javax.swing.Box; -import javax.swing.JComponent; import javax.swing.JFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; @@ -28,56 +20,42 @@ import javax.swing.JTree; import javax.swing.WindowConstants; import javax.swing.table.DefaultTableModel; -import javax.swing.text.Utilities; -import javax.swing.tree.TreePath; -import org.fudaa.ctulu.CtuluResource; +import org.fudaa.ctulu.CtuluUIDefault; import org.fudaa.ctulu.gui.CtuluLibSwing; -import org.fudaa.ctulu.image.CtuluLibImage; import org.fudaa.ctulu.iterator.LogarithmicNumberIterator; -import org.fudaa.ebli.courbe.EGAxe; +import org.fudaa.ebli.calque.BVueCalque; +import org.fudaa.ebli.calque.ZCalqueLigneBrisee; +import org.fudaa.ebli.calque.ZEbliCalquesPanel; +import org.fudaa.ebli.calque.edition.ZCalqueLigneBriseeEditable; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbeChild; import org.fudaa.ebli.courbe.EGCourbeModelDefault; import org.fudaa.ebli.courbe.EGFillePanel; import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.ebli.courbe.EGGrapheModelListener; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; -import org.fudaa.ebli.courbe.EGObject; -import org.fudaa.ebli.tableau.EbliGrapheValeur; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.ebli.visuallibrary.EbliCheckBoxNodeEditor; -import org.fudaa.ebli.visuallibrary.EbliCheckBoxTreeRenderer; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorDblFleche; import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorFleche; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorGraphe; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorLegende; import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorRectangle; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorVue2d; import org.fudaa.ebli.visuallibrary.EbliWidgetDBLFleche; -import org.fudaa.ebli.visuallibrary.EbliWidgetGraphe; -import org.fudaa.ebli.visuallibrary.EbliWidgetJXTree; -import org.fudaa.ebli.visuallibrary.EbliWidgetJXTreeModel; -import org.fudaa.ebli.visuallibrary.WidgetLegendeManager; -import org.fudaa.ebli.visuallibrary.WidgetLegendeManagerOLD; -import org.jdesktop.swingx.JXTree; +import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; +import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; +import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende; +import org.fudaa.ebli.visuallibrary.tree.EbliCheckBoxNodeEditor; +import org.fudaa.ebli.visuallibrary.tree.EbliCheckBoxTreeRenderer; +import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTree; +import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTreeModel; import org.netbeans.api.visual.action.ActionFactory; import org.netbeans.api.visual.border.BorderFactory; -import org.netbeans.api.visual.graph.GraphScene; import org.netbeans.api.visual.laf.LookFeel; -import org.netbeans.api.visual.layout.LayoutFactory; import org.netbeans.api.visual.model.ObjectState; import org.netbeans.api.visual.widget.ComponentWidget; -import org.netbeans.api.visual.widget.ImageWidget; -import org.netbeans.api.visual.widget.LabelWidget; -import org.netbeans.api.visual.widget.LayerWidget; -import org.netbeans.api.visual.widget.Widget; -import org.netbeans.api.visual.widget.general.IconNodeWidget; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuPanel; @@ -89,281 +67,250 @@ */ public final class TestGraphe2 { - private TestGraphe2() { - super(); - } + private TestGraphe2() { + super(); + } - /** - * @param _args - * non utilise - */ - public static void main(final String[] _args) { - final EGGrapheTreeModel grapheModel = new EGGrapheTreeModel(); - final EGGraphe g = new EGGraphe(grapheModel); - final EGAxeHorizontal x = new EGAxeHorizontal(false); - x.setTitre("temps"); - x.setUnite("sec"); - x.setBounds(0.0001, 1000000); - x.setAxisIterator(new LogarithmicNumberIterator()); - x.setGraduations(true); - g.setXAxe(x); - EGGroup gr = new EGGroup(); - gr.setTitle("gr 1"); - EGCourbeModelDefault m = new EGCourbeModelDefault(new double[] { - 0.0001, 3, 4, 1000000 }, new double[] { 10000, 4, 5, 3 }); - EGCourbeChild c = new EGCourbeChild(gr); - m.setTitle("toto bleue"); - c.setModel(m); - c.setAspectContour(Color.cyan); + private static EGGraphe createGraphe() { + final EGGrapheTreeModel grapheModel = new EGGrapheTreeModel(); + final EGGraphe g = new EGGraphe(grapheModel); + final EGAxeHorizontal x = new EGAxeHorizontal(false); + x.setTitre("temps"); + x.setUnite("sec"); + x.setBounds(0.0001, 1000000); + x.setAxisIterator(new LogarithmicNumberIterator()); + x.setGraduations(true); + g.setXAxe(x); + EGGroup gr = new EGGroup(); + gr.setTitle("gr 1"); + EGCourbeModelDefault m = new EGCourbeModelDefault(new double[] { 0.0001, 3, 4, 1000000 }, new double[] { 10000, 4, + 5, 3 }); + EGCourbeChild c = new EGCourbeChild(gr); + m.setTitle("toto bleue"); + c.setModel(m); + c.setAspectContour(Color.cyan); - gr.addEGComponent(c); + gr.addEGComponent(c); - m = new EGCourbeModelDefault(new double[] { 0.0002, 5, 7, 900000 }, - new double[] { 0.001, 1, 3, 4 }); - c = new EGCourbeChild(gr); - c.setAspectContour(Color.RED); - m.setTitle("toto rouge"); - c.setModel(m); + m = new EGCourbeModelDefault(new double[] { 0.0002, 5, 7, 900000 }, new double[] { 0.001, 1, 3, 4 }); + c = new EGCourbeChild(gr); + c.setAspectContour(Color.RED); + m.setTitle("toto rouge"); + c.setModel(m); - gr.addEGComponent(c); + gr.addEGComponent(c); - EGAxeVertical y = new EGAxeVertical(); - y.setGraduations(true); - y.setGrille(new TraceLigneModel(TraceLigne.LISSE, 1, Color.LIGHT_GRAY)); - y.setDroite(true); - y.setAxisIterator(new LogarithmicNumberIterator()); - y.setBounds(0.0001, 10000); - y.setLineColor(Color.blue); - y.setTitre("essai 2"); - gr.setAxeY(y); - grapheModel.add(gr); - gr = new EGGroup(); - gr.setTitle("gr 2"); - m = new EGCourbeModelDefault(new double[] { 1, 8, 9, 10 }, - new double[] { 10, 4, 2, 24 }); - c = new EGCourbeChild(gr); - c.setAspectContour(Color.yellow); - m.setTitle("toto jaune"); - c.setModel(m); - gr.addEGComponent(c); - y = new EGAxeVertical(); - y.setGraduations(true); - y.setBounds(0, 55); - y.setTitre("essai 1"); - gr.setAxeY(y); - gr.addEGComponent(c); - m = new EGCourbeModelDefault(new double[] { 1, 3, 4, 5 }, new double[] { - 14, 54, 25, 43 }); - c = new EGCourbeChild(gr); - m.setTitle("toto vert"); - c.setAspectContour(Color.green); - c.setModel(m); - gr.addEGComponent(c); - grapheModel.add(gr); - final JFrame f = new JFrame(); - f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - f.setSize(new Dimension(1024, 768)); - final BuPanel p = new BuPanel(); - p.setLayout(new BuBorderLayout()); + EGAxeVertical y = new EGAxeVertical(); + y.setGraduations(true); + y.setGrille(new TraceLigneModel(TraceLigne.LISSE, 1, Color.LIGHT_GRAY)); + y.setDroite(true); + y.setAxisIterator(new LogarithmicNumberIterator()); + y.setBounds(0.0001, 10000); + y.setLineColor(Color.blue); + y.setTitre("essai 2"); + gr.setAxeY(y); + grapheModel.add(gr); + gr = new EGGroup(); + gr.setTitle("gr 2"); + m = new EGCourbeModelDefault(new double[] { 1, 8, 9, 10 }, new double[] { 10, 4, 2, 24 }); + c = new EGCourbeChild(gr); + c.setAspectContour(Color.yellow); + m.setTitle("toto jaune"); + c.setModel(m); + gr.addEGComponent(c); + y = new EGAxeVertical(); + y.setGraduations(true); + y.setBounds(0, 55); + y.setTitre("essai 1"); + gr.setAxeY(y); + gr.addEGComponent(c); + m = new EGCourbeModelDefault(new double[] { 1, 3, 4, 5 }, new double[] { 14, 54, 25, 43 }); + c = new EGCourbeChild(gr); + m.setTitle("toto vert"); + c.setAspectContour(Color.green); + c.setModel(m); + gr.addEGComponent(c); + grapheModel.add(gr); + return g; + } - g.setPreferredSize(new Dimension(200, 300)); - g.setSize(g.getPreferredSize()); - final JTree t = new JTree(grapheModel); - t.setSelectionModel(grapheModel.getSelectionModel()); - t.setRootVisible(false); + /** + * @param _args + * non utilise + */ + public static void main(final String[] _args) { + EGGraphe g = createGraphe(); + final EGFillePanel pn = new EGFillePanel(g); - Box boxEast = Box.createVerticalBox(); - boxEast.add(new BuScrollPane(t)); - p.add(new JScrollPane(boxEast), BuBorderLayout.EAST); - - f.setContentPane(p); - final EGFillePanel pn = new EGFillePanel(g); + // creation de la scene EBLI + EbliScene scene = new EbliScene(); - // creation de la scene EBLI - EbliScene scene = new EbliScene(); + // -- construction du jtree - - - - - - - - //-- construction du jtree - - //etape 1 construction du model - EbliWidgetJXTreeModel model=new EbliWidgetJXTreeModel(1/*,scene*/); - - //etape 2 SUPER IMPORTANT: ajout du model comme listener de la scene - scene.addEbliNodeListener(model); - - - //etape 3 creation du jtree - EbliWidgetJXTree tree=new EbliWidgetJXTree(model); - - EbliCheckBoxTreeRenderer renderer = new EbliCheckBoxTreeRenderer(); - tree.setCellRenderer(renderer); - tree.setCellEditor(new EbliCheckBoxNodeEditor(tree)); - tree.setEditable(true); - p.add(tree,BuBorderLayout.WEST); - - - - - - - - // ajout graphe - // GrapheWidget graphe=new GrapheWidget(scene,null,g); - // graphe.setPreferredSize(new Dimension(300, 300)); - // scene.addWidget(graphe); - - - //-- creation d un noeud Graphe --// - EbliNodeDefault node = new EbliNodeDefault(); - node.setCreator(new EbliWidgetCreatorGraphe(g)); - node.setTitle("Graphe"); - node.setD(new Dimension(300, 300)); - node.setP(new Point(4, 4)); - scene.addNode(node); + // etape 1 construction du model + EbliWidgetJXTreeModel model = new EbliWidgetJXTreeModel(1/* ,scene */); - //-- creation d un noeud legende --// - EbliNodeDefault nodeLegende = new EbliNodeDefault(); - nodeLegende.setTitle("Legende"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(g)); - nodeLegende.setD(new Dimension(100, 100)); - scene.addNode(nodeLegende); + // etape 2 SUPER IMPORTANT: ajout du model comme listener de la scene + scene.addEbliNodeListener(model); - - - //-- creation de la vue calque - TestZCalquePoint test = new TestZCalquePoint(); - test.getVueCalque().setPreferredSize(new Dimension(200, 200)); - node = new EbliNodeDefault(); - node.setTitle("Vue Calque"); - node.setCreator(new EbliWidgetCreatorVue2d(test.getVisuPanel())); - node.setD(new Dimension(200, 200)); - // scene.addNode(node); - //scene.addChild(new ComponentWidget(scene, test.getVisuPanel().getVueCalque())); + // etape 3 creation du jtree + EbliWidgetJXTree tree = new EbliWidgetJXTree(model); - - - //-- ajout du rectangle --// - EbliNodeDefault nodeRect = new EbliNodeDefault(); - nodeRect.setTitle("Rectangle"); - nodeRect.setCreator(new EbliWidgetCreatorRectangle("Test recangle")); -// nodeRect.setD(new Dimension(100, 100)); - nodeRect.setP(new Point(350,125)); - scene.addNode(nodeRect); + EbliCheckBoxTreeRenderer renderer = new EbliCheckBoxTreeRenderer(); + tree.setCellRenderer(renderer); + tree.setCellEditor(new EbliCheckBoxNodeEditor(tree)); + tree.setEditable(true); - - //-- ajout du fleche double sens diagonale--// - node = new EbliNodeDefault(); - node.setTitle("Fleche Double"); - node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_DIAG1)); - node.setD(new Dimension(100, 100)); - node.setP(new Point(450,125)); - scene.addNode(node); - - - //-- ajout du fleche double sens nord--// - node = new EbliNodeDefault(); - node.setTitle("Fleche Double"); - node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_WEST)); - node.setD(new Dimension(100, 100)); - node.setP(new Point(450,125)); - scene.addNode(node); - - - //-- ajout du fleche sens unique--// - node = new EbliNodeDefault(); - node.setTitle("Fleche"); - node.setCreator(new EbliWidgetCreatorFleche(0)); - node.setD(new Dimension(100, 100)); - node.setP(new Point(250,525)); - scene.addNode(node); - - - - + // ajout graphe + // GrapheWidget graphe=new GrapheWidget(scene,null,g); + // graphe.setPreferredSize(new Dimension(300, 300)); + // scene.addWidget(graphe); - - // WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, - // graphe.getClientArea()); + // -- creation d un noeud Graphe --// + EbliNodeDefault node = new EbliNodeDefault(); + node.setCreator(new EbliWidgetCreatorGraphe(g)); + node.setTitle("Graphe"); + node.setD(new Dimension(300, 300)); + node.setP(new Point(4, 4)); + scene.addNode(node); - /* - // ajout iconenode - IconNodeWidget iconNode = new IconNodeWidget(scene); - iconNode.setImage(CtuluResource.CTULU.getImage("crystal_non")); - iconNode.setLabel("MyIconNode"); - // this.addChild (iconNode); - iconNode.getActions().addAction( - ActionFactory.createCenteredZoomAction(1.1)); - iconNode.getActions().addAction(ActionFactory.createPanAction()); - // assign HoverAction - the actual hovered widget is held by the scene - iconNode.getActions().addAction(scene.createWidgetHoverAction()); - // MoveAction has to be after the hover action - // otherwise MoveAction will always consume the event and HoverAction - // will never be invoked - iconNode.getActions().addAction(ActionFactory.createMoveAction()); - iconNode.setPreferredLocation(new Point(400, 150)); -*/ - - JTable table = new JTable(); - table.setModel(new DefaultTableModel(new Object[][] { { "11", "12" }, - { "21", "22" } }, new Object[] { "First", "Second" })); - ComponentWidget widgetJtable = new ComponentWidget(scene, - new JScrollPane(table)) { - public void notifyStateChanged(ObjectState previousState, - ObjectState newState) { - LookFeel lookFeel = getScene().getLookFeel(); + // -- creation d un noeud legende --// + EbliNodeDefault nodeLegende = new EbliNodeDefault(); + nodeLegende.setTitle("Legende"); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(g)); + nodeLegende.setD(new Dimension(100, 100)); + scene.addNode(nodeLegende); - setBorder(BorderFactory.createResizeBorder(10)); + // -- creation de la vue calque + final TestModelLigneBrisee m = TestModelLigneBrisee.buildDefault(); + ZCalqueLigneBrisee br = new ZCalqueLigneBrisee(m); + br.setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 5, Color.RED)); + BVueCalque vueC = new BVueCalque(br); + vueC.setSize(new Dimension(200, 200)); + node = new EbliNodeDefault(); + node.setTitle("Vue Calque"); +// JFrame fr = new JFrame(); - } - }; - widgetJtable.setBorder(BorderFactory.createResizeBorder(10)); - widgetJtable.setPreferredLocation(new Point(500, 300)); - widgetJtable.getActions().addAction(ActionFactory.createResizeAction()); - //scene.addChild(widgetJtable); - - - // fin - p.add(new JScrollPane(scene.createView()), BuBorderLayout.CENTER); + ZEbliCalquesPanel ebliCalquesPanel = new ZEbliCalquesPanel(br, new CtuluUIDefault()); +// fr.setContentPane(ebliCalquesPanel); +// ebliCalquesPanel.setPreferredSize(new Dimension(400, 400)); +// fr.setPreferredSize(new Dimension(400, 400)); +// fr.setVisible(true); + node.setCreator(new EbliWidgetCreatorVueCalque(ebliCalquesPanel)); + scene.addNode(node); + // scene.addChild(new ComponentWidget(scene, + // test.getVisuPanel().getVueCalque())); - // ajout de la vue sattelite en bas \xE4 gauche - boxEast.add(scene.createSatelliteView()); + // -- ajout du rectangle --// + EbliNodeDefault nodeRect = new EbliNodeDefault(); + nodeRect.setTitle("Rectangle"); + nodeRect.setCreator(new EbliWidgetCreatorRectangle("Test recangle")); + // nodeRect.setD(new Dimension(100, 100)); + nodeRect.setP(new Point(350, 125)); + scene.addNode(nodeRect); - final JMenu menu = new JMenu(); - menu.setName("essai"); - menu.setText("essai"); - pn.fillSpecificMenu(menu); - final JMenuBar b = new JMenuBar(); - b.add(menu); - f.setJMenuBar(b); - f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + // -- ajout du fleche double sens diagonale--// + node = new EbliNodeDefault(); + node.setTitle("Fleche Double"); + node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_DIAG1)); + node.setD(new Dimension(100, 100)); + node.setP(new Point(450, 125)); + scene.addNode(node); - // f.pack(); - f.show(); - scene.setFont(CtuluLibSwing.getMiniFont()); - g.computeMarges(scene.getGraphics()); - g.fullRepaint(); - - - - - -//-- ajout par la suite --/ -/* - node = new EbliNodeDefault(); - node.setTitle("BOUDOUM"); - node.setCreator(new EbliWidgetCreatorRectangle("BOUDOUM")); - - node.setD(new Dimension(100, 100)); - node.setP(new Point(450,20)); - scene.addNode(node); - */ - - p.doLayout(); - } + // -- ajout du fleche double sens nord--// + node = new EbliNodeDefault(); + node.setTitle("Fleche Double"); + node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_WEST)); + node.setD(new Dimension(100, 100)); + node.setP(new Point(450, 125)); + scene.addNode(node); + + // -- ajout du fleche sens unique--// + node = new EbliNodeDefault(); + node.setTitle("Fleche"); + node.setCreator(new EbliWidgetCreatorFleche(0)); + node.setD(new Dimension(100, 100)); + node.setP(new Point(250, 525)); + scene.addNode(node); + + // WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, + // graphe.getClientArea()); + + /* + * // ajout iconenode IconNodeWidget iconNode = new IconNodeWidget(scene); + * iconNode.setImage(CtuluResource.CTULU.getImage("crystal_non")); + * iconNode.setLabel("MyIconNode"); // this.addChild (iconNode); + * iconNode.getActions().addAction( + * ActionFactory.createCenteredZoomAction(1.1)); + * iconNode.getActions().addAction(ActionFactory.createPanAction()); // + * assign HoverAction - the actual hovered widget is held by the scene + * iconNode.getActions().addAction(scene.createWidgetHoverAction()); // + * MoveAction has to be after the hover action // otherwise MoveAction will + * always consume the event and HoverAction // will never be invoked + * iconNode.getActions().addAction(ActionFactory.createMoveAction()); + * iconNode.setPreferredLocation(new Point(400, 150)); + */ + + JTable table = new JTable(); + table.setModel(new DefaultTableModel(new Object[][] { { "11", "12" }, { "21", "22" } }, new Object[] { "First", + "Second" })); + ComponentWidget widgetJtable = new ComponentWidget(scene, new JScrollPane(table)) { + public void notifyStateChanged(ObjectState previousState, ObjectState newState) { + + setBorder(BorderFactory.createResizeBorder(10)); + + } + }; + widgetJtable.setBorder(BorderFactory.createResizeBorder(10)); + widgetJtable.setPreferredLocation(new Point(500, 300)); + widgetJtable.getActions().addAction(ActionFactory.createResizeAction()); + // scene.addChild(widgetJtable); + + final JFrame f = new JFrame(); + f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + f.setSize(new Dimension(1024, 768)); + final BuPanel p = new BuPanel(); + p.setLayout(new BuBorderLayout()); + p.add(tree, BuBorderLayout.WEST); + g.setPreferredSize(new Dimension(200, 300)); + g.setSize(g.getPreferredSize()); + final JTree t = new JTree((EGGrapheTreeModel) g.getModel()); + t.setSelectionModel(((EGGrapheTreeModel) g.getModel()).getSelectionModel()); + t.setRootVisible(false); + + Box boxEast = Box.createVerticalBox(); + boxEast.add(new BuScrollPane(t)); + p.add(new JScrollPane(boxEast), BuBorderLayout.EAST); + + f.setContentPane(p); + // fin + p.add(new JScrollPane(scene.createView()), BuBorderLayout.CENTER); + + // ajout de la vue sattelite en bas \xE4 gauche + boxEast.add(scene.createSatelliteView()); + + final JMenu menu = new JMenu(); + menu.setName("essai"); + menu.setText("essai"); + pn.fillSpecificMenu(menu); + final JMenuBar b = new JMenuBar(); + b.add(menu); + f.setJMenuBar(b); + f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + // f.pack(); + f.setVisible(true); + scene.setFont(CtuluLibSwing.getMiniFont()); + + // -- ajout par la suite --/ + /* + * node = new EbliNodeDefault(); node.setTitle("BOUDOUM"); + * node.setCreator(new EbliWidgetCreatorRectangle("BOUDOUM")); + * + * node.setD(new Dimension(100, 100)); node.setP(new Point(450,20)); + * scene.addNode(node); + */ + + p.doLayout(); + } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-08-06 15:03:15
|
Revision: 3716 http://fudaa.svn.sourceforge.net/fudaa/?rev=3716&view=rev Author: hadouxad Date: 2008-08-06 15:03:18 +0000 (Wed, 06 Aug 2008) Log Message: ----------- AFFECT?\195?\137 - # 40: L?\195?\169gende pour les courbe 1d http://mantis.genesis-groupe.com//view.php?id=40 mise en forme des donnees - ajout des nodes pour les elements - implementation dans EbliScene Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-06 14:53:07 UTC (rev 3715) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-06 15:03:18 UTC (rev 3716) @@ -23,8 +23,10 @@ import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JScrollPane; +import javax.swing.JTable; import javax.swing.JTree; import javax.swing.WindowConstants; +import javax.swing.table.DefaultTableModel; import javax.swing.text.Utilities; import org.fudaa.ctulu.CtuluResource; @@ -42,17 +44,24 @@ import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; import org.fudaa.ebli.courbe.EGObject; +import org.fudaa.ebli.tableau.EbliGrapheValeur; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.ebli.visuallibrary.EbliGraphScene; -import org.fudaa.ebli.visuallibrary.GrapheWidget; +import org.fudaa.ebli.visuallibrary.EbliNodeDefault; +import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorGraphe; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorLegende; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorVue2d; +import org.fudaa.ebli.visuallibrary.EbliWidgetGraphe; import org.fudaa.ebli.visuallibrary.WidgetLegendeManager; import org.fudaa.ebli.visuallibrary.WidgetLegendeManagerOLD; import org.netbeans.api.visual.action.ActionFactory; +import org.netbeans.api.visual.border.BorderFactory; import org.netbeans.api.visual.graph.GraphScene; import org.netbeans.api.visual.laf.LookFeel; import org.netbeans.api.visual.layout.LayoutFactory; import org.netbeans.api.visual.model.ObjectState; +import org.netbeans.api.visual.widget.ComponentWidget; import org.netbeans.api.visual.widget.ImageWidget; import org.netbeans.api.visual.widget.LabelWidget; import org.netbeans.api.visual.widget.LayerWidget; @@ -142,7 +151,7 @@ grapheModel.add(gr); final JFrame f = new JFrame(); f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - f.setSize(new Dimension(1024,768)); + f.setSize(new Dimension(1024, 768)); final BuPanel p = new BuPanel(); p.setLayout(new BuBorderLayout()); @@ -151,55 +160,93 @@ final JTree t = new JTree(grapheModel); t.setSelectionModel(grapheModel.getSelectionModel()); t.setRootVisible(false); - - Box boxEast=Box.createVerticalBox(); + + Box boxEast = Box.createVerticalBox(); boxEast.add(new BuScrollPane(t)); p.add(boxEast, BuBorderLayout.EAST); p.doLayout(); f.setContentPane(p); final EGFillePanel pn = new EGFillePanel(g); - - + // creation de la scene EBLI - EbliGraphScene scene = new EbliGraphScene(); + EbliScene scene = new EbliScene(); + // ajout graphe + // GrapheWidget graphe=new GrapheWidget(scene,null,g); + // graphe.setPreferredSize(new Dimension(300, 300)); + // scene.addWidget(graphe); - - //ajout graphe - GrapheWidget graphe=new GrapheWidget(scene,null,g); - graphe.setPreferredSize(new Dimension(300, 300)); - scene.addChild(graphe); - + //-- creation d un noeud Graphe --// + EbliNodeDefault node = new EbliNodeDefault(); + node.setCreator(new EbliWidgetCreatorGraphe(g)); + node.setD(new Dimension(300, 300)); + node.setP(new Point(4, 4)); + scene.addNode(node); + //-- creation d un noeud legende --// + node = new EbliNodeDefault(); + node.setCreator(new EbliWidgetCreatorLegende(g)); + node.setD(new Dimension(100, 100)); + scene.addNode(node); + - //WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, graphe.getClientArea()); - scene.addChild (WidgetLegendeManager.createLegende(g, scene,null)); - - //ajout iconenode - IconNodeWidget iconNode = new IconNodeWidget (scene); - iconNode.setImage (CtuluResource.CTULU.getImage("crystal_non")); - iconNode.setLabel ("MyIconNode"); -// this.addChild (iconNode); - iconNode.getActions ().addAction (ActionFactory.createCenteredZoomAction (1.1)); - iconNode.getActions ().addAction (ActionFactory.createPanAction ()); + //-- creation de la vue calque + TestZCalquePoint test = new TestZCalquePoint(); + test.getVueCalque().setPreferredSize(new Dimension(200, 200)); + node = new EbliNodeDefault(); + node.setCreator(new EbliWidgetCreatorVue2d(test.getVisuPanel())); + node.setD(new Dimension(200, 200)); + // scene.addNode(node); + //scene.addChild(new ComponentWidget(scene, test.getVisuPanel().getVueCalque())); + + // WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, + // graphe.getClientArea()); + + scene.addChild(WidgetLegendeManager.createLegende(g, scene, null)); + + // ajout iconenode + IconNodeWidget iconNode = new IconNodeWidget(scene); + iconNode.setImage(CtuluResource.CTULU.getImage("crystal_non")); + iconNode.setLabel("MyIconNode"); + // this.addChild (iconNode); + iconNode.getActions().addAction( + ActionFactory.createCenteredZoomAction(1.1)); + iconNode.getActions().addAction(ActionFactory.createPanAction()); // assign HoverAction - the actual hovered widget is held by the scene - iconNode.getActions ().addAction (scene.createWidgetHoverAction ()); + iconNode.getActions().addAction(scene.createWidgetHoverAction()); // MoveAction has to be after the hover action - // otherwise MoveAction will always consume the event and HoverAction will never be invoked - iconNode.getActions ().addAction (ActionFactory.createMoveAction ()); - iconNode.setPreferredLocation(new Point(400,150)); - scene.addChild(iconNode); + // otherwise MoveAction will always consume the event and HoverAction + // will never be invoked + iconNode.getActions().addAction(ActionFactory.createMoveAction()); + iconNode.setPreferredLocation(new Point(400, 150)); + - //scene.addNode(new Object()); + JTable table = new JTable(); + table.setModel(new DefaultTableModel(new Object[][] { { "11", "12" }, + { "21", "22" } }, new Object[] { "First", "Second" })); + ComponentWidget widgetJtable = new ComponentWidget(scene, + new JScrollPane(table)) { + public void notifyStateChanged(ObjectState previousState, + ObjectState newState) { + LookFeel lookFeel = getScene().getLookFeel(); + + setBorder(BorderFactory.createResizeBorder(10)); + + } + }; + widgetJtable.setBorder(BorderFactory.createResizeBorder(10)); + widgetJtable.setPreferredLocation(new Point(500, 300)); + widgetJtable.getActions().addAction(ActionFactory.createResizeAction()); + scene.addChild(widgetJtable); + // scene.addNode(new Object()); // fin p.add(new JScrollPane(scene.createView()), BuBorderLayout.CENTER); - - //ajout de la vue sattelite en bas \xE4 gauche + + // ajout de la vue sattelite en bas \xE4 gauche boxEast.add(scene.createSatelliteView()); - - + final JMenu menu = new JMenu(); menu.setName("essai"); menu.setText("essai"); @@ -209,7 +256,7 @@ f.setJMenuBar(b); f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - //f.pack(); + // f.pack(); f.show(); scene.setFont(CtuluLibSwing.getMiniFont()); g.computeMarges(scene.getGraphics()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-08-07 13:58:35
|
Revision: 3726 http://fudaa.svn.sourceforge.net/fudaa/?rev=3726&view=rev Author: hadouxad Date: 2008-08-07 13:58:44 +0000 (Thu, 07 Aug 2008) Log Message: ----------- AFFECT?\195?\137 - # 40: L?\195?\169gende pour les courbe 1d http://mantis.genesis-groupe.com//view.php?id=40 - les widget fleches directionnelle et bi directionnelle (a ameliorer) - les classes modeles et tree - les methodes de gestion des listener eblinodelistener pour la scene - la classe exemple testGraphe - exemple testgraphe pour voir le fonctionnement du lien tree scene Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-07 13:56:12 UTC (rev 3725) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-07 13:58:44 UTC (rev 3726) @@ -7,6 +7,7 @@ */ package org.fudaa.ebli.all; +import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.awt.Font; @@ -28,6 +29,7 @@ import javax.swing.WindowConstants; import javax.swing.table.DefaultTableModel; import javax.swing.text.Utilities; +import javax.swing.tree.TreePath; import org.fudaa.ctulu.CtuluResource; import org.fudaa.ctulu.gui.CtuluLibSwing; @@ -49,13 +51,19 @@ import org.fudaa.ebli.trace.TraceLigneModel; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorDblFleche; +import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorFleche; import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorGraphe; import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorLegende; import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorRectangle; import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorVue2d; +import org.fudaa.ebli.visuallibrary.EbliWidgetDBLFleche; import org.fudaa.ebli.visuallibrary.EbliWidgetGraphe; +import org.fudaa.ebli.visuallibrary.EbliWidgetJXTree; +import org.fudaa.ebli.visuallibrary.EbliWidgetJXTreeModel; import org.fudaa.ebli.visuallibrary.WidgetLegendeManager; import org.fudaa.ebli.visuallibrary.WidgetLegendeManagerOLD; +import org.jdesktop.swingx.JXTree; import org.netbeans.api.visual.action.ActionFactory; import org.netbeans.api.visual.border.BorderFactory; import org.netbeans.api.visual.graph.GraphScene; @@ -164,14 +172,42 @@ Box boxEast = Box.createVerticalBox(); boxEast.add(new BuScrollPane(t)); - p.add(boxEast, BuBorderLayout.EAST); - p.doLayout(); + p.add(new JScrollPane(boxEast), BuBorderLayout.EAST); + f.setContentPane(p); final EGFillePanel pn = new EGFillePanel(g); // creation de la scene EBLI EbliScene scene = new EbliScene(); + + + + + + + + //-- construction du jtree + + //etape 1 construction du model + EbliWidgetJXTreeModel model=new EbliWidgetJXTreeModel(1/*,scene*/); + + //etape 2 SUPER IMPORTANT: ajout du model comme listener de la scene + scene.addEbliNodeListener(model); + + + //etape 3 creation du jtree + EbliWidgetJXTree tree=new EbliWidgetJXTree(model); + + + p.add(tree,BuBorderLayout.WEST); + + + + + + + // ajout graphe // GrapheWidget graphe=new GrapheWidget(scene,null,g); // graphe.setPreferredSize(new Dimension(300, 300)); @@ -181,15 +217,17 @@ //-- creation d un noeud Graphe --// EbliNodeDefault node = new EbliNodeDefault(); node.setCreator(new EbliWidgetCreatorGraphe(g)); + node.setTitle("Graphe"); node.setD(new Dimension(300, 300)); node.setP(new Point(4, 4)); scene.addNode(node); //-- creation d un noeud legende --// - node = new EbliNodeDefault(); - node.setCreator(new EbliWidgetCreatorLegende(g)); - node.setD(new Dimension(100, 100)); - scene.addNode(node); + EbliNodeDefault nodeLegende = new EbliNodeDefault(); + nodeLegende.setTitle("Legende"); + nodeLegende.setCreator(new EbliWidgetCreatorLegende(g)); + nodeLegende.setD(new Dimension(100, 100)); + scene.addNode(nodeLegende); @@ -197,6 +235,7 @@ TestZCalquePoint test = new TestZCalquePoint(); test.getVueCalque().setPreferredSize(new Dimension(200, 200)); node = new EbliNodeDefault(); + node.setTitle("Vue Calque"); node.setCreator(new EbliWidgetCreatorVue2d(test.getVisuPanel())); node.setD(new Dimension(200, 200)); // scene.addNode(node); @@ -205,18 +244,49 @@ //-- ajout du rectangle --// + EbliNodeDefault nodeRect = new EbliNodeDefault(); + nodeRect.setTitle("Rectangle"); + nodeRect.setCreator(new EbliWidgetCreatorRectangle("Test recangle")); +// nodeRect.setD(new Dimension(100, 100)); + nodeRect.setP(new Point(350,125)); + scene.addNode(nodeRect); + + + //-- ajout du fleche double sens diagonale--// node = new EbliNodeDefault(); - node.setCreator(new EbliWidgetCreatorRectangle("Test recangle")); -// node.setD(new Dimension(100, 100)); - node.setP(new Point(350,125)); + node.setTitle("Fleche Double"); + node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_DIAG1)); + node.setD(new Dimension(100, 100)); + node.setP(new Point(450,125)); scene.addNode(node); + + + //-- ajout du fleche double sens nord--// + node = new EbliNodeDefault(); + node.setTitle("Fleche Double"); + node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_WEST)); + node.setD(new Dimension(100, 100)); + node.setP(new Point(450,125)); + scene.addNode(node); + + + //-- ajout du fleche sens unique--// + node = new EbliNodeDefault(); + node.setTitle("Fleche"); + node.setCreator(new EbliWidgetCreatorFleche(0)); + node.setD(new Dimension(100, 100)); + node.setP(new Point(250,525)); + scene.addNode(node); + + + + // WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, // graphe.getClientArea()); - scene.addChild(WidgetLegendeManager.createLegende(g, scene, null)); - + /* // ajout iconenode IconNodeWidget iconNode = new IconNodeWidget(scene); iconNode.setImage(CtuluResource.CTULU.getImage("crystal_non")); @@ -232,7 +302,7 @@ // will never be invoked iconNode.getActions().addAction(ActionFactory.createMoveAction()); iconNode.setPreferredLocation(new Point(400, 150)); - +*/ JTable table = new JTable(); table.setModel(new DefaultTableModel(new Object[][] { { "11", "12" }, @@ -250,8 +320,9 @@ widgetJtable.setBorder(BorderFactory.createResizeBorder(10)); widgetJtable.setPreferredLocation(new Point(500, 300)); widgetJtable.getActions().addAction(ActionFactory.createResizeAction()); - scene.addChild(widgetJtable); - // scene.addNode(new Object()); + //scene.addChild(widgetJtable); + + // fin p.add(new JScrollPane(scene.createView()), BuBorderLayout.CENTER); @@ -272,6 +343,22 @@ scene.setFont(CtuluLibSwing.getMiniFont()); g.computeMarges(scene.getGraphics()); g.fullRepaint(); - + + + + + +//-- ajout par la suite --/ +/* + node = new EbliNodeDefault(); + node.setTitle("BOUDOUM"); + node.setCreator(new EbliWidgetCreatorRectangle("BOUDOUM")); + + node.setD(new Dimension(100, 100)); + node.setP(new Point(450,20)); + scene.addNode(node); + */ + + p.doLayout(); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-08-11 21:05:07
|
Revision: 3766 http://fudaa.svn.sourceforge.net/fudaa/?rev=3766&view=rev Author: deniger Date: 2008-08-11 21:04:55 +0000 (Mon, 11 Aug 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-11 21:02:53 UTC (rev 3765) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-11 21:04:55 UTC (rev 3766) @@ -174,7 +174,6 @@ tree.setCellEditor(new EbliCheckBoxNodeEditor(tree)); tree.setEditable(true); - // -- creation d un noeud Graphe --// final EbliNodeDefault nodeG = new EbliNodeDefault(); nodeG.setCreator(new EbliWidgetCreatorGraphe(g)); @@ -202,13 +201,13 @@ nodeCalque.setTitle("Vue Calque"); nodeCalque.setPreferedSize(new Dimension(400, 200)); nodeCalque.setPreferedLocation(new Point(250, 170)); -// JFrame fr = new JFrame(); + // JFrame fr = new JFrame(); ZEbliCalquesPanel ebliCalquesPanel = new ZEbliCalquesPanel(br, new CtuluUIDefault()); -// fr.setContentPane(ebliCalquesPanel); -// ebliCalquesPanel.setPreferredSize(new Dimension(400, 400)); -// fr.setPreferredSize(new Dimension(400, 400)); -// fr.setVisible(true); + // fr.setContentPane(ebliCalquesPanel); + // ebliCalquesPanel.setPreferredSize(new Dimension(400, 400)); + // fr.setPreferredSize(new Dimension(400, 400)); + // fr.setVisible(true); nodeCalque.setCreator(new EbliWidgetCreatorVueCalque(ebliCalquesPanel)); scene.addNode(nodeCalque); // scene.addChild(new ComponentWidget(scene, @@ -218,11 +217,9 @@ final EbliNodeDefault nodeRect = new EbliNodeDefault(); nodeRect.setTitle("Rectangle"); nodeRect.setCreator(new EbliWidgetCreatorRectangle("Test recangle")); - nodeRect.setPreferedSize(new Dimension(200, 100)); + nodeRect.setPreferedSize(new Dimension(200, 100)); nodeRect.setPreferedLocation(new Point(350, 125)); scene.addNode(nodeRect); - - // -- ajout du fleche double sens diagonale--// node = new EbliNodeDefault(); @@ -248,13 +245,9 @@ nodeFleche.setPreferedLocation(new Point(250, 525)); scene.addNode(nodeFleche); - - - // node.getCreator().getWidget().setState(state) - //if(node.getCreator().getWidget().) - - - + // node.getCreator().getWidget().setState(state) + // if(node.getCreator().getWidget().) + // WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, // graphe.getClientArea()); @@ -304,9 +297,9 @@ boxEast.add(new BuScrollPane(t)); p.add(new JScrollPane(boxEast), BuBorderLayout.EAST); f.setLayout(new BorderLayout()); - - //f.setContentPane(p); - f.add(p,BorderLayout.CENTER); + + // f.setContentPane(p); + f.add(p, BorderLayout.CENTER); // fin p.add(new JScrollPane(scene.createView()), BuBorderLayout.CENTER); @@ -335,31 +328,28 @@ * scene.addNode(node); */ -JToolBar bar =new JToolBar(); -f.add(bar,BorderLayout.PAGE_START); -bar.add(new EbliWidgetActionAlign(scene, EbliWidgetActionAlign.ALIGNLEFT)); -bar.add(new EbliWidgetActionAlign(scene, EbliWidgetActionAlign.ALIGNRIGHT)); -bar.add(new EbliWidgetActionAlign(scene, EbliWidgetActionAlign.ALIGNCENTERHORIZONTAL)); -bar.add(new EbliWidgetActionAlign(scene, EbliWidgetActionAlign.ALIGNCENTERVERTICAL)); -bar.add(new EbliWidgetActionAlign(scene, EbliWidgetActionAlign.ALIGNTOP)); -bar.add(new EbliWidgetActionAlign(scene, EbliWidgetActionAlign.ALIGNBOTTOM)); - -bar =new JToolBar(); -f.add(bar,BorderLayout.PAGE_END); + JToolBar bar = new JToolBar(); + f.add(bar, BorderLayout.PAGE_START); + bar.add(new EbliWidgetActionAlign.Left(scene, scene.getCmdMng())); + bar.add(new EbliWidgetActionAlign.Right(scene, scene.getCmdMng())); + bar.add(new EbliWidgetActionAlign.Middle(scene, scene.getCmdMng())); + bar.add(new EbliWidgetActionAlign.Center(scene, scene.getCmdMng())); + bar.add(new EbliWidgetActionAlign.Top(scene, scene.getCmdMng())); + bar.add(new EbliWidgetActionAlign.Bottom(scene, scene.getCmdMng())); -bar.add(new EbliWidgetActionDuplicate(scene)); + bar = new JToolBar(); + f.add(bar, BorderLayout.PAGE_END); + bar.add(new EbliWidgetActionDuplicate(scene)); -bar.add(new EbliWidgetActionForeGround(scene)); + bar.add(new EbliWidgetActionForeGround(scene)); -bar.add(new EbliWidgetActionBackGround(scene)); + bar.add(new EbliWidgetActionBackGround(scene)); -/* -JFrame frame2=new JFrame(); -frame2.getContentPane().add(new EGFillePanel(g)); -frame2.setSize(500,500); -frame2.setVisible(true); -*/ -p.doLayout(); + /* + * JFrame frame2=new JFrame(); frame2.getContentPane().add(new + * EGFillePanel(g)); frame2.setSize(500,500); frame2.setVisible(true); + */ + p.doLayout(); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-08-11 21:32:40
|
Revision: 3769 http://fudaa.svn.sourceforge.net/fudaa/?rev=3769&view=rev Author: deniger Date: 2008-08-11 21:32:37 +0000 (Mon, 11 Aug 2008) Log Message: ----------- Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-11 21:30:31 UTC (rev 3768) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-11 21:32:37 UTC (rev 3769) @@ -12,13 +12,9 @@ import java.awt.Dimension; import java.awt.Point; import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import javax.swing.AbstractAction; import javax.swing.Box; -import javax.swing.JButton; import javax.swing.JFrame; -import javax.swing.JInternalFrame; import javax.swing.JMenu; import javax.swing.JMenuBar; import javax.swing.JScrollPane; @@ -28,13 +24,14 @@ import javax.swing.WindowConstants; import javax.swing.table.DefaultTableModel; +import org.fudaa.ctulu.CtuluCommandManager; import org.fudaa.ctulu.CtuluUIDefault; import org.fudaa.ctulu.gui.CtuluLibSwing; import org.fudaa.ctulu.iterator.LogarithmicNumberIterator; import org.fudaa.ebli.calque.BVueCalque; import org.fudaa.ebli.calque.ZCalqueLigneBrisee; import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.calque.edition.ZCalqueLigneBriseeEditable; +import org.fudaa.ebli.commun.EbliActionSimple; import org.fudaa.ebli.courbe.EGAxeHorizontal; import org.fudaa.ebli.courbe.EGAxeVertical; import org.fudaa.ebli.courbe.EGCourbeChild; @@ -43,10 +40,8 @@ import org.fudaa.ebli.courbe.EGGraphe; import org.fudaa.ebli.courbe.EGGrapheTreeModel; import org.fudaa.ebli.courbe.EGGroup; -import org.fudaa.ebli.courbe.EGTableGraphePanel; import org.fudaa.ebli.trace.TraceLigne; import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.ebli.visuallibrary.EbliNode; import org.fudaa.ebli.visuallibrary.EbliNodeDefault; import org.fudaa.ebli.visuallibrary.EbliScene; import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorDblFleche; @@ -66,12 +61,12 @@ import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTreeModel; import org.netbeans.api.visual.action.ActionFactory; import org.netbeans.api.visual.border.BorderFactory; -import org.netbeans.api.visual.laf.LookFeel; import org.netbeans.api.visual.model.ObjectState; import org.netbeans.api.visual.widget.ComponentWidget; import com.memoire.bu.BuBorderLayout; import com.memoire.bu.BuPanel; +import com.memoire.bu.BuResource; import com.memoire.bu.BuScrollPane; /** @@ -194,6 +189,7 @@ // -- creation de la vue calque final TestModelLigneBrisee m = TestModelLigneBrisee.buildDefault(); ZCalqueLigneBrisee br = new ZCalqueLigneBrisee(m); + br.setTitle("test"); br.setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 5, Color.RED)); BVueCalque vueC = new BVueCalque(br); vueC.setSize(new Dimension(200, 200)); @@ -330,12 +326,29 @@ JToolBar bar = new JToolBar(); f.add(bar, BorderLayout.PAGE_START); - bar.add(new EbliWidgetActionAlign.Left(scene, scene.getCmdMng())); - bar.add(new EbliWidgetActionAlign.Right(scene, scene.getCmdMng())); - bar.add(new EbliWidgetActionAlign.Middle(scene, scene.getCmdMng())); - bar.add(new EbliWidgetActionAlign.Center(scene, scene.getCmdMng())); - bar.add(new EbliWidgetActionAlign.Top(scene, scene.getCmdMng())); - bar.add(new EbliWidgetActionAlign.Bottom(scene, scene.getCmdMng())); + // om met en place le undo/redo + scene.setCmdMng(new CtuluCommandManager()); + bar.add(new EbliActionSimple("undo", BuResource.BU.getToolIcon("defaire"), "UNDO") { + @Override + public void actionPerformed(ActionEvent _e) { + if (scene.getCmdMng().canUndo()) + scene.getCmdMng().undo(); + } + }); + bar.add(new EbliActionSimple("redo", BuResource.BU.getToolIcon("refaire"), "REDO") { + @Override + public void actionPerformed(ActionEvent _e) { + if (scene.getCmdMng().canRedo()) + scene.getCmdMng().redo(); + } + }); + bar.addSeparator(); + bar.add(new EbliWidgetActionAlign.Left(scene)); + bar.add(new EbliWidgetActionAlign.Right(scene)); + bar.add(new EbliWidgetActionAlign.Middle(scene)); + bar.add(new EbliWidgetActionAlign.Center(scene)); + bar.add(new EbliWidgetActionAlign.Top(scene)); + bar.add(new EbliWidgetActionAlign.Bottom(scene)); bar = new JToolBar(); f.add(bar, BorderLayout.PAGE_END); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <had...@us...> - 2008-08-11 14:17:45
|
Revision: 3760 http://fudaa.svn.sourceforge.net/fudaa/?rev=3760&view=rev Author: hadouxad Date: 2008-08-11 14:17:51 +0000 (Mon, 11 Aug 2008) Log Message: ----------- - ajout etat supplementaire poru le jtree: si la widget est masquee, affiche icone differente - Mise en place de l editor du graphe - Mise en place de l editor du calque Modified Paths: -------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Modified: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-11 14:17:07 UTC (rev 3759) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-08-11 14:17:51 UTC (rev 3760) @@ -354,10 +354,12 @@ bar.add(new EbliWidgetActionBackGround(scene)); -// -//boxEast.add(new ZEbliCalquesPanel()); - - +/* +JFrame frame2=new JFrame(); +frame2.getContentPane().add(new EGFillePanel(g)); +frame2.setSize(500,500); +frame2.setVisible(true); +*/ p.doLayout(); } } \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <de...@us...> - 2008-09-25 19:42:28
|
Revision: 3986 http://fudaa.svn.sourceforge.net/fudaa/?rev=3986&view=rev Author: deniger Date: 2008-09-25 19:42:20 +0000 (Thu, 25 Sep 2008) Log Message: ----------- Removed Paths: ------------- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java Deleted: branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java =================================================================== --- branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-09-25 16:48:48 UTC (rev 3985) +++ branches/Prepro-0.92-SNAPSHOT/ebli/test/org/fudaa/ebli/all/TestGraphe2.java 2008-09-25 19:42:20 UTC (rev 3986) @@ -1,486 +0,0 @@ -/** - * @creation 21 juin 2004 - * @modification $Date: 2007-01-17 10:45:17 $ - * @license GNU General Public License 2 - * @copyright (c)1998-2001 CETMEF 2 bd Gambetta F-60231 Compiegne - * @mail de...@fu... - */ -package org.fudaa.ebli.all; - -import java.awt.BorderLayout; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Point; -import java.awt.event.ActionEvent; - -import javax.swing.Box; -import javax.swing.JFrame; -import javax.swing.JMenu; -import javax.swing.JMenuBar; -import javax.swing.JScrollPane; -import javax.swing.JTable; -import javax.swing.JToolBar; -import javax.swing.JTree; -import javax.swing.WindowConstants; -import javax.swing.table.DefaultTableModel; - -import org.fudaa.ctulu.CtuluCommandManager; -import org.fudaa.ctulu.CtuluUIDefault; -import org.fudaa.ctulu.gui.CtuluHtmlEditorPanel; -import org.fudaa.ctulu.gui.CtuluLibSwing; -import org.fudaa.ctulu.iterator.LogarithmicNumberIterator; -import org.fudaa.ebli.calque.BCalqueLegende; -import org.fudaa.ebli.calque.BVueCalque; -import org.fudaa.ebli.calque.ZCalqueLigneBrisee; -import org.fudaa.ebli.calque.ZEbliCalquesPanel; -import org.fudaa.ebli.commun.EbliActionSimple; -import org.fudaa.ebli.courbe.EGAxeHorizontal; -import org.fudaa.ebli.courbe.EGAxeVertical; -import org.fudaa.ebli.courbe.EGCourbeChild; -import org.fudaa.ebli.courbe.EGCourbeModelDefault; -import org.fudaa.ebli.courbe.EGFillePanel; -import org.fudaa.ebli.courbe.EGGraphe; -import org.fudaa.ebli.courbe.EGGrapheTreeModel; -import org.fudaa.ebli.courbe.EGGroup; -import org.fudaa.ebli.trace.TraceLigne; -import org.fudaa.ebli.trace.TraceLigneModel; -import org.fudaa.ebli.visuallibrary.EbliNodeDefault; -import org.fudaa.ebli.visuallibrary.EbliScene; -import org.fudaa.ebli.visuallibrary.EbliWidget; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorDblFleche; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorFleche; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorShape; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorTextEditor; -import org.fudaa.ebli.visuallibrary.EbliWidgetCreatorTextLabel; -import org.fudaa.ebli.visuallibrary.EbliWidgetDBLFleche; -import org.fudaa.ebli.visuallibrary.EbliWidgetShape; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionAlign; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionBackGround; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionColorBackground; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionColorForeground; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionConfigure; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionDuplicate; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionFont; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionForeGround; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionImageChooser; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRetaillageHorizontal; -import org.fudaa.ebli.visuallibrary.actions.EbliWidgetActionRetaillageVertical; -import org.fudaa.ebli.visuallibrary.calque.EbliWidgetCreatorVueCalque; -import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorCircle; -import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorEllipse; -import org.fudaa.ebli.visuallibrary.creator.ShapeCreatorFleche; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorGraphe; -import org.fudaa.ebli.visuallibrary.graphe.EbliWidgetCreatorLegende; -import org.fudaa.ebli.visuallibrary.tree.EbliWidgetJXTreeTableModel; -import org.jdesktop.swingx.JXTreeTable; -import org.netbeans.api.visual.action.ActionFactory; -import org.netbeans.api.visual.border.BorderFactory; -import org.netbeans.api.visual.model.ObjectState; -import org.netbeans.api.visual.widget.ComponentWidget; - -import com.memoire.bu.BuBorderLayout; -import com.memoire.bu.BuPanel; -import com.memoire.bu.BuResource; -import com.memoire.bu.BuScrollPane; - -/** - * @author Fred Deniger - * @version $Id: TestGraphe2.java,v 1.8 2007-01-17 10:45:17 deniger Exp $ - */ -public final class TestGraphe2 { - - private TestGraphe2() { - super(); - } - - private static EGGraphe createGraphe() { - final EGGrapheTreeModel grapheModel = new EGGrapheTreeModel(); - final EGGraphe g = new EGGraphe(grapheModel); - final EGAxeHorizontal x = new EGAxeHorizontal(false); - x.setTitre("temps"); - x.setUnite("sec"); - x.setBounds(0.0001, 1000000); - x.setAxisIterator(new LogarithmicNumberIterator()); - x.setGraduations(true); - g.setXAxe(x); - EGGroup gr = new EGGroup(); - gr.setTitle("gr 1"); - EGCourbeModelDefault m = new EGCourbeModelDefault(new double[] { 0.0001, 3, 4, 1000000 }, new double[] { 10000, 4, - 5, 3 }); - EGCourbeChild c = new EGCourbeChild(gr); - m.setTitle("toto bleue"); - c.setModel(m); - c.setAspectContour(Color.cyan); - - gr.addEGComponent(c); - - m = new EGCourbeModelDefault(new double[] { 0.0002, 5, 7, 900000 }, new double[] { 0.001, 1, 3, 4 }); - c = new EGCourbeChild(gr); - c.setAspectContour(Color.RED); - m.setTitle("toto rouge"); - c.setModel(m); - - gr.addEGComponent(c); - - EGAxeVertical y = new EGAxeVertical(); - y.setGraduations(true); - y.setGrille(new TraceLigneModel(TraceLigne.LISSE, 1, Color.LIGHT_GRAY)); - y.setDroite(true); - y.setAxisIterator(new LogarithmicNumberIterator()); - y.setBounds(0.0001, 10000); - y.setLineColor(Color.blue); - y.setTitre("essai 2"); - gr.setAxeY(y); - grapheModel.add(gr); - gr = new EGGroup(); - gr.setTitle("gr 2"); - m = new EGCourbeModelDefault(new double[] { 1, 8, 9, 10 }, new double[] { 10, 4, 2, 24 }); - c = new EGCourbeChild(gr); - c.setAspectContour(Color.yellow); - m.setTitle("toto jaune"); - c.setModel(m); - gr.addEGComponent(c); - y = new EGAxeVertical(); - y.setGraduations(true); - y.setBounds(0, 55); - y.setTitre("essai 1"); - gr.setAxeY(y); - gr.addEGComponent(c); - m = new EGCourbeModelDefault(new double[] { 1, 3, 4, 5 }, new double[] { 14, 54, 25, 43 }); - c = new EGCourbeChild(gr); - m.setTitle("toto vert"); - c.setAspectContour(Color.green); - c.setModel(m); - gr.addEGComponent(c); - grapheModel.add(gr); - return g; - } - - /** - * @param _args - * non utilise - */ - public static void main(final String[] _args) { - EGGraphe g = createGraphe(); - final EGFillePanel pn = new EGFillePanel(g); - - // creation de la scene EBLI - final EbliScene scene = new EbliScene(); - - // -- construction du jtree - - // etape 1 construction du model - // EbliWidgetJXTreeModel model = new EbliWidgetJXTreeModel(1/* ,scene */); - - // etape 2 SUPER IMPORTANT: ajout du model comme listener de la scene - // scene.addEbliNodeListener(model); - - // etape 3 creation du jtree - - // tree.setCellEditor(new EbliCheckBoxNodeEditor(tree)); - // tree.setEditable(true); - - // -- creation d un noeud Graphe --// - final EbliNodeDefault nodeG = new EbliNodeDefault(); - nodeG.setCreator(new EbliWidgetCreatorGraphe(g)); - nodeG.setTitle("Graphe"); - nodeG.setPreferedSize(new Dimension(200, 250)); - nodeG.setPreferedLocation(new Point(12, 420)); - scene.addNode(nodeG); - - EbliNodeDefault node; - // -- creation d un noeud legende --// - EbliNodeDefault nodeLegende = new EbliNodeDefault(); - nodeLegende.setTitle("Legende"); - nodeLegende.setCreator(new EbliWidgetCreatorLegende(g)); - nodeLegende.setPreferedSize(new Dimension(100, 100)); - nodeLegende.setPreferedLocation(new Point(4, 270)); - scene.addNode(nodeLegende); - - // -- creation de la vue calque - final TestModelLigneBrisee m = TestModelLigneBrisee.buildDefault(); - ZCalqueLigneBrisee br = new ZCalqueLigneBrisee(m); - br.setTitle("test"); - br.setLineModel(0, new TraceLigneModel(TraceLigne.LISSE, 5, Color.RED)); - BVueCalque vueC = new BVueCalque(br); - vueC.setSize(new Dimension(200, 200)); - final EbliNodeDefault nodeCalque = new EbliNodeDefault(); - nodeCalque.setTitle("Vue Calque"); - nodeCalque.setPreferedSize(new Dimension(400, 200)); - nodeCalque.setPreferedLocation(new Point(250, 170)); - // JFrame fr = new JFrame(); - - ZEbliCalquesPanel ebliCalquesPanel = new ZEbliCalquesPanel(br, new CtuluUIDefault()); - // fr.setContentPane(ebliCalquesPanel); - // ebliCalquesPanel.setPreferredSize(new Dimension(400, 400)); - // fr.setPreferredSize(new Dimension(400, 400)); - // fr.setVisible(true); - nodeCalque.setCreator(new EbliWidgetCreatorVueCalque(ebliCalquesPanel)); - scene.addNode(nodeCalque); - // scene.addChild(new ComponentWidget(scene, - // test.getVisuPanel().getVueCalque())); - - // -- ajout du rectangle --// - final EbliNodeDefault nodeRect = new EbliNodeDefault(); - nodeRect.setTitle("Rectangle"); - nodeRect.setCreator(new EbliWidgetCreatorTextLabel("Test recangle")); - nodeRect.setPreferedSize(new Dimension(200, 100)); - nodeRect.setPreferedLocation(new Point(350, 125)); - scene.addNode(nodeRect); - - // -- ajout du fleche double sens diagonale--// - node = new EbliNodeDefault(); - node.setTitle("Fleche Double"); - node.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_DIAG1)); - node.setPreferedSize(new Dimension(100, 100)); - node.setPreferedLocation(new Point(450, 125)); - scene.addNode(node); - - // -- ajout du fleche double sens nord--// - final EbliNodeDefault nodeDbl = new EbliNodeDefault(); - nodeDbl.setTitle("Fleche Double"); - nodeDbl.setCreator(new EbliWidgetCreatorDblFleche(EbliWidgetDBLFleche.ORIENTATION_WEST)); - nodeDbl.setPreferedSize(new Dimension(100, 100)); - nodeDbl.setPreferedLocation(new Point(450, 125)); - scene.addNode(nodeDbl); - - // -- ajout du fleche sens unique--// - final EbliNodeDefault nodeFleche = new EbliNodeDefault(); - nodeFleche.setTitle("Fleche"); - nodeFleche.setCreator(new EbliWidgetCreatorFleche(0)); - nodeFleche.setPreferedSize(new Dimension(100, 100)); - nodeFleche.setPreferedLocation(new Point(250, 525)); - scene.addNode(nodeFleche); - - EbliWidget widget = nodeFleche.getWidget(); - widget.removeFromParent(); - node.getWidget().addChild(widget); - - EbliNodeDefault nodeShape = new EbliNodeDefault(); - nodeShape.setTitle("Shape fleche"); - nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorFleche())); - nodeShape.setPreferedSize(new Dimension(100, 100)); - nodeShape.setPreferedLocation(new Point(250, 225)); - scene.addNode(nodeShape); - - ((EbliWidgetShape) nodeShape.getWidget()).setRotation(Math.PI / 2); - ((EbliWidgetShape) nodeShape.getWidget()).repaint(); - scene.refresh(); - - nodeShape = new EbliNodeDefault(); - nodeShape.setTitle("Shape cercle"); - nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorCircle())); - nodeShape.setPreferedSize(new Dimension(100, 100)); - nodeShape.setPreferedLocation(new Point(270, 225)); - scene.addNode(nodeShape); - scene.refresh(); - - - nodeShape = new EbliNodeDefault(); - nodeShape.setTitle("Shape cercle"); - nodeShape.setCreator(new EbliWidgetCreatorTextEditor(new CtuluHtmlEditorPanel())); - nodeShape.setPreferedSize(new Dimension(400, 400)); - nodeShape.setPreferedLocation(new Point(370, 225)); - scene.addNode(nodeShape); - scene.refresh(); - - nodeShape = new EbliNodeDefault(); - nodeShape.setTitle("Shape Elipse"); - nodeShape.setCreator(new EbliWidgetCreatorShape(new ShapeCreatorEllipse())); - nodeShape.setPreferedSize(new Dimension(100, 100)); - nodeShape.setPreferedLocation(new Point(290, 225)); - scene.addNode(nodeShape); - - scene.refresh(); - /* - * nodeLegende = new EbliNodeDefault(); - * nodeLegende.setTitle("Legende calque"); - * - * nodeLegende.setCreator(new EbliWidgetCreatorCalqueLegende(new - * BCalqueLegende().getLegendePanel(0))); nodeLegende.setPreferedSize(new - * Dimension(200, 100)); nodeLegende.setPreferedLocation(new Point(10, 10)); - * // ajout du node au scene.addNode(nodeLegende); - * - * scene.refresh(); - */ - // node.getWidget().setState(state) - // if(node.getWidget().) - - // WidgetLegendeManagerOLD.createWidgetLegendeGraphe(this, visu, courbe, - // graphe.getClientArea()); - - /* - * // ajout iconenode IconNodeWidget iconNode = new IconNodeWidget(scene); - * iconNode.setImage(CtuluResource.CTULU.getImage("crystal_non")); - * iconNode.setLabel("MyIconNode"); // this.addChild (iconNode); - * iconNode.getActions().addAction( - * ActionFactory.createCenteredZoomAction(1.1)); - * iconNode.getActions().addAction(ActionFactory.createPanAction()); // - * assign HoverAction - the actual hovered widget is held by the scene - * iconNode.getActions().addAction(scene.createWidgetHoverAction()); // - * MoveAction has to be after the hover action // otherwise MoveAction will - * always consume the event and HoverAction // will never be invoked - * iconNode.getActions().addAction(ActionFactory.createMoveAction()); - * iconNode.setPreferredLocation(new Point(400, 150)); - */ - - JTable table = new JTable(); - table.setModel(new DefaultTableModel(new Object[][] { { "11", "12" }, { "21", "22" } }, new Object[] { "First", - "Second" })); - ComponentWidget widgetJtable = new ComponentWidget(scene, new JScrollPane(table)) { - public void notifyStateChanged(ObjectState previousState, ObjectState newState) { - - setBorder(BorderFactory.createResizeBorder(10)); - - } - }; - widgetJtable.setBorder(BorderFactory.createResizeBorder(10)); - widgetJtable.setPreferredLocation(new Point(500, 300)); - widgetJtable.getActions().addAction(ActionFactory.createResizeAction()); - // scene.addChild(widgetJtable); - - final JFrame f = new JFrame(); - f.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); - f.setSize(new Dimension(1024, 768)); - final BuPanel p = new BuPanel(); - p.setLayout(new BuBorderLayout()); - EbliWidgetJXTreeTableModel tree = new EbliWidgetJXTreeTableModel(scene); - - JXTreeTable view = new JXTreeTable(tree); - - -// view.setTreeCellRenderer(EbliWidgetCellRendererBuilder.getNodeIconCellRenderer()); - p.add(new JScrollPane(view), BuBorderLayout.WEST); - g.setPreferredSize(new Dimension(200, 300)); - g.setSize(g.getPreferredSize()); - final JTree t = new JTree((EGGrapheTreeModel) g.getModel()); - t.setSelectionModel(((EGGrapheTreeModel) g.getModel()).getSelectionModel()); - t.setRootVisible(false); - - Box boxEast = Box.createVerticalBox(); - boxEast.add(new BuScrollPane(t)); - p.add(new JScrollPane(boxEast), BuBorderLayout.EAST); - f.setLayout(new BorderLayout()); - - // f.setContentPane(p); - f.add(p, BorderLayout.CENTER); - // fin - p.add(new JScrollPane(scene.createView()), BuBorderLayout.CENTER); - - // ajout de la vue sattelite en bas \xE4 gauche - boxEast.add(scene.createSatelliteView()); - - final JMenu menu = new JMenu(); - menu.setName("essai"); - menu.setText("essai"); - pn.fillSpecificMenu(menu); - final JMenuBar b = new JMenuBar(); - b.add(menu); - f.setJMenuBar(b); - f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - // f.pack(); - f.setVisible(true); - scene.setFont(CtuluLibSwing.getMiniFont()); - - // -- ajout par la suite --/ - /* - * node = new EbliNodeDefault(); node.setTitle("BOUDOUM"); - * node.setCreator(new EbliWidgetCreatorRectangle("BOUDOUM")); - * - * node.setD(new Dimension(100, 100)); node.setP(new Point(450,20)); - * scene.addNode(node); - */ - - JToolBar bar = new JToolBar(); - f.add(bar, BorderLayout.PAGE_START); - // om met en place le undo/redo - scene.setCmdMng(new CtuluCommandManager()); - bar.add(new EbliActionSimple("undo", BuResource.BU.getToolIcon("defaire"), "UNDO") { - @Override - public void actionPerformed(ActionEvent _e) { - if (scene.getCmdMng().canUndo()) scene.getCmdMng().undo(); - } - }); - bar.add(new EbliActionSimple("redo", BuResource.BU.getToolIcon("refaire"), "REDO") { - @Override - public void actionPerformed(ActionEvent _e) { - if (scene.getCmdMng().canRedo()) scene.getCmdMng().redo(); - } - }); - bar.addSeparator(); - bar.add(new EbliWidgetActionAlign.Left(scene)); - bar.add(new EbliWidgetActionAlign.Right(scene)); - bar.add(new EbliWidgetActionAlign.Middle(scene)); - bar.add(new EbliWidgetActionAlign.Center(scene)); - bar.add(new EbliWidgetActionAlign.Top(scene)); - bar.add(new EbliWidgetActionAlign.Bottom(scene)); - - bar.add(new EbliWidgetActionConfigure(scene)); - - /** - * Action qui recupere les noeuds de l arbre selectionnes et indique la - * widget comme target. - */ - /* - * BConfigurePaletteAction action = new - * BConfigurePaletteAction(view.getTreeSelectionModel()) { - * - * protected Object getTarget(final TreeSelectionModel _m) { final - * TreePath[] p = _m.getSelectionPaths(); - * - * if (p != null) { final Object[] targets = new Object[p.length]; // p est - * non null for (int i = p.length - 1; i >= 0; i--) { targets[i] = p[i] == - * null ? null : ((EbliNode) ((EbliWidgetTreeTableNode) - * p[i].getLastPathComponent()) .getUserObject()).getWidget(); - * - * - * FuLog.warning("je suis la target selectionne title: " + - * targets[i].toString()); } - * - * - * - * return targets; } return null; } - * - * }; bar.add(action); - */ - bar = new JToolBar(); - f.add(bar, BorderLayout.PAGE_END); - - bar.add(new EbliWidgetActionDuplicate(scene)); - - bar.add(new EbliWidgetActionForeGround(scene)); - - bar.add(new EbliWidgetActionBackGround(scene)); - - bar.add(new EbliWidgetActionColorForeground(scene)); - - bar.add(new EbliWidgetActionColorBackground.ForScene(scene)); - - bar.add(new EbliWidgetActionRetaillageHorizontal(scene, EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MIN)); - bar.add(new EbliWidgetActionRetaillageHorizontal(scene, EbliWidgetActionRetaillageHorizontal.RETAIILLAGE_MAX)); - bar.add(new EbliWidgetActionRetaillageVertical(scene, EbliWidgetActionRetaillageVertical.RETAIILLAGE_MIN)); - bar.add(new EbliWidgetActionRetaillageVertical(scene, EbliWidgetActionRetaillageVertical.RETAIILLAGE_MAX)); - - bar.add(new EbliWidgetActionImageChooser(scene)); - -// bar.add(new EbliWidgetActiontextEditor(scene)); - - - p.doLayout(); - - // -- creation de l action pour les fonts --// - EbliWidgetActionFont actionFont = new EbliWidgetActionFont(scene); - - // -- ajout de la combo des font dans la toolbar --// - bar.add(actionFont.getFonts()); - - bar.add(actionFont.getSizeFonts()); - - - boxEast.add(new BCalqueLegende()); - - - - } -} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |