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

edu.stanford.smi.protege.event.SlotEvent Maven / Gradle / Ivy

Go to download

Core code for the Protege ontology editor. Serves as the basis for the Protege-Frames and Protege-OWL editors.

There is a newer version: 3.5.1
Show newest version
package edu.stanford.smi.protege.event;

import edu.stanford.smi.protege.model.*;
import edu.stanford.smi.protege.util.*;

/**
 * Event generated when a slot changes.
 *
 * @author    Ray Fergerson 
 */
public class SlotEvent extends AbstractEvent {
    private static final long serialVersionUID = -2516816810373373956L;
    private static final int BASE = 400;
    public static final int TEMPLATE_SLOT_CLS_ADDED = BASE + 1;
    public static final int TEMPLATE_SLOT_CLS_REMOVED = BASE + 2;
    public static final int DIRECT_SUBSLOT_ADDED = BASE + 5;
    public static final int DIRECT_SUBSLOT_REMOVED = BASE + 6;
    public static final int DIRECT_SUPERSLOT_ADDED = BASE + 7;
    public static final int DIRECT_SUPERSLOT_REMOVED = BASE + 8;
    public static final int DIRECT_SUBSLOT_MOVED = BASE + 9;

    public SlotEvent(Slot slot, int type, Frame frame) {
        super(slot, type, frame);
    }

    public Cls getCls() {
        return (Cls) getArgument();
    }

    public Frame getFrame() {
        return (Frame) getArgument();
    }

    public Slot getSlot() {
        return (Slot) getSource();
    }

    public Slot getSubslot() {
        return (Slot) getArgument();
    }

    public Slot getSuperslot() {
        return (Slot) getArgument();
    }
    
    public boolean isDeletingSlotEvent() {
        return getSlot().isBeingDeleted();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy