Owl2graph

Résolu
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011 - 10 déc. 2010 à 11:22
 Utilisateur anonyme - 12 déc. 2010 à 23:02
Bonjour
Comment je peux visualiser un fichier owl
en un graph
?
Car c'est plus intéressant de visualiser l'ontologie
J'ai téléchargé OWLViewerv3.0 qu'il a créé un fichier .svg mais ce dernier je ne sais pas comment je le visualiser.
Est ce qu'il existe une API ou quelque chose qui me permet de faire ça ?
Si quelqu'un en sait quelque chose ça serait gentil de m'aider et de m'orienter. merci.

17 réponses

Utilisateur anonyme
10 déc. 2010 à 15:40
3
Utilisateur anonyme
11 déc. 2010 à 12:49
org.lwjgl.opengl.GL11 vient de LWJGL, tu peux trouver ça sur lwjgl.org

Pour com.tinyline.svg.ImageLoader, contacte directement l'auteur de Slick.













TUER : http://tuer.sourceforge.net/tuer.jnlp

yeah! vive java
3
Utilisateur anonyme
12 déc. 2010 à 21:29
C'est expliqué là :
http://lwjgl.org/wiki/index.php?title=Setting_Up_LWJGL_with_Eclipse

Tu aurais dû regarder sur le site de LWJGL avant de me poser cette question.
















TUER : http://tuer.sourceforge.net/tuer.jnlp

yeah! vive java
3
Utilisateur anonyme
10 déc. 2010 à 13:16
Bonjour

L'API Slick dispose d'une fonctionnalité d'affichage des fichiers SVG, regarde dans le paquetage org.newdawn.slick.svg. Bon courage.



















TUER : http://tuer.sourceforge.net/tuer.jnlp

yeah! vive java
1

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
10 déc. 2010 à 14:23
bonjour et merci
SVP le nom du package cad(.jar)

merci
oui bien sur vive java
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
10 déc. 2010 à 14:48
j'ai telecharger le fichier jar mais comment je peut ouvrir le fichier .svg

j'ai toujours à votre aide
0
Utilisateur anonyme
10 déc. 2010 à 15:43
Désolé pour les fautes de frappe et d'orthographe.












TUER : http://tuer.sourceforge.net/tuer.jnlp

yeah! vive java
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
11 déc. 2010 à 10:30
bonjour et merci
Maintenant je suis entrain d'utiliser ces API
Merci pour cette orientation.
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
11 déc. 2010 à 10:43
bonjour
Où je trouve les packages pour ces deux importimport org.lwjgl.opengl.GL11;
import com.tinyline.svg.ImageLoader;
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
11 déc. 2010 à 13:17
salut
je ne sais pas comment contacter l'auteur de Slick
est ce que tu peut m'aider
et merci
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
11 déc. 2010 à 13:20
est ce que ce lien que tu propose

http://www.cokeandcode.com
si oui, comment je peut le contacter?
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
11 déc. 2010 à 17:52
salut
J'ai essayé d'exécuter l'exemple précédant mais j'ai reçu ces exceptions
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1734)
at java.lang.Runtime.loadLibrary0(Runtime.java:823)
at java.lang.System.loadLibrary(System.java:1028)
at org.lwjgl.Sys$1.run(Sys.java:73)
at java.security.AccessController.doPrivileged(Native Method)
at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
at org.lwjgl.Sys.loadLibrary(Sys.java:82)
at org.lwjgl.Sys.<clinit>(Sys.java:99)
at org.lwjgl.opengl.Display.<clinit>(Display.java:130)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:34)
at sans_titre3.Cadre1.jButton1_actionPerformed(Cadre1.java:60)
at sans_titre3.Cadre1_jButton1_actionAdapter.actionPerformed(Cadre1.java:80)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

