All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.protege.editor.owl.ui.renderer.layout.FileLink Maven / Gradle / Ivy

Go to download

OWL ontology editing infrastructure used by the Protege desktop application.

The newest version!
package org.protege.editor.owl.ui.renderer.layout;

import org.protege.editor.core.FileUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.awt.*;
import java.awt.event.MouseEvent;
import java.io.File;
import java.io.IOException;

/**
 * Author: Matthew Horridge
* Stanford University
* Bio-Medical Informatics Research Group
* Date: 11/11/2011 *

* Represents a link that points to a local file. When the link is clicked the file is show. *

*

* This class is subject to change and it is therefore not recommended for public use. *

*/ public class FileLink extends Link { private Logger logger = LoggerFactory.getLogger(FileLink.class); private File file; public FileLink(File file) { super(file.toString()); this.file = file; } @Override public void activate(Component component, MouseEvent event) { try { FileUtils.showFile(file); } catch (IOException e) { logger.error("Could not activate file link.", e.getMessage(), e); } } @Override public boolean isRollOverLink() { return false; } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy