Search in sources :

Example 1 with InfoTextPanel

use of au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel in project constellation by constellation-app.

the class JoclVersionAction method actionPerformed.

@Override
public void actionPerformed(final ActionEvent e) {
    final com.jogamp.opencl.JoclVersion jv = com.jogamp.opencl.JoclVersion.getInstance();
    final Set<?> names = jv.getAttributeNames();
    final ArrayList<String> lines = new ArrayList<>();
    for (final Object name : names) {
        lines.add(String.format("%s: %s\n", name, jv.getAttribute((Attributes.Name) name)));
    }
    Collections.sort(lines);
    final StringBuilder sb = new StringBuilder();
    sb.append("JOCL Attributes\n");
    for (final String line : lines) {
        sb.append(line);
    }
    final InfoTextPanel itp = new InfoTextPanel(sb.toString());
    final NotifyDescriptor.Message msg = new NotifyDescriptor.Message(itp);
    msg.setTitle(Bundle.CTL_JoclVersionAction());
    DialogDisplayer.getDefault().notify(msg);
}
Also used : ArrayList(java.util.ArrayList) Attributes(java.util.jar.Attributes) InfoTextPanel(au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel) NotifyDescriptor(org.openide.NotifyDescriptor)

Example 2 with InfoTextPanel

use of au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel in project constellation by constellation-app.

the class GraphRenderable method init.

/**
 * Initialise the batch store.
 * <p>
 * Only JOGL initialisation is done here to match the JOGL context.
 * Everything here is independent of any particular graph.
 *
 * @param drawable GL drawable.
 */
@Override
public void init(final GLAutoDrawable drawable) {
    final GL3 gl = drawable.getGL().getGL3();
    // Each character is drawn individually.
    try {
        blazeBatcher.createShader(gl);
        lineBatcher.createShader(gl);
        loopBatcher.createShader(gl);
        nodeLabelBatcher.createShader(gl);
        connectionLabelBatcher.createShader(gl);
        iconBatcher.createShader(gl);
    } catch (final IOException | RenderException ex) {
        // If we get here, a shader didn't compile. This obviously shouldn't happen in production,
        // our shaders are static and read from built-in resource files (it happens a lot in
        // development when we edit a shader, but that's OK). Since at least one shader is null,
        // there will be subsequent NullPointerExceptions, but there's nothing we can do about that.
        // Without shaders, we're dead in the water anyway.
        final String msg = "This error may have occurred because your video card and/or driver is\n" + "incompatible with CONSTELLATION.\n\n" + "Please inform CONSTELLATION support, including the text of this message.\n\n" + ex.getMessage();
        LOGGER.log(Level.SEVERE, msg, ex);
        final InfoTextPanel itp = new InfoTextPanel(msg);
        final NotifyDescriptor.Message nd = new NotifyDescriptor.Message(itp, NotifyDescriptor.ERROR_MESSAGE);
        nd.setTitle("Shader Error");
        DialogDisplayer.getDefault().notify(nd);
    }
    graphDisplayer.init(drawable);
    GLTools.checkFramebufferStatus(gl, "gr-check");
    parent.rebuild();
}
Also used : NotifyDescriptor(org.openide.NotifyDescriptor) RenderException(au.gov.asd.tac.constellation.visual.opengl.utilities.RenderException) IOException(java.io.IOException) InfoTextPanel(au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel) GL3(com.jogamp.opengl.GL3)

Example 3 with InfoTextPanel

use of au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel in project constellation by constellation-app.

the class GLInfo method respondToIncompatibleHardwareOrGL.

/**
 * Generate a user dialogue box to alert the user that the hardware/graphics
 * drivers they are using are incompatible with CONSTELLATION
 *
 * @param drawable - a GLAutoDrawable object currently being displayed on
 * the screen. This may be null in the event of the method being called from
 * a GLException exception handler.
 */
public static void respondToIncompatibleHardwareOrGL(final GLAutoDrawable drawable) {
    final String basicInfo = drawable == null ? "Not available" : (new GLInfo(drawable.getGL())).getBasicInfo();
    final String errorMessage = BrandingUtilities.APPLICATION_NAME + " requires a minimum of " + "OpenGL version " + MINIMUM_OPEN_GL_VERSION + "\n\n" + "This PC has an incompatible graphics card.\n" + "Please contact CONSTELLATION support, or use a different PC.\n\n" + "This PC's details:\n\n" + basicInfo;
    new Thread(() -> {
        final InfoTextPanel itp = new InfoTextPanel(errorMessage);
        final NotifyDescriptor d = new NotifyDescriptor.Message(itp, NotifyDescriptor.ERROR_MESSAGE);
        DialogDisplayer.getDefault().notify(d);
    }).start();
}
Also used : NotifyDescriptor(org.openide.NotifyDescriptor) InfoTextPanel(au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel)

Example 4 with InfoTextPanel

use of au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel in project constellation by constellation-app.

the class FPSRenderable method init.

@Override
public void init(final GLAutoDrawable drawable) {
    final GL3 gl = drawable.getGL().getGL3();
    try {
        fpsBatcher.createShader(gl);
        fpsBatcher.createBatch(null).run(gl);
    } catch (final IOException | RenderException ex) {
        // If we get here, a shader didn't compile. This obviously shouldn't happen in production,
        // our shaders are static and read from built-in resource files (it happens a lot in
        // development when we edit a shader, but that's OK). Since at least one shader is null,
        // there will be subsequent NullPointerExceptions, but there's nothing we can do about that.
        // Without shaders, we're dead in the water anyway.
        final String msg = "This error may have occurred because your video card and/or driver is\n" + "incompatible with CONSTELLATION.\n\n" + "Please inform CONSTELLATION support, including the text of this message.\n\n" + ex.getMessage();
        LOGGER.log(Level.SEVERE, msg, ex);
        final InfoTextPanel itp = new InfoTextPanel(msg);
        final NotifyDescriptor.Message nd = new NotifyDescriptor.Message(itp, NotifyDescriptor.ERROR_MESSAGE);
        nd.setTitle("Shader Error");
        DialogDisplayer.getDefault().notify(nd);
    }
}
Also used : NotifyDescriptor(org.openide.NotifyDescriptor) RenderException(au.gov.asd.tac.constellation.visual.opengl.utilities.RenderException) IOException(java.io.IOException) InfoTextPanel(au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel) GL3(com.jogamp.opengl.GL3)

Example 5 with InfoTextPanel

use of au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel in project constellation by constellation-app.

the class JoglVersionAction method actionPerformed.

@Override
public void actionPerformed(final ActionEvent e) {
    final GLProfile glProfile = SharedDrawable.getGLProfile();
    // Create GLContext and trigger GLContext object creation and native realization.
    final GLAutoDrawable drawable = GLDrawableFactory.getFactory(glProfile).createDummyAutoDrawable(null, true, new GLCapabilities(glProfile), null);
    drawable.display();
    drawable.getContext().makeCurrent();
    final GL gl = drawable.getGL().getGL3();
    final StringBuilder sb = new StringBuilder();
    sb.append(String.format("OpenGL version: %s\n", gl.glGetString(GL.GL_VERSION)));
    sb.append(String.format("Vendor: %s\n", gl.glGetString(GL.GL_VENDOR)));
    sb.append(String.format("Renderer: %s\n", gl.glGetString(GL.GL_RENDERER)));
    if (gl instanceof GL2ES2) {
        sb.append(String.format("Shading language version: %s\n", gl.glGetString(GL2ES2.GL_SHADING_LANGUAGE_VERSION)));
    }
    final JoglVersion jv = JoglVersion.getInstance();
    final Set<?> names = jv.getAttributeNames();
    final ArrayList<String> lines = new ArrayList<>();
    for (final Object name : names) {
        lines.add(String.format("%s: %s\n", name, jv.getAttribute((Attributes.Name) name)));
    }
    Collections.sort(lines);
    sb.append("\nJOGL Attributes\n");
    for (final String line : lines) {
        sb.append(line);
    }
    sb.append("\nGL Strings\n");
    JoglVersion.getGLStrings(gl, sb, true);
    sb.append(SeparatorConstants.NEWLINE);
    final InfoTextPanel itp = new InfoTextPanel(sb.toString());
    final NotifyDescriptor.Message msg = new NotifyDescriptor.Message(itp);
    msg.setTitle(Bundle.CTL_JoglVersionAction());
    DialogDisplayer.getDefault().notify(msg);
}
Also used : GLAutoDrawable(com.jogamp.opengl.GLAutoDrawable) GL(com.jogamp.opengl.GL) JoglVersion(com.jogamp.opengl.JoglVersion) ArrayList(java.util.ArrayList) Attributes(java.util.jar.Attributes) InfoTextPanel(au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel) NotifyDescriptor(org.openide.NotifyDescriptor) GLCapabilities(com.jogamp.opengl.GLCapabilities) GL2ES2(com.jogamp.opengl.GL2ES2) GLProfile(com.jogamp.opengl.GLProfile)

Aggregations

InfoTextPanel (au.gov.asd.tac.constellation.utilities.gui.InfoTextPanel)6 NotifyDescriptor (org.openide.NotifyDescriptor)6 RenderException (au.gov.asd.tac.constellation.visual.opengl.utilities.RenderException)2 GL3 (com.jogamp.opengl.GL3)2 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 Attributes (java.util.jar.Attributes)2 GL (com.jogamp.opengl.GL)1 GL2ES2 (com.jogamp.opengl.GL2ES2)1 GLAutoDrawable (com.jogamp.opengl.GLAutoDrawable)1 GLCapabilities (com.jogamp.opengl.GLCapabilities)1 GLProfile (com.jogamp.opengl.GLProfile)1 JoglVersion (com.jogamp.opengl.JoglVersion)1 ModuleInfo (org.openide.modules.ModuleInfo)1