Skip to content

Commit

Permalink
Create logical definition (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsilaghi authored Oct 28, 2024
1 parent 1895b9e commit c0defa8
Show file tree
Hide file tree
Showing 29 changed files with 2,003 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
import edu.stanford.bmir.protege.web.client.library.modal.ModalViewImpl;
import edu.stanford.bmir.protege.web.client.library.msgbox.InputBoxView;
import edu.stanford.bmir.protege.web.client.library.msgbox.InputBoxViewImpl;
import edu.stanford.bmir.protege.web.client.linearization.*;
import edu.stanford.bmir.protege.web.client.login.LoginView;
import edu.stanford.bmir.protege.web.client.login.LoginViewImpl;
import edu.stanford.bmir.protege.web.client.login.SignInRequestHandler;
Expand Down Expand Up @@ -496,26 +495,6 @@ EntityTagsSelectorView provideEntityTagsSelectorView(EntityTagsSelectorViewImpl
EditorPortletView provideEditorPortletView(EditorPortletViewImpl impl) {
return impl;
}
@Provides
LinearizationParentView provideLinearizationParentView(LinearizationParentViewImpl impl) {
return impl;
}


@Provides
LinearizationPortletView provideLinearizationPortletView(LinearizationPortletViewImpl impl) {
return impl;
}

@Provides
PostCoordinationPortletView providePostCoordinationPortletView(PostCoordinationPortletViewImpl impl){
return impl;
}

@Provides
LinearizationCommentsView provideLienarizationCommentsView(LinearizationCommentsViewImpl impl){
return impl;
}

@Provides
ProjectTagsView provideProjectTagsView(ProjectTagsViewImpl impl) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,23 @@
import edu.stanford.bmir.protege.web.client.individualslist.*;
import edu.stanford.bmir.protege.web.client.lang.*;
import edu.stanford.bmir.protege.web.client.library.tokenfield.*;
import edu.stanford.bmir.protege.web.client.linearization.*;
import edu.stanford.bmir.protege.web.client.list.*;
import edu.stanford.bmir.protege.web.client.logicaldefinition.LogicalDefinitionPortletView;
import edu.stanford.bmir.protege.web.client.logicaldefinition.LogicalDefinitionPortletViewImpl;
import edu.stanford.bmir.protege.web.client.logicaldefinition.LogicalDefinitionTableWrapper;
import edu.stanford.bmir.protege.web.client.logicaldefinition.LogicalDefinitionTableWrapperImpl;
import edu.stanford.bmir.protege.web.client.match.*;
import edu.stanford.bmir.protege.web.client.ontology.annotations.*;
import edu.stanford.bmir.protege.web.client.permissions.*;
import edu.stanford.bmir.protege.web.client.perspective.*;
import edu.stanford.bmir.protege.web.client.portlet.*;
import edu.stanford.bmir.protege.web.client.postcoordination.PostCoordinationChangesHandler;
import edu.stanford.bmir.protege.web.client.postcoordination.PostCoordinationChangesHandlerImpl;
import edu.stanford.bmir.protege.web.client.postcoordination.PostCoordinationPortletView;
import edu.stanford.bmir.protege.web.client.postcoordination.PostCoordinationPortletViewImpl;
import edu.stanford.bmir.protege.web.client.postcoordination.PostCoordinationChangesHandler;
import edu.stanford.bmir.protege.web.client.postcoordination.PostCoordinationChangesHandlerImpl;
import edu.stanford.bmir.protege.web.client.project.*;
import edu.stanford.bmir.protege.web.client.projectsettings.*;
import edu.stanford.bmir.protege.web.client.renderer.*;
Expand Down Expand Up @@ -217,6 +226,39 @@ NumericValueCriteriaView provideNumericValueCriteriaView(NumericValueCriteriaVie
return impl;
}


@Provides
LogicalDefinitionPortletView provideLogicalDefinitionPortletView(LogicalDefinitionPortletViewImpl impl) {
return impl;
}

/* @Provides
LogicalDefinitionTableWrapper provideLogicalDefinitionTableWrapper(LogicalDefinitionTableWrapperImpl impl) {
return impl;
}*/

@Provides
LinearizationParentView provideLinearizationParentView(LinearizationParentViewImpl impl) {
return impl;
}


@Provides
LinearizationPortletView provideLinearizationPortletView(LinearizationPortletViewImpl impl) {
return impl;
}

@Provides
PostCoordinationPortletView providePostCoordinationPortletView(PostCoordinationPortletViewImpl impl){
return impl;
}


@Provides
LinearizationCommentsView provideLienarizationCommentsView(LinearizationCommentsViewImpl impl){
return impl;
}

@Provides
LangTagMatchesCriteriaView provideLangTagMatchesCriteriaView(LangTagMatchesCriteriaViewImpl impl) {
return impl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import java.util.Iterator;
import java.util.List;
import java.util.logging.Logger;


public class LinearizationParentViewImpl extends Composite implements LinearizationParentView {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
.superClassTable {
overflow: hidden;
margin-top: 15px;
border-collapse: collapse;
padding: 3px;
width: 50%;
}

.tableText {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
vertical-align: middle;
}

.definitionsEmptyState {
height: 300px;
background-repeat: no-repeat;
background-position: center;
}

.tableText > div {
display: flex;
justify-content: start;
align-content: center;
text-align: left;
max-width: 350px;
margin: 8px;

}

.logicalDefinitionDropdown {
background-color: white;
margin: 5px;
padding: 3px;
}

.superClassTableHeader .tableText > div {
font-size: 14px;
font-weight: bold;
}

.customRowStyle {

border-bottom: 1px solid #f2f2f2;
}

.removeButtonCell {
width: 20px;
height: 20px;
align-self: center;
}

.removeButtonCell > div {
margin-top: 2px;
margin-bottom: 2px;
}


.superClassTableHeader {
font-size: 18px;
color: #fff;
line-height: 1.4;
background-color: #186cd4;
font-family: "Helvetica Neue", "Lucida Grande", "Segoe UI", Arial, Helvetica, Verdana, sans-serif;
}

.dropDownMandatory{
color: red;
margin: 2px;
font-size: bold;
}

.dropDownAllowed {
color: green;
margin: 2px;
font-size: bold;
}

.dropDownNotSet{
margin: 2px;
}

.superClassName {
font-size: 12px;
font-weight: bold;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package edu.stanford.bmir.protege.web.client.logicaldefinition;

import edu.stanford.bmir.protege.web.client.dispatch.DispatchServiceManager;
import edu.stanford.bmir.protege.web.client.lang.DisplayNameRenderer;
import edu.stanford.bmir.protege.web.client.portlet.AbstractWebProtegePortletPresenter;
import edu.stanford.bmir.protege.web.client.portlet.PortletUi;
import edu.stanford.bmir.protege.web.client.selection.SelectionModel;
import edu.stanford.bmir.protege.web.shared.event.WebProtegeEventBus;
import edu.stanford.bmir.protege.web.shared.project.ProjectId;
import edu.stanford.bmir.protege.web.shared.renderer.GetEntityRenderingAction;
import edu.stanford.webprotege.shared.annotations.Portlet;
import org.semanticweb.owlapi.model.OWLEntity;

import javax.annotation.Nonnull;
import javax.inject.Inject;
import java.util.Optional;

@Portlet(id = "portlets.LogicalDefinition",
title = "iCat-X Logical Definition",
tooltip = "Displays the existing logical definitions on the current entity.")
public class LogicalDefinitionPortletPresenter extends AbstractWebProtegePortletPresenter {


private LogicalDefinitionPortletView view;

private DispatchServiceManager dispatch;

@Inject
public LogicalDefinitionPortletPresenter(@Nonnull SelectionModel selectionModel,
@Nonnull ProjectId projectId,
@Nonnull DisplayNameRenderer displayNameRenderer,
@Nonnull DispatchServiceManager dispatch,
@Nonnull LogicalDefinitionPortletView view) {
super(selectionModel, projectId, displayNameRenderer, dispatch);
this.view = view;
this.dispatch = dispatch;
}

@Override
public void startPortlet(PortletUi portletUi,
WebProtegeEventBus eventBus) {
setDisplaySelectedEntityNameAsSubtitle(true);
portletUi.setWidget(view.asWidget());

}

@Override
protected void handleReloadRequest() {

}

@Override
protected void handleAfterSetEntity(Optional<OWLEntity> entityData) {
if(!entityData.isPresent()) {
setNothingSelectedVisible(true);
setDisplayedEntity(Optional.empty());
} else {
setNothingSelectedVisible(false);
dispatch.execute(GetEntityRenderingAction.create(getProjectId(), entityData.get()),
(result) -> setDisplayedEntity(Optional.of(result.getEntityData())));
view.setEntity(entityData.get(), getProjectId());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package edu.stanford.bmir.protege.web.client.logicaldefinition;

import com.google.gwt.user.client.ui.AcceptsOneWidget;
import com.google.gwt.user.client.ui.IsWidget;
import edu.stanford.bmir.protege.web.shared.HasDispose;
import edu.stanford.bmir.protege.web.shared.project.ProjectId;
import org.semanticweb.owlapi.model.OWLEntity;

public interface LogicalDefinitionPortletView extends AcceptsOneWidget, IsWidget, HasDispose {

void setEntity(OWLEntity owlEntity, ProjectId projectId);
}
Loading

0 comments on commit c0defa8

Please sign in to comment.