view src/econnect/wp3_3/client/core/DataObject.java @ 45:fc9061488e75 CellTable

background and border color of CellTable for selection and hover
author Sebastian Kruse <skruse@mpiwg-berlin.mpg.de>
date Fri, 07 Dec 2012 18:57:02 +0100
parents 3316a738ac72
children 8b58d9bc0bb6
line wrap: on
line source

package econnect.wp3_3.client.core;

import com.google.gwt.core.client.JavaScriptObject;

/**
 * Implementation of the wrapper for the DataObject class of the STI JavaScript source
 * needed to interact between the js-objects and the table element of the spatio-temporal interface 
*/
public class DataObject extends JavaScriptObject {

	protected DataObject(){
	}
	
    /**
     * Initializes a DataObject element
     *
     * @param name name of the data object
     * @param description description of the data object
     * @param place the place, the data object corresponds to
     * @param date the time stamp, the data object corresponds to
     * @param granularity the granularity of the given time
     * @param lon the longitude value corresponding to the given place 
     * @param lat the latitude value corresponding to the given place
     * @return a DataObject STICore object
    */
	public static native DataObject createDataObject(	String name, String description, String place, String date, int granularity, double lon, double lat ) /*-{
		return new $wnd.DataObject(name, description, place, new Date(Number(date)), undefined, granularity, lon, lat);
	}-*/;	
	
    /**
     * Getter for the name of the DataObject
     *
     * @return name of the data object
    */
	public final native String getName() /*-{
		return this.name;
	}-*/;
	
    /**
     * Getter for the description of the DataObject
     *
     * @return description of the data object
    */
	public final native String getDescription()  /*-{
		return this.description;
	}-*/;

    /**
     * Getter for the lon of the DataObject
     *
     * @return place of the data object
    */
	public final native String getLon() /*-{
		return this.longitude;
	}-*/;

    /**
     * Getter for the lat of the DataObject
     *
     * @return place of the data object
    */
	public final native String getLat() /*-{
		return this.latitude;
	}-*/;

    /**
     * Getter for the place of the DataObject
     *
     * @return place of the data object
    */
	public final native String getPlace() /*-{
		return this.place;
	}-*/;

	/**
     * Getter for the status of the DataObject
     *
     * @return status of the data object
    */
	public final native boolean getStatus()  /*-{
		return this.status;
	}-*/;

    /**
     * Getter for the selection percentage of the DataObject
     *
     * @return percentage of the data object
    */
	public final native double getPercentage()  /*-{
		return this.percentage;
	}-*/;
	
    /**
     * Getter for the time of the DataObject
     *
     * @return time of the data object as string representation
    */
	public final native String getTimeString()  /*-{
		return this.getTimeString();
	}-*/;

    /**
     * Getter for the timeStamp of the DataObject
     *
     * @return time of the data object as string representation
    */
	public final native String getTimeStamp()  /*-{
		return this.getTimeStampString();
	}-*/;

	/**
     * Getter for the start of the timeSpan of the DataObject
     *
     * @return time of the data object as string representation
    */
	public final native String getTimeSpanStart()  /*-{
		return this.getTimeSpanStartString();
	}-*/;

    /**
     * Getter for the end of the timeSpan of the DataObject
     *
     * @return time of the data object as string representation
    */
	public final native String getTimeSpanEnd()  /*-{
		return this.getTimeSpanEndString();
	}-*/;

	/**
     * Setter for the hover status of the DataObject
     *
     * @param hover boolean value is true, if the object is hovered
    */
	public final native void setHover( boolean hover )  /*-{
		this.setHover(hover);
	}-*/;

	/**
     * Getter for the hover status of the DataObject
     *
     * @param hover boolean value is true, if the object is hovered
    */
	public final native boolean getHover()  /*-{
		return (this.hoverSelect == true);
	}-*/;

    /**
     * Setter for the selection of the DataObject
     *
     * @param percentage percentage is 1 if selected or 0 if not
    */
	public final native void setPercentage( double percentage)  /*-{
		this.percentage = percentage;
	}-*/;
	
    /**
     * Getter for the selection status of the DataObject
     *
     * @return the selection status; true if selected, false if not
    */
	public final native boolean isSelected()  /*-{
		return this.isSelected();
	}-*/;
	
}