Voici la classe (j'ai développé avec jbuilder)


 public void jButton1_actionPerformed(ActionEvent e) {
        Horloge fen = new Horloge();
        fen.setVisible(true);
     
              try {//TinylineRenderToTexture g=new TinylineRenderToTexture();
                      AppGameContainer container =
            new AppGameContainer(new TinylineRenderToTexture(),
                                      800, 600, false);
                      container.start();
              } catch (Exception ee) {
                      ee.printStackTrace();
              }
     

    }

package sans_titre3;

import java.io.InputStream;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.IntBuffer;
import java.util.zip.GZIPInputStream;

import org.lwjgl.opengl.GL11;
import org.newdawn.slick.AppGameContainer;
import org.newdawn.slick.BasicGame;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.SlickException;
import org.newdawn.slick.opengl.Texture;
import org.newdawn.slick.util.ResourceLoader;

import com.tinyline.svg.AnimationCallback;
import com.tinyline.svg.ImageLoader;
import com.tinyline.svg.SVG;
import com.tinyline.svg.SVGAttr;
import com.tinyline.svg.SVGDocument;
import com.tinyline.svg.SVGFontElem;
import com.tinyline.svg.SVGImageElem;
import com.tinyline.svg.SVGImageProducer;
import com.tinyline.svg.SVGParser;
import com.tinyline.svg.SVGRaster;
import com.tinyline.tiny2d.TinyBitmap;
import com.tinyline.tiny2d.TinyPixbuf;
import com.tinyline.tiny2d.TinyRect;
import com.tinyline.tiny2d.TinyString;

/**
 * Titre : 


 *
 * Description : 


 *
 * Copyright : Copyright (c) 2010


 *
 * Société : 


 *
 * @author non attribuable
 * @version 1.0
 */

public class TinylineRenderToTexture extends BasicGame implements
        SVGImageProducer, ImageLoader {
    /** The texture generated from the SVG */
    private int texture;
    /** The pixel buffer filled by TinyLine */
    private TinyPixbuf pixBuffer;
    /** The raster rendered to by TinyLine */
    private SVGRaster raster;
    /** The buffer holding the generated texture */
    private ByteBuffer textureBuffer;
    /** The SVG document being rendered */
    private SVGDocument doc;
    /** The position in the time line of animation */
    private int time = 0;
    /** The width of the texture generated */
    private int width = 256;
    /** The height of the texture generated */
    private int height = 256;

    /**
     * SVG test
     */
    public TinylineRenderToTexture() {
        super("TinylineRenderToTexture");
    }

    /**
     * Creates an integer pixBuffer to hold specified ints - strictly a utility
     * method
     *
     * @param size
     *            how many int to contain
     * @return created IntBuffer
     */
    protected IntBuffer createIntBuffer(int size) {
        ByteBuffer temp = ByteBuffer.allocateDirect(4 * size);
        temp.order(ByteOrder.nativeOrder());

        return temp.asIntBuffer();
    }

    /**
     * Create a new texture ID
     *
     * @return A new texture ID
     */
    private int createTextureID() {
        IntBuffer tmp = createIntBuffer(1);
        GL11.glGenTextures(tmp);
        return tmp.get(0);
    }

    /**
     * Create the texture that will be updated from SVG
     *
     * @param width The width of the texture
     * @param height The height of the texture
     * @return The generated texture ID
     */
    private int createTexture(int width, int height) {
        int target = GL11.GL_TEXTURE_2D;
        int textureID = createTextureID();
        GL11.glBindTexture(target, textureID);

        byte[] data = new byte[4 * width * height];
        textureBuffer = ByteBuffer.allocateDirect(data.length);
        textureBuffer.order(ByteOrder.nativeOrder());
        textureBuffer.put(data, 0, data.length);

        textureBuffer.flip();

        GL11.glTexParameteri(target, GL11.GL_TEXTURE_MIN_FILTER,
                             GL11.GL_LINEAR);
        GL11.glTexParameteri(target, GL11.GL_TEXTURE_MAG_FILTER,
                             GL11.GL_LINEAR);
        GL11.glTexImage2D(target, 0, GL11.GL_RGBA, width, height, 0,
                          GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, textureBuffer);

        return textureID;
    }

    /**
     * Loads an SVGT document from the given URL.
     *
     * @param ref The SVGT document URL or path.
     * @return An SVGT document.
     */
    public SVGDocument loadSVG(String ref) {
        try {
            InputStream is = ResourceLoader.getResourceAsStream(ref);
            if (ref.endsWith("svg")) {
                is = new GZIPInputStream(is);
            }

            final SVGDocument doc = raster.createSVGDocument();

            TinyPixbuf pixbuf = raster.getPixelBuffer();
            SVGAttr attrParser = new SVGAttr(pixbuf.width, pixbuf.height);
            SVGParser parser = new SVGParser(attrParser);
            parser.load(doc, is);

            doc.nActiveAnimations = 0;
            doc.animTargets.count = 0;
            doc.addAnimations(doc.root);
            doc.acb = new AnimationCallback() {
                public void postSMILEvent(int eventType, TinyString event) {
                    System.out.println(eventType + ":" + event);
                    doc.resolveEventBased(event);
                }
            };
            return doc;
        } catch (Exception ex) {
            ex.printStackTrace();
            return null;
        }
    }

    /**
     * @see org.newdawn.slick.BasicGame#init(org.newdawn.slick.GameContainer)
     */
    public void init(GameContainer container) throws SlickException {
        texture = createTexture(width, height);
        TinyPixbuf buffer = new TinyPixbuf(width, height);
        raster = new SVGRaster(buffer);
        raster.setSVGImageProducer(this);
        SVGImageElem.setImageLoader(this);

        SVGDocument fontDoc = loadSVG("org/newdawn/slick/data/helvetica_svg");
        SVGFontElem font = SVGDocument.getFont(fontDoc,
                                               SVG.VAL_DEFAULT_FONTFAMILY);
       SVGDocument.defaultFont = font;

        doc = loadSVG("E:/projet/sans_titre3/ontology.svg");

        raster.setAntialiased(true);
        raster.setSVGDocument(doc);
      //  raster.setCamera();
      //  raster.update();
      //  raster.sendPixels();

    }

    /**
     * @see org.newdawn.slick.BasicGame#update(org.newdawn.slick.GameContainer,
     *      int)
     */
    public void update(GameContainer container, int delta) throws
            SlickException {
        time += delta;
        TinyRect dirty = doc.animate(time / 4);
        raster.setDevClip(dirty);
        raster.update();
        raster.sendPixels();

        Thread.yield();
    }

    /**
     * @see org.newdawn.slick.Game#render(org.newdawn.slick.GameContainer,
     *      org.newdawn.slick.Graphics)
     */
    public void render(GameContainer container, Graphics g)
                       throws SlickException {
               GL11.glEnable(GL11.GL_TEXTURE_2D);
               GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
               GL11.glBegin(GL11.GL_QUADS);
               GL11.glTexCoord2f(0, 0);
               GL11.glVertex2f(10, 50);
               GL11.glTexCoord2f(0, 1);
               GL11.glVertex2f(10, 562);
               GL11.glTexCoord2f(1, 1);
               GL11.glVertex2f(522, 562);
               GL11.glTexCoord2f(1, 0);
               GL11.glVertex2f(522, 50);

               GL11.glTexCoord2f(0, 0);
               GL11.glVertex2f(530, 50);
               GL11.glTexCoord2f(0, 1);
               GL11.glVertex2f(530, 306);
               GL11.glTexCoord2f(1, 1);
               GL11.glVertex2f(786, 306);
               GL11.glTexCoord2f(1, 0);
               GL11.glVertex2f(786, 50);
               GL11.glEnd();

               Texture.unbind();
       }

    /**
     * Entry point to the test
     *
     * @param argv The arguments to the test (normally none)
     */

    /**
     * @see com.tinyline.svg.SVGImageProducer#hasConsumer()
     */
    public boolean hasConsumer() {
        return true;
    }

    /**
     * @see com.tinyline.svg.SVGImageProducer#imageComplete()
     */
     public void imageComplete() {
             TinyRect dirty = raster.getDevClip();
             int width = dirty.xmax - dirty.xmin;
             int height = dirty.ymax - dirty.ymin;

             GL11.glBindTexture(GL11.GL_TEXTURE_2D, texture);
             int[] data = raster.getPixelBuffer().pixels32;
             textureBuffer.clear();
             for (int y=dirty.ymin;y<dirty.ymax;y++) {
                     for (int x=dirty.xmin;x<dirty.xmax;x++) {
                             int i = x + (y*this.width);
                             int red = ((data[i] & 0xFF0000) >> 16) & 0xFF;
                             int green = ((data[i] & 0xFF00) >> 8) & 0xFF;
                             int blue = (data[i] & 0xFF);
                             int alpha = ((data[i] & 0xFF000000) >> 24) & 0xFF;
                             textureBuffer.put((byte) red);
                             textureBuffer.put((byte) green);
                             textureBuffer.put((byte) blue);
                             textureBuffer.put((byte) alpha);
                     }
             }

             textureBuffer.flip();
             GL11.glTexSubImage2D(GL11.GL_TEXTURE_2D, 0, dirty.xmin, dirty.ymin, width, height,
     GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, textureBuffer);

             Texture.unbind();
     }

    /**
     * @see com.tinyline.svg.SVGImageProducer#sendPixels()
     */
    public void sendPixels() {
    }

    /**
     * @see com.tinyline.svg.ImageLoader#createTinyBitmap(com.tinyline.tiny2d.TinyString)
     */
    public TinyBitmap createTinyBitmap(TinyString arg0) {
        return null;
    }

    /**
     * @see com.tinyline.svg.ImageLoader#createTinyBitmap(byte[], int, int)
     */
    public TinyBitmap createTinyBitmap(byte[] arg0, int arg1, int arg2) {
        return null;
    }
   
}
0
Utilisateur anonyme
11 déc. 2010 à 22:45
Ca veut simplement dire que tu as oublié de modifier le Java library path et que JBuilder ne trouve pas les modules natifs de LWJGL (les DLL sous Windows, les .so sous Linux, les .jnilib sous Mac). Comme je ne connais ni JBuilder (j'utilise Eclipse, c'est plus simple et plus professionnel) ni LWJGL (j'utilise JOGL qui est bien plus stable), je ne peux pas trop t'aider. Demande de l'aide sur le forum LWJGL.














TUER : http://tuer.sourceforge.net/tuer.jnlp

yeah! vive java
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
12 déc. 2010 à 18:56
salut
vous avez m'aider beaucoup et merci pour votre disponibilité
mon probléme est de creer une ontologie(.owl ) et de la visualiser.
est ce que vous pouvez me proposer un'autre package pour atteindre mes objectifs.
j'ai télecharger le lwjgl.dll mais comment je peux l'intégrer vous pouvez m'indiquer comment vous avez intégrer sous eclipse
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
12 déc. 2010 à 19:09
salut
voila les exceptions aprés l'intégration du fichier .dll
c'est quoi une méthode native

E
xception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: org.lwjgl.DefaultSysImplementation.getPointerSize()I
at org.lwjgl.DefaultSysImplementation.getPointerSize(Native Method)
at org.lwjgl.Sys.<clinit>(Sys.java:100)
at org.lwjgl.opengl.Display.<clinit>(Display.java:130)
at org.newdawn.slick.AppGameContainer$1.run(AppGameContainer.java:37)
at java.security.AccessController.doPrivileged(Native Method)
at org.newdawn.slick.AppGameContainer.<clinit>(AppGameContainer.java:34)
at sans_titre3.Cadre1.jButton1_actionPerformed(Cadre1.java:60)
at sans_titre3.Cadre1_jButton1_actionAdapter.actionPerformed(Cadre1.java:80)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2478)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
0
lakelkheira Messages postés 21 Date d'inscription mercredi 22 novembre 2006 Statut Membre Dernière intervention 24 juin 2011
12 déc. 2010 à 21:54
salut merci beaucoup gouessej
enfin j'ai exécuter l'example sans erreurs
le probléme est que le package qui j'ai utilisé contient des méthodes qui ne sont pas implémentés donc je le change avec autre
mais il affiche une fenetre noire
sans le graph de l'ontologie .
malgré que j'ai creé le fichier .svg par OWLViewerv3.0
Sun Dec 12 21:33:32 CET 2010 INFO:Slick Build #170
Sun Dec 12 21:33:32 CET 2010 INFO:LWJGL Version: 2.6
Sun Dec 12 21:33:32 CET 2010 INFO:OriginalDisplayMode: 1024 x 768 x 32 @60Hz
Sun Dec 12 21:33:32 CET 2010 INFO:TargetDisplayMode: 800 x 600 x 0 @0Hz
Sun Dec 12 21:33:33 CET 2010 INFO:Starting display 800x600
Loading: net.java.games.input.DirectAndRawInputEnvironmentPlugin
Sun Dec 12 21:33:33 CET 2010 INFO:Found 0 controllers
0
Utilisateur anonyme
12 déc. 2010 à 23:02
De quel paquetage parles-tu? Demande de l'aide au créateur de Slick sur cokeandcode.com car là, je ne vois pas d'où ton problème peut venir.








TUER : http://tuer.sourceforge.net/tuer.jnlp

yeah! vive java
0
Rejoignez-nous