Search in sources :

Example 1 with LabelledFrame

use of edu.stanford.bmir.protege.web.shared.frame.LabelledFrame in project webprotege by protegeproject.

the class GetNamedIndividualFrameActionHandler method execute.

@Nonnull
@Override
public GetNamedIndividualFrameResult execute(@Nonnull GetNamedIndividualFrameAction action, @Nonnull ExecutionContext executionContext) {
    NamedIndividualFrame frame = translator.getFrame(renderingManager.getRendering(action.getSubject()));
    String rendering = renderingManager.getShortForm(action.getSubject());
    LabelledFrame<NamedIndividualFrame> labelledFrame = new LabelledFrame<>(rendering, frame);
    logger.info(BROWSING, "{} {} retrieved NamedIndividual frame for {} ({})", action.getProjectId(), executionContext.getUserId(), action.getSubject(), labelledFrame.getDisplayName());
    return new GetNamedIndividualFrameResult(labelledFrame);
}
Also used : NamedIndividualFrame(edu.stanford.bmir.protege.web.shared.frame.NamedIndividualFrame) LabelledFrame(edu.stanford.bmir.protege.web.shared.frame.LabelledFrame) GetNamedIndividualFrameResult(edu.stanford.bmir.protege.web.shared.dispatch.actions.GetNamedIndividualFrameResult) Nonnull(javax.annotation.Nonnull)

Example 2 with LabelledFrame

use of edu.stanford.bmir.protege.web.shared.frame.LabelledFrame in project webprotege by protegeproject.

the class GetAnnotationPropertyFrameActionHandler method execute.

@Nonnull
@Override
public GetAnnotationPropertyFrameResult execute(@Nonnull GetAnnotationPropertyFrameAction action, @Nonnull ExecutionContext executionContext) {
    AnnotationPropertyFrameTranslator translator = new AnnotationPropertyFrameTranslator(renderingManager, rootOntology);
    AnnotationPropertyFrame frame = translator.getFrame(renderingManager.getRendering(action.getSubject()));
    String label = renderingManager.getBrowserText(action.getSubject());
    LabelledFrame<AnnotationPropertyFrame> labelledFrame = new LabelledFrame<>(label, frame);
    logger.info(BROWSING, "{} {} retrieved AnnotationProperty frame for {} ({})", action.getProjectId(), executionContext.getUserId(), action.getSubject(), labelledFrame.getDisplayName());
    return new GetAnnotationPropertyFrameResult(labelledFrame);
}
Also used : LabelledFrame(edu.stanford.bmir.protege.web.shared.frame.LabelledFrame) GetAnnotationPropertyFrameResult(edu.stanford.bmir.protege.web.shared.frame.GetAnnotationPropertyFrameResult) AnnotationPropertyFrame(edu.stanford.bmir.protege.web.shared.frame.AnnotationPropertyFrame) Nonnull(javax.annotation.Nonnull)

Aggregations

LabelledFrame (edu.stanford.bmir.protege.web.shared.frame.LabelledFrame)2 Nonnull (javax.annotation.Nonnull)2 GetNamedIndividualFrameResult (edu.stanford.bmir.protege.web.shared.dispatch.actions.GetNamedIndividualFrameResult)1 AnnotationPropertyFrame (edu.stanford.bmir.protege.web.shared.frame.AnnotationPropertyFrame)1 GetAnnotationPropertyFrameResult (edu.stanford.bmir.protege.web.shared.frame.GetAnnotationPropertyFrameResult)1 NamedIndividualFrame (edu.stanford.bmir.protege.web.shared.frame.NamedIndividualFrame)1