Commit a3543194 authored by Piotr Gawron's avatar Piotr Gawron
Browse files

issue #41, work in progress

submaps are opening from link (when accessing it from coment tab in
admin panel), however centering is still not handled properly
parent 04445f4a
package lcsb.mapviewer.services.view;
import java.io.Serializable;
import lcsb.mapviewer.model.map.Comment;
/**
* View representation of the Comment.
*
* @author Piotr Gawron
*
*/
public class CommentView extends AbstractView<Comment> implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Author of the comment.
*/
private String author;
/**
* Email of the comment.
*/
private String email;
/**
* Content of the comment.
*/
private String content;
/**
* Title of the comment.
*/
private String title;
/**
* Is the comment visible on the map.
*/
private String pinned;
/**
* Is the comment removed.
*/
private String removed;
/**
* X coordinate on the map.
*/
private String xCoord;
/**
* Y coordinate on the map.
*/
private String yCoord;
/**
* Zoom level at which comment should be investigated on the map (to see
* details).
*/
private String zoom;
/**
* Constructor that initialize the view with the data from original comment.
*
* @param comment
* data required for initialization
*/
protected CommentView(final Comment comment) {
super(comment);
}
/**
* Default constructor. Should be used only for deserialization.
*/
protected CommentView() {
}
/**
* @return the author
* @see #author
*/
public String getAuthor() {
return author;
}
/**
* @param author
* the author to set
* @see #author
*/
public void setAuthor(String author) {
this.author = author;
}
/**
* @return the email
* @see #email
*/
public String getEmail() {
return email;
}
/**
* @param email
* the email to set
* @see #email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return the content
* @see #content
*/
public String getContent() {
return content;
}
/**
* @param content
* the content to set
* @see #content
*/
public void setContent(String content) {
this.content = content;
}
/**
* @return the title
* @see #title
*/
public String getTitle() {
return title;
}
/**
* @param title
* the title to set
* @see #title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the pinned
* @see #pinned
*/
public String getPinned() {
return pinned;
}
/**
* @param pinned
* the pinned to set
* @see #pinned
*/
public void setPinned(String pinned) {
this.pinned = pinned;
}
/**
* @return the removed
* @see #removed
*/
public String getRemoved() {
return removed;
}
/**
* @param removed
* the removed to set
* @see #removed
*/
public void setRemoved(String removed) {
this.removed = removed;
}
/**
* @return the xCoord
* @see #xCoord
*/
public String getxCoord() {
return xCoord;
}
/**
* @param xCoord
* the xCoord to set
* @see #xCoord
*/
public void setxCoord(String xCoord) {
this.xCoord = xCoord;
}
/**
* @return the yCoord
* @see #yCoord
*/
public String getyCoord() {
return yCoord;
}
/**
* @param yCoord
* the yCoord to set
* @see #yCoord
*/
public void setyCoord(String yCoord) {
this.yCoord = yCoord;
}
/**
* @return the zoom
* @see #zoom
*/
public String getZoom() {
return zoom;
}
/**
* @param zoom
* the zoom to set
* @see #zoom
*/
public void setZoom(String zoom) {
this.zoom = zoom;
}
/**
* @param pinned
* the pinned to set
* @see #pinned
*/
public void setPinned(final boolean pinned) {
if (pinned) {
setPinned("YES");
} else {
setPinned("NO");
}
}
/**
* Sets x coordinate.
*
* @param x
* x coordinate to set
* @see #xCoord
*/
public void setxCoord(double x) {
this.xCoord = x + "";
}
/**
* Sets y coordinate.
*
* @param y
* y coordinate to set
* @see #yCoord
*/
public void setyCoord(double y) {
this.yCoord = y + "";
}
};
package lcsb.mapviewer.services.view;
import java.io.Serializable;
import lcsb.mapviewer.model.map.Comment;
/**
* View representation of the Comment.
*
* @author Piotr Gawron
*
*/
public class CommentView extends AbstractView<Comment> implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
/**
* Author of the comment.
*/
private String author;
/**
* Email of the comment.
*/
private String email;
/**
* Content of the comment.
*/
private String content;
/**
* Title of the comment.
*/
private String title;
/**
* Is the comment visible on the map.
*/
private String pinned;
/**
* Is the comment removed.
*/
private String removed;
/**
* X coordinate on the map.
*/
private String xCoord;
/**
* Y coordinate on the map.
*/
private String yCoord;
/**
* Zoom level at which comment should be investigated on the map (to see
* details).
*/
private String zoom;
private String submap;
/**
* Constructor that initialize the view with the data from original comment.
*
* @param comment
* data required for initialization
*/
protected CommentView(final Comment comment) {
super(comment);
}
/**
* Default constructor. Should be used only for deserialization.
*/
protected CommentView() {
}
/**
* @return the author
* @see #author
*/
public String getAuthor() {
return author;
}
/**
* @param author
* the author to set
* @see #author
*/
public void setAuthor(String author) {
this.author = author;
}
/**
* @return the email
* @see #email
*/
public String getEmail() {
return email;
}
/**
* @param email
* the email to set
* @see #email
*/
public void setEmail(String email) {
this.email = email;
}
/**
* @return the content
* @see #content
*/
public String getContent() {
return content;
}
/**
* @param content
* the content to set
* @see #content
*/
public void setContent(String content) {
this.content = content;
}
/**
* @return the title
* @see #title
*/
public String getTitle() {
return title;
}
/**
* @param title
* the title to set
* @see #title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* @return the pinned
* @see #pinned
*/
public String getPinned() {
return pinned;
}
/**
* @param pinned
* the pinned to set
* @see #pinned
*/
public void setPinned(String pinned) {
this.pinned = pinned;
}
/**
* @return the removed
* @see #removed
*/
public String getRemoved() {
return removed;
}
/**
* @param removed
* the removed to set
* @see #removed
*/
public void setRemoved(String removed) {
this.removed = removed;
}
/**
* @return the xCoord
* @see #xCoord
*/
public String getxCoord() {
return xCoord;
}
/**
* @param xCoord
* the xCoord to set
* @see #xCoord
*/
public void setxCoord(String xCoord) {
this.xCoord = xCoord;
}
/**
* @return the yCoord
* @see #yCoord
*/
public String getyCoord() {
return yCoord;
}
/**
* @param yCoord
* the yCoord to set
* @see #yCoord
*/
public void setyCoord(String yCoord) {
this.yCoord = yCoord;
}
/**
* @return the zoom
* @see #zoom
*/
public String getZoom() {
return zoom;
}
/**
* @param zoom
* the zoom to set
* @see #zoom
*/
public void setZoom(String zoom) {
this.zoom = zoom;
}
/**
* @param pinned
* the pinned to set
* @see #pinned
*/
public void setPinned(final boolean pinned) {
if (pinned) {
setPinned("YES");
} else {
setPinned("NO");
}
}
/**
* Sets x coordinate.
*
* @param x
* x coordinate to set
* @see #xCoord
*/
public void setxCoord(double x) {
this.xCoord = x + "";
}
/**
* Sets y coordinate.
*
* @param y
* y coordinate to set
* @see #yCoord
*/
public void setyCoord(double y) {
this.yCoord = y + "";
}
/**
* @return the submap
* @see #submap
*/
public String getSubmap() {
return submap;
}
/**
* @param submap the submap to set
* @see #submap
*/
public void setSubmap(String submap) {
this.submap = submap;
}
};
......@@ -87,12 +87,14 @@ public class CommentViewFactory extends AbstractViewFactory<Comment, CommentView
}
}
}
result.setTitle((title));
result.setTitle(title);
if (comment.getSubmodelData() != null) {
result.setSubmap(comment.getSubmodelData().getId() + "");
}
if (coordinates != null) {
result.setxCoord(coordinates.getX());
result.setyCoord(coordinates.getY());
result.setZoom("" + (Configuration.MIN_ZOOM_LEVEL + model.getZoomLevels() - 1));
}
return result;
}
......
......@@ -87,6 +87,12 @@
<p:remoteCommand name="_sendReferenceGenomeDetailRequest" actionListener="#{referenceGenomeMB.requestJavasciptGenomeDetails}" />
</h:form>
<h:form id="createSubmodelDialog">
<p:remoteCommand name="_createSubmodelDialog" actionListener="#{mapMB.createSubmodelDialog}" async="false"/>
</h:form>
<!-- loading dialog used for informing user that data is being loaded -->
<p:dialog header="Loading" widgetVar="loadingDlg" resizable="false" id="loadingDlg"
showEffect="fade" modal="true" closable="false">
......
......@@ -19,21 +19,13 @@
<h:panelGroup layout="block" >
<p:dataTable id="submapDataTable" var="submap" value="#{mapMB.mapDataList}">
<!-- <p:column sortBy="id" headerText="Id">
<h:outputText id="id" value="#{submap.mapConfig.idObject}" />
</p:column> -->
<p:column sortBy="name" headerText="Name">
<h:outputText id="name" value="#{submap.mapConfig.name}" />
</p:column>
<!-- <p:column sortBy="type" headerText="Type">
<h:outputText id="type" value="#{submap.type}" />
</p:column> -